Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
Revert "New Release 06/02/2024 (workadventure#3718)"
Browse files Browse the repository at this point in the history
This reverts commit 8e21dad.
  • Loading branch information
gparant committed Feb 16, 2024
1 parent 8e21dad commit 93725fa
Show file tree
Hide file tree
Showing 91 changed files with 442 additions and 3,222 deletions.
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ services:
ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
API_URL: back:50051
DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS
#Map editor
PUBLIC_MAP_STORAGE_URL: "http://map-storage.workadventure.localhost"
INTERNAL_MAP_STORAGE_URL: "http://map-storage:3000"
ENABLE_OPENAPI_ENDPOINT: "true"
Expand Down
160 changes: 4 additions & 156 deletions docs/schema/1.0/wam.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,36 +207,6 @@
"type"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/id"
},
"buttonLabel": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/buttonLabel"
},
"hideButtonLabel": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/hideButtonLabel"
},
"type": {
"type": "string",
"const": "entityDescriptionProperties"
},
"description": {
"type": "string"
},
"searchable": {
"type": "boolean",
"default": false
}
},
"required": [
"id",
"type"
],
"additionalProperties": false
}
]
}
Expand Down Expand Up @@ -472,36 +442,6 @@
"speakerZoneName"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/id"
},
"buttonLabel": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/buttonLabel"
},
"hideButtonLabel": {
"$ref": "#/definitions/WAMFileFormat/properties/entities/additionalProperties/properties/properties/items/anyOf/0/properties/hideButtonLabel"
},
"type": {
"type": "string",
"const": "areaDescriptionProperties"
},
"description": {
"type": "string"
},
"searchable": {
"type": "boolean",
"default": false
}
},
"required": [
"id",
"type"
],
"additionalProperties": false
}
]
}
Expand Down Expand Up @@ -580,112 +520,20 @@
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "string"
}
]
},
{
"type": "null"
}
],
"type": "string",
"description": "The name of the map."
},
"description": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "string"
}
]
},
{
"type": "null"
}
],
"type": "string",
"description": "A description of the map. Can be used in social networks when sharing a link to the map."
},
"copyright": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "string"
}
]
},
{
"type": "null"
}
],
"type": "string",
"description": "Copyright notice for this map. Can be a link to a license. Parts of this map like tilesets or images can have their own copyright."
},
"thumbnail": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "string"
}
]
},
{
"type": "null"
}
],
"type": "string",
"description": "URL to a thumbnail image. This image will be used in social networks when sharing a link to the map."
},
"areasSearchable": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "number"
}
]
},
{
"type": "null"
}
],
"description": "Number of areas define as searchable by the map editor for the exploration mode."
},
"entitiesSearchable": {
"anyOf": [
{
"anyOf": [
{
"not": {}
},
{
"type": "number"
}
]
},
{
"type": "null"
}
],
"description": "Number of entities define as searchable by the map editor for the exploration mode."
}
},
"additionalProperties": false,
Expand Down
3 changes: 1 addition & 2 deletions libs/map-editor/src/Commands/Command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { v4 as uuidv4 } from "uuid";
import { WAMFileFormat } from "../types";

export abstract class Command {
public readonly commandId: string;
Expand All @@ -8,6 +7,6 @@ export abstract class Command {
this.commandId = commandId ?? uuidv4();
}

public abstract execute(): Promise<void | undefined | WAMFileFormat>;
public abstract execute(): Promise<void>;
//public abstract undo(): Promise<void>;
}
6 changes: 3 additions & 3 deletions libs/map-editor/src/Commands/Entity/UpdateEntityCommand.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WAMEntityData, WAMFileFormat } from "../../types";
import type { WAMEntityData } from "../../types";
import type { GameMap } from "../../GameMap/GameMap";
import { Command } from "../Command";

Expand Down Expand Up @@ -29,10 +29,10 @@ export class UpdateEntityCommand extends Command {
this.newConfig = structuredClone(dataToModify);
}

public execute(): Promise<undefined | WAMFileFormat> {
public execute(): Promise<void> {
if (!this.gameMap.getGameMapEntities()?.updateEntity(this.entityId, this.newConfig)) {
throw new Error(`MapEditorError: Could not execute UpdateEntity Command. Entity ID: ${this.entityId}`);
}
return Promise.resolve(this.gameMap.getGameMapEntities()?.wamFile);
return Promise.resolve();
}
}
34 changes: 0 additions & 34 deletions libs/map-editor/src/Commands/WAM/UpdateWAMMetadataCommand.ts

This file was deleted.

4 changes: 0 additions & 4 deletions libs/map-editor/src/GameMap/GameMapEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,4 @@ export class GameMapEntities {
public getEntities(): Record<string, WAMEntityData> {
return this.wam.entities;
}

get wamFile(): WAMFileFormat {
return this.wam;
}
}
1 change: 0 additions & 1 deletion libs/map-editor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from "./Commands/Entity/UpdateEntityCommand";
export * from "./Commands/Entity/CreateEntityCommand";
export * from "./Commands/Entity/DeleteEntityCommand";
export * from "./Commands/WAM/UpdateWAMSettingCommand";
export * from "./Commands/WAM/UpdateWAMMetadataCommand";
export * from "./Commands/Command";
// MapFetcher is not exported because it is using Node imports that are not available in the browser
//export * from "./MapFetcher";
Expand Down
32 changes: 1 addition & 31 deletions libs/map-editor/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,6 @@ export const ListenerMegaphonePropertyData = PropertyBase.extend({
chatEnabled: z.boolean().default(false),
});

export const EntityDescriptionPropertyData = PropertyBase.extend({
type: z.literal("entityDescriptionProperties"),
description: z.string().optional(),
searchable: z.boolean().default(false),
});

export const AreaDescriptionPropertyData = PropertyBase.extend({
type: z.literal("areaDescriptionProperties"),
description: z.string().optional(),
searchable: z.boolean().default(false),
});

export const AreaDataProperty = z.discriminatedUnion("type", [
StartPropertyData,
ExitPropertyData,
Expand All @@ -128,7 +116,6 @@ export const AreaDataProperty = z.discriminatedUnion("type", [
OpenWebsitePropertyData,
SpeakerMegaphonePropertyData,
ListenerMegaphonePropertyData,
AreaDescriptionPropertyData,
]);

export const AreaDataProperties = z.array(AreaDataProperty);
Expand All @@ -155,7 +142,6 @@ export const EntityDataProperty = z.discriminatedUnion("type", [
JitsiRoomPropertyData,
PlayAudioPropertyData,
OpenWebsitePropertyData,
EntityDescriptionPropertyData,
]);

export const EntityDataProperties = z.array(EntityDataProperty);
Expand Down Expand Up @@ -201,38 +187,24 @@ export const WAMEntityData = EntityData.omit({ prefab: true, id: true });
export type WAMEntityData = z.infer<typeof WAMEntityData>;

export const WAMMetadata = z.object({
name: z.string().optional().nullable().describe("The name of the map."),
name: z.string().optional().describe("The name of the map."),
description: z
.string()
.optional()
.nullable()
.describe("A description of the map. Can be used in social networks when sharing a link to the map."),
copyright: z
.string()
.optional()
.nullable()
.describe(
"Copyright notice for this map. Can be a link to a license. Parts of this map like tilesets or images can have their own copyright."
),
thumbnail: z
.string()
.optional()
.nullable()
.describe(
"URL to a thumbnail image. This image will be used in social networks when sharing a link to the map."
),
areasSearchable: z
.number()
.optional()
.nullable()
.describe("Number of areas define as searchable by the map editor for the exploration mode."),
entitiesSearchable: z
.number()
.optional()
.nullable()
.describe("Number of entities define as searchable by the map editor for the exploration mode."),
});
export type WAMMetadata = z.infer<typeof WAMMetadata>;

export const WAMVendor = z
.unknown()
Expand Down Expand Up @@ -316,8 +288,6 @@ export type MapsCacheSingleMapFormat = z.infer<typeof MapsCacheSingleMapFormat>;
export type MapsCacheFileFormat = z.infer<typeof MapsCacheFileFormat>;
export type SpeakerMegaphonePropertyData = z.infer<typeof SpeakerMegaphonePropertyData>;
export type ListenerMegaphonePropertyData = z.infer<typeof ListenerMegaphonePropertyData>;
export type EntityDescriptionPropertyData = z.infer<typeof EntityDescriptionPropertyData>;
export type AreaDescriptionPropertyData = z.infer<typeof AreaDescriptionPropertyData>;

export enum GameMapProperties {
ALLOW_API = "allowApi",
Expand Down
Loading

0 comments on commit 93725fa

Please sign in to comment.