@4players/odin-common 2.5.0 → 2.7.0
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/lib/cjs/plugin/api.js +11 -1
- package/lib/esm/plugin/api.js +10 -0
- package/lib/plugin/api.d.ts +18 -4
- package/package.json +1 -1
package/lib/cjs/plugin/api.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MinDBFS = void 0;
|
|
3
|
+
exports.Backend = exports.MinDBFS = void 0;
|
|
4
4
|
exports.MinDBFS = -758.596;
|
|
5
|
+
var Backend;
|
|
6
|
+
(function (Backend) {
|
|
7
|
+
let PeerCipherStatus;
|
|
8
|
+
(function (PeerCipherStatus) {
|
|
9
|
+
PeerCipherStatus[PeerCipherStatus["InvalidPassword"] = -1] = "InvalidPassword";
|
|
10
|
+
PeerCipherStatus[PeerCipherStatus["Unknown"] = 0] = "Unknown";
|
|
11
|
+
PeerCipherStatus[PeerCipherStatus["Unecrypted"] = 1] = "Unecrypted";
|
|
12
|
+
PeerCipherStatus[PeerCipherStatus["Encrypted"] = 2] = "Encrypted";
|
|
13
|
+
})(PeerCipherStatus = Backend.PeerCipherStatus || (Backend.PeerCipherStatus = {}));
|
|
14
|
+
})(Backend || (exports.Backend = Backend = {}));
|
package/lib/esm/plugin/api.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
1
|
export const MinDBFS = -758.596;
|
|
2
|
+
export var Backend;
|
|
3
|
+
(function (Backend) {
|
|
4
|
+
let PeerCipherStatus;
|
|
5
|
+
(function (PeerCipherStatus) {
|
|
6
|
+
PeerCipherStatus[PeerCipherStatus["InvalidPassword"] = -1] = "InvalidPassword";
|
|
7
|
+
PeerCipherStatus[PeerCipherStatus["Unknown"] = 0] = "Unknown";
|
|
8
|
+
PeerCipherStatus[PeerCipherStatus["Unecrypted"] = 1] = "Unecrypted";
|
|
9
|
+
PeerCipherStatus[PeerCipherStatus["Encrypted"] = 2] = "Encrypted";
|
|
10
|
+
})(PeerCipherStatus = Backend.PeerCipherStatus || (Backend.PeerCipherStatus = {}));
|
|
11
|
+
})(Backend || (Backend = {}));
|
package/lib/plugin/api.d.ts
CHANGED
|
@@ -36,11 +36,12 @@ export declare namespace Backend {
|
|
|
36
36
|
readonly roomId?: string;
|
|
37
37
|
readonly userData?: Uint8Array;
|
|
38
38
|
readonly position?: [number, number, number];
|
|
39
|
-
readonly cipher?:
|
|
39
|
+
readonly cipher?: SetupCipherSettings;
|
|
40
40
|
readonly onEvent: OnEvent;
|
|
41
41
|
}
|
|
42
42
|
interface Room {
|
|
43
43
|
readonly token: string;
|
|
44
|
+
readonly cipher: Cipher | undefined;
|
|
44
45
|
request(method: string, properties: unknown): Promise<unknown>;
|
|
45
46
|
link(media: Media): Promise<void>;
|
|
46
47
|
unlink(media: Media): void;
|
|
@@ -105,8 +106,21 @@ export declare namespace Backend {
|
|
|
105
106
|
transientSuppressor: boolean;
|
|
106
107
|
gainController: boolean;
|
|
107
108
|
}
|
|
108
|
-
type
|
|
109
|
+
type SetupCipherSettings = {
|
|
109
110
|
type: 'OdinCrypto';
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
} & OdinCryptoSettings;
|
|
112
|
+
type CipherSettings = OdinCryptoSettings;
|
|
113
|
+
interface OdinCryptoSettings {
|
|
114
|
+
password: string | null;
|
|
115
|
+
}
|
|
116
|
+
enum PeerCipherStatus {
|
|
117
|
+
InvalidPassword = -1,
|
|
118
|
+
Unknown = 0,
|
|
119
|
+
Unecrypted = 1,
|
|
120
|
+
Encrypted = 2
|
|
121
|
+
}
|
|
122
|
+
interface Cipher {
|
|
123
|
+
configure(settings: CipherSettings): void;
|
|
124
|
+
getPeerStatus(peerId: number): PeerCipherStatus;
|
|
125
|
+
}
|
|
112
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|