Skip to content

Commit 088ba5b

Browse files
feat: add pvp editor state and leaderboard
1 parent ca1a95c commit 088ba5b

40 files changed

+2189
-583
lines changed

docs/spec/CodeCharacter-API.yml

Lines changed: 401 additions & 4 deletions
Large diffs are not rendered by default.

packages/client/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ src/apis/LeaderboardApi.ts
88
src/apis/MapApi.ts
99
src/apis/MatchApi.ts
1010
src/apis/NotificationApi.ts
11+
src/apis/PvpGameApi.ts
12+
src/apis/PvpLeaderboardApi.ts
1113
src/apis/UserApi.ts
1214
src/apis/index.ts
1315
src/index.ts
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.0
1+
7.2.0

packages/client/src/apis/AuthApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -20,7 +20,7 @@ import type {
2020
PasswordLoginRequest,
2121
PasswordLoginResponse,
2222
ResetPasswordRequest,
23-
} from '../models';
23+
} from '../models/index';
2424

2525
export interface ForgotPasswordOperationRequest {
2626
forgotPasswordRequest: ForgotPasswordRequest;

packages/client/src/apis/CodeApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -20,7 +20,7 @@ import type {
2020
CreateCodeRevisionRequest,
2121
GenericError,
2222
UpdateLatestCodeRequest,
23-
} from '../models';
23+
} from '../models/index';
2424

2525
export interface CreateCodeRevisionOperationRequest {
2626
createCodeRevisionRequest: CreateCodeRevisionRequest;

packages/client/src/apis/CurrentUserApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,7 +19,7 @@ import type {
1919
GenericError,
2020
UpdateCurrentUserProfile,
2121
UpdatePasswordRequest,
22-
} from '../models';
22+
} from '../models/index';
2323

2424
export interface CompleteUserProfileRequest {
2525
completeProfileRequest: CompleteProfileRequest;

packages/client/src/apis/DailyChallengesApi.ts

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,7 +18,8 @@ import type {
1818
DailyChallengeLeaderBoardResponse,
1919
DailyChallengeMatchRequest,
2020
GenericError,
21-
} from '../models';
21+
Match,
22+
} from '../models/index';
2223

2324
export interface CreateDailyChallengeMatchRequest {
2425
dailyChallengeMatchRequest: DailyChallengeMatchRequest;
@@ -29,6 +30,11 @@ export interface GetDailyChallengeLeaderBoardRequest {
2930
size?: number;
3031
}
3132

33+
export interface GetUserDCMatchesRequest {
34+
page?: number;
35+
size?: number;
36+
}
37+
3238
/**
3339
* DailyChallengesApi - interface
3440
*
@@ -100,6 +106,30 @@ export interface DailyChallengesApiInterface {
100106
size?: number,
101107
initOverrides?: RequestInit | runtime.InitOverrideFunction,
102108
): Promise<Array<DailyChallengeLeaderBoardResponse>>;
109+
110+
/**
111+
* Get daily-challenge matches played by authenticated user
112+
* @summary Get user daily challenge matches
113+
* @param {number} [page] Index of the page
114+
* @param {number} [size] Size of the page
115+
* @param {*} [options] Override http request option.
116+
* @throws {RequiredError}
117+
* @memberof DailyChallengesApiInterface
118+
*/
119+
getUserDCMatchesRaw(
120+
requestParameters: GetUserDCMatchesRequest,
121+
initOverrides?: RequestInit | runtime.InitOverrideFunction,
122+
): Promise<runtime.ApiResponse<Array<Match>>>;
123+
124+
/**
125+
* Get daily-challenge matches played by authenticated user
126+
* Get user daily challenge matches
127+
*/
128+
getUserDCMatches(
129+
page?: number,
130+
size?: number,
131+
initOverrides?: RequestInit | runtime.InitOverrideFunction,
132+
): Promise<Array<Match>>;
103133
}
104134

105135
/**
@@ -268,4 +298,61 @@ export class DailyChallengesApi
268298
);
269299
return await response.value();
270300
}
301+
302+
/**
303+
* Get daily-challenge matches played by authenticated user
304+
* Get user daily challenge matches
305+
*/
306+
async getUserDCMatchesRaw(
307+
requestParameters: GetUserDCMatchesRequest,
308+
initOverrides?: RequestInit | runtime.InitOverrideFunction,
309+
): Promise<runtime.ApiResponse<Array<Match>>> {
310+
const queryParameters: any = {};
311+
312+
if (requestParameters.page !== undefined) {
313+
queryParameters['page'] = requestParameters.page;
314+
}
315+
316+
if (requestParameters.size !== undefined) {
317+
queryParameters['size'] = requestParameters.size;
318+
}
319+
320+
const headerParameters: runtime.HTTPHeaders = {};
321+
322+
if (this.configuration && this.configuration.accessToken) {
323+
const token = this.configuration.accessToken;
324+
const tokenString = await token('http-bearer', []);
325+
326+
if (tokenString) {
327+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
328+
}
329+
}
330+
const response = await this.request(
331+
{
332+
path: `/dc/matches`,
333+
method: 'GET',
334+
headers: headerParameters,
335+
query: queryParameters,
336+
},
337+
initOverrides,
338+
);
339+
340+
return new runtime.JSONApiResponse(response);
341+
}
342+
343+
/**
344+
* Get daily-challenge matches played by authenticated user
345+
* Get user daily challenge matches
346+
*/
347+
async getUserDCMatches(
348+
page?: number,
349+
size?: number,
350+
initOverrides?: RequestInit | runtime.InitOverrideFunction,
351+
): Promise<Array<Match>> {
352+
const response = await this.getUserDCMatchesRaw(
353+
{ page: page, size: size },
354+
initOverrides,
355+
);
356+
return await response.value();
357+
}
271358
}

packages/client/src/apis/GameApi.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -95,7 +95,11 @@ export class GameApi extends runtime.BaseAPI implements GameApiInterface {
9595
initOverrides,
9696
);
9797

98-
return new runtime.TextApiResponse(response) as any;
98+
if (this.isJsonMime(response.headers.get('content-type'))) {
99+
return new runtime.JSONApiResponse<string>(response);
100+
} else {
101+
return new runtime.TextApiResponse(response) as any;
102+
}
99103
}
100104

101105
/**

packages/client/src/apis/LeaderboardApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,7 +13,7 @@
1313
*/
1414

1515
import * as runtime from '../runtime';
16-
import type { LeaderboardEntry, TierType } from '../models';
16+
import type { LeaderboardEntry, TierType } from '../models/index';
1717

1818
export interface GetLeaderboardRequest {
1919
page?: number;

packages/client/src/apis/MapApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* CodeCharacter API
55
* Specification of the CodeCharacter API
66
*
7-
* The version of the OpenAPI document: 2023.0.1
7+
* The version of the OpenAPI document: 2024.0.1
88
* Contact: delta@nitt.edu
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,7 +21,7 @@ import type {
2121
GenericError,
2222
MapCommitByCommitIdResponse,
2323
UpdateLatestMapRequest,
24-
} from '../models';
24+
} from '../models/index';
2525

2626
export interface CreateMapRevisionOperationRequest {
2727
createMapRevisionRequest: CreateMapRevisionRequest;

0 commit comments

Comments
 (0)