magicrealmsshared 0.3.8 → 0.3.10
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.
- package/dist/communication/ws.d.ts +11 -1
- package/dist/communication/ws.js +6 -1
- package/dist/types/types.d.ts +14 -0
- package/package.json +1 -1
- package/src/communication/ws.ts +14 -1
- package/src/types/types.ts +18 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Well } from "../types/types";
|
|
1
|
+
import { Auth_Token, Player, Well } from "../types/types";
|
|
2
2
|
export declare const AUTH = "AUTH";
|
|
3
3
|
export declare const AUTH_ACK = "AUTH_ACK";
|
|
4
4
|
export declare const LOGIN_COMMAND = "LOGIN";
|
|
@@ -7,6 +7,16 @@ export type LOGIN_DATA = {
|
|
|
7
7
|
passwordHash: string;
|
|
8
8
|
passwordSalt: string;
|
|
9
9
|
};
|
|
10
|
+
export declare const LOGIN_RESPONSE_COMMAND = "NIGOL";
|
|
11
|
+
export type LOGIN_RESPONSE_DATA<T> = {
|
|
12
|
+
code: number;
|
|
13
|
+
playerData?: Player<T>;
|
|
14
|
+
authToken?: Auth_Token;
|
|
15
|
+
};
|
|
16
|
+
export declare const LOGIN_RESPONSE_CODE_SUCCESS = 0;
|
|
17
|
+
export declare const LOGIN_RESPONSE_CODE_EMAIL_INVALID = 10;
|
|
18
|
+
export declare const LOGIN_RESPONSE_CODE_PASSWORD_INVALID = 20;
|
|
19
|
+
export declare const LOGIN_RESPONSE_CODE_SERVER_ERROR = 1000;
|
|
10
20
|
export declare const DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
11
21
|
export type DATA_UPDATE<T> = {
|
|
12
22
|
wells: Well<T>[];
|
package/dist/communication/ws.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.LOGIN_COMMAND = exports.AUTH_ACK = exports.AUTH = void 0;
|
|
3
|
+
exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.LOGIN_RESPONSE_CODE_SERVER_ERROR = exports.LOGIN_RESPONSE_CODE_PASSWORD_INVALID = exports.LOGIN_RESPONSE_CODE_EMAIL_INVALID = exports.LOGIN_RESPONSE_CODE_SUCCESS = exports.LOGIN_RESPONSE_COMMAND = exports.LOGIN_COMMAND = exports.AUTH_ACK = exports.AUTH = void 0;
|
|
4
4
|
exports.AUTH = "AUTH";
|
|
5
5
|
exports.AUTH_ACK = "AUTH_ACK";
|
|
6
6
|
exports.LOGIN_COMMAND = "LOGIN";
|
|
7
|
+
exports.LOGIN_RESPONSE_COMMAND = "NIGOL";
|
|
8
|
+
exports.LOGIN_RESPONSE_CODE_SUCCESS = 0;
|
|
9
|
+
exports.LOGIN_RESPONSE_CODE_EMAIL_INVALID = 10;
|
|
10
|
+
exports.LOGIN_RESPONSE_CODE_PASSWORD_INVALID = 20;
|
|
11
|
+
exports.LOGIN_RESPONSE_CODE_SERVER_ERROR = 1000;
|
|
7
12
|
exports.DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
8
13
|
exports.POSUPDATE_COMMAND = "POSUPDATE";
|
package/dist/types/types.d.ts
CHANGED
|
@@ -10,6 +10,20 @@ export type WorldObject<T> = ObjectWithId<T> & {
|
|
|
10
10
|
export type Privileges = {
|
|
11
11
|
all?: boolean;
|
|
12
12
|
};
|
|
13
|
+
export type Auth_Token = {
|
|
14
|
+
/**
|
|
15
|
+
* Auth-Token-String
|
|
16
|
+
*
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
s: string;
|
|
20
|
+
/**
|
|
21
|
+
* Expiration
|
|
22
|
+
*
|
|
23
|
+
* @type {Date}
|
|
24
|
+
*/
|
|
25
|
+
e: Date;
|
|
26
|
+
};
|
|
13
27
|
export type Player<T> = ObjectWithId<T> & {
|
|
14
28
|
email: string;
|
|
15
29
|
password: string;
|
package/package.json
CHANGED
package/src/communication/ws.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Well } from "../types/types";
|
|
1
|
+
import { Auth_Token, Player, Well } from "../types/types";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
export const AUTH = "AUTH";
|
|
5
5
|
export const AUTH_ACK = "AUTH_ACK";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
export const LOGIN_COMMAND = "LOGIN";
|
|
9
10
|
export type LOGIN_DATA = {
|
|
10
11
|
email: string;
|
|
@@ -12,6 +13,18 @@ export type LOGIN_DATA = {
|
|
|
12
13
|
passwordSalt: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
export const LOGIN_RESPONSE_COMMAND = "NIGOL";
|
|
17
|
+
export type LOGIN_RESPONSE_DATA<T> = {
|
|
18
|
+
code: number;
|
|
19
|
+
playerData?: Player<T>;
|
|
20
|
+
authToken?: Auth_Token;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const LOGIN_RESPONSE_CODE_SUCCESS = 0;
|
|
24
|
+
export const LOGIN_RESPONSE_CODE_EMAIL_INVALID = 10;
|
|
25
|
+
export const LOGIN_RESPONSE_CODE_PASSWORD_INVALID = 20;
|
|
26
|
+
export const LOGIN_RESPONSE_CODE_SERVER_ERROR = 1000;
|
|
27
|
+
|
|
15
28
|
|
|
16
29
|
export const DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
17
30
|
export type DATA_UPDATE<T> = {
|
package/src/types/types.ts
CHANGED
|
@@ -18,6 +18,24 @@ export type Privileges = {
|
|
|
18
18
|
//TODO: add other privileges as required
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
export type Auth_Token = {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Auth-Token-String
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
s: string,
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Expiration
|
|
33
|
+
*
|
|
34
|
+
* @type {Date}
|
|
35
|
+
*/
|
|
36
|
+
e: Date,
|
|
37
|
+
};
|
|
38
|
+
|
|
21
39
|
export type Player<T> = ObjectWithId<T> & {
|
|
22
40
|
email: string,
|
|
23
41
|
password: string,
|