revolt.js
Advanced tools
Comparing version 6.0.0-2 to 6.0.0-3
@@ -374,2 +374,6 @@ import EventEmitter from "eventemitter3"; | ||
}, ...args: FileArgs): string | undefined; | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock(): Promise<void>; | ||
} |
@@ -120,4 +120,4 @@ "use strict"; | ||
authentication: { | ||
revolt: this.session | ||
} | ||
revolt: this.session, | ||
}, | ||
}); | ||
@@ -134,3 +134,3 @@ } | ||
const data = yield this.api.post("/auth/session/login", details); | ||
if (data.result === 'Success') { | ||
if (data.result === "Success") { | ||
this.session = data; | ||
@@ -215,6 +215,6 @@ return yield this.$connect(); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const code = typeof invite === 'string' ? invite : invite.code; | ||
if (typeof invite === 'object') { | ||
const code = typeof invite === "string" ? invite : invite.code; | ||
if (typeof invite === "object") { | ||
switch (invite.type) { | ||
case 'Group': { | ||
case "Group": { | ||
const group = this.channels.get(invite.channel_id); | ||
@@ -225,3 +225,3 @@ if (group) | ||
} | ||
case 'Server': { | ||
case "Server": { | ||
const server = this.servers.get(invite.server_id); | ||
@@ -234,3 +234,3 @@ if (server) | ||
const response = yield this.api.post(`/invites/${code}`); | ||
if (response.type === 'Server') { | ||
if (response.type === "Server") { | ||
return yield this.servers.fetch(response.server._id, response.server, response.channels); | ||
@@ -368,6 +368,6 @@ } | ||
// ! FIXME: These limits should be done on Autumn. | ||
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) === 'Image') { | ||
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) === "Image") { | ||
if (Math.min(metadata.width, metadata.height) <= 0 || | ||
(content_type === "image/gif" | ||
&& Math.max(metadata.width, metadata.height) >= 1024)) | ||
(content_type === "image/gif" && | ||
Math.max(metadata.width, metadata.height) >= 1024)) | ||
return fallback; | ||
@@ -387,3 +387,102 @@ } | ||
} | ||
/** | ||
* 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, | ||
}, | ||
}); | ||
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"); | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
exports.Client = Client; |
@@ -1,2 +0,2 @@ | ||
export declare const LIBRARY_VERSION = "6.0.0"; | ||
export declare const LIBRARY_VERSION = "6.0.0-3"; | ||
export declare const defaultConfig: { | ||
@@ -3,0 +3,0 @@ apiURL: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultConfig = exports.LIBRARY_VERSION = void 0; | ||
exports.LIBRARY_VERSION = "6.0.0"; | ||
exports.LIBRARY_VERSION = "6.0.0-3"; | ||
exports.defaultConfig = { | ||
@@ -6,0 +6,0 @@ apiURL: "https://api.revolt.chat", |
@@ -374,2 +374,6 @@ import EventEmitter from "eventemitter3"; | ||
}, ...args: FileArgs): string | undefined; | ||
/** | ||
* Configure mock data ("demo mode") | ||
*/ | ||
mock(): Promise<void>; | ||
} |
@@ -114,4 +114,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
authentication: { | ||
revolt: this.session | ||
} | ||
revolt: this.session, | ||
}, | ||
}); | ||
@@ -128,3 +128,3 @@ } | ||
const data = yield this.api.post("/auth/session/login", details); | ||
if (data.result === 'Success') { | ||
if (data.result === "Success") { | ||
this.session = data; | ||
@@ -209,6 +209,6 @@ return yield this.$connect(); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const code = typeof invite === 'string' ? invite : invite.code; | ||
if (typeof invite === 'object') { | ||
const code = typeof invite === "string" ? invite : invite.code; | ||
if (typeof invite === "object") { | ||
switch (invite.type) { | ||
case 'Group': { | ||
case "Group": { | ||
const group = this.channels.get(invite.channel_id); | ||
@@ -219,3 +219,3 @@ if (group) | ||
} | ||
case 'Server': { | ||
case "Server": { | ||
const server = this.servers.get(invite.server_id); | ||
@@ -228,3 +228,3 @@ if (server) | ||
const response = yield this.api.post(`/invites/${code}`); | ||
if (response.type === 'Server') { | ||
if (response.type === "Server") { | ||
return yield this.servers.fetch(response.server._id, response.server, response.channels); | ||
@@ -362,6 +362,6 @@ } | ||
// ! FIXME: These limits should be done on Autumn. | ||
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) === 'Image') { | ||
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) === "Image") { | ||
if (Math.min(metadata.width, metadata.height) <= 0 || | ||
(content_type === "image/gif" | ||
&& Math.max(metadata.width, metadata.height) >= 1024)) | ||
(content_type === "image/gif" && | ||
Math.max(metadata.width, metadata.height) >= 1024)) | ||
return fallback; | ||
@@ -381,2 +381,101 @@ } | ||
} | ||
/** | ||
* 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, | ||
}, | ||
}); | ||
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"); | ||
} | ||
} | ||
}); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
export declare const LIBRARY_VERSION = "6.0.0"; | ||
export declare const LIBRARY_VERSION = "6.0.0-3"; | ||
export declare const defaultConfig: { | ||
@@ -3,0 +3,0 @@ apiURL: string; |
@@ -1,2 +0,2 @@ | ||
export const LIBRARY_VERSION = "6.0.0"; | ||
export const LIBRARY_VERSION = "6.0.0-3"; | ||
export const defaultConfig = { | ||
@@ -3,0 +3,0 @@ apiURL: "https://api.revolt.chat", |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.0-2", | ||
"version": "6.0.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.3", | ||
"revolt-api": "0.5.3-5-patch.4", | ||
"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
467863
13024
+ Added@insertish/oapi@0.1.16(transitive)
+ Addedrevolt-api@0.5.3-5-patch.4(transitive)
- Removed@insertish/oapi@0.1.15(transitive)
- Removedrevolt-api@0.5.3-5-patch.3(transitive)
Updatedrevolt-api@0.5.3-5-patch.4