revolt.js
Advanced tools
Comparing version 6.0.2 to 6.0.3
import EventEmitter from "eventemitter3"; | ||
import type { DataCreateAccount, DataLogin, DataOnboard, InviteResponse, Session } from "revolt-api"; | ||
import type { DataCreateAccount, DataLogin, DataOnboard, InviteResponse } from "revolt-api"; | ||
import type { RevoltConfig, Metadata } from "revolt-api"; | ||
@@ -374,6 +374,2 @@ import { API, MemberCompositeKey, Role } from "revolt-api"; | ||
}, ...args: FileArgs): string | undefined; | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock(): Promise<void>; | ||
} |
@@ -381,120 +381,3 @@ "use strict"; | ||
} | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock() { | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this.configuration = { | ||
revolt: "0.5.3", | ||
features: { | ||
captcha: { | ||
enabled: true, | ||
key: "", | ||
}, | ||
email: true, | ||
invite_only: false, | ||
autumn: { enabled: true, url: "https://autumn.revolt.chat" }, | ||
january: { enabled: true, url: "https://jan.revolt.chat" }, | ||
voso: { | ||
enabled: true, | ||
url: "https://vortex.revolt.chat", | ||
ws: "wss://vortex.revolt.chat", | ||
}, | ||
}, | ||
ws: "wss://ws.revolt.chat", | ||
app: "https://app.revolt.chat", | ||
vapid: "", | ||
}; | ||
this.user = yield this.users.fetch("user", { | ||
_id: "user", | ||
username: "insert", | ||
online: true, | ||
status: { | ||
presence: "Online", | ||
text: "gaming frfr", | ||
}, | ||
profile: { | ||
content: "profile text", | ||
background: { | ||
_id: "7B3pdjRfTd7NriBWRYFdqKTQpUiskBzHkZ67tJiMtE", | ||
tag: "backgrounds", | ||
filename: "tenor.gif", | ||
metadata: { | ||
type: "Image", | ||
width: 498, | ||
height: 292, | ||
}, | ||
content_type: "image/gif", | ||
size: 1073166, | ||
}, | ||
}, | ||
avatar: { | ||
_id: "6rgg372gI2LrxCUx0CiA2R1Qs6eTtmC-2NpMq1Xa_3", | ||
tag: "avatars", | ||
filename: "e4332b6d70619b8a98086e532dbd4b9e.png", | ||
metadata: { | ||
type: "Image", | ||
width: 128, | ||
height: 128, | ||
}, | ||
content_type: "image/png", | ||
size: 23321, | ||
}, | ||
}); | ||
yield this.users.fetch("user2", { | ||
_id: "user2", | ||
username: "mink", | ||
online: true, | ||
}); | ||
const names = [ | ||
"Server Name", | ||
"My Server", | ||
"Joe Nuts", | ||
"F", | ||
"G", | ||
"Deez", | ||
"A B C D E F", | ||
]; | ||
for (let i = 0; i < names.length; i++) { | ||
const _id = i.toString(); | ||
this.channels.fetch(_id, { | ||
_id, | ||
channel_type: "TextChannel", | ||
name: "General", | ||
server: _id, | ||
}); | ||
this.servers.fetch(_id, { | ||
_id, | ||
name: names[i], | ||
channels: [], | ||
default_permissions: 0, | ||
owner: "user", | ||
}); | ||
if (Math.random() > 0.75) { | ||
const count = Math.floor(Math.random() * 10); | ||
for (let i = 0; i < count; i++) { | ||
(_a = this.unreads) === null || _a === void 0 ? void 0 : _a.markMention(_id, "mid"); | ||
} | ||
} | ||
else if (Math.random() > 0.5) { | ||
(_b = this.unreads) === null || _b === void 0 ? void 0 : _b.markUnread(_id, "mid"); | ||
} | ||
} | ||
this.channels.fetch("group", { | ||
_id: "group", | ||
channel_type: "Group", | ||
name: "Group Chat", | ||
owner: "user2", | ||
recipients: ["user", "user2"], | ||
}); | ||
this.channels.fetch("dm", { | ||
_id: "dm", | ||
channel_type: "DirectMessage", | ||
active: true, | ||
recipients: ["user", "user2"], | ||
}); | ||
}); | ||
} | ||
} | ||
exports.Client = Client; |
@@ -476,5 +476,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.client.api.post( | ||
// @ts-expect-error .delete does not support params | ||
`/channels/${this._id}/messages/bulk`, { ids }, { method: "DELETE" }); | ||
yield this.client.api.delete(`/channels/${this._id}/messages/bulk`, { data: { ids } }); | ||
}); | ||
@@ -481,0 +479,0 @@ } |
@@ -112,3 +112,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.client.api.put(`/users/${this.username}/friend`); | ||
return yield this.client.api.post(`/users/friend`, { | ||
username: this.username, | ||
}); | ||
}); | ||
@@ -115,0 +117,0 @@ } |
@@ -67,3 +67,3 @@ "use strict"; | ||
return { | ||
last_id: "10000000000000000000000000", | ||
last_id: "40000000000000000000000000", | ||
}; | ||
@@ -70,0 +70,0 @@ return this.channels.get(channel_id); |
@@ -1,2 +0,2 @@ | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser, Session } from "revolt-api"; | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Channel, Message } from "revolt-api"; | ||
@@ -3,0 +3,0 @@ import type { Member, MemberCompositeKey, Role, Server } from "revolt-api"; |
import EventEmitter from "eventemitter3"; | ||
import type { DataCreateAccount, DataLogin, DataOnboard, InviteResponse, Session } from "revolt-api"; | ||
import type { DataCreateAccount, DataLogin, DataOnboard, InviteResponse } from "revolt-api"; | ||
import type { RevoltConfig, Metadata } from "revolt-api"; | ||
@@ -374,6 +374,2 @@ import { API, MemberCompositeKey, Role } from "revolt-api"; | ||
}, ...args: FileArgs): string | undefined; | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock(): Promise<void>; | ||
} |
@@ -375,119 +375,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock() { | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this.configuration = { | ||
revolt: "0.5.3", | ||
features: { | ||
captcha: { | ||
enabled: true, | ||
key: "", | ||
}, | ||
email: true, | ||
invite_only: false, | ||
autumn: { enabled: true, url: "https://autumn.revolt.chat" }, | ||
january: { enabled: true, url: "https://jan.revolt.chat" }, | ||
voso: { | ||
enabled: true, | ||
url: "https://vortex.revolt.chat", | ||
ws: "wss://vortex.revolt.chat", | ||
}, | ||
}, | ||
ws: "wss://ws.revolt.chat", | ||
app: "https://app.revolt.chat", | ||
vapid: "", | ||
}; | ||
this.user = yield this.users.fetch("user", { | ||
_id: "user", | ||
username: "insert", | ||
online: true, | ||
status: { | ||
presence: "Online", | ||
text: "gaming frfr", | ||
}, | ||
profile: { | ||
content: "profile text", | ||
background: { | ||
_id: "7B3pdjRfTd7NriBWRYFdqKTQpUiskBzHkZ67tJiMtE", | ||
tag: "backgrounds", | ||
filename: "tenor.gif", | ||
metadata: { | ||
type: "Image", | ||
width: 498, | ||
height: 292, | ||
}, | ||
content_type: "image/gif", | ||
size: 1073166, | ||
}, | ||
}, | ||
avatar: { | ||
_id: "6rgg372gI2LrxCUx0CiA2R1Qs6eTtmC-2NpMq1Xa_3", | ||
tag: "avatars", | ||
filename: "e4332b6d70619b8a98086e532dbd4b9e.png", | ||
metadata: { | ||
type: "Image", | ||
width: 128, | ||
height: 128, | ||
}, | ||
content_type: "image/png", | ||
size: 23321, | ||
}, | ||
}); | ||
yield this.users.fetch("user2", { | ||
_id: "user2", | ||
username: "mink", | ||
online: true, | ||
}); | ||
const names = [ | ||
"Server Name", | ||
"My Server", | ||
"Joe Nuts", | ||
"F", | ||
"G", | ||
"Deez", | ||
"A B C D E F", | ||
]; | ||
for (let i = 0; i < names.length; i++) { | ||
const _id = i.toString(); | ||
this.channels.fetch(_id, { | ||
_id, | ||
channel_type: "TextChannel", | ||
name: "General", | ||
server: _id, | ||
}); | ||
this.servers.fetch(_id, { | ||
_id, | ||
name: names[i], | ||
channels: [], | ||
default_permissions: 0, | ||
owner: "user", | ||
}); | ||
if (Math.random() > 0.75) { | ||
const count = Math.floor(Math.random() * 10); | ||
for (let i = 0; i < count; i++) { | ||
(_a = this.unreads) === null || _a === void 0 ? void 0 : _a.markMention(_id, "mid"); | ||
} | ||
} | ||
else if (Math.random() > 0.5) { | ||
(_b = this.unreads) === null || _b === void 0 ? void 0 : _b.markUnread(_id, "mid"); | ||
} | ||
} | ||
this.channels.fetch("group", { | ||
_id: "group", | ||
channel_type: "Group", | ||
name: "Group Chat", | ||
owner: "user2", | ||
recipients: ["user", "user2"], | ||
}); | ||
this.channels.fetch("dm", { | ||
_id: "dm", | ||
channel_type: "DirectMessage", | ||
active: true, | ||
recipients: ["user", "user2"], | ||
}); | ||
}); | ||
} | ||
} |
@@ -470,5 +470,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.client.api.post( | ||
// @ts-expect-error .delete does not support params | ||
`/channels/${this._id}/messages/bulk`, { ids }, { method: "DELETE" }); | ||
yield this.client.api.delete(`/channels/${this._id}/messages/bulk`, { data: { ids } }); | ||
}); | ||
@@ -475,0 +473,0 @@ } |
@@ -106,3 +106,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.client.api.put(`/users/${this.username}/friend`); | ||
return yield this.client.api.post(`/users/friend`, { | ||
username: this.username, | ||
}); | ||
}); | ||
@@ -109,0 +111,0 @@ } |
@@ -65,3 +65,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
return { | ||
last_id: "10000000000000000000000000", | ||
last_id: "40000000000000000000000000", | ||
}; | ||
@@ -68,0 +68,0 @@ return this.channels.get(channel_id); |
@@ -1,2 +0,2 @@ | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser, Session } from "revolt-api"; | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Channel, Message } from "revolt-api"; | ||
@@ -3,0 +3,0 @@ import type { Member, MemberCompositeKey, Role, Server } from "revolt-api"; |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"main": "dist/index.js", | ||
@@ -20,3 +20,3 @@ "typings": "dist/index.d.ts", | ||
"mobx": "^6.3.2", | ||
"revolt-api": "0.5.3-5-patch.4", | ||
"revolt-api": "0.5.3-7", | ||
"ulid": "^2.3.0", | ||
@@ -23,0 +23,0 @@ "ws": "^8.2.2" |
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
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
461257
12838
+ Addedrevolt-api@0.5.3-7(transitive)
- Removedrevolt-api@0.5.3-5-patch.4(transitive)
Updatedrevolt-api@0.5.3-7