Skip to content

Commit

Permalink
Feature/update pacifista endpoints (#3)
Browse files Browse the repository at this point in the history
* update packages

* update packages

* done pacifista data module

* exported services
  • Loading branch information
FunixG authored Jan 9, 2024
1 parent f2b55b9 commit cc29f14
Show file tree
Hide file tree
Showing 10 changed files with 3,180 additions and 2,387 deletions.
5,430 changes: 3,058 additions & 2,372 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@
},
"private": false,
"dependencies": {
"@angular/animations": "^16.1.0",
"@angular/common": "^16.1.0",
"@angular/compiler": "^16.1.0",
"@angular/core": "^16.1.0",
"@angular/forms": "^16.1.0",
"@angular/platform-browser": "^16.1.0",
"@angular/platform-browser-dynamic": "^16.1.0",
"@angular/router": "^16.1.0",
"@angular/animations": "^17.0.8",
"@angular/common": "^17.0.8",
"@angular/compiler": "^17.0.8",
"@angular/core": "^17.0.8",
"@angular/forms": "^17.0.8",
"@angular/platform-browser": "^17.0.8",
"@angular/platform-browser-dynamic": "^17.0.8",
"@angular/router": "^17.0.8",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.1.8",
"@angular/cli": "~16.1.5",
"@angular/compiler-cli": "^16.1.0",
"@angular-devkit/build-angular": "^17.0.9",
"@angular/cli": "~17.0.9",
"@angular/compiler-cli": "^17.0.8",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ng-packagr": "^16.0.0",
"typescript": "~5.1.3"
"ng-packagr": "^17.0.3",
"typescript": "~5.2.2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export enum PacifistaServerGameMode {
NEUTRAL = 'NEUTRAL',
SURVIVAL = 'SURVIVAL',
CREATIVE = 'CREATIVE',
SKYBLOCK = 'SKYBLOCK',
EVENT = 'EVENT'
}

export enum PacifistaServerType {
HUB = 'HUB',
CREATIVE = 'CREATIVE',
EVENT = 'EVENT',
SURVIE_ALPHA = 'SURVIE_ALPHA',
SURVIE_BETA = 'SURVIE_BETA',
SURVIE_RESOURCE = 'SURVIE_RESOURCE'
}

export function getGameModeFromPacifistaServerType(serverType: PacifistaServerType) {
if (serverType === PacifistaServerType.CREATIVE) {
return PacifistaServerGameMode.CREATIVE;
} else if (serverType === PacifistaServerType.EVENT) {
return PacifistaServerGameMode.EVENT;
} else if (serverType === PacifistaServerType.SURVIE_ALPHA || serverType === PacifistaServerType.SURVIE_BETA || serverType === PacifistaServerType.SURVIE_RESOURCE) {
return PacifistaServerGameMode.SURVIVAL;
} else {
return PacifistaServerGameMode.NEUTRAL;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {ApiDTO} from "../../../../../core/dtos/api-dto";
import {PacifistaServerType} from "../../../../core/enums/PacifistaServerType";

export class PacifistaPlayerChatMessageDTO extends ApiDTO {
message?: string
serverType?: PacifistaServerType
isCommand?: boolean
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {ApiDTO} from "../../../../../core/dtos/api-dto";

export class PacifistaPlayerDataDTO extends ApiDTO {
playTime?: Number
lastConnection?: Date
firstConnection?: Date
acceptPayments?: boolean
acceptTeleportation?: boolean
acceptPingSoundTagMessage?: boolean
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {ApiDTO} from "../../../../../core/dtos/api-dto";

export class PacifistaPlayerSessionDTO extends ApiDTO {
connectedAt?: Date
disconnectedAt?: Date
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client";
import {PacifistaPlayerChatMessageDTO} from "../dtos/PacifistaPlayerChatMessageDTO";
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../../../../../environments/environment";
import {environmentDev} from "../../../../../../../environments/environment-dev";

export class PacifistaPlayerChatMessagesService extends CrudHttpClient<PacifistaPlayerChatMessageDTO> {
constructor(protected httpClient: HttpClient, production: boolean) {
super(
httpClient,
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl,
'playerdata/chatmessages'
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client";
import {PacifistaPlayerDataDTO} from "../dtos/PacifistaPlayerDataDTO";
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../../../../../environments/environment";
import {environmentDev} from "../../../../../../../environments/environment-dev";

export class PacifistaPlayerDataService extends CrudHttpClient<PacifistaPlayerDataDTO> {
constructor(protected httpClient: HttpClient, production: boolean) {
super(
httpClient,
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl,
'playerdata/data'
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client";
import {PacifistaPlayerSessionDTO} from "../dtos/PacifistaPlayerSessionDTO";
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../../../../../environments/environment";
import {environmentDev} from "../../../../../../../environments/environment-dev";

export class PacifistaPlayerSessionsService extends CrudHttpClient<PacifistaPlayerSessionDTO> {
constructor(protected httpClient: HttpClient, production: boolean) {
super(
httpClient,
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl,
'playerdata/session'
);
}
}
10 changes: 10 additions & 0 deletions projects/funixproductions-requests/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@ export * from './lib/services/funixproductions-api/twitch/enums/TwitchTokenType'
/**
* Pacifista API
*/
export * from './lib/services/pacifista-api/core/enums/PacifistaServerType';

export * from './lib/services/pacifista-api/support/tickets/dtos/PacifistaSupportTicketDTO';
export * from './lib/services/pacifista-api/support/tickets/dtos/PacifistaSupportTicketMessageDTO';
export * from './lib/services/pacifista-api/support/tickets/service/PacifistaSupportTicketService';
export * from './lib/services/pacifista-api/support/tickets/service/PacifistaSupportTicketMessageService';
export * from './lib/services/pacifista-api/support/tickets/service/PacifistaSupportTicketMessageWebsocketService';

export * from './lib/services/pacifista-api/web/news/dtos/PacifistaNewsDTO';
export * from './lib/services/pacifista-api/web/news/services/PacifistaNewsService';
export * from './lib/services/pacifista-api/web/shop/articles/dtos/PacifistaShopArticleDTO';
export * from './lib/services/pacifista-api/web/shop/articles/services/PacifistaShopArticleService';
export * from './lib/services/pacifista-api/web/shop/categories/services/PacifistaShopCategoryService';
export * from './lib/services/pacifista-api/web/shop/categories/dtos/PacifistaShopCategoryDTO';

export * from './lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerDataDTO';
export * from './lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerChatMessageDTO';
export * from './lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerSessionDTO';
export * from './lib/services/pacifista-api/server/players/data/service/PacifistaPlayerDataService';
export * from './lib/services/pacifista-api/server/players/data/service/PacifistaPlayerSessionsService';
export * from './lib/services/pacifista-api/server/players/data/service/PacifistaPlayerChatMessagesService';

0 comments on commit cc29f14

Please sign in to comment.