New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

@sapphire/framework

Package Overview
Dependencies
Maintainers
3
Versions
860
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sapphire/framework - npm Package Compare versions

Comparing version 2.0.0-next.5c67dadc7c5a2bd242ab009acef32d5f007f6911.0 to 2.0.0-next.74eb3ece.0

4

dist/index.js

@@ -1,2 +0,2 @@

/* Version: 2.0.0-next.5c67dadc7c5a2bd242ab009acef32d5f007f6911.0 - June 5, 2021 14:26:46 */
/* Version: 2.0.0-next.74eb3ece.0 - June 11, 2021 06:30:48 */
'use strict';

@@ -47,2 +47,2 @@

tslib_1.__exportStar(require("./lib/utils/preconditions/PreconditionContainerSingle"), exports);
exports.version = '2.0.0-next.5c67dadc7c5a2bd242ab009acef32d5f007f6911.0';
exports.version = '2.0.0-next.74eb3ece.0';

@@ -11,3 +11,3 @@ "use strict";

/**
* The argument parser to be used in [[Command]].
* The argument parser to be used in {@link Command}.
*/

@@ -149,9 +149,9 @@ class Args {

* console.log(args.getFlags('f'));
* >>> true
* // >>> true
*
* console.log(args.getFlags('g', 'h'));
* >>> true
* // >>> true
*
* console.log(args.getFlags('h'));
* >>> false
* // >>> false
* ```

@@ -169,9 +169,9 @@ */

* console.log(args.getOption('a'));
* >>> '1'
* // >>> '1'
*
* console.log(args.getOption('b', 'c'));
* >>> '2'
* // >>> '2'
*
* console.log(args.getOption('d'));
* >>> null
* // >>> null
* ```

@@ -189,9 +189,9 @@ */

* console.log(args.getOptions('a'));
* >>> ['1', '1']
* // >>> ['1', '1']
*
* console.log(args.getOptions('b', 'c'));
* >>> ['2', '3']
* // >>> ['2', '3']
*
* console.log(args.getOptions('d'));
* >>> null
* // >>> null
* ```

@@ -242,3 +242,3 @@ */

* Resolves an argument.
* @param arg The argument name or [[IArgument]] instance.
* @param arg The argument name or {@link IArgument} instance.
*/

@@ -252,3 +252,3 @@ resolveArgument(arg) {

* Converts a callback into an usable argument.
* @param cb The callback to convert into an [[IArgument]].
* @param cb The callback to convert into an {@link IArgument}.
*/

@@ -259,3 +259,3 @@ static make(cb, name = '') {

/**
* Constructs an [[Ok]] result.
* Constructs an {@link Ok} result.
* @param value The value to pass.

@@ -267,3 +267,3 @@ */

/**
* Constructs an [[Err]] result containing an [[ArgumentError]].
* Constructs an {@link Err} result containing an {@link ArgumentError}.
* @param options The options for the argument error.

@@ -270,0 +270,0 @@ */

@@ -18,9 +18,11 @@ "use strict";

/**
* The base [[Client]] extension that makes Sapphire work. When building a Discord bot with the framework, the developer
* The base {@link Client} extension that makes Sapphire work. When building a Discord bot with the framework, the developer
* must either use this class, or extend it.
*
* Sapphire also automatically detects the folders to scan for pieces, please read
* [[SapphireClient.registerUserDirectories]] for reference. This method is called at the start of the
* [[SapphireClient.login]] method.
* {@link SapphireClient.registerUserDirectories} for reference. This method is called at the start of the
* {@link SapphireClient.login} method.
*
* @see {@link SapphireClientOptions} for all options available to the Sapphire Client. You can also provide all of discord.js' [ClientOptions](https://discord.js.org/#/docs/main/stable/typedef/ClientOptions)
*
* @since 1.0.0

@@ -27,0 +29,0 @@ * @example

@@ -8,3 +8,3 @@ "use strict";

* The base argument class. This class is abstract and is to be extended by subclasses implementing the methods. In
* Sapphire's workflow, arguments are called when using [[Args]]'s methods (usually used inside [[Command]]s by default).
* Sapphire's workflow, arguments are called when using {@link Args}'s methods (usually used inside {@link Command}s by default).
*

@@ -14,3 +14,3 @@ * @example

* // TypeScript:
* import { Argument, ArgumentResult, PieceContext } from '(at)sapphire/framework';
* import { Argument, ArgumentResult, PieceContext } from '@sapphire/framework';
* import { URL } from 'url';

@@ -36,3 +36,3 @@ *

* // and others have a return type of `URL`.
* declare module 'sapphire/framework/dist/lib/utils/Args' {
* declare module '@sapphire/framework/dist/lib/utils/Args' {
* export interface ArgType {

@@ -47,3 +47,3 @@ * url: URL;

* // JavaScript:
* const { Argument } = require('(at)sapphire/framework');
* const { Argument } = require('@sapphire/framework');
*

@@ -75,3 +75,3 @@ * // Define a class extending `Argument`, then export it.

/**
* Constructs an [[ArgumentError]] with a custom type.
* Constructs an {@link ArgumentError} with a custom type.
* @param parameter The parameter that triggered the argument.

@@ -78,0 +78,0 @@ * @param type The identifier for the error.

"use strict";
var _listener;
var _Event_listener;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -15,3 +15,3 @@ exports.Event = void 0;

* // TypeScript:
* import { Event, Events, PieceContext } from '(at)sapphire/framework';
* import { Event, Events, PieceContext } from '@sapphire/framework';
*

@@ -26,3 +26,3 @@ * // Define a class extending `CoreEvent`, then export it.

* public run() {
* if (!this.client.id) this.client.id = this.client.user?.id ?? null;
* if (!this.container.client.id) this.container.client.id = this.container.client.user?.id ?? null;
* }

@@ -35,3 +35,3 @@ * }

* // JavaScript:
* const { Event, Events } = require('(at)sapphire/framework');
* const { Event, Events } = require('@sapphire/framework');
*

@@ -45,3 +45,3 @@ * // Define a class extending `CoreEvent`, then export it.

* run() {
* if (!this.client.id) this.client.id = this.client.user?.id ?? null;
* if (!this.container.client.id) this.container.client.id = this.container.client.user?.id ?? null;
* }

@@ -56,3 +56,3 @@ * }

// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_listener.set(this, void 0);
_Event_listener.set(this, void 0);
this.emitter =

@@ -64,11 +64,11 @@ typeof options.emitter === 'undefined'

this.once = (_c = options.once) !== null && _c !== void 0 ? _c : false;
tslib_1.__classPrivateFieldSet(this, _listener, this.emitter && this.event ? (this.once ? this._runOnce.bind(this) : this._run.bind(this)) : null);
tslib_1.__classPrivateFieldSet(this, _Event_listener, this.emitter && this.event ? (this.once ? this._runOnce.bind(this) : this._run.bind(this)) : null, "f");
}
onLoad() {
if (tslib_1.__classPrivateFieldGet(this, _listener))
this.emitter[this.once ? 'once' : 'on'](this.event, tslib_1.__classPrivateFieldGet(this, _listener));
if (tslib_1.__classPrivateFieldGet(this, _Event_listener, "f"))
this.emitter[this.once ? 'once' : 'on'](this.event, tslib_1.__classPrivateFieldGet(this, _Event_listener, "f"));
}
onUnload() {
if (!this.once && tslib_1.__classPrivateFieldGet(this, _listener))
this.emitter.off(this.event, tslib_1.__classPrivateFieldGet(this, _listener));
if (!this.once && tslib_1.__classPrivateFieldGet(this, _Event_listener, "f"))
this.emitter.off(this.event, tslib_1.__classPrivateFieldGet(this, _Event_listener, "f"));
}

@@ -83,3 +83,2 @@ toJSON() {

try {
// @ts-expect-error Argument of type 'unknown[]' is not assignable to parameter of type 'E extends string | number ? ClientEvents[E] : unknown[]'. (2345)
await this.run(...args);

@@ -97,3 +96,3 @@ }

exports.Event = Event;
_listener = new WeakMap();
_Event_listener = new WeakMap();
//# sourceMappingURL=Event.js.map

@@ -8,4 +8,4 @@ "use strict";

* The extended argument class. This class is abstract and is to be extended by subclasses which
* will implement the [[ExtendedArgument#handle]] method.
* Much like the [[Argument]] class, this class handles parsing user-specified command arguments
* will implement the {@link ExtendedArgument#handle} method.
* Much like the {@link Argument} class, this class handles parsing user-specified command arguments
* into typed command parameters. However, this class can be used to expand upon an existing

@@ -18,7 +18,7 @@ * argument in order to process its transformed value rather than just the argument string.

* import { ApplyOptions } from '@sapphire/decorators';
* import { ArgumentResult, ExtendedArgument, ExtendedArgumentContext, ExtendedArgumentOptions } from '(at)sapphire/framework';
* import { ArgumentResult, ExtendedArgument, ExtendedArgumentContext, ExtendedArgumentOptions } from '@sapphire/framework';
* import type { Channel, TextChannel } from 'discord.js';
*
* // Just like with `Argument`, you can use `export default` or `export =` too.
* @ApplyOptions<ExtendedArgumentOptions>({
* (at)ApplyOptions<ExtendedArgumentOptions>({
* name: 'textChannel',

@@ -31,3 +31,3 @@ * baseArgument: 'channel'

* ? this.ok(parsed as TextChannel)
* : this.error(argument, 'ArgumentTextChannelInvalidTextChannel', 'The argument did not resolve to a text channel.');
* : this.error({ identifier: 'ArgumentTextChannelInvalidTextChannel', message: 'The argument did not resolve to a text channel.' });
* }

@@ -40,3 +40,3 @@ * }

* // JavaScript:
* const { ExtendedArgument } = require('(at)sapphire/framework');
* const { ExtendedArgument } = require('@sapphire/framework');
*

@@ -51,3 +51,3 @@ * module.exports = class TextChannelArgument extends ExtendedArgument {

* ? this.ok(parsed)
* : this.error(argument, 'ArgumentTextChannelInvalidTextChannel', 'The argument did not resolve to a text channel/');
* : this.error({ identifier: 'ArgumentTextChannelInvalidTextChannel', message: 'The argument did not resolve to a text channel' });
* }

@@ -54,0 +54,0 @@ * }

@@ -17,3 +17,3 @@ "use strict";

/**
* Constructs a [[PreconditionError]] with the precondition parameter set to `this`.
* Constructs a {@link PreconditionError} with the precondition parameter set to `this`.
* @param options The information.

@@ -20,0 +20,0 @@ */

@@ -9,3 +9,3 @@ "use strict";

/**
* A strict-typed store registry. This is available in both [[Client.stores]] and [[Store.injectedContext]].
* A strict-typed store registry. This is available in both {@link Client.stores} and {@link Store.injectedContext}.
* @since 1.0.0

@@ -22,3 +22,3 @@ * @example

* // file somewhere:
* declare module '(at)sapphire/framework' {
* declare module '@sapphire/framework' {
* export interface StoreRegistryEntries {

@@ -25,0 +25,0 @@ * routes: RouteStore;

@@ -5,3 +5,3 @@ "use strict";

/**
* The logger levels for the [[ILogger]].
* The logger levels for the {@link ILogger}.
*/

@@ -11,23 +11,23 @@ var LogLevel;

/**
* The lowest log level, used when calling [[ILogger.trace]].
* The lowest log level, used when calling {@link ILogger.trace}.
*/
LogLevel[LogLevel["Trace"] = 10] = "Trace";
/**
* The debug level, used when calling [[ILogger.debug]].
* The debug level, used when calling {@link ILogger.debug}.
*/
LogLevel[LogLevel["Debug"] = 20] = "Debug";
/**
* The info level, used when calling [[ILogger.info]].
* The info level, used when calling {@link ILogger.info}.
*/
LogLevel[LogLevel["Info"] = 30] = "Info";
/**
* The warning level, used when calling [[ILogger.warn]].
* The warning level, used when calling {@link ILogger.warn}.
*/
LogLevel[LogLevel["Warn"] = 40] = "Warn";
/**
* The error level, used when calling [[ILogger.error]].
* The error level, used when calling {@link ILogger.error}.
*/
LogLevel[LogLevel["Error"] = 50] = "Error";
/**
* The critical level, used when calling [[ILogger.fatal]].
* The critical level, used when calling {@link ILogger.fatal}.
*/

@@ -34,0 +34,0 @@ LogLevel[LogLevel["Fatal"] = 60] = "Fatal";

@@ -6,3 +6,3 @@ "use strict";

/**
* An [[IPreconditionCondition]] which runs all containers similarly to doing (V0 && V1 [&& V2 [&& V3 ...]]).
* An {@link IPreconditionCondition]] which runs all containers similarly to doing (V0 && V1 [&& V2 [&& V3 ...}).
* @since 1.0.0

@@ -9,0 +9,0 @@ */

@@ -6,3 +6,3 @@ "use strict";

/**
* An [[IPreconditionCondition]] which runs all containers similarly to doing (V0 || V1 [|| V2 [|| V3 ...]]).
* An {@link IPreconditionCondition]] which runs all containers similarly to doing (V0 || V1 [|| V2 [|| V3 ...}).
* @since 1.0.0

@@ -9,0 +9,0 @@ */

@@ -9,3 +9,3 @@ "use strict";

/**
* The run mode for a [[PreconditionContainerArray]].
* The run mode for a {@link PreconditionContainerArray}.
* @since 1.0.0

@@ -29,3 +29,3 @@ */

/**
* The condition for a [[PreconditionContainerArray]].
* The condition for a {@link PreconditionContainerArray}.
*/

@@ -35,3 +35,3 @@ var PreconditionRunCondition;

/**
* Defines a condition where all the entries must pass. This uses [[PreconditionConditionAnd]].
* Defines a condition where all the entries must pass. This uses {@link PreconditionConditionAnd}.
* @since 1.0.0

@@ -41,3 +41,3 @@ */

/**
* Defines a condition where at least one entry must pass. This uses [[PreconditionConditionOr]].
* Defines a condition where at least one entry must pass. This uses {@link PreconditionConditionOr}.
* @since 1.0.0

@@ -51,5 +51,5 @@ */

/**
* An [[IPreconditionContainer]] that defines an array of multiple [[IPreconditionContainer]]s.
* An {@link IPreconditionContainer} that defines an array of multiple {@link IPreconditionContainer}s.
*
* By default, array containers run either of two conditions: AND and OR ([[PreconditionRunCondition]]), the top level
* By default, array containers run either of two conditions: AND and OR ({@link PreconditionRunCondition}), the top level
* will always default to AND, where the nested one flips the logic (OR, then children arrays are AND, then OR...).

@@ -66,4 +66,4 @@ *

* ```
* @remark More advanced logic can be accomplished by adding more [[IPreconditionCondition]]s (e.g. other operators),
* see [[PreconditionContainerArray.conditions]] for more information.
* @remark More advanced logic can be accomplished by adding more {@link IPreconditionCondition}s (e.g. other operators),
* see {@link PreconditionContainerArray.conditions} for more information.
* @since 1.0.0

@@ -121,3 +121,3 @@ */

/**
* Retrieves a condition from [[PreconditionContainerArray.conditions]], assuming existence.
* Retrieves a condition from {@link PreconditionContainerArray.conditions}, assuming existence.
* @since 1.0.0

@@ -131,4 +131,4 @@ */

/**
* The preconditions to be run. Extra ones can be added by augmenting [[PreconditionRunCondition]] and then
* inserting [[IPreconditionCondition]]s.
* The preconditions to be run. Extra ones can be added by augmenting {@link PreconditionRunCondition} and then
* inserting {@link IPreconditionCondition}s.
* @since 1.0.0

@@ -145,3 +145,3 @@ * @example

* // file somewhere:
* declare module '(at)sapphire/framework' {
* declare module '@sapphire/framework' {
* export enum PreconditionRunCondition {

@@ -148,0 +148,0 @@ * Random = 2

@@ -6,3 +6,3 @@ "use strict";

/**
* An [[IPreconditionContainer]] which runs a single precondition from [[SapphireClient.preconditions]].
* An {@link IPreconditionContainer} which runs a single precondition from {@link SapphireClient.preconditions}.
* @since 1.0.0

@@ -9,0 +9,0 @@ */

{
"name": "@sapphire/framework",
"version": "2.0.0-next.5c67dadc7c5a2bd242ab009acef32d5f007f6911.0",
"version": "2.0.0-next.74eb3ece.0",
"description": "Discord bot framework built on top of @sapphire/lib for advanced and amazing bots.",

@@ -32,13 +32,10 @@ "main": "dist/index.js",

"dependencies": {
"@sapphire/discord-utilities": "^2.1.1",
"@sapphire/discord.js-utilities": "^1.5.7",
"@sapphire/discord-utilities": "^2.1.3",
"@sapphire/discord.js-utilities": "^1.5.9",
"@sapphire/pieces": "^2.0.0",
"@sapphire/ratelimits": "^1.2.1",
"@sapphire/utilities": "^1.5.1",
"@sapphire/ratelimits": "^1.2.3",
"@sapphire/utilities": "^1.5.3",
"lexure": "^0.17.0",
"tslib": "^2.2.0"
},
"peerDependencies": {
"discord.js": "12.x"
},
"devDependencies": {

@@ -48,7 +45,7 @@ "@commitlint/cli": "^12.1.4",

"@mdx-js/mdx": "^1.6.22",
"@sapphire/eslint-config": "^3.1.2",
"@sapphire/prettier-config": "^1.1.1",
"@sapphire/ts-config": "^2.2.1",
"@sapphire/eslint-config": "^3.1.4",
"@sapphire/prettier-config": "^1.1.3",
"@sapphire/ts-config": "^2.2.3",
"@types/jest": "^26.0.23",
"@types/node": "^15.6.1",
"@types/node": "^15.12.1",
"@types/ws": "^7.4.4",

@@ -58,16 +55,16 @@ "cz-conventional-changelog": "^3.3.0",

"husky": "^6.0.0",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"jest": "^27.0.4",
"jest-circus": "^27.0.4",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
"pretty-quick": "^3.1.0",
"rollup": "^2.47.0",
"rollup": "^2.51.0",
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-version-injector": "^1.3.3",
"standard-version": "^9.3.0",
"ts-jest": "^26.5.6",
"ts-jest": "^27.0.2",
"ts-node": "^10.0.0",
"typedoc": "^0.20.36",
"typedoc": "^0.21.0-beta.1",
"typedoc-plugin-nojekyll": "^1.0.1",
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},

@@ -125,5 +122,6 @@ "repository": {

"merge": "^2.1.1",
"trim": "^1.0.1"
"trim": "^1.0.1",
"trim-newlines": "^3.0.1"
},
"prettier": "@sapphire/prettier-config"
}

@@ -24,4 +24,2 @@ <div align="center">

**Much of the code in this repository is inspired and based on the ideas from [klasa].**
## Features

@@ -33,4 +31,18 @@

- Advanced Plugins Support
- Complete i18n Integration
- Supports many [plugins](https://github.com/sapphiredev/plugins)
## Installation
`@sapphire/framework` depends on the following packages. Be sure to install these along with this package!
- [`discord.js`](https://www.npmjs.com/package/discord.js)
You can use the following command to install this package, or replace `npm install` with your package manager of choice.
```sh
npm install @sapphire/framework discord.js
```
---
## API Documentation

@@ -92,2 +104,1 @@

[discord.js]: https://github.com/discordjs/discord.js
[klasa]: https://github.com/dirigeants/klasa

Sorry, the diff of this file is too big to display

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