1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-05 18:32:33 +01:00

Client: update to canary 165341

This commit is contained in:
Puyodead1 2022-12-20 23:18:52 -05:00
parent b96d851646
commit 280a584aed
No known key found for this signature in database
GPG Key ID: B1FDE614A91E5BE9
11 changed files with 4079 additions and 26 deletions

View File

@ -23,7 +23,7 @@
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
MARKETING_ENDPOINT: "//discord.com",
RELEASE_CHANNEL: "stable",
RELEASE_CHANNEL: "canary",
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0"
};
GLOBAL_ENV.MEDIA_PROXY_ENDPOINT = location.protocol + "//" + GLOBAL_ENV.CDN_HOST;
@ -32,12 +32,12 @@
localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT);
localStorage.setItem(
"DeveloperOptionsStore",
`{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
`{"trace":false,"canary":true,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
);
</script>
<script src="/assets/38f40c32d3c8a2fdf73b.js" integrity=""></script>
<script src="/assets/aa190934324e05fcc35c.js" integrity=""></script>
<script src="/assets/45664a0209e828a528b4.js" integrity=""></script>
<script src="/assets/1cebe9b2b9ed8283ce52.js" integrity=""></script>
<script src="/assets/b48be57bceaf40c221ac.js" integrity=""></script>
<script src="/assets/b6e25718b296713dc29d.js" integrity=""></script>
</body>
</html>
</html>

View File

@ -24,7 +24,7 @@
INVITE_HOST: `${location.hostname}/invite`,
GUILD_TEMPLATE_HOST: "${location.host}/template",
GIFT_CODE_HOST: "${location.hostname}/gift",
RELEASE_CHANNEL: "stable",
RELEASE_CHANNEL: "canary",
MARKETING_ENDPOINT: "//discord.com",
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
@ -33,7 +33,7 @@
ACTIVITY_APPLICATION_HOST: "discordsays.com",
PROJECT_ENV: "production",
REMOTE_AUTH_ENDPOINT: "//localhost:3020",
SENTRY_TAGS: { buildId: "75e36d9", buildType: "normal" },
SENTRY_TAGS: { buildId: "d5b97e42230075cb9634c419c0cf4d2f8f9ada53", buildType: "normal" },
MIGRATION_SOURCE_ORIGIN: "https://${location.hostname}",
MIGRATION_DESTINATION_ORIGIN: "https://${location.hostname}",
HTML_TIMESTAMP: Date.now(),
@ -42,7 +42,7 @@
window.localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT);
window.localStorage.setItem(
"DeveloperOptionsStore",
`{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
`{"trace":false,"canary":true,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
);
</script>
@ -128,11 +128,11 @@
<body>
<div id="app-mount"></div>
<script src="/assets/83ace7450e110d16319e.js"></script>
<script src="/assets/e02290aaa8dac5d195c2.js"></script>
<script src="/assets/4f3b3c576b879a5f75d1.js"></script>
<script src="/assets/699456246fdfe7589855.js"></script>
<script src="/assets/b456855ec667950dcf68.js"></script>
<script src="/assets/cfb9efe961b2bf3647bc.js"></script>
<script src="/assets/f98a039261c37f892cbf.js"></script>
<script src="/assets/4470c87bb13810847db0.js"></script>
<!-- plugin marker -->
</body>
</html>
</html>

View File

@ -10863,6 +10863,10 @@
},
"private_channels_version": {
"type": "integer"
},
"guild_versions": {},
"api_code_version": {
"type": "integer"
}
},
"additionalProperties": false
@ -10885,6 +10889,10 @@
},
"useruserGuildSettingsVersion": {
"type": "integer"
},
"guildVersions": {},
"apiCodeVersion": {
"type": "integer"
}
},
"additionalProperties": false

View File

@ -34,7 +34,9 @@
"devDependencies": {
"@types/amqplib": "^0.8.2",
"@types/bcrypt": "^5.0.0",
"@types/body-parser": "^1.19.2",
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.15",
"@types/i18next-node-fs-backend": "^2.1.1",
"@types/json-bigint": "^1.0.1",
"@types/jsonwebtoken": "^8.5.9",
@ -59,6 +61,7 @@
"ajv-formats": "2.1.1",
"amqplib": "^0.10.3",
"bcrypt": "^5.0.1",
"body-parser": "^1.20.1",
"cheerio": "^1.0.0-rc.12",
"cookie-parser": "^1.4.6",
"dotenv": "^16.0.2",
@ -73,6 +76,7 @@
"json-bigint": "^1.0.0",
"jsonwebtoken": "^8.5.1",
"lambert-server": "^1.2.12",
"missing-native-js-functions": "^1.2.18",
"module-alias": "^2.2.2",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
@ -82,7 +86,9 @@
"picocolors": "^1.0.0",
"probe-image-size": "^7.2.3",
"proxy-agent": "^5.0.0",
"sqlite3": "^5.1.1",
"reflect-metadata": "^0.1.13",
"sqlite3": "^5.1.4",
"tslib": "^2.4.1",
"typeorm": "^0.3.10",
"typescript-json-schema": "0.50.1",
"ws": "^8.9.0"

3874
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,8 @@ import {
IdentifySchema,
DefaultUserGuildSettings,
UserGuildSettings,
ReadyGuildDTO,
Guild,
} from "@fosscord/util";
import { Send } from "../util/Send";
import { CLOSECODES, OPCODES } from "../util/Constants";
@ -255,17 +257,17 @@ export async function onIdentify(this: WebSocket, data: Payload) {
};
const d: ReadyEventData = {
v: 8,
v: 9,
application: { id: application?.id ?? '', flags: application?.flags ?? 0 }, //TODO: check this code!
user: privateUser,
user_settings: user.settings,
// @ts-ignore
guilds: guilds.map((x) => {
// @ts-ignore
x.guild_hashes = {}; // @ts-ignore
x.guild_scheduled_events = []; // @ts-ignore
x.threads = [];
return x;
return {
...new ReadyGuildDTO(x as Guild & { joined_at: Date }).toJSON(),
guild_hashes: {},
joined_at: x.joined_at
};
}),
guild_experiments: [], // TODO
geo_ordered_rtc_regions: [], // TODO
@ -298,8 +300,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
merged_members: merged_members,
// shard // TODO: only for user sharding
sessions: [], // TODO:
presences: [], // TODO:
tutorial: null,
};
// TODO: send real proper data structure

View File

@ -0,0 +1,153 @@
import { Channel, Emoji, Guild, Member, Role, Sticker } from "../entities";
export interface IReadyGuildDTO {
application_command_counts?: { 1: number; 2: number; 3: number }; // ????????????
channels: Channel[];
data_mode: string; // what is this
emojis: Emoji[];
guild_scheduled_events: any[];
id: string;
large: boolean | undefined;
lazy: boolean;
member_count: number | undefined;
members: Member[];
premium_subscription_count: number | undefined;
properties: {
name: string;
description?: string | null;
icon?: string | null;
splash?: string | null;
banner?: string | null;
features: string[];
preferred_locale?: string | null;
owner_id?: string | null;
application_id?: string | null;
afk_channel_id?: string | null;
afk_timeout: number | undefined;
system_channel_id?: string | null;
verification_level: number | undefined;
explicit_content_filter: number | undefined;
default_message_notifications: number | undefined;
mfa_level: number | undefined;
vanity_url_code?: string | null;
premium_tier: number | undefined;
premium_progress_bar_enabled: boolean;
system_channel_flags: number | undefined;
discovery_splash?: string | null;
rules_channel_id?: string | null;
public_updates_channel_id?: string | null;
max_video_channel_users: number | undefined;
max_members: number | undefined;
nsfw_level: number | undefined;
hub_type?: any | null; // ????
};
roles: Role[];
stage_instances: any[];
stickers: Sticker[];
threads: any[];
version: string;
}
export class ReadyGuildDTO implements IReadyGuildDTO {
application_command_counts?: { 1: number; 2: number; 3: number }; // ????????????
channels: Channel[];
data_mode: string; // what is this
emojis: Emoji[];
guild_scheduled_events: any[];
id: string;
large: boolean | undefined;
lazy: boolean;
member_count: number | undefined;
members: Member[];
premium_subscription_count: number | undefined;
properties: {
name: string;
description?: string | null;
icon?: string | null;
splash?: string | null;
banner?: string | null;
features: string[];
preferred_locale?: string | null;
owner_id?: string | null;
application_id?: string | null;
afk_channel_id?: string | null;
afk_timeout: number | undefined;
system_channel_id?: string | null;
verification_level: number | undefined;
explicit_content_filter: number | undefined;
default_message_notifications: number | undefined;
mfa_level: number | undefined;
vanity_url_code?: string | null;
premium_tier: number | undefined;
premium_progress_bar_enabled: boolean;
system_channel_flags: number | undefined;
discovery_splash?: string | null;
rules_channel_id?: string | null;
public_updates_channel_id?: string | null;
max_video_channel_users: number | undefined;
max_members: number | undefined;
nsfw_level: number | undefined;
hub_type?: any | null; // ????
};
roles: Role[];
stage_instances: any[];
stickers: Sticker[];
threads: any[];
version: string;
constructor(guild: Guild) {
this.application_command_counts = {
1: 5,
2: 2,
3: 2,
}; // ?????
this.channels = guild.channels;
this.data_mode = "full";
this.emojis = guild.emojis;
this.guild_scheduled_events = [];
this.id = guild.id;
this.large = guild.large;
this.lazy = true; // ??????????
this.member_count = guild.member_count;
this.members = guild.members;
this.premium_subscription_count = guild.premium_subscription_count;
this.properties = {
name: guild.name,
description: guild.description,
icon: guild.icon,
splash: guild.splash,
banner: guild.banner,
features: guild.features,
preferred_locale: guild.preferred_locale,
owner_id: guild.owner_id,
application_id: null, // ?????
afk_channel_id: guild.afk_channel_id,
afk_timeout: guild.afk_timeout,
system_channel_id: guild.system_channel_id,
verification_level: guild.verification_level,
explicit_content_filter: guild.explicit_content_filter,
default_message_notifications: guild.default_message_notifications,
mfa_level: guild.mfa_level,
vanity_url_code: null, // ?????
premium_tier: guild.premium_tier,
premium_progress_bar_enabled: guild.premium_progress_bar_enabled,
system_channel_flags: guild.system_channel_flags,
discovery_splash: guild.discovery_splash,
rules_channel_id: guild.rules_channel_id,
public_updates_channel_id: guild.public_updates_channel_id,
max_video_channel_users: guild.max_video_channel_users,
max_members: guild.max_members,
nsfw_level: guild.nsfw_level,
hub_type: null,
};
this.roles = guild.roles;
this.stage_instances = [];
this.stickers = guild.stickers;
this.threads = [];
this.version = "1"; // ??????
}
toJSON() {
return this as IReadyGuildDTO;
}
}

View File

@ -1,2 +1,3 @@
export * from "./DmChannelDTO";
export * from "./ReadyGuildDTO";
export * from "./UserDTO";

View File

@ -29,6 +29,7 @@ import { Role } from "./Role";
import { BaseClassWithoutId } from "./BaseClass";
import { Ban, PublicGuildRelations } from ".";
import { DiscordApiErrors } from "../util/Constants";
import { ReadyGuildDTO } from "../dtos";
export const MemberPrivateProjection: (keyof Member)[] = [
"id",
@ -363,7 +364,7 @@ export class Member extends BaseClassWithoutId {
emitEvent({
event: "GUILD_CREATE",
data: {
...guild,
...new ReadyGuildDTO(guild).toJSON(),
members: [...memberPreview, { ...member, user }],
member_count: memberCount + 1,
guild_hashes: {},
@ -373,6 +374,7 @@ export class Member extends BaseClassWithoutId {
stage_instances: [],
threads: [],
embedded_activities: [],
voice_states: guild.voice_states
},
user_id,
} as GuildCreateEvent),

View File

@ -20,6 +20,7 @@ import {
Status,
Presence,
UserSettings,
IReadyGuildDTO,
} from "@fosscord/util";
export interface Event {
@ -62,7 +63,7 @@ export interface ReadyEventData {
};
private_channels: Channel[]; // this will be empty for bots
session_id: string; // resuming
guilds: Guild[];
guilds: IReadyGuildDTO[];
analytics_token?: string;
connected_accounts?: ConnectedAccount[];
consents?: {
@ -155,7 +156,7 @@ export interface ChannelRecipientRemoveEvent extends Event {
export interface GuildCreateEvent extends Event {
event: "GUILD_CREATE";
data: Guild & {
data: IReadyGuildDTO & {
joined_at: Date;
// TODO: add them to guild
guild_scheduled_events: never[];

View File

@ -44,6 +44,8 @@ export const IdentifySchema = {
$user_settings_version: undefined,
$useruser_guild_settings_version: undefined,
$private_channels_version: Number,
$guild_versions: Object,
$api_code_version: Number,
},
$clientState: {
$guildHashes: Object,
@ -51,6 +53,8 @@ export const IdentifySchema = {
$readStateVersion: Number,
$useruserGuildSettingsVersion: undefined,
$userGuildSettingsVersion: undefined,
$guildVersions: Object,
$apiCodeVersion: Number,
},
$v: Number,
$version: Number,
@ -96,6 +100,8 @@ export interface IdentifySchema {
user_settings_version?: number;
useruser_guild_settings_version?: number;
private_channels_version?: number;
guild_versions?: any;
api_code_version?: number;
};
clientState?: {
guildHashes?: any;
@ -103,6 +109,8 @@ export interface IdentifySchema {
readStateVersion?: number;
userGuildSettingsVersion?: number;
useruserGuildSettingsVersion?: number;
guildVersions?: any;
apiCodeVersion?: number;
};
v?: number;
}