summary refs log tree commit diff
path: root/src/util/entities/Application.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/entities/Application.ts')
-rw-r--r--src/util/entities/Application.ts165
1 files changed, 149 insertions, 16 deletions
diff --git a/src/util/entities/Application.ts b/src/util/entities/Application.ts

index e00b4a988..014361bca 100644 --- a/src/util/entities/Application.ts +++ b/src/util/entities/Application.ts
@@ -21,6 +21,22 @@ import { BaseClass } from "./BaseClass"; import { Team } from "./Team"; import { User } from "./User"; import { Guild } from "./Guild"; +import { + ApplicationApprovableConsoleType, + ApplicationCompanySchema, + ApplicationDiscoverabilityState, + ApplicationEventWebhooksStatus, + ApplicationEventWebhooksType, + ApplicationExecutableSchema, + ApplicationGuildRestriction, + ApplicationIntegrationTypeConfigurationSchema, + ApplicationInteractionsVersion, + ApplicationMonetizationState, + ApplicationSKUSchema, + ApplicationVerificationState, + RPCApplicationState, + StoreApplicationState, +} from "@spacebar/schemas"; @Entity({ name: "applications", @@ -45,9 +61,11 @@ export class Application extends BaseClass { hook: boolean = true; @Column() + // deprecated bot_public?: boolean = true; @Column() + // deprecated bot_require_code_grant?: boolean = false; @Column() @@ -57,21 +75,21 @@ export class Application extends BaseClass { @ManyToOne(() => User, { onDelete: "CASCADE" }) owner: User; - // TODO: enum this? https://discord.com/developers/docs/resources/application#application-object-application-flags @Column() + // ApplicationFlags bitfield flags: number = 0; @Column({ type: "simple-array", nullable: true }) redirect_uris: string[] = []; - @Column({ nullable: true }) - rpc_application_state: number = 0; + @Column() + rpc_application_state: RPCApplicationState = RPCApplicationState.DISABLED; - @Column({ nullable: true }) - store_application_state: number = 1; + @Column() + store_application_state: StoreApplicationState = StoreApplicationState.NONE; - @Column({ nullable: true }) - verification_state: number = 1; + @Column() + verification_state: ApplicationVerificationState = ApplicationVerificationState.INELIGIBLE; @Column({ nullable: true }) interactions_endpoint_url?: string; @@ -83,10 +101,10 @@ export class Application extends BaseClass { integration_require_code_grant: boolean = false; @Column({ nullable: true }) - discoverability_state: number = 1; + discoverability_state: ApplicationDiscoverabilityState = ApplicationDiscoverabilityState.INELIGIBLE; @Column({ nullable: true }) - discovery_eligibility_flags: number = 2240; + discovery_eligibility_flags: number = 0; // ApplicationDiscoveryEligibilityFlags bitfield @JoinColumn({ name: "bot_user_id" }) @OneToOne(() => User, { onDelete: "CASCADE" }) @@ -118,16 +136,131 @@ export class Application extends BaseClass { @Column({ nullable: true }) custom_install_url?: string; - //just for us + @Column({ nullable: true }) + splash?: string; + + @Column({ nullable: true }) + primary_sku_id?: string; // if this application is a game sold, this field will be the id of the "Game SKU" that is created, + + @Column({ nullable: true }) + eula_id?: string; + + @Column({ nullable: true }) + slug?: string; // if this application is a game sold, this field will be the URL slug that links to the store page + + @Column({ type: "simple-array", nullable: true }) + aliases?: string[]; + + @Column({ type: "simple-json", nullable: true }) + executables?: ApplicationExecutableSchema[]; + + @Column({ type: "simple-json", nullable: true }) + third_party_skus?: ApplicationSKUSchema[]; + + @Column({ nullable: true }) + overlay?: boolean = false; + + @Column({ nullable: true }) + overlay_methods?: number; // only one right now is 1 << 0 OUT_OF_PROCESS + + @Column({ nullable: true }) + overlay_warn?: boolean = false; + + @Column({ nullable: true }) + overlay_compatibility_hook?: boolean = false; + + @Column({ type: "simple-json", nullable: true }) + developers?: ApplicationCompanySchema[]; + + @Column({ type: "simple-json", nullable: true }) + publishers?: ApplicationCompanySchema[]; + + @Column({ type: "simple-array", nullable: true }) + rpc_origins?: string[]; + + @Column({ nullable: true }) + deeplink_uri?: string; + + @Column({ nullable: true }) + bot_disabled?: boolean = false; + + @Column({ nullable: true }) + bot_quarantined?: boolean = false; + + @Column({ nullable: true }) + bot_approximate_guild_count?: number; + + @Column({ nullable: true }) + approximate_guild_count?: number; + + @Column({ nullable: true }) + approximate_user_install_count?: number; + + @Column({ nullable: true }) + approximate_user_authorization_count?: number; + + @Column({ nullable: true }) + internal_guild_restriction?: ApplicationGuildRestriction; + + @Column({ nullable: true, type: "text" }) + role_connections_verification_url: string | null = null; + + @Column() + interactions_version: ApplicationInteractionsVersion = ApplicationInteractionsVersion.VERSION_1; - //@Column({ type: "simple-array", nullable: true }) - //rpc_origins?: string[]; + @Column({ type: "simple-array" }) + interactions_event_types: ApplicationEventWebhooksType[] = []; + + @Column({ nullable: true }) + event_webhooks_status?: ApplicationEventWebhooksStatus; + + @Column({ nullable: true }) + event_webhooks_url?: string; + + @Column({ type: "simple-array", nullable: true }) + event_webhooks_types?: ApplicationEventWebhooksType[]; + + @Column() + explicit_content_filter: number = 0; // Inherits the guild's explicit content filter + + @Column({ type: "simple-json", nullable: true }) + integration_types_config?: Record<number, ApplicationIntegrationTypeConfigurationSchema>; + + @Column({ nullable: true }) + connection_entrypoint_url?: string; + + @Column() + is_verified: boolean = false; + + @Column() + creator_monetization_state: number = 0; // unknown values + + @Column() + is_discoverable: boolean = false; + + @Column() + is_monetized: boolean = false; + + @Column() + storefront_available: boolean = false; + + @Column() + monetization_state: ApplicationMonetizationState = ApplicationMonetizationState.NONE; + + @Column({ nullable: true }) + monetization_eligibility_flags?: number = 0; // ApplicationMonetizationEligibilityFlags + + @Column({ nullable: true }) + max_participants?: number; // max participants for embedded applications, -1 for unlimited + + @Column({ type: "simple-json", nullable: true }) + embedded_activity_config?: object; // dont feel like making types for this rn - //@Column({ nullable: true }) - //primary_sku_id?: string; // if this application is a game sold, this field will be the id of the "Game SKU" that is created, + @Column({ type: "simple-array" }) + approved_consoles: ApplicationApprovableConsoleType[] = []; - //@Column({ nullable: true }) - //slug?: string; // if this application is a game sold, this field will be the URL slug that links to the store page + // @Column() + // pricing_localization_strategy: string; @JoinColumn({ name: "team_id" }) @ManyToOne(() => Team, {