@open-discord-bots/framework 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/main.js +1 -1
- package/dist/cli/editConfig.js +18 -3
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +2 -1
- package/package.json +1 -1
package/dist/api/main.js
CHANGED
|
@@ -44,7 +44,7 @@ export class ODMain {
|
|
|
44
44
|
constructor(managers, project) {
|
|
45
45
|
this.project = project;
|
|
46
46
|
this.versions = managers.versions;
|
|
47
|
-
this.versions.add(ODVersion.fromString("opendiscord:api", "v0.4.
|
|
47
|
+
this.versions.add(ODVersion.fromString("opendiscord:api", "v0.4.4"));
|
|
48
48
|
this.versions.add(ODVersion.fromString("opendiscord:livestatus", "v2.0.0"));
|
|
49
49
|
this.debugfile = managers.debugfile;
|
|
50
50
|
this.console = managers.console;
|
package/dist/cli/editConfig.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as api from "../api/index.js";
|
|
2
2
|
import * as utilities from "../utilities/index.js";
|
|
3
|
-
import
|
|
3
|
+
import terminalKit from "terminal-kit";
|
|
4
4
|
import ansis from "ansis";
|
|
5
5
|
import { renderHeader } from "./index.js";
|
|
6
|
+
const terminal = terminalKit.terminal;
|
|
6
7
|
export class ODCliEditConfigInstance {
|
|
7
8
|
opts;
|
|
8
9
|
opendiscord;
|
|
@@ -676,7 +677,14 @@ export class ODCliEditConfigInstance {
|
|
|
676
677
|
else {
|
|
677
678
|
localData[enabledProperty] = data;
|
|
678
679
|
//copy old object checker to new object checker => all options get de-referenced (this is needed for the new object skip keys are temporary)
|
|
679
|
-
const newStructure = new api.ODCheckerObjectStructure(subStructure.id,
|
|
680
|
+
const newStructure = new api.ODCheckerObjectStructure(subStructure.id, { children: [] });
|
|
681
|
+
//copy all options over to the new checker. This can't be done using structuredClone() because of the custom() function
|
|
682
|
+
newStructure.options.children = [...subStructure.options.children];
|
|
683
|
+
newStructure.options.cliInitSkipKeys = [...(subStructure.options.cliInitSkipKeys ?? [])];
|
|
684
|
+
for (const key of Object.keys(subStructure.options)) {
|
|
685
|
+
if (key != "children" && key != "cliInitSkipKeys")
|
|
686
|
+
newStructure.options[key] = subStructure.options[key];
|
|
687
|
+
}
|
|
680
688
|
//continues to next function
|
|
681
689
|
await this.renderAdditionConfigObjectStructure(checker, async () => { await this.renderAdditionConfigEnabledObjectStructure(checker, backFn, nextFn, structure, parent, parentIndex, path, localPath); }, nextFn, newStructure, parent, parentIndex, path, localPath, localData);
|
|
682
690
|
await nextFn(localData);
|
|
@@ -699,7 +707,14 @@ export class ODCliEditConfigInstance {
|
|
|
699
707
|
const objectTemplate = structure.options.objects[answer.selectedIndex];
|
|
700
708
|
//copy old object checker to new object checker => all options get de-referenced (this is needed for the new object switch properties which are temporary)
|
|
701
709
|
const oldStructure = objectTemplate.checker;
|
|
702
|
-
const newStructure = new api.ODCheckerObjectStructure(oldStructure.id,
|
|
710
|
+
const newStructure = new api.ODCheckerObjectStructure(oldStructure.id, { children: [] });
|
|
711
|
+
//copy all options over to the new checker. This can't be done using structuredClone() because of the custom() function
|
|
712
|
+
newStructure.options.children = [...oldStructure.options.children];
|
|
713
|
+
newStructure.options.cliInitSkipKeys = [...(oldStructure.options.cliInitSkipKeys ?? [])];
|
|
714
|
+
for (const key of Object.keys(oldStructure.options)) {
|
|
715
|
+
if (key != "children" && key != "cliInitSkipKeys")
|
|
716
|
+
newStructure.options[key] = oldStructure.options[key];
|
|
717
|
+
}
|
|
703
718
|
//add the keys of the object switch properties to the 'cliInitSkipKeys' because they need to be skipped.
|
|
704
719
|
objectTemplate.properties.map((p) => p.key).forEach((p) => {
|
|
705
720
|
if (!newStructure.options.cliInitSkipKeys)
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as api from "../api/index.js";
|
|
2
|
-
import
|
|
2
|
+
import terminalKit from "terminal-kit";
|
|
3
3
|
import * as discord from "discord.js";
|
|
4
4
|
export * from "./editConfig.js";
|
|
5
5
|
/**## ODCliHeaderOpts `interface`
|
|
@@ -30,6 +30,6 @@ export declare function renderHeader(opts: ODCliHeaderOpts, path: (string | numb
|
|
|
30
30
|
/**Execute/start the Interactive Setup CLI. Make sure no other processes disturb the flow. */
|
|
31
31
|
export declare function execute(opts: ODCliHeaderOpts, renderEditConfig: ODCliStartFunction | null, renderQuickSetup: ODCliStartFunction | null): Promise<void>;
|
|
32
32
|
/**A basic style template for select menu's in the interactive setup CLI. */
|
|
33
|
-
export declare const autoCompleteMenuOpts: Terminal.SingleLineMenuOptions;
|
|
33
|
+
export declare const autoCompleteMenuOpts: terminalKit.Terminal.SingleLineMenuOptions;
|
|
34
34
|
/**A set of preset colors to be used when auto-filling colors in the interactive setup CLI. */
|
|
35
35
|
export declare const presetColors: Map<string, string>;
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import terminalKit from "terminal-kit";
|
|
2
2
|
import ansis from "ansis";
|
|
3
3
|
import crypto from "crypto";
|
|
4
|
+
const terminal = terminalKit.terminal;
|
|
4
5
|
export * from "./editConfig.js";
|
|
5
6
|
/**A utility function to center text to a certain width. */
|
|
6
7
|
export function centerText(text, width) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-discord-bots/framework",
|
|
3
3
|
"author": "DJj123dj",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"description": "The core framework of the popular open-source discord bots: Open Ticket & Open Moderation.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|