summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/interfaces/Activity.ts9
-rw-r--r--src/util/migrations/mariadb/1662626234189-notes.ts14
-rw-r--r--src/util/migrations/postgres/1662626234189-notes.ts14
-rw-r--r--src/util/migrations/sqlite/1662626234189-notes.ts14
-rw-r--r--src/util/schemas/ActivitySchema.ts11
5 files changed, 61 insertions, 1 deletions
diff --git a/src/util/interfaces/Activity.ts b/src/util/interfaces/Activity.ts

index 3b36b4a6..7e9c6a56 100644 --- a/src/util/interfaces/Activity.ts +++ b/src/util/interfaces/Activity.ts
@@ -33,6 +33,15 @@ export interface Activity { }; instance?: boolean; flags: string; // activity flags OR d together, describes what the payload includes + // spotify and other rich presence data + id?: string; + sync_id?: string; + metadata?: { + context_uri?: string; + album_id?: string; + artist_ids?: string[]; + }, + session_id?: string; } export enum ActivityType { diff --git a/src/util/migrations/mariadb/1662626234189-notes.ts b/src/util/migrations/mariadb/1662626234189-notes.ts new file mode 100644
index 00000000..57aaecbd --- /dev/null +++ b/src/util/migrations/mariadb/1662626234189-notes.ts
@@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; + +export class notes1662626234189 implements MigrationInterface { + name = 'notes1662626234189' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.dropColumn("users", "notes"); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" })); + } + +} diff --git a/src/util/migrations/postgres/1662626234189-notes.ts b/src/util/migrations/postgres/1662626234189-notes.ts new file mode 100644
index 00000000..57aaecbd --- /dev/null +++ b/src/util/migrations/postgres/1662626234189-notes.ts
@@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; + +export class notes1662626234189 implements MigrationInterface { + name = 'notes1662626234189' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.dropColumn("users", "notes"); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" })); + } + +} diff --git a/src/util/migrations/sqlite/1662626234189-notes.ts b/src/util/migrations/sqlite/1662626234189-notes.ts new file mode 100644
index 00000000..57aaecbd --- /dev/null +++ b/src/util/migrations/sqlite/1662626234189-notes.ts
@@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; + +export class notes1662626234189 implements MigrationInterface { + name = 'notes1662626234189' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.dropColumn("users", "notes"); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" })); + } + +} diff --git a/src/util/schemas/ActivitySchema.ts b/src/util/schemas/ActivitySchema.ts
index d94557ea..db42fff4 100644 --- a/src/util/schemas/ActivitySchema.ts +++ b/src/util/schemas/ActivitySchema.ts
@@ -37,7 +37,16 @@ export const ActivitySchema = { $match: String }, $instance: Boolean, - $flags: String + $flags: String, + // spotify and other rich presence data + $id: String, + $sync_id: String, + $metadata: { + $context_uri: String, + $album_id: String, + $artist_ids: [String], + }, + $session_id: String, } ], $since: Number // unix time (in milliseconds) of when the client went idle, or null if the client is not idle