@rpgjs/client 5.0.0-alpha.13 → 5.0.0-alpha.14

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.
Files changed (49) hide show
  1. package/dist/index10.js +1 -1
  2. package/dist/index15.js +2 -2
  3. package/dist/index15.js.map +1 -1
  4. package/dist/index16.js.map +1 -1
  5. package/dist/index19.js.map +1 -1
  6. package/dist/index22.js +32 -32
  7. package/dist/index22.js.map +1 -1
  8. package/dist/index23.js +2 -2
  9. package/dist/index23.js.map +1 -1
  10. package/dist/index30.js.map +1 -1
  11. package/dist/index31.js.map +1 -1
  12. package/dist/index33.js +1 -1
  13. package/dist/index34.js +1 -1
  14. package/dist/index35.js +184 -9
  15. package/dist/index35.js.map +1 -1
  16. package/dist/index36.js +495 -4394
  17. package/dist/index36.js.map +1 -1
  18. package/dist/index37.js +9 -171
  19. package/dist/index37.js.map +1 -1
  20. package/dist/index38.js +6 -500
  21. package/dist/index38.js.map +1 -1
  22. package/dist/index39.js +3680 -67
  23. package/dist/index39.js.map +1 -1
  24. package/dist/index4.js +6 -1
  25. package/dist/index4.js.map +1 -1
  26. package/dist/index40.js +67 -10
  27. package/dist/index40.js.map +1 -1
  28. package/dist/index41.js +3 -93
  29. package/dist/index41.js.map +1 -1
  30. package/dist/index42.js +20 -0
  31. package/dist/index42.js.map +1 -0
  32. package/dist/index43.js +96 -0
  33. package/dist/index43.js.map +1 -0
  34. package/dist/index44.js +12 -0
  35. package/dist/index44.js.map +1 -0
  36. package/dist/index45.js +113 -0
  37. package/dist/index45.js.map +1 -0
  38. package/dist/index46.js +136 -0
  39. package/dist/index46.js.map +1 -0
  40. package/dist/index47.js +137 -0
  41. package/dist/index47.js.map +1 -0
  42. package/dist/index48.js +112 -0
  43. package/dist/index48.js.map +1 -0
  44. package/dist/index49.js +9 -0
  45. package/dist/index49.js.map +1 -0
  46. package/dist/services/mmorpg.d.ts +1 -0
  47. package/package.json +8 -8
  48. package/src/components/character.ce +3 -2
  49. package/src/services/mmorpg.ts +7 -1
@@ -0,0 +1,136 @@
1
+ var util;
2
+ (function (util) {
3
+ util.assertEqual = (_) => { };
4
+ function assertIs(_arg) { }
5
+ util.assertIs = assertIs;
6
+ function assertNever(_x) {
7
+ throw new Error();
8
+ }
9
+ util.assertNever = assertNever;
10
+ util.arrayToEnum = (items) => {
11
+ const obj = {};
12
+ for (const item of items) {
13
+ obj[item] = item;
14
+ }
15
+ return obj;
16
+ };
17
+ util.getValidEnumValues = (obj) => {
18
+ const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
19
+ const filtered = {};
20
+ for (const k of validKeys) {
21
+ filtered[k] = obj[k];
22
+ }
23
+ return util.objectValues(filtered);
24
+ };
25
+ util.objectValues = (obj) => {
26
+ return util.objectKeys(obj).map(function (e) {
27
+ return obj[e];
28
+ });
29
+ };
30
+ util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
31
+ ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
32
+ : (object) => {
33
+ const keys = [];
34
+ for (const key in object) {
35
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
36
+ keys.push(key);
37
+ }
38
+ }
39
+ return keys;
40
+ };
41
+ util.find = (arr, checker) => {
42
+ for (const item of arr) {
43
+ if (checker(item))
44
+ return item;
45
+ }
46
+ return undefined;
47
+ };
48
+ util.isInteger = typeof Number.isInteger === "function"
49
+ ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
50
+ : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
51
+ function joinValues(array, separator = " | ") {
52
+ return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
53
+ }
54
+ util.joinValues = joinValues;
55
+ util.jsonStringifyReplacer = (_, value) => {
56
+ if (typeof value === "bigint") {
57
+ return value.toString();
58
+ }
59
+ return value;
60
+ };
61
+ })(util || (util = {}));
62
+ var objectUtil;
63
+ (function (objectUtil) {
64
+ objectUtil.mergeShapes = (first, second) => {
65
+ return {
66
+ ...first,
67
+ ...second, // second overwrites first
68
+ };
69
+ };
70
+ })(objectUtil || (objectUtil = {}));
71
+ const ZodParsedType = util.arrayToEnum([
72
+ "string",
73
+ "nan",
74
+ "number",
75
+ "integer",
76
+ "float",
77
+ "boolean",
78
+ "date",
79
+ "bigint",
80
+ "symbol",
81
+ "function",
82
+ "undefined",
83
+ "null",
84
+ "array",
85
+ "object",
86
+ "unknown",
87
+ "promise",
88
+ "void",
89
+ "never",
90
+ "map",
91
+ "set",
92
+ ]);
93
+ const getParsedType = (data) => {
94
+ const t = typeof data;
95
+ switch (t) {
96
+ case "undefined":
97
+ return ZodParsedType.undefined;
98
+ case "string":
99
+ return ZodParsedType.string;
100
+ case "number":
101
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
102
+ case "boolean":
103
+ return ZodParsedType.boolean;
104
+ case "function":
105
+ return ZodParsedType.function;
106
+ case "bigint":
107
+ return ZodParsedType.bigint;
108
+ case "symbol":
109
+ return ZodParsedType.symbol;
110
+ case "object":
111
+ if (Array.isArray(data)) {
112
+ return ZodParsedType.array;
113
+ }
114
+ if (data === null) {
115
+ return ZodParsedType.null;
116
+ }
117
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
118
+ return ZodParsedType.promise;
119
+ }
120
+ if (typeof Map !== "undefined" && data instanceof Map) {
121
+ return ZodParsedType.map;
122
+ }
123
+ if (typeof Set !== "undefined" && data instanceof Set) {
124
+ return ZodParsedType.set;
125
+ }
126
+ if (typeof Date !== "undefined" && data instanceof Date) {
127
+ return ZodParsedType.date;
128
+ }
129
+ return ZodParsedType.object;
130
+ default:
131
+ return ZodParsedType.unknown;
132
+ }
133
+ };
134
+
135
+ export { ZodParsedType, getParsedType, objectUtil, util };
136
+ //# sourceMappingURL=index46.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index46.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js"],"sourcesContent":["export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n"],"names":[],"mappings":"AAAU,IAAC;AACX,CAAC,UAAU,IAAI,EAAE;AACjB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;AACjC,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,IAAI,SAAS,WAAW,CAAC,EAAE,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,EAAE;AACzB,IAAI;AACJ,IAAI,IAAI,CAAC,WAAW,GAAG,WAAW;AAClC,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK;AAClC,QAAQ,MAAM,GAAG,GAAG,EAAE;AACtB,QAAQ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAClC,YAAY,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI;AAC5B,QAAQ;AACR,QAAQ,OAAO,GAAG;AAClB,IAA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AK;AAC1C,YAAY;AACZ,YAAY,IAAI,IAAI,KAAK,IAAI,EAAE;AAC/B,gBAAgB,OAAO,aAAa,CAAC,IAAI;AACzC,YAAY;AACZ,YAAY,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;AAChH,gBAAgB,OAAO,aAAa,CAAC,OAAO;AAC5C,YAAY;AACZ,YAAY,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,IAAI,YAAY,GAAG,EAAE;AACnE,gBAAgB,OAAO,aAAa,CAAC,GAAG;AACxC,YAAY;AACZ,YAAY,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,IAAI,YAAY,GAAG,EAAE;AACnE,gBAAgB,OAAO,aAAa,CAAC,GAAG;AACxC,YAAY;AACZ,YAAY,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,YAAY,IAAI,EAAE;AACrE,gBAAgB,OAAO,aAAa,CAAC,IAAI;AACzC,YAAY;AACZ,YAAY,OAAO,aAAa,CAAC,MAAM;AACvC,QAAQ;AACR,YAAY,OAAO,aAAa,CAAC,OAAO;AACxC;AACA;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,137 @@
1
+ import { util } from './index46.js';
2
+
3
+ const ZodIssueCode = util.arrayToEnum([
4
+ "invalid_type",
5
+ "invalid_literal",
6
+ "custom",
7
+ "invalid_union",
8
+ "invalid_union_discriminator",
9
+ "invalid_enum_value",
10
+ "unrecognized_keys",
11
+ "invalid_arguments",
12
+ "invalid_return_type",
13
+ "invalid_date",
14
+ "invalid_string",
15
+ "too_small",
16
+ "too_big",
17
+ "invalid_intersection_types",
18
+ "not_multiple_of",
19
+ "not_finite",
20
+ ]);
21
+ const quotelessJson = (obj) => {
22
+ const json = JSON.stringify(obj, null, 2);
23
+ return json.replace(/"([^"]+)":/g, "$1:");
24
+ };
25
+ class ZodError extends Error {
26
+ get errors() {
27
+ return this.issues;
28
+ }
29
+ constructor(issues) {
30
+ super();
31
+ this.issues = [];
32
+ this.addIssue = (sub) => {
33
+ this.issues = [...this.issues, sub];
34
+ };
35
+ this.addIssues = (subs = []) => {
36
+ this.issues = [...this.issues, ...subs];
37
+ };
38
+ const actualProto = new.target.prototype;
39
+ if (Object.setPrototypeOf) {
40
+ // eslint-disable-next-line ban/ban
41
+ Object.setPrototypeOf(this, actualProto);
42
+ }
43
+ else {
44
+ this.__proto__ = actualProto;
45
+ }
46
+ this.name = "ZodError";
47
+ this.issues = issues;
48
+ }
49
+ format(_mapper) {
50
+ const mapper = _mapper ||
51
+ function (issue) {
52
+ return issue.message;
53
+ };
54
+ const fieldErrors = { _errors: [] };
55
+ const processError = (error) => {
56
+ for (const issue of error.issues) {
57
+ if (issue.code === "invalid_union") {
58
+ issue.unionErrors.map(processError);
59
+ }
60
+ else if (issue.code === "invalid_return_type") {
61
+ processError(issue.returnTypeError);
62
+ }
63
+ else if (issue.code === "invalid_arguments") {
64
+ processError(issue.argumentsError);
65
+ }
66
+ else if (issue.path.length === 0) {
67
+ fieldErrors._errors.push(mapper(issue));
68
+ }
69
+ else {
70
+ let curr = fieldErrors;
71
+ let i = 0;
72
+ while (i < issue.path.length) {
73
+ const el = issue.path[i];
74
+ const terminal = i === issue.path.length - 1;
75
+ if (!terminal) {
76
+ curr[el] = curr[el] || { _errors: [] };
77
+ // if (typeof el === "string") {
78
+ // curr[el] = curr[el] || { _errors: [] };
79
+ // } else if (typeof el === "number") {
80
+ // const errorArray: any = [];
81
+ // errorArray._errors = [];
82
+ // curr[el] = curr[el] || errorArray;
83
+ // }
84
+ }
85
+ else {
86
+ curr[el] = curr[el] || { _errors: [] };
87
+ curr[el]._errors.push(mapper(issue));
88
+ }
89
+ curr = curr[el];
90
+ i++;
91
+ }
92
+ }
93
+ }
94
+ };
95
+ processError(this);
96
+ return fieldErrors;
97
+ }
98
+ static assert(value) {
99
+ if (!(value instanceof ZodError)) {
100
+ throw new Error(`Not a ZodError: ${value}`);
101
+ }
102
+ }
103
+ toString() {
104
+ return this.message;
105
+ }
106
+ get message() {
107
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
108
+ }
109
+ get isEmpty() {
110
+ return this.issues.length === 0;
111
+ }
112
+ flatten(mapper = (issue) => issue.message) {
113
+ const fieldErrors = {};
114
+ const formErrors = [];
115
+ for (const sub of this.issues) {
116
+ if (sub.path.length > 0) {
117
+ const firstEl = sub.path[0];
118
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
119
+ fieldErrors[firstEl].push(mapper(sub));
120
+ }
121
+ else {
122
+ formErrors.push(mapper(sub));
123
+ }
124
+ }
125
+ return { formErrors, fieldErrors };
126
+ }
127
+ get formErrors() {
128
+ return this.flatten();
129
+ }
130
+ }
131
+ ZodError.create = (issues) => {
132
+ const error = new ZodError(issues);
133
+ return error;
134
+ };
135
+
136
+ export { ZodError, ZodIssueCode, quotelessJson };
137
+ //# sourceMappingURL=index47.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index47.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js"],"sourcesContent":["import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n"],"names":[],"mappings":";;AACY,MAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;AAC7C,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,IAAI,6BAA6B;AACjC,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,IAAI,WAAW;AACf,IAAI,SAAS;AACb,IAAI,4BAA4B;AAChC,IAAI,iBAAiB;AACrB,IAAI,YAAY;AAChB,CAAC;AACW,MAAC,aAAa,GAAG,CAAC,GAAG,KAAK;AACtC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC;AAC7C;AACO,MAAM,QAAQ,SAAS,KAAK,CAAC;AACpC,IAAI,IAAI,MAAM,GAAG;AACjB,QAAQ,OAAO,IAAI,CAAC,MAAM;AAC1B,IAAI;AACJ,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,EAAE;AACf,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE;AACxB,QAAQ,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK;AACjC,YAAY,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;AAC/C,QAAQ,CAAC;AACT,QAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,GAAG,EAAE,KAAK;AACxC,YAAY,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;AACnD,QAAQ,CAAC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+1,112 @@
1
+ import { ZodIssueCode } from './index47.js';
2
+ import { util, ZodParsedType } from './index46.js';
3
+
4
+ const errorMap = (issue, _ctx) => {
5
+ let message;
6
+ switch (issue.code) {
7
+ case ZodIssueCode.invalid_type:
8
+ if (issue.received === ZodParsedType.undefined) {
9
+ message = "Required";
10
+ }
11
+ else {
12
+ message = `Expected ${issue.expected}, received ${issue.received}`;
13
+ }
14
+ break;
15
+ case ZodIssueCode.invalid_literal:
16
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
17
+ break;
18
+ case ZodIssueCode.unrecognized_keys:
19
+ message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
20
+ break;
21
+ case ZodIssueCode.invalid_union:
22
+ message = `Invalid input`;
23
+ break;
24
+ case ZodIssueCode.invalid_union_discriminator:
25
+ message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
26
+ break;
27
+ case ZodIssueCode.invalid_enum_value:
28
+ message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
29
+ break;
30
+ case ZodIssueCode.invalid_arguments:
31
+ message = `Invalid function arguments`;
32
+ break;
33
+ case ZodIssueCode.invalid_return_type:
34
+ message = `Invalid function return type`;
35
+ break;
36
+ case ZodIssueCode.invalid_date:
37
+ message = `Invalid date`;
38
+ break;
39
+ case ZodIssueCode.invalid_string:
40
+ if (typeof issue.validation === "object") {
41
+ if ("includes" in issue.validation) {
42
+ message = `Invalid input: must include "${issue.validation.includes}"`;
43
+ if (typeof issue.validation.position === "number") {
44
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
45
+ }
46
+ }
47
+ else if ("startsWith" in issue.validation) {
48
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
49
+ }
50
+ else if ("endsWith" in issue.validation) {
51
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
52
+ }
53
+ else {
54
+ util.assertNever(issue.validation);
55
+ }
56
+ }
57
+ else if (issue.validation !== "regex") {
58
+ message = `Invalid ${issue.validation}`;
59
+ }
60
+ else {
61
+ message = "Invalid";
62
+ }
63
+ break;
64
+ case ZodIssueCode.too_small:
65
+ if (issue.type === "array")
66
+ message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
67
+ else if (issue.type === "string")
68
+ message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
69
+ else if (issue.type === "number")
70
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
71
+ else if (issue.type === "bigint")
72
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
73
+ else if (issue.type === "date")
74
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
75
+ else
76
+ message = "Invalid input";
77
+ break;
78
+ case ZodIssueCode.too_big:
79
+ if (issue.type === "array")
80
+ message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
81
+ else if (issue.type === "string")
82
+ message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
83
+ else if (issue.type === "number")
84
+ message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
85
+ else if (issue.type === "bigint")
86
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
87
+ else if (issue.type === "date")
88
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
89
+ else
90
+ message = "Invalid input";
91
+ break;
92
+ case ZodIssueCode.custom:
93
+ message = `Invalid input`;
94
+ break;
95
+ case ZodIssueCode.invalid_intersection_types:
96
+ message = `Intersection results could not be merged`;
97
+ break;
98
+ case ZodIssueCode.not_multiple_of:
99
+ message = `Number must be a multiple of ${issue.multipleOf}`;
100
+ break;
101
+ case ZodIssueCode.not_finite:
102
+ message = "Number must be finite";
103
+ break;
104
+ default:
105
+ message = _ctx.defaultError;
106
+ util.assertNever(issue);
107
+ }
108
+ return { message };
109
+ };
110
+
111
+ export { errorMap as default };
112
+ //# sourceMappingURL=index48.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index48.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js"],"sourcesContent":["import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n"],"names":[],"mappings":";;;AAEK,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,IAAI,KAAK;AAClC,IAAI,IAAI,OAAO;AACf,IAAI,QAAQ,KAAK,CAAC,IAAI;AACtB,QAAQ,KAAK,YAAY,CAAC,YAAY;AACtC,YAAY,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,CAAC,SAAS,EAAE;AAC5D,gBAAgB,OAAO,GAAG,UAAU;AACpC,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,OAAO,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClF,YAAY;AACZ,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,eAAe;AACzC,YAAY,OAAO,GAAG,CAAC,gCAAgC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;AACrH,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,iBAAiB;AAC3C,YAAY,OAAO,GAAG,CAAC,+BAA+B,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3F,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,aAAa;AACvC,YAAY,OAAO,GAAG,CAAC,aAAa,CAAC;AACrC,YAAY;AACZ,QAA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xE,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,UAAU;AACpC,YAAY,OAAO,GAAG,uBAAuB;AAC7C,YAAY;AACZ,QAAQ;AACR,YAAY,OAAO,GAAG,IAAI,CAAC,YAAY;AACvC,YAAY,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACnC;AACA,IAAI,OAAO,EAAE,OAAO,EAAE;AACtB;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,9 @@
1
+ var errorUtil;
2
+ (function (errorUtil) {
3
+ errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
4
+ // biome-ignore lint:
5
+ errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
6
+ })(errorUtil || (errorUtil = {}));
7
+
8
+ export { errorUtil };
9
+ //# sourceMappingURL=index49.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index49.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js"],"sourcesContent":["export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n"],"names":[],"mappings":"AAAU,IAAC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB,IAAI,SAAS,CAAC,QAAQ,GAAG,CAAC,OAAO,KAAK,OAAO,OAAO,KAAK,QAAQ,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,IAAI,EAAE;AAC/F;AACA,IAAI,SAAS,CAAC,QAAQ,GAAG,CAAC,OAAO,KAAK,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,EAAE,OAAO;AAC9F,CAAC,EAAE,SAAS,KAAK,SAAS,GAAG,EAAE,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
@@ -10,6 +10,7 @@ declare class BridgeWebsocket extends AbstractWebsocket {
10
10
  protected context: Context;
11
11
  private options;
12
12
  private socket;
13
+ private privateId;
13
14
  constructor(context: Context, options?: MmorpgOptions);
14
15
  connection(listeners?: (data: any) => void): Promise<void>;
15
16
  on(key: string, callback: (data: any) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpgjs/client",
3
- "version": "5.0.0-alpha.13",
3
+ "version": "5.0.0-alpha.14",
4
4
  "description": "RPGJS is a framework for creating RPG/MMORPG games",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,17 +22,17 @@
22
22
  "pixi.js": "^8.9.2"
23
23
  },
24
24
  "dependencies": {
25
- "@rpgjs/client": "*",
26
- "@rpgjs/common": "*",
27
- "@rpgjs/server": "*",
28
- "@signe/di": "^2.4.5",
29
- "@signe/room": "^2.4.5",
30
- "@signe/sync": "^2.4.5",
25
+ "@rpgjs/client": "5.0.0-alpha.14",
26
+ "@rpgjs/common": "5.0.0-alpha.14",
27
+ "@rpgjs/server": "5.0.0-alpha.14",
28
+ "@signe/di": "^2.4.6",
29
+ "@signe/room": "^2.4.6",
30
+ "@signe/sync": "^2.4.6",
31
31
  "rxjs": "^7.8.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@canvasengine/compiler": "2.0.0-beta.32",
35
- "vite": "^7.1.1",
35
+ "vite": "^7.1.2",
36
36
  "vite-plugin-dts": "^4.5.4",
37
37
  "vitest": "^3.2.4"
38
38
  },
@@ -1,4 +1,4 @@
1
- <Container x y zIndex={y} viewportFollow={isMe} controls onBeforeDestroy>
1
+ <Container x y zIndex={y} viewportFollow={isMe} controls onBeforeDestroy visible={isConnected}>
2
2
  @for (component of componentsBehind) {
3
3
  <Container>
4
4
  <component object />
@@ -48,7 +48,8 @@
48
48
  emitParticleTrigger,
49
49
  particleName,
50
50
  graphics,
51
- hitbox
51
+ hitbox,
52
+ isConnected
52
53
  } = object;
53
54
 
54
55
  const particleSettings = client.particleSettings;
@@ -10,10 +10,14 @@ interface MmorpgOptions {
10
10
  }
11
11
 
12
12
  class BridgeWebsocket extends AbstractWebsocket {
13
- private socket: any;
13
+ private socket: any;
14
+ private privateId: string;
14
15
 
15
16
  constructor(protected context: Context, private options: MmorpgOptions = {}) {
16
17
  super(context);
18
+ const id = localStorage.getItem("rpgjs-user-id") || crypto.randomUUID()
19
+ localStorage.setItem("rpgjs-user-id", id)
20
+ this.privateId = id
17
21
  }
18
22
 
19
23
  async connection(listeners?: (data: any) => void) {
@@ -25,6 +29,7 @@ class BridgeWebsocket extends AbstractWebsocket {
25
29
  this.socket = await connectionRoom({
26
30
  host: this.options.host || window.location.host,
27
31
  room: "lobby-1",
32
+ id: this.privateId
28
33
  }, instance)
29
34
 
30
35
  listeners?.(this.socket)
@@ -45,6 +50,7 @@ class BridgeWebsocket extends AbstractWebsocket {
45
50
  updateProperties({ room }: { room: any }) {
46
51
  this.socket.conn.updateProperties({
47
52
  room: room,
53
+ id: this.privateId,
48
54
  host: this.options.host
49
55
  })
50
56
  }