952a5bd87c
Also, bootstraping a new LocalAdmin service to mock the AdminApi in the pusher
27 lines
738 B
TypeScript
27 lines
738 B
TypeScript
import { FetchMemberDataByUuidResponse } from "./AdminApi";
|
|
import { AdminInterface } from "./AdminInterface";
|
|
|
|
/**
|
|
* A local class mocking a real admin if no admin is configured.
|
|
*/
|
|
class LocalAdmin implements AdminInterface {
|
|
fetchMemberDataByUuid(
|
|
userIdentifier: string,
|
|
playUri: string,
|
|
ipAddress: string,
|
|
characterLayers: string[]
|
|
): Promise<FetchMemberDataByUuidResponse> {
|
|
return Promise.resolve({
|
|
email: userIdentifier,
|
|
userUuid: userIdentifier,
|
|
tags: [],
|
|
messages: [],
|
|
visitCardUrl: null,
|
|
textures: [],
|
|
userRoomToken: undefined,
|
|
});
|
|
}
|
|
}
|
|
|
|
export const localAdmin = new LocalAdmin();
|