magicrealmsshared 0.6.17 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,21 @@
1
1
  import { GameCharacter } from "../types/charcter";
2
2
  import { Auth_Token, PlayerClientData, Well } from "../types/types";
3
3
  import { z } from "zod";
4
- export declare const enum ResponseCode {
5
- SUCCESS = 0,
6
- AUTH_INVALID = 1,
7
- PARSING_FAILED = 2,
8
- NOT_ALLOWED = 3,
9
- CREDENTIAL_MISMATCH = 4,
10
- EXISTS = 10,
11
- DOESNT_EXIST = 11,
12
- SERVER_ERROR = 500
13
- }
14
- type ResponseSuccess = {
15
- code: ResponseCode.SUCCESS;
16
- msg?: string;
4
+ export declare const ResponseCode: {
5
+ readonly SUCCESS: 0;
6
+ readonly AUTH_INVALID: 1;
7
+ readonly PARSING_FAILED: 2;
8
+ readonly NOT_ALLOWED: 3;
9
+ readonly CREDENTIAL_MISMATCH: 4;
10
+ readonly EXISTS: 10;
11
+ readonly DOESNT_EXIST: 11;
12
+ readonly SERVER_ERROR: 500;
17
13
  };
18
- type ResponseFailure = {
14
+ export type ResponseCode = typeof ResponseCode[keyof typeof ResponseCode];
15
+ export type Response = {
19
16
  code: ResponseCode;
20
17
  msg?: string;
21
18
  };
22
- export type Response = ResponseSuccess | ResponseFailure;
23
19
  export declare const GeoJSONPointSchema: z.ZodObject<{
24
20
  type: z.ZodLiteral<"Point">;
25
21
  coordinates: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>;
@@ -143,13 +139,18 @@ export type DEBUG_SOCKET_INFO_RESPONSE = Response & {
143
139
  export declare const CHARACTER_CREATE_COMMAND = "CHARACTER_CREATE";
144
140
  export declare const CHARACTER_CREATE_SCHEME: z.ZodObject<{
145
141
  name: z.ZodString;
142
+ gender: z.ZodEnum<["f", "m"]>;
143
+ portrait: z.ZodString;
146
144
  }, "strict", z.ZodTypeAny, {
147
145
  name: string;
146
+ gender: "f" | "m";
147
+ portrait: string;
148
148
  }, {
149
149
  name: string;
150
+ gender: "f" | "m";
151
+ portrait: string;
150
152
  }>;
151
153
  export type CHARACTER_CREATE_DATA = z.infer<typeof CHARACTER_CREATE_SCHEME>;
152
154
  export type CHARACTER_CREATE_RESPONSE = Response & {
153
155
  character?: GameCharacter<string, number>;
154
156
  };
155
- export {};
@@ -1,7 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHARACTER_CREATE_SCHEME = exports.CHARACTER_CREATE_COMMAND = exports.DEBUG_SOCKET_INFO_RETRIEVE_SCHEME = exports.DEBUG_SOCKET_INFO_RETRIEVE_COMMAND = exports.ADMIN_WELL_DELETE_SCHEME = exports.ADMIN_WELL_DELETE_COMMAND = exports.ADMIN_WELL_CREATE_SCHEME = exports.ADMIN_WELL_CREATE_COMMAND = exports.POSUPDATE_SCHEME = exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.REGISTER_RESPONSE_COMMAND = exports.REGISTER_DATA_SCHEME = exports.REGISTER_COMMAND = exports.LOGOUT_COMMAND = exports.LOGIN_RESPONSE_COMMAND = exports.LOGIN_DATA_SCHEME = exports.LOGIN_COMMAND = exports.AUTH_INVALID = exports.AUTH_ACK = exports.AUTH = exports.AUTH_TOKEN_SCHEME = exports.GeoJSONPointSchema = void 0;
3
+ exports.CHARACTER_CREATE_SCHEME = exports.CHARACTER_CREATE_COMMAND = exports.DEBUG_SOCKET_INFO_RETRIEVE_SCHEME = exports.DEBUG_SOCKET_INFO_RETRIEVE_COMMAND = exports.ADMIN_WELL_DELETE_SCHEME = exports.ADMIN_WELL_DELETE_COMMAND = exports.ADMIN_WELL_CREATE_SCHEME = exports.ADMIN_WELL_CREATE_COMMAND = exports.POSUPDATE_SCHEME = exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.REGISTER_RESPONSE_COMMAND = exports.REGISTER_DATA_SCHEME = exports.REGISTER_COMMAND = exports.LOGOUT_COMMAND = exports.LOGIN_RESPONSE_COMMAND = exports.LOGIN_DATA_SCHEME = exports.LOGIN_COMMAND = exports.AUTH_INVALID = exports.AUTH_ACK = exports.AUTH = exports.AUTH_TOKEN_SCHEME = exports.GeoJSONPointSchema = exports.ResponseCode = void 0;
4
+ const charcter_1 = require("../types/charcter");
4
5
  const zod_1 = require("zod");
6
+ exports.ResponseCode = {
7
+ SUCCESS: 0,
8
+ AUTH_INVALID: 1,
9
+ PARSING_FAILED: 2,
10
+ NOT_ALLOWED: 3,
11
+ CREDENTIAL_MISMATCH: 4,
12
+ EXISTS: 10,
13
+ DOESNT_EXIST: 11,
14
+ SERVER_ERROR: 500,
15
+ };
5
16
  exports.GeoJSONPointSchema = zod_1.z.strictObject({
6
17
  type: zod_1.z.literal("Point"),
7
18
  coordinates: zod_1.z.array(zod_1.z.number()).length(2).superRefine(([lon, lat], ctx) => {
@@ -58,5 +69,7 @@ exports.DEBUG_SOCKET_INFO_RETRIEVE_SCHEME = zod_1.z.strictObject({});
58
69
  exports.CHARACTER_CREATE_COMMAND = "CHARACTER_CREATE";
59
70
  exports.CHARACTER_CREATE_SCHEME = zod_1.z.strictObject({
60
71
  name: zod_1.z.string().min(3).max(32),
72
+ gender: charcter_1.GenderSchema,
73
+ portrait: zod_1.z.string().min(2).max(8),
61
74
  });
62
75
  //#endregion
@@ -1,3 +1,4 @@
1
+ import z from "zod";
1
2
  import { GameItem, HeadGear, ManaCrytal } from "./items";
2
3
  import { ObjectWithId } from "./types";
3
4
  export type Equipment<IDFormat, DateFormat> = {
@@ -8,6 +9,10 @@ export type GameCharacter<IDFormat, DateFormat> = ObjectWithId<IDFormat> & {
8
9
  ownerId: IDFormat;
9
10
  name: string;
10
11
  creationDate: DateFormat;
12
+ gender: Gender;
13
+ portrait: string;
11
14
  equipment: Equipment<IDFormat, DateFormat>;
12
15
  inventory: GameItem<IDFormat, DateFormat>[];
13
16
  };
17
+ export declare const GenderSchema: z.ZodEnum<["f", "m"]>;
18
+ export type Gender = z.infer<typeof GenderSchema>;
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GenderSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.GenderSchema = zod_1.default.enum(["f", "m"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magicrealmsshared",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {