mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-03-21 17:34:19 -05:00
feat: port original BOSS gRPC implementation into v1 folder
This commit is contained in:
parent
e66bc817b1
commit
1f5455219b
40
package-lock.json
generated
40
package-lock.json
generated
|
|
@ -11,7 +11,7 @@
|
|||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.723.0",
|
||||
"@pretendonetwork/boss-crypto": "^1.0.0",
|
||||
"@pretendonetwork/grpc": "^1.0.6",
|
||||
"@pretendonetwork/grpc": "^2.2.4",
|
||||
"@typegoose/auto-increment": "^4.13.0",
|
||||
"commander": "^14.0.0",
|
||||
"cron": "^4.3.3",
|
||||
|
|
@ -917,6 +917,12 @@
|
|||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@bufbuild/protobuf": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.9.0.tgz",
|
||||
"integrity": "sha512-rnJenoStJ8nvmt9Gzye8nkYd6V22xUAnu4086ER7h1zJ508vStko4pMvDeQ446ilDTFpV5wnoc5YS7XvMwwMqA==",
|
||||
"license": "(Apache-2.0 AND BSD-3-Clause)"
|
||||
},
|
||||
"node_modules/@emnapi/core": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz",
|
||||
|
|
@ -2057,12 +2063,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@pretendonetwork/grpc": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/grpc/-/grpc-1.0.6.tgz",
|
||||
"integrity": "sha512-kTK4lO8AdrQ5GOvYdJ7sqvIP3ubn5TGqGGqjVpgCTSiVBvBmlnz3fQkoDHmYw2WeA0CNtUx2dROG3Juiy5t7BQ==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/grpc/-/grpc-2.2.4.tgz",
|
||||
"integrity": "sha512-fqhKbc7QFGtMyap5wxCPXmBH+ydPy6W4gAmlDS1wLTkE/Q4o7QVcrXGv+WMRzL8dsHpLqKNnhB1hm6K8Sbn80w==",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"long": "^5.2.1",
|
||||
"protobufjs": "^7.2.3"
|
||||
"@bufbuild/protobuf": "^2.2.2",
|
||||
"nice-grpc-common": "^2.0.2",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobufjs/aspromise": {
|
||||
|
|
@ -9467,7 +9475,6 @@
|
|||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
|
||||
"integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
|
|
@ -10622,6 +10629,11 @@
|
|||
"tslib": "^2.6.2"
|
||||
}
|
||||
},
|
||||
"@bufbuild/protobuf": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.9.0.tgz",
|
||||
"integrity": "sha512-rnJenoStJ8nvmt9Gzye8nkYd6V22xUAnu4086ER7h1zJ508vStko4pMvDeQ446ilDTFpV5wnoc5YS7XvMwwMqA=="
|
||||
},
|
||||
"@emnapi/core": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz",
|
||||
|
|
@ -11292,12 +11304,13 @@
|
|||
}
|
||||
},
|
||||
"@pretendonetwork/grpc": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/grpc/-/grpc-1.0.6.tgz",
|
||||
"integrity": "sha512-kTK4lO8AdrQ5GOvYdJ7sqvIP3ubn5TGqGGqjVpgCTSiVBvBmlnz3fQkoDHmYw2WeA0CNtUx2dROG3Juiy5t7BQ==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/grpc/-/grpc-2.2.4.tgz",
|
||||
"integrity": "sha512-fqhKbc7QFGtMyap5wxCPXmBH+ydPy6W4gAmlDS1wLTkE/Q4o7QVcrXGv+WMRzL8dsHpLqKNnhB1hm6K8Sbn80w==",
|
||||
"requires": {
|
||||
"long": "^5.2.1",
|
||||
"protobufjs": "^7.2.3"
|
||||
"@bufbuild/protobuf": "^2.2.2",
|
||||
"nice-grpc-common": "^2.0.2",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
},
|
||||
"@protobufjs/aspromise": {
|
||||
|
|
@ -16295,8 +16308,7 @@
|
|||
"typescript": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
|
||||
"integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg=="
|
||||
},
|
||||
"typescript-eslint": {
|
||||
"version": "8.39.1",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.723.0",
|
||||
"@pretendonetwork/boss-crypto": "^1.0.0",
|
||||
"@pretendonetwork/grpc": "^1.0.6",
|
||||
"@pretendonetwork/grpc": "^2.2.4",
|
||||
"@typegoose/auto-increment": "^4.13.0",
|
||||
"commander": "^14.0.0",
|
||||
"cron": "^4.3.3",
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
import { listKnownBOSSApps } from '@/services/grpc/boss/list-known-boss-apps';
|
||||
import { listTasks } from '@/services/grpc/boss/list-tasks';
|
||||
import { registerTask } from '@/services/grpc/boss/register-task';
|
||||
import { updateTask } from '@/services/grpc/boss/update-task';
|
||||
import { deleteTask } from '@/services/grpc/boss/delete-task';
|
||||
import { listFiles } from '@/services/grpc/boss/list-files';
|
||||
import { uploadFile } from '@/services/grpc/boss/upload-file';
|
||||
import { updateFileMetadata } from '@/services/grpc/boss/update-file-metadata';
|
||||
import { deleteFile } from '@/services/grpc/boss/delete-file';
|
||||
import type { BOSSServiceImplementation } from '@pretendonetwork/grpc/boss/boss_service';
|
||||
|
||||
export const implementation: BOSSServiceImplementation = {
|
||||
listKnownBOSSApps,
|
||||
listTasks,
|
||||
registerTask,
|
||||
updateTask,
|
||||
deleteTask,
|
||||
listFiles,
|
||||
uploadFile,
|
||||
updateFileMetadata,
|
||||
deleteFile
|
||||
};
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { Status, ServerError } from 'nice-grpc';
|
||||
import { getTaskFileByDataID } from '@/database';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { DeleteFileRequest } from '@pretendonetwork/grpc/boss/delete_file';
|
||||
import type { Empty } from '@pretendonetwork/grpc/boss/google/protobuf/empty';
|
||||
import type { Empty } from '@pretendonetwork/grpc/google/protobuf/empty';
|
||||
|
||||
export async function deleteFile(request: DeleteFileRequest, context: CallContext & AuthenticationCallContextExt): Promise<Empty> {
|
||||
if (!hasPermission(context, 'deleteBossFiles')) {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { Status, ServerError } from 'nice-grpc';
|
||||
import { getTask } from '@/database';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { DeleteTaskRequest } from '@pretendonetwork/grpc/boss/delete_task';
|
||||
import type { Empty } from '@pretendonetwork/grpc/boss/google/protobuf/empty';
|
||||
import type { Empty } from '@pretendonetwork/grpc/google/protobuf/empty';
|
||||
|
||||
export async function deleteTask(request: DeleteTaskRequest, context: CallContext & AuthenticationCallContextExt): Promise<Empty> {
|
||||
if (!hasPermission(context, 'deleteBossTasks')) {
|
||||
22
src/services/grpc/boss/v1/implementation.ts
Normal file
22
src/services/grpc/boss/v1/implementation.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { listKnownBOSSApps } from '@/services/grpc/boss/v1/list-known-boss-apps';
|
||||
import { listTasks } from '@/services/grpc/boss/v1/list-tasks';
|
||||
import { registerTask } from '@/services/grpc/boss/v1/register-task';
|
||||
import { updateTask } from '@/services/grpc/boss/v1/update-task';
|
||||
import { deleteTask } from '@/services/grpc/boss/v1/delete-task';
|
||||
import { listFiles } from '@/services/grpc/boss/v1/list-files';
|
||||
import { uploadFile } from '@/services/grpc/boss/v1/upload-file';
|
||||
import { updateFileMetadata } from '@/services/grpc/boss/v1/update-file-metadata';
|
||||
import { deleteFile } from '@/services/grpc/boss/v1/delete-file';
|
||||
import type { BOSSServiceImplementation } from '@pretendonetwork/grpc/boss/boss_service';
|
||||
|
||||
export const bossServiceImplementationV1: BOSSServiceImplementation = {
|
||||
listKnownBOSSApps,
|
||||
listTasks,
|
||||
registerTask,
|
||||
updateTask,
|
||||
deleteTask,
|
||||
listFiles,
|
||||
uploadFile,
|
||||
updateFileMetadata,
|
||||
deleteFile
|
||||
};
|
||||
|
|
@ -5,399 +5,399 @@ export async function listKnownBOSSApps(): Promise<ListKnownBOSSAppsResponse> {
|
|||
apps: [
|
||||
{
|
||||
bossAppId: 'WJDaV6ePVgrS0TRa',
|
||||
titleId: '0005003010016000',
|
||||
titleId: BigInt(0x0005003010016000),
|
||||
titleRegion: 'UNK',
|
||||
name: 'Unknown',
|
||||
tasks: ['olvinfo']
|
||||
},
|
||||
{
|
||||
bossAppId: 'VFoY6V7u7UUq1EG5',
|
||||
titleId: '0005003010016100',
|
||||
titleId: BigInt(0x0005003010016100),
|
||||
titleRegion: 'UNK',
|
||||
name: 'Unknown',
|
||||
tasks: ['olvinfo']
|
||||
},
|
||||
{
|
||||
bossAppId: '8MNOVprfNVAJjfCM',
|
||||
titleId: '0005003010016200',
|
||||
titleId: BigInt(0x0005003010016200),
|
||||
titleRegion: 'UNK',
|
||||
name: 'Unknown',
|
||||
tasks: ['olvinfo']
|
||||
},
|
||||
{
|
||||
bossAppId: 'v1cqzWykBKUg0rHQ',
|
||||
titleId: '000500301001900A',
|
||||
titleId: BigInt(0x000500301001900A),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Miiverse Post All',
|
||||
tasks: ['solv']
|
||||
},
|
||||
{
|
||||
bossAppId: 'bieC9ACJlisFg5xS',
|
||||
titleId: '000500301001910A',
|
||||
titleId: BigInt(0x000500301001910A),
|
||||
titleRegion: 'USA',
|
||||
name: 'Miiverse Post All',
|
||||
tasks: ['solv']
|
||||
},
|
||||
{
|
||||
bossAppId: 'tOaQcoBLtPTgVN3Y',
|
||||
titleId: '000500301001920A',
|
||||
titleId: BigInt(0x000500301001920A),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Miiverse Post All',
|
||||
tasks: ['solv']
|
||||
},
|
||||
{
|
||||
bossAppId: 'HX8a16MMNn6i1z0Y',
|
||||
titleId: '000500301001400A',
|
||||
titleId: BigInt(0x000500301001400A),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Nintendo eShop',
|
||||
tasks: ['wood1', 'woodBGM']
|
||||
},
|
||||
{
|
||||
bossAppId: '07E3nY6lAwlwrQRo',
|
||||
titleId: '000500301001410A',
|
||||
titleId: BigInt(0x000500301001410A),
|
||||
titleRegion: 'USA',
|
||||
name: 'Nintendo eShop',
|
||||
tasks: ['wood1', 'woodBGM']
|
||||
},
|
||||
{
|
||||
bossAppId: '8UsM86l8xgkjFk8z',
|
||||
titleId: '000500301001420A',
|
||||
titleId: BigInt(0x000500301001420A),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Nintendo eShop',
|
||||
tasks: ['wood1', 'woodBGM']
|
||||
},
|
||||
{
|
||||
bossAppId: 'IXmFUqR2qenXfF61',
|
||||
titleId: '0005001010066000',
|
||||
titleId: BigInt(0x0005001010066000),
|
||||
titleRegion: 'ALL',
|
||||
name: 'ECO Process',
|
||||
tasks: ['promo1', 'promo2', 'promo3', 'push']
|
||||
},
|
||||
{
|
||||
bossAppId: 'BMQAm5iUVtPsJVsU',
|
||||
titleId: '000500101004D000',
|
||||
titleId: BigInt(0x000500101004D000),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Notifications',
|
||||
tasks: ['sysmsg1', 'sysmsg2']
|
||||
},
|
||||
{
|
||||
bossAppId: 'LRmanFo4Tx3kEGDp',
|
||||
titleId: '000500101004D100',
|
||||
titleId: BigInt(0x000500101004D100),
|
||||
titleRegion: 'USA',
|
||||
name: 'Notifications',
|
||||
tasks: ['sysmsg1', 'sysmsg2']
|
||||
},
|
||||
{
|
||||
bossAppId: 'TZr27FE8wzKiEaTO',
|
||||
titleId: '000500101004D200',
|
||||
titleId: BigInt(0x000500101004D200),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Notifications',
|
||||
tasks: ['sysmsg1', 'sysmsg2']
|
||||
},
|
||||
{
|
||||
bossAppId: 'JnIrm9c4E9JBmxBo',
|
||||
titleId: '0005000010185200',
|
||||
titleId: BigInt(0x0005000010185200),
|
||||
titleRegion: 'JPN',
|
||||
name: 'NewスーパーマリオブラザーズU 無料お試し版 (New SUPER MARIO BROS. U (Trial))',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'dadlI27Ww8H2d56x',
|
||||
titleId: '0005000010101C00',
|
||||
titleId: BigInt(0x0005000010101C00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'NewスーパーマリオブラザーズU (New SUPER MARIO BROS. U)',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'RaPn5saabzliYrpo',
|
||||
titleId: '0005000010101D00',
|
||||
titleId: BigInt(0x0005000010101D00),
|
||||
titleRegion: 'USA',
|
||||
name: 'New SUPER MARIO BROS. U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: '14VFIK3rY2SP0WRE',
|
||||
titleId: '0005000010101E00',
|
||||
titleId: BigInt(0x0005000010101E00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'New SUPER MARIO BROS. U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'RbEQ44t2AocC4rvu',
|
||||
titleId: '000500001014B700',
|
||||
titleId: BigInt(0x000500001014B700),
|
||||
titleRegion: 'USA',
|
||||
name: 'New SUPER MARIO BROS. U + New SUPER LUIGI U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: '287gv3WZdxo1QRhl',
|
||||
titleId: '000500001014B800',
|
||||
titleId: BigInt(0x000500001014B800),
|
||||
titleRegion: 'EUR',
|
||||
name: 'New SUPER MARIO BROS. U + New SUPER LUIGI U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'bb6tOEckvgZ50ciH',
|
||||
titleId: '0005000010162B00',
|
||||
titleId: BigInt(0x0005000010162B00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'スプラトゥーン (Splatoon)',
|
||||
tasks: ['optdat2', 'schdat2', 'schdata']
|
||||
},
|
||||
{
|
||||
bossAppId: 'rjVlM7hUXPxmYQJh',
|
||||
titleId: '0005000010176900',
|
||||
titleId: BigInt(0x0005000010176900),
|
||||
titleRegion: 'USA',
|
||||
name: 'Splatoon',
|
||||
tasks: ['optdat2', 'schdat2', 'schdata', 'optdata2', 'schdata2']
|
||||
},
|
||||
{
|
||||
bossAppId: 'zvGSM4kOrXpkKnpT',
|
||||
titleId: '0005000010176A00',
|
||||
titleId: BigInt(0x0005000010176A00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Splatoon',
|
||||
tasks: ['optdat2', 'schdat2', 'schdata', 'optdata']
|
||||
},
|
||||
{
|
||||
bossAppId: 'm8KJPtmPweiPuETE',
|
||||
titleId: '000500001012F100',
|
||||
titleId: BigInt(0x000500001012F100),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Wii Sports Club',
|
||||
tasks: ['sp1_ans']
|
||||
},
|
||||
{
|
||||
bossAppId: 'pO72Hi5uqf5yuNd8',
|
||||
titleId: '0005000010144D00',
|
||||
titleId: BigInt(0x0005000010144D00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Wii Sports Club',
|
||||
tasks: ['sp1_ans']
|
||||
},
|
||||
{
|
||||
bossAppId: '4m8Xme1wKgzwslTJ',
|
||||
titleId: '0005000010144E00',
|
||||
titleId: BigInt(0x0005000010144E00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Wii Sports Club',
|
||||
tasks: ['sp1_ans']
|
||||
},
|
||||
{
|
||||
bossAppId: 'ESLqtAhxS8KQU4eu',
|
||||
titleId: '000500001018DB00',
|
||||
titleId: BigInt(0x000500001018DB00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Super Mario Maker (スーパーマリオメーカー)',
|
||||
tasks: ['CHARA']
|
||||
},
|
||||
{
|
||||
bossAppId: 'vGwChBW1ExOoHDsm',
|
||||
titleId: '000500001018DC00',
|
||||
titleId: BigInt(0x000500001018DC00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Super Mario Maker',
|
||||
tasks: ['CHARA']
|
||||
},
|
||||
{
|
||||
bossAppId: 'IeUc4hQsKKe9rJHB',
|
||||
titleId: '000500001018DD00',
|
||||
titleId: BigInt(0x000500001018DD00),
|
||||
titleRegion: 'EUA',
|
||||
name: 'Super Mario Maker',
|
||||
tasks: ['CHARA']
|
||||
},
|
||||
{
|
||||
bossAppId: '4krJA4Gx3jF5nhQf',
|
||||
titleId: '000500001012BC00',
|
||||
titleId: BigInt(0x000500001012BC00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'ピクミン3 (PIKMIN 3)',
|
||||
tasks: ['histgrm']
|
||||
},
|
||||
{
|
||||
bossAppId: '9jRZEoWYLc3OG9a8',
|
||||
titleId: '000500001012BD00',
|
||||
titleId: BigInt(0x000500001012BD00),
|
||||
titleRegion: 'USA',
|
||||
name: 'PIKMIN 3',
|
||||
tasks: ['histgrm']
|
||||
},
|
||||
{
|
||||
bossAppId: 'VWqUTspR5YtjDjxa',
|
||||
titleId: '000500001012BE00',
|
||||
titleId: BigInt(0x000500001012BE00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'PIKMIN 3',
|
||||
tasks: ['histgrm']
|
||||
},
|
||||
{
|
||||
bossAppId: 'Ge1KtMu8tYlf4AUM',
|
||||
titleId: '0005000010192000',
|
||||
titleId: BigInt(0x0005000010192000),
|
||||
titleRegion: 'JPN',
|
||||
name: '太鼓の達人 特盛り! (Taiko no Tatsujin Tokumori!)',
|
||||
tasks: ['notice1']
|
||||
},
|
||||
{
|
||||
bossAppId: 'gycVtTzCouZmukZ6',
|
||||
titleId: '0005000010110E00',
|
||||
titleId: BigInt(0x0005000010110E00),
|
||||
titleRegion: 'JPN',
|
||||
name: '大乱闘スマッシュブラザーズ for Wii U (Super Smash Bros. for Wii U)',
|
||||
tasks: ['NEWS', 'amiibo']
|
||||
},
|
||||
{
|
||||
bossAppId: 'o2Ug1pIp9Uhri6Nh',
|
||||
titleId: '0005000010144F00',
|
||||
titleId: BigInt(0x0005000010144F00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Super Smash Bros. for Wii U',
|
||||
tasks: ['amiibo', 'NEWS', 'friend', 'CONQ']
|
||||
},
|
||||
{
|
||||
bossAppId: 'n6rAJ1nnfC1Sgcpl',
|
||||
titleId: '0005000010145000',
|
||||
titleId: BigInt(0x0005000010145000),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Super Smash Bros. for Wii U',
|
||||
tasks: ['amiibo', 'NEWS', 'friend', 'CONQ']
|
||||
},
|
||||
{
|
||||
bossAppId: 'CHUN6T1m7Xk4EBg4',
|
||||
titleId: '00050000101DFF00',
|
||||
titleId: BigInt(0x00050000101DFF00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'プチコンBIG (Petitcom BIG)',
|
||||
tasks: ['ptcbnws']
|
||||
},
|
||||
{
|
||||
bossAppId: 'zyXdCW9jGdi9rjaz',
|
||||
titleId: '0005000010142200',
|
||||
titleId: BigInt(0x0005000010142200),
|
||||
titleRegion: 'JPN',
|
||||
name: 'NewスーパールイージU (New SUPER LUIGI U)',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'jPHLlJr2fJyTzffp',
|
||||
titleId: '0005000010142300',
|
||||
titleId: BigInt(0x0005000010142300),
|
||||
titleRegion: 'USA',
|
||||
name: 'New SUPER LUIGI U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'YsXB6IRGSI56tPxl',
|
||||
titleId: '0005000010142400',
|
||||
titleId: BigInt(0x0005000010142400),
|
||||
titleRegion: 'EUR',
|
||||
name: 'New SUPER LUIGI U',
|
||||
tasks: ['news']
|
||||
},
|
||||
{
|
||||
bossAppId: 'Lbqp9Sg1i0xUzFFa',
|
||||
titleId: '0005000010113800',
|
||||
titleId: BigInt(0x0005000010113800),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Zen Pinball 2',
|
||||
tasks: ['PTS']
|
||||
},
|
||||
{
|
||||
bossAppId: 'DwU7n0FidGrLNiOo',
|
||||
titleId: '000500001014D900',
|
||||
titleId: BigInt(0x000500001014D900),
|
||||
titleRegion: 'JPN',
|
||||
name: 'ぷよぷよテトリス (PUYOPUYOTETRIS)',
|
||||
tasks: ['boss1', 'boss2', 'boss3']
|
||||
},
|
||||
{
|
||||
bossAppId: 'yIUkFmuGVkGP8pDb',
|
||||
titleId: '0005000010132200',
|
||||
titleId: BigInt(0x0005000010132200),
|
||||
titleRegion: 'JPN',
|
||||
name: '太鼓の達人 Wii Uば~じょん! (Taiko no Tatsujin Wii U version!)',
|
||||
tasks: ['notice1']
|
||||
},
|
||||
{
|
||||
bossAppId: 'v4WRObSzD7VU3dcJ',
|
||||
titleId: '00050000101D3000',
|
||||
titleId: BigInt(0x00050000101D3000),
|
||||
titleRegion: 'JPN',
|
||||
name: '太鼓の達人 あつめて★ともだち大作戦! (Taiko no Tatsujin Atsumete★ TomodachiDaisakusen!)',
|
||||
tasks: ['notice1']
|
||||
},
|
||||
{
|
||||
bossAppId: '3zDjXIA57bSceyaw',
|
||||
titleId: '00050000101BEC00',
|
||||
titleId: BigInt(0x00050000101BEC00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Star Fox Guard',
|
||||
tasks: ['param']
|
||||
},
|
||||
{
|
||||
bossAppId: 'NL38jhExI2CQqhWd',
|
||||
titleId: '00050000101CDB00',
|
||||
titleId: BigInt(0x00050000101CDB00),
|
||||
titleRegion: 'JPN',
|
||||
name: 'Splatoon Pre-Launch Review',
|
||||
tasks: ['schdata']
|
||||
},
|
||||
{
|
||||
bossAppId: 'sE6KwEpQYyg6tdU7',
|
||||
titleId: '00050000101CDC00',
|
||||
titleId: BigInt(0x00050000101CDC00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Splatoon Pre-Launch Review',
|
||||
tasks: ['schdata']
|
||||
},
|
||||
{
|
||||
bossAppId: 'pTKZ9q5KrCP3gBag',
|
||||
titleId: '00050000101CDD00',
|
||||
titleId: BigInt(0x00050000101CDD00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Splatoon Pre-Launch Review',
|
||||
tasks: ['schdata']
|
||||
},
|
||||
{
|
||||
bossAppId: 'CJT88RO008LAnD51',
|
||||
titleId: '0005000010170600',
|
||||
titleId: BigInt(0x0005000010170600),
|
||||
titleRegion: 'JPN',
|
||||
name: '仮面ライダー バトライド・ウォーⅡ プレミアムTV&MOVIEサウンドED. (KAMEN RIDER BATTRIDE WAR Ⅱ PREMIUM TV&MOVIE SOUND ED.)',
|
||||
tasks: ['PE_GAK', 'PE_ZNG']
|
||||
},
|
||||
{
|
||||
bossAppId: 'FyyMFzEByuQJc6sJ',
|
||||
titleId: '0005000010135200',
|
||||
titleId: BigInt(0x0005000010135200),
|
||||
titleRegion: 'USA',
|
||||
name: 'Star Wars Pinball',
|
||||
tasks: ['PTS']
|
||||
},
|
||||
{
|
||||
bossAppId: 'A4yyXWKZZUToFtrt',
|
||||
titleId: '0005000010132A00',
|
||||
titleId: BigInt(0x0005000010132A00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Star Wars Pinball',
|
||||
tasks: ['PTS']
|
||||
},
|
||||
{
|
||||
bossAppId: 'HauaFQ1sPsnQ6rBj',
|
||||
titleId: '0005000010171F00',
|
||||
titleId: BigInt(0x0005000010171F00),
|
||||
titleRegion: 'USA',
|
||||
name: 'Pushmo World',
|
||||
tasks: ['annouce']
|
||||
},
|
||||
{
|
||||
bossAppId: 'qDUeFmk0Az71nHyD',
|
||||
titleId: '0005000010110900',
|
||||
titleId: BigInt(0x0005000010110900),
|
||||
titleRegion: 'JPN',
|
||||
name: 'NINJA GAIDEN 3: Razor\'s Edge',
|
||||
tasks: ['DLCINFO']
|
||||
},
|
||||
{
|
||||
bossAppId: 'yVsSPM2E0DEOxroT',
|
||||
titleId: '0005000010110A00',
|
||||
titleId: BigInt(0x0005000010110A00),
|
||||
titleRegion: 'USA',
|
||||
name: 'NINJA GAIDEN 3: Razor\'s Edge',
|
||||
tasks: ['DLCINFO']
|
||||
},
|
||||
{
|
||||
bossAppId: 'Xw6OvZkQofQ3O8Bi',
|
||||
titleId: '0005000010110B00',
|
||||
titleId: BigInt(0x0005000010110B00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'Ninja Gaiden 3: Razor\'s Edge',
|
||||
tasks: ['DLCINFO']
|
||||
},
|
||||
{
|
||||
bossAppId: 'LUQX5swEjBUPQ8nR',
|
||||
titleId: '0005000010110200',
|
||||
titleId: BigInt(0x0005000010110200),
|
||||
titleRegion: 'USA',
|
||||
name: 'WARRIORS OROCHI 3 Hyper(NA)',
|
||||
tasks: ['OR2H000']
|
||||
},
|
||||
{
|
||||
bossAppId: 'y4pXrgLe0JGao3No',
|
||||
titleId: '0005000010112B00',
|
||||
titleId: BigInt(0x0005000010112B00),
|
||||
titleRegion: 'EUR',
|
||||
name: 'WARRIORS OROCHI 3 Hyper(EU)',
|
||||
tasks: ['OR2H000']
|
||||
},
|
||||
{
|
||||
bossAppId: 'j01mRJ9sNe00MWPC',
|
||||
titleId: '0005000010170700',
|
||||
titleId: BigInt(0x0005000010170700),
|
||||
titleRegion: 'JPN',
|
||||
name: '仮面ライダー バトライド・ウォーⅡ (KAMEN RIDER BATTRIDE WAR Ⅱ)',
|
||||
tasks: ['CHR_GAK', 'CHR_ZNG']
|
||||
|
|
@ -12,7 +12,7 @@ export async function listTasks(): Promise<ListTasksResponse> {
|
|||
bossAppId: task.boss_app_id,
|
||||
creatorPid: task.creator_pid,
|
||||
status: task.status,
|
||||
titleId: task.title_id,
|
||||
titleId: BigInt(parseInt(task.title_id, 16)),
|
||||
description: task.description,
|
||||
createdTimestamp: task.created,
|
||||
updatedTimestamp: task.updated
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { ServerError, Status } from 'nice-grpc';
|
||||
import { getTask } from '@/database';
|
||||
import { Task } from '@/models/task';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { RegisterTaskRequest, RegisterTaskResponse } from '@pretendonetwork/grpc/boss/register_task';
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ export async function registerTask(request: RegisterTaskRequest, context: CallCo
|
|||
|
||||
const taskID = request.id.trim();
|
||||
const bossAppID = request.bossAppId.trim();
|
||||
const titleID = request.titleId.trim().toLocaleLowerCase();
|
||||
const titleID = request.titleId.toString(16).toLowerCase().padStart(16, '0');
|
||||
const description = request.description.trim();
|
||||
|
||||
if (!taskID) {
|
||||
|
|
@ -68,7 +68,7 @@ export async function registerTask(request: RegisterTaskRequest, context: CallCo
|
|||
bossAppId: task.boss_app_id,
|
||||
creatorPid: task.creator_pid,
|
||||
status: task.status,
|
||||
titleId: task.title_id,
|
||||
titleId: BigInt(parseInt(task.title_id, 16)),
|
||||
description: task.description,
|
||||
createdTimestamp: task.created,
|
||||
updatedTimestamp: task.updated
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import { Status, ServerError } from 'nice-grpc';
|
||||
import { getTaskFileByDataID } from '@/database';
|
||||
import { isValidFileNotifyCondition, isValidFileType } from '@/util';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { UpdateFileMetadataRequest } from '@pretendonetwork/grpc/boss/update_file_metadata';
|
||||
import type { Empty } from '@pretendonetwork/grpc/boss/google/protobuf/empty';
|
||||
import type { Empty } from '@pretendonetwork/grpc/google/protobuf/empty';
|
||||
|
||||
export async function updateFileMetadata(request: UpdateFileMetadataRequest, context: CallContext & AuthenticationCallContextExt): Promise<Empty> {
|
||||
if (!hasPermission(context, 'updateBossFiles')) {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { Status, ServerError } from 'nice-grpc';
|
||||
import { getTask } from '@/database';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { UpdateTaskRequest } from '@pretendonetwork/grpc/boss/update_task';
|
||||
import type { Empty } from '@pretendonetwork/grpc/boss/google/protobuf/empty';
|
||||
import type { Empty } from '@pretendonetwork/grpc/google/protobuf/empty';
|
||||
|
||||
export async function updateTask(request: UpdateTaskRequest, context: CallContext & AuthenticationCallContextExt): Promise<Empty> {
|
||||
if (!hasPermission(context, 'updateBossTasks')) {
|
||||
|
|
@ -41,8 +41,9 @@ export async function updateTask(request: UpdateTaskRequest, context: CallContex
|
|||
task.id = updateData.id.slice(0, 7);
|
||||
task.in_game_id = updateData.id;
|
||||
}
|
||||
|
||||
task.boss_app_id = updateData.bossAppId ? updateData.bossAppId : task.boss_app_id;
|
||||
task.title_id = updateData.titleId ? updateData.titleId : task.title_id;
|
||||
task.title_id = updateData.titleId ? updateData.titleId.toString(16).toLowerCase().padStart(16, '0') : task.title_id;
|
||||
task.status = updateData.status ? updateData.status : task.status;
|
||||
task.description = updateData.description ? updateData.description : task.description;
|
||||
task.updated = BigInt(Date.now());
|
||||
|
|
@ -5,8 +5,8 @@ import { getTask, getTaskFile } from '@/database';
|
|||
import { File } from '@/models/file';
|
||||
import { config } from '@/config-manager';
|
||||
import { uploadCDNFile } from '@/cdn';
|
||||
import { hasPermission } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { hasPermission } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { AuthenticationCallContextExt } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import type { CallContext } from 'nice-grpc';
|
||||
import type { UploadFileRequest, UploadFileResponse } from '@pretendonetwork/grpc/boss/upload_file';
|
||||
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
import { createServer } from 'nice-grpc';
|
||||
import { BOSSDefinition } from '@pretendonetwork/grpc/boss/boss_service';
|
||||
import { apiKeyMiddleware } from '@/services/grpc/boss/middleware/api-key-middleware';
|
||||
import { authenticationMiddleware } from '@/services/grpc/boss/middleware/authentication-middleware';
|
||||
import { implementation } from '@/services/grpc/boss/implementation';
|
||||
import { BOSSDefinition as BossServiceDefinitionV1 } from '@pretendonetwork/grpc/boss/boss_service';
|
||||
import { apiKeyMiddleware as apiKeyMiddlewareV1 } from '@/services/grpc/boss/v1/middleware/api-key-middleware';
|
||||
import { authenticationMiddleware as authenticationMiddlewareV1 } from '@/services/grpc/boss/v1/middleware/authentication-middleware';
|
||||
import { bossServiceImplementationV1 } from '@/services/grpc/boss/v1/implementation';
|
||||
import { config } from '@/config-manager';
|
||||
import type { Server } from 'nice-grpc';
|
||||
|
||||
export async function startGRPCServer(): Promise<void> {
|
||||
const server: Server = createServer();
|
||||
|
||||
server.with(apiKeyMiddleware).with(authenticationMiddleware).add(BOSSDefinition, implementation);
|
||||
server.with(apiKeyMiddlewareV1).with(authenticationMiddlewareV1).add(BossServiceDefinitionV1, bossServiceImplementationV1);
|
||||
|
||||
await server.listen(`${config.grpc.boss.address}:${config.grpc.boss.port}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user