Compute instance in pusher /map endpoint
This commit is contained in:
parent
03909f14f7
commit
0f08e3d1b5
@ -130,6 +130,7 @@ export class Room {
|
|||||||
this._canReport = data.canReport ?? false;
|
this._canReport = data.canReport ?? false;
|
||||||
this._loadingLogo = data.loadingLogo ?? undefined;
|
this._loadingLogo = data.loadingLogo ?? undefined;
|
||||||
this._loginSceneLogo = data.loginSceneLogo ?? undefined;
|
this._loginSceneLogo = data.loginSceneLogo ?? undefined;
|
||||||
|
this.instance = data.instance;
|
||||||
return new MapDetail(data.mapUrl);
|
return new MapDetail(data.mapUrl);
|
||||||
} else {
|
} else {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
@ -13,6 +13,7 @@ export const isMapDetailsData = z.object({
|
|||||||
roomSlug: z.nullable(z.string()), // deprecated
|
roomSlug: z.nullable(z.string()), // deprecated
|
||||||
contactPage: z.nullable(z.string()),
|
contactPage: z.nullable(z.string()),
|
||||||
group: z.nullable(z.string()),
|
group: z.nullable(z.string()),
|
||||||
|
instance: z.string(),
|
||||||
|
|
||||||
iframeAuthentication: z.optional(z.nullable(z.string())),
|
iframeAuthentication: z.optional(z.nullable(z.string())),
|
||||||
// The date (in ISO 8601 format) at which the room will expire
|
// The date (in ISO 8601 format) at which the room will expire
|
||||||
|
@ -76,6 +76,10 @@ export class MapController extends BaseHttpController {
|
|||||||
* type: string|null
|
* type: string|null
|
||||||
* description: The group this room is part of (maps the notion of "world" in WorkAdventure SAAS)
|
* description: The group this room is part of (maps the notion of "world" in WorkAdventure SAAS)
|
||||||
* example: myorg/myworld
|
* example: myorg/myworld
|
||||||
|
* instance:
|
||||||
|
* type: string
|
||||||
|
* description: The instance of this map. In a public URL: the second part of the URL (_/[instance]/map.json)
|
||||||
|
* example: global
|
||||||
* iframeAuthentication:
|
* iframeAuthentication:
|
||||||
* type: string|null
|
* type: string|null
|
||||||
* description: The URL of the authentication Iframe
|
* description: The URL of the authentication Iframe
|
||||||
@ -111,14 +115,15 @@ export class MapController extends BaseHttpController {
|
|||||||
if (!ADMIN_API_URL) {
|
if (!ADMIN_API_URL) {
|
||||||
const roomUrl = new URL(query.playUri);
|
const roomUrl = new URL(query.playUri);
|
||||||
|
|
||||||
const match = /\/_\/[^/]+\/(.+)/.exec(roomUrl.pathname);
|
const match = /\/_\/([^/]+)\/(.+)/.exec(roomUrl.pathname);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
res.status(404);
|
res.status(404);
|
||||||
res.json({});
|
res.json({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapUrl = roomUrl.protocol + "//" + match[1];
|
const instance = match[1];
|
||||||
|
const mapUrl = roomUrl.protocol + "//" + match[2];
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
mapUrl,
|
mapUrl,
|
||||||
@ -128,6 +133,7 @@ export class MapController extends BaseHttpController {
|
|||||||
tags: [],
|
tags: [],
|
||||||
contactPage: null,
|
contactPage: null,
|
||||||
authenticationMandatory: DISABLE_ANONYMOUS,
|
authenticationMandatory: DISABLE_ANONYMOUS,
|
||||||
|
instance,
|
||||||
} as MapDetailsData);
|
} as MapDetailsData);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user