@open-discord-bots/framework 0.5.3 → 0.5.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 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.5.3"));
47
+ this.versions.add(ODVersion.fromString("opendiscord:api", "v0.5.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;
@@ -97,6 +97,7 @@ export declare class ODJsonDatabase<IdList extends ODDatabaseIdConstraint = ODDa
97
97
  * const didOverwrite = database.setData("category","key","value") //value can be any of the valid types
98
98
  * //You need an ODJsonDatabase class named "database" for this example to work!
99
99
  */
100
+ set<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId, key: string, value: IdList[CategoryId]): ODOptionalPromise<boolean>;
100
101
  set(category: string, key: string, value: ODValidJsonType): ODOptionalPromise<boolean>;
101
102
  /**Get the value of `category` & `key`. Returns `undefined` when non-existent!
102
103
  * @example
@@ -110,8 +111,10 @@ export declare class ODJsonDatabase<IdList extends ODDatabaseIdConstraint = ODDa
110
111
  * const didExist = database.deleteData("category","key") //delete this value
111
112
  * //You need an ODJsonDatabase class named "database" for this example to work!
112
113
  */
114
+ delete<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId, key: string): ODOptionalPromise<boolean>;
113
115
  delete(category: string, key: string): ODOptionalPromise<boolean>;
114
116
  /**Check if a value of `category` & `key` exists. Returns `false` when non-existent! */
117
+ exists(category: keyof ODNoGeneric<IdList>, key: string): ODOptionalPromise<boolean>;
115
118
  exists(category: string, key: string): ODOptionalPromise<boolean>;
116
119
  /**Get all values in `category`. Returns `undefined` when non-existent! */
117
120
  getCategory<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId): ODOptionalPromise<{
@@ -145,6 +148,7 @@ export declare class ODFormattedJsonDatabase<IdList extends ODDatabaseIdConstrai
145
148
  * const didOverwrite = database.setData("category","key","value") //value can be any of the valid types
146
149
  * //You need an ODFormattedJsonDatabase class named "database" for this example to work!
147
150
  */
151
+ set<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId, key: string, value: IdList[CategoryId]): ODOptionalPromise<boolean>;
148
152
  set(category: string, key: string, value: ODValidJsonType): ODOptionalPromise<boolean>;
149
153
  /**Get the value of `category` & `key`. Returns `undefined` when non-existent!
150
154
  * @example
@@ -158,8 +162,10 @@ export declare class ODFormattedJsonDatabase<IdList extends ODDatabaseIdConstrai
158
162
  * const didExist = database.deleteData("category","key") //delete this value
159
163
  * //You need an ODFormattedJsonDatabase class named "database" for this example to work!
160
164
  */
165
+ delete<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId, key: string): ODOptionalPromise<boolean>;
161
166
  delete(category: string, key: string): ODOptionalPromise<boolean>;
162
167
  /**Check if a value of `category` & `key` exists. Returns `false` when non-existent! */
168
+ exists(category: keyof ODNoGeneric<IdList>, key: string): ODOptionalPromise<boolean>;
163
169
  exists(category: string, key: string): ODOptionalPromise<boolean>;
164
170
  /**Get all values in `category`. Returns `undefined` when non-existent! */
165
171
  getCategory<CategoryId extends keyof ODNoGeneric<IdList>>(category: CategoryId): ODOptionalPromise<{
@@ -65,11 +65,6 @@ export class ODJsonDatabase extends ODDatabase {
65
65
  init() {
66
66
  this.#system.getData();
67
67
  }
68
- /**Set/overwrite the value of `category` & `key`. Returns `true` when overwritten!
69
- * @example
70
- * const didOverwrite = database.setData("category","key","value") //value can be any of the valid types
71
- * //You need an ODJsonDatabase class named "database" for this example to work!
72
- */
73
68
  set(category, key, value) {
74
69
  const currentList = this.#system.getData();
75
70
  const currentData = currentList.find((d) => (d.category === category) && (d.key === key));
@@ -88,11 +83,6 @@ export class ODJsonDatabase extends ODDatabase {
88
83
  const tempresult = currentList.find((d) => (d.category === category) && (d.key === key));
89
84
  return tempresult ? tempresult.value : undefined;
90
85
  }
91
- /**Remove the value of `category` & `key`. Returns `undefined` when non-existent!
92
- * @example
93
- * const didExist = database.deleteData("category","key") //delete this value
94
- * //You need an ODJsonDatabase class named "database" for this example to work!
95
- */
96
86
  delete(category, key) {
97
87
  const currentList = this.#system.getData();
98
88
  const currentData = currentList.find((d) => (d.category === category) && (d.key === key));
@@ -101,7 +91,6 @@ export class ODJsonDatabase extends ODDatabase {
101
91
  this.#system.setData(currentList);
102
92
  return currentData ? true : false;
103
93
  }
104
- /**Check if a value of `category` & `key` exists. Returns `false` when non-existent! */
105
94
  exists(category, key) {
106
95
  const currentList = this.#system.getData();
107
96
  const tempresult = currentList.find((d) => (d.category === category) && (d.key === key));
@@ -160,11 +149,6 @@ export class ODFormattedJsonDatabase extends ODDatabase {
160
149
  init() {
161
150
  this.#system.getData();
162
151
  }
163
- /**Set/overwrite the value of `category` & `key`. Returns `true` when overwritten!
164
- * @example
165
- * const didOverwrite = database.setData("category","key","value") //value can be any of the valid types
166
- * //You need an ODFormattedJsonDatabase class named "database" for this example to work!
167
- */
168
152
  set(category, key, value) {
169
153
  const currentList = this.#system.getData();
170
154
  const currentData = currentList.find((d) => (d.category === category) && (d.key === key));
@@ -183,11 +167,6 @@ export class ODFormattedJsonDatabase extends ODDatabase {
183
167
  const tempresult = currentList.find((d) => (d.category === category) && (d.key === key));
184
168
  return tempresult ? tempresult.value : undefined;
185
169
  }
186
- /**Remove the value of `category` & `key`. Returns `undefined` when non-existent!
187
- * @example
188
- * const didExist = database.deleteData("category","key") //delete this value
189
- * //You need an ODFormattedJsonDatabase class named "database" for this example to work!
190
- */
191
170
  delete(category, key) {
192
171
  const currentList = this.#system.getData();
193
172
  const currentData = currentList.find((d) => (d.category === category) && (d.key === key));
@@ -196,7 +175,6 @@ export class ODFormattedJsonDatabase extends ODDatabase {
196
175
  this.#system.setData(currentList);
197
176
  return currentData ? true : false;
198
177
  }
199
- /**Check if a value of `category` & `key` exists. Returns `false` when non-existent! */
200
178
  exists(category, key) {
201
179
  const currentList = this.#system.getData();
202
180
  const tempresult = currentList.find((d) => (d.category === category) && (d.key === key));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-discord-bots/framework",
3
3
  "author": "DJj123dj",
4
- "version": "0.5.3",
4
+ "version": "0.5.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",