tachyon-protocol 0.3.5 → 1.0.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/dist/index.d.ts +196 -180
- package/dist/index.js +28 -41
- package/dist/lobby/joined/response.json +9 -2
- package/dist/lobby/list/response.json +9 -2
- package/dist/lobby/updated/response.json +9 -2
- package/dist/system/connected/response.json +9 -2
- package/dist/user/subscribe/response.json +9 -2
- package/dist/user/updated/response.json +9 -2
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EmptyObject } from 'type-fest';
|
|
1
|
+
import { EmptyObject, KeysOfUnion } from 'type-fest';
|
|
2
2
|
import { ValidateFunction } from 'ajv';
|
|
3
3
|
|
|
4
4
|
declare const tachyonMeta: {
|
|
5
|
-
readonly version: "0.
|
|
5
|
+
readonly version: "1.0.0";
|
|
6
6
|
readonly ids: {
|
|
7
7
|
readonly autohost: {
|
|
8
8
|
readonly slave: readonly ["request", "response"];
|
|
@@ -85,6 +85,22 @@ type EmptyRequestId<S extends ServiceId> = {
|
|
|
85
85
|
type DataRequestId<S extends ServiceId> = {
|
|
86
86
|
[K in EndpointId<S>]: RequestData<S, K> extends EmptyObject ? never : K;
|
|
87
87
|
}[EndpointId<S>];
|
|
88
|
+
type RequestType = {
|
|
89
|
+
[S in keyof Tachyon]: {
|
|
90
|
+
[E in keyof Tachyon[S]]: Tachyon[S][E] extends {
|
|
91
|
+
request: unknown;
|
|
92
|
+
} ? Tachyon[S][E]["request"] : never;
|
|
93
|
+
}[KeysOfUnion<Tachyon[S]>];
|
|
94
|
+
}[KeysOfUnion<Tachyon>];
|
|
95
|
+
type ResponseType = {
|
|
96
|
+
[S in keyof Tachyon]: {
|
|
97
|
+
[E in keyof Tachyon[S]]: Tachyon[S][E] extends {
|
|
98
|
+
response: unknown;
|
|
99
|
+
} ? Tachyon[S][E]["response"] : never;
|
|
100
|
+
}[KeysOfUnion<Tachyon[S]>];
|
|
101
|
+
}[KeysOfUnion<Tachyon>];
|
|
102
|
+
type RequestCommandId = Pick<RequestType, "commandId">;
|
|
103
|
+
type ResponseCommandId = Pick<ResponseType, "commandId">;
|
|
88
104
|
type GenericRequestCommand = {
|
|
89
105
|
commandId: string;
|
|
90
106
|
messageId: string;
|
|
@@ -105,7 +121,7 @@ declare function getValidator<T extends {
|
|
|
105
121
|
commandId: string;
|
|
106
122
|
}>(command: T): ValidateFunction<T>;
|
|
107
123
|
|
|
108
|
-
export { Command, DataRequestId, EmptyRequestId, EndpointId, GenericRequestCommand, GenericResponseCommand, RequestCommand, RequestData, RequestEndpointId, ResponseCommand, ResponseData, ResponseEndpointId, ResponseOnlyEndpointId, ServiceId, SuccessResponseData, getValidator, tachyonMeta };
|
|
124
|
+
export { Command, DataRequestId, EmptyRequestId, EndpointId, GenericRequestCommand, GenericResponseCommand, RequestCommand, RequestCommandId, RequestData, RequestEndpointId, RequestType, ResponseCommand, ResponseCommandId, ResponseData, ResponseEndpointId, ResponseOnlyEndpointId, ResponseType, ServiceId, SuccessResponseData, getValidator, tachyonMeta };
|
|
109
125
|
|
|
110
126
|
export type AutohostSlaveResponse =
|
|
111
127
|
| {
|
|
@@ -367,7 +383,7 @@ export type LobbyJoinedResponse =
|
|
|
367
383
|
userId: string;
|
|
368
384
|
username: string;
|
|
369
385
|
displayName: string;
|
|
370
|
-
avatarUrl: string;
|
|
386
|
+
avatarUrl: string | null;
|
|
371
387
|
clanId: string | null;
|
|
372
388
|
partyId: string | null;
|
|
373
389
|
roles: string[];
|
|
@@ -534,7 +550,7 @@ export type LobbyListResponse =
|
|
|
534
550
|
userId: string;
|
|
535
551
|
username: string;
|
|
536
552
|
displayName: string;
|
|
537
|
-
avatarUrl: string;
|
|
553
|
+
avatarUrl: string | null;
|
|
538
554
|
clanId: string | null;
|
|
539
555
|
partyId: string | null;
|
|
540
556
|
roles: string[];
|
|
@@ -778,7 +794,7 @@ export type LobbyUpdatedResponse =
|
|
|
778
794
|
userId: string;
|
|
779
795
|
username: string;
|
|
780
796
|
displayName: string;
|
|
781
|
-
avatarUrl: string;
|
|
797
|
+
avatarUrl: string | null;
|
|
782
798
|
clanId: string | null;
|
|
783
799
|
partyId: string | null;
|
|
784
800
|
roles: string[];
|
|
@@ -1087,7 +1103,7 @@ export type SystemConnectedResponse =
|
|
|
1087
1103
|
userId: string;
|
|
1088
1104
|
username: string;
|
|
1089
1105
|
displayName: string;
|
|
1090
|
-
avatarUrl: string;
|
|
1106
|
+
avatarUrl: string | null;
|
|
1091
1107
|
clanId: string | null;
|
|
1092
1108
|
partyId: string | null;
|
|
1093
1109
|
roles: string[];
|
|
@@ -1204,7 +1220,7 @@ export type UserSubscribeResponse =
|
|
|
1204
1220
|
userId: string;
|
|
1205
1221
|
username: string;
|
|
1206
1222
|
displayName: string;
|
|
1207
|
-
avatarUrl: string;
|
|
1223
|
+
avatarUrl: string | null;
|
|
1208
1224
|
clanId: string | null;
|
|
1209
1225
|
partyId: string | null;
|
|
1210
1226
|
roles: string[];
|
|
@@ -1297,7 +1313,7 @@ export type UserUpdatedResponse =
|
|
|
1297
1313
|
userId?: string;
|
|
1298
1314
|
username?: string;
|
|
1299
1315
|
displayName?: string;
|
|
1300
|
-
avatarUrl?: string;
|
|
1316
|
+
avatarUrl?: string | null;
|
|
1301
1317
|
clanId?: string | null;
|
|
1302
1318
|
partyId?: string | null;
|
|
1303
1319
|
roles?: string[];
|
|
@@ -1671,173 +1687,8 @@ export interface UserUnsubscribeRequest {
|
|
|
1671
1687
|
userIds: string[];
|
|
1672
1688
|
};
|
|
1673
1689
|
}
|
|
1674
|
-
export
|
|
1675
|
-
|
|
1676
|
-
export interface TachyonBattleContender {
|
|
1677
|
-
playerId: number;
|
|
1678
|
-
teamId: number;
|
|
1679
|
-
color: string;
|
|
1680
|
-
bonus: number;
|
|
1681
|
-
inGame: boolean;
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
export type TachyonBattlePlayer = {
|
|
1685
|
-
playerId: number;
|
|
1686
|
-
teamId: number;
|
|
1687
|
-
color: string;
|
|
1688
|
-
bonus: number;
|
|
1689
|
-
inGame: boolean;
|
|
1690
|
-
} & {
|
|
1691
|
-
isSpectator: false;
|
|
1692
|
-
isBot: false;
|
|
1693
|
-
ready: boolean;
|
|
1694
|
-
sync: {
|
|
1695
|
-
engine: number;
|
|
1696
|
-
game: number;
|
|
1697
|
-
map: number;
|
|
1698
|
-
};
|
|
1699
|
-
};
|
|
1700
|
-
|
|
1701
|
-
export interface TachyonBattleSpectator {
|
|
1702
|
-
isSpectator: true;
|
|
1703
|
-
isBot: false;
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
export interface TachyonBot {
|
|
1707
|
-
playerId: number;
|
|
1708
|
-
teamId: number;
|
|
1709
|
-
color: string;
|
|
1710
|
-
bonus: number;
|
|
1711
|
-
inGame: boolean;
|
|
1712
|
-
isSpectator: false;
|
|
1713
|
-
isBot: true;
|
|
1714
|
-
ownerId: string;
|
|
1715
|
-
aiShortName: string;
|
|
1716
|
-
name: string;
|
|
1717
|
-
aiOptions: {
|
|
1718
|
-
/**
|
|
1719
|
-
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
1720
|
-
* via the `patternProperty` "^(.*)$".
|
|
1721
|
-
*/
|
|
1722
|
-
[k: string]: unknown;
|
|
1723
|
-
};
|
|
1724
|
-
faction: string;
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
export type TachyonBattleStatus =
|
|
1728
|
-
| ({
|
|
1729
|
-
battleId: string;
|
|
1730
|
-
} & (
|
|
1731
|
-
| ({
|
|
1732
|
-
playerId: number;
|
|
1733
|
-
teamId: number;
|
|
1734
|
-
color: string;
|
|
1735
|
-
bonus: number;
|
|
1736
|
-
inGame: boolean;
|
|
1737
|
-
} & {
|
|
1738
|
-
isSpectator: false;
|
|
1739
|
-
isBot: false;
|
|
1740
|
-
ready: boolean;
|
|
1741
|
-
sync: {
|
|
1742
|
-
engine: number;
|
|
1743
|
-
game: number;
|
|
1744
|
-
map: number;
|
|
1745
|
-
};
|
|
1746
|
-
})
|
|
1747
|
-
| {
|
|
1748
|
-
isSpectator: true;
|
|
1749
|
-
isBot: false;
|
|
1750
|
-
}
|
|
1751
|
-
))
|
|
1752
|
-
| null;
|
|
1753
|
-
|
|
1754
|
-
export type TachyonUserStatus = "offline" | "menu" | "playing" | "lobby";
|
|
1755
|
-
|
|
1756
|
-
export interface TachyonUser {
|
|
1757
|
-
userId: string;
|
|
1758
|
-
username: string;
|
|
1759
|
-
displayName: string;
|
|
1760
|
-
avatarUrl: string;
|
|
1761
|
-
clanId: string | null;
|
|
1762
|
-
partyId: string | null;
|
|
1763
|
-
roles: string[];
|
|
1764
|
-
countryCode?: string;
|
|
1765
|
-
status: "offline" | "menu" | "playing" | "lobby";
|
|
1766
|
-
battleStatus:
|
|
1767
|
-
| ({
|
|
1768
|
-
battleId: string;
|
|
1769
|
-
} & (
|
|
1770
|
-
| ({
|
|
1771
|
-
playerId: number;
|
|
1772
|
-
teamId: number;
|
|
1773
|
-
color: string;
|
|
1774
|
-
bonus: number;
|
|
1775
|
-
inGame: boolean;
|
|
1776
|
-
} & {
|
|
1777
|
-
isSpectator: false;
|
|
1778
|
-
isBot: false;
|
|
1779
|
-
ready: boolean;
|
|
1780
|
-
sync: {
|
|
1781
|
-
engine: number;
|
|
1782
|
-
game: number;
|
|
1783
|
-
map: number;
|
|
1784
|
-
};
|
|
1785
|
-
})
|
|
1786
|
-
| {
|
|
1787
|
-
isSpectator: true;
|
|
1788
|
-
isBot: false;
|
|
1789
|
-
}
|
|
1790
|
-
))
|
|
1791
|
-
| null;
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
export interface TachyonPrivateUser {
|
|
1795
|
-
userId: string;
|
|
1796
|
-
username: string;
|
|
1797
|
-
displayName: string;
|
|
1798
|
-
avatarUrl: string;
|
|
1799
|
-
clanId: string | null;
|
|
1800
|
-
partyId: string | null;
|
|
1801
|
-
roles: string[];
|
|
1802
|
-
countryCode?: string;
|
|
1803
|
-
status: "offline" | "menu" | "playing" | "lobby";
|
|
1804
|
-
battleStatus:
|
|
1805
|
-
| ({
|
|
1806
|
-
battleId: string;
|
|
1807
|
-
} & (
|
|
1808
|
-
| ({
|
|
1809
|
-
playerId: number;
|
|
1810
|
-
teamId: number;
|
|
1811
|
-
color: string;
|
|
1812
|
-
bonus: number;
|
|
1813
|
-
inGame: boolean;
|
|
1814
|
-
} & {
|
|
1815
|
-
isSpectator: false;
|
|
1816
|
-
isBot: false;
|
|
1817
|
-
ready: boolean;
|
|
1818
|
-
sync: {
|
|
1819
|
-
engine: number;
|
|
1820
|
-
game: number;
|
|
1821
|
-
map: number;
|
|
1822
|
-
};
|
|
1823
|
-
})
|
|
1824
|
-
| {
|
|
1825
|
-
isSpectator: true;
|
|
1826
|
-
isBot: false;
|
|
1827
|
-
}
|
|
1828
|
-
))
|
|
1829
|
-
| null;
|
|
1830
|
-
friendIds: string[];
|
|
1831
|
-
outgoingFriendRequestIds: string[];
|
|
1832
|
-
incomingFriendRequestIds: string[];
|
|
1833
|
-
ignoreIds: string[];
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
export interface TachyonRect {
|
|
1837
|
-
x: number;
|
|
1838
|
-
y: number;
|
|
1839
|
-
width: number;
|
|
1840
|
-
height: number;
|
|
1690
|
+
export interface TachyonAutohostStatus {
|
|
1691
|
+
gameStartTime: number | null;
|
|
1841
1692
|
}
|
|
1842
1693
|
|
|
1843
1694
|
export interface TachyonBattle {
|
|
@@ -1894,7 +1745,7 @@ export interface TachyonBattle {
|
|
|
1894
1745
|
userId: string;
|
|
1895
1746
|
username: string;
|
|
1896
1747
|
displayName: string;
|
|
1897
|
-
avatarUrl: string;
|
|
1748
|
+
avatarUrl: string | null;
|
|
1898
1749
|
clanId: string | null;
|
|
1899
1750
|
partyId: string | null;
|
|
1900
1751
|
roles: string[];
|
|
@@ -1929,6 +1780,84 @@ export interface TachyonBattle {
|
|
|
1929
1780
|
}[];
|
|
1930
1781
|
}
|
|
1931
1782
|
|
|
1783
|
+
export interface TachyonBattleContender {
|
|
1784
|
+
playerId: number;
|
|
1785
|
+
teamId: number;
|
|
1786
|
+
color: string;
|
|
1787
|
+
bonus: number;
|
|
1788
|
+
inGame: boolean;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
export type TachyonBattlePlayer = {
|
|
1792
|
+
playerId: number;
|
|
1793
|
+
teamId: number;
|
|
1794
|
+
color: string;
|
|
1795
|
+
bonus: number;
|
|
1796
|
+
inGame: boolean;
|
|
1797
|
+
} & {
|
|
1798
|
+
isSpectator: false;
|
|
1799
|
+
isBot: false;
|
|
1800
|
+
ready: boolean;
|
|
1801
|
+
sync: {
|
|
1802
|
+
engine: number;
|
|
1803
|
+
game: number;
|
|
1804
|
+
map: number;
|
|
1805
|
+
};
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
export interface TachyonBattleSpectator {
|
|
1809
|
+
isSpectator: true;
|
|
1810
|
+
isBot: false;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
export type TachyonBattleStatus =
|
|
1814
|
+
| ({
|
|
1815
|
+
battleId: string;
|
|
1816
|
+
} & (
|
|
1817
|
+
| ({
|
|
1818
|
+
playerId: number;
|
|
1819
|
+
teamId: number;
|
|
1820
|
+
color: string;
|
|
1821
|
+
bonus: number;
|
|
1822
|
+
inGame: boolean;
|
|
1823
|
+
} & {
|
|
1824
|
+
isSpectator: false;
|
|
1825
|
+
isBot: false;
|
|
1826
|
+
ready: boolean;
|
|
1827
|
+
sync: {
|
|
1828
|
+
engine: number;
|
|
1829
|
+
game: number;
|
|
1830
|
+
map: number;
|
|
1831
|
+
};
|
|
1832
|
+
})
|
|
1833
|
+
| {
|
|
1834
|
+
isSpectator: true;
|
|
1835
|
+
isBot: false;
|
|
1836
|
+
}
|
|
1837
|
+
))
|
|
1838
|
+
| null;
|
|
1839
|
+
|
|
1840
|
+
export interface TachyonBot {
|
|
1841
|
+
playerId: number;
|
|
1842
|
+
teamId: number;
|
|
1843
|
+
color: string;
|
|
1844
|
+
bonus: number;
|
|
1845
|
+
inGame: boolean;
|
|
1846
|
+
isSpectator: false;
|
|
1847
|
+
isBot: true;
|
|
1848
|
+
ownerId: string;
|
|
1849
|
+
aiShortName: string;
|
|
1850
|
+
name: string;
|
|
1851
|
+
aiOptions: {
|
|
1852
|
+
/**
|
|
1853
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
1854
|
+
* via the `patternProperty` "^(.*)$".
|
|
1855
|
+
*/
|
|
1856
|
+
[k: string]: unknown;
|
|
1857
|
+
};
|
|
1858
|
+
faction: string;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1932
1861
|
export type TachyonCustomBattle = {
|
|
1933
1862
|
battleId: string;
|
|
1934
1863
|
hostId: string;
|
|
@@ -1983,7 +1912,7 @@ export type TachyonCustomBattle = {
|
|
|
1983
1912
|
userId: string;
|
|
1984
1913
|
username: string;
|
|
1985
1914
|
displayName: string;
|
|
1986
|
-
avatarUrl: string;
|
|
1915
|
+
avatarUrl: string | null;
|
|
1987
1916
|
clanId: string | null;
|
|
1988
1917
|
partyId: string | null;
|
|
1989
1918
|
roles: string[];
|
|
@@ -2030,7 +1959,94 @@ export type TachyonCustomBattle = {
|
|
|
2030
1959
|
};
|
|
2031
1960
|
};
|
|
2032
1961
|
|
|
2033
|
-
export interface
|
|
2034
|
-
|
|
1962
|
+
export interface TachyonPrivateUser {
|
|
1963
|
+
userId: string;
|
|
1964
|
+
username: string;
|
|
1965
|
+
displayName: string;
|
|
1966
|
+
avatarUrl: string | null;
|
|
1967
|
+
clanId: string | null;
|
|
1968
|
+
partyId: string | null;
|
|
1969
|
+
roles: string[];
|
|
1970
|
+
countryCode?: string;
|
|
1971
|
+
status: "offline" | "menu" | "playing" | "lobby";
|
|
1972
|
+
battleStatus:
|
|
1973
|
+
| ({
|
|
1974
|
+
battleId: string;
|
|
1975
|
+
} & (
|
|
1976
|
+
| ({
|
|
1977
|
+
playerId: number;
|
|
1978
|
+
teamId: number;
|
|
1979
|
+
color: string;
|
|
1980
|
+
bonus: number;
|
|
1981
|
+
inGame: boolean;
|
|
1982
|
+
} & {
|
|
1983
|
+
isSpectator: false;
|
|
1984
|
+
isBot: false;
|
|
1985
|
+
ready: boolean;
|
|
1986
|
+
sync: {
|
|
1987
|
+
engine: number;
|
|
1988
|
+
game: number;
|
|
1989
|
+
map: number;
|
|
1990
|
+
};
|
|
1991
|
+
})
|
|
1992
|
+
| {
|
|
1993
|
+
isSpectator: true;
|
|
1994
|
+
isBot: false;
|
|
1995
|
+
}
|
|
1996
|
+
))
|
|
1997
|
+
| null;
|
|
1998
|
+
friendIds: string[];
|
|
1999
|
+
outgoingFriendRequestIds: string[];
|
|
2000
|
+
incomingFriendRequestIds: string[];
|
|
2001
|
+
ignoreIds: string[];
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
export interface TachyonRect {
|
|
2005
|
+
x: number;
|
|
2006
|
+
y: number;
|
|
2007
|
+
width: number;
|
|
2008
|
+
height: number;
|
|
2035
2009
|
}
|
|
2036
2010
|
|
|
2011
|
+
export type TachyonUnixTime = number | null;
|
|
2012
|
+
|
|
2013
|
+
export interface TachyonUser {
|
|
2014
|
+
userId: string;
|
|
2015
|
+
username: string;
|
|
2016
|
+
displayName: string;
|
|
2017
|
+
avatarUrl: string | null;
|
|
2018
|
+
clanId: string | null;
|
|
2019
|
+
partyId: string | null;
|
|
2020
|
+
roles: string[];
|
|
2021
|
+
countryCode?: string;
|
|
2022
|
+
status: "offline" | "menu" | "playing" | "lobby";
|
|
2023
|
+
battleStatus:
|
|
2024
|
+
| ({
|
|
2025
|
+
battleId: string;
|
|
2026
|
+
} & (
|
|
2027
|
+
| ({
|
|
2028
|
+
playerId: number;
|
|
2029
|
+
teamId: number;
|
|
2030
|
+
color: string;
|
|
2031
|
+
bonus: number;
|
|
2032
|
+
inGame: boolean;
|
|
2033
|
+
} & {
|
|
2034
|
+
isSpectator: false;
|
|
2035
|
+
isBot: false;
|
|
2036
|
+
ready: boolean;
|
|
2037
|
+
sync: {
|
|
2038
|
+
engine: number;
|
|
2039
|
+
game: number;
|
|
2040
|
+
map: number;
|
|
2041
|
+
};
|
|
2042
|
+
})
|
|
2043
|
+
| {
|
|
2044
|
+
isSpectator: true;
|
|
2045
|
+
isBot: false;
|
|
2046
|
+
}
|
|
2047
|
+
))
|
|
2048
|
+
| null;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
export type TachyonUserStatus = "offline" | "menu" | "playing" | "lobby";
|
|
2052
|
+
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -8,10 +7,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
9
|
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
10
|
var __copyProps = (to, from, except, desc) => {
|
|
16
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -28,7 +23,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
24
|
mod
|
|
30
25
|
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
26
|
|
|
33
27
|
// node_modules/ajv/dist/compile/codegen/code.js
|
|
34
28
|
var require_code = __commonJS({
|
|
@@ -2032,9 +2026,9 @@ var require_subschema = __commonJS({
|
|
|
2032
2026
|
|
|
2033
2027
|
// node_modules/fast-deep-equal/index.js
|
|
2034
2028
|
var require_fast_deep_equal = __commonJS({
|
|
2035
|
-
"node_modules/fast-deep-equal/index.js"(exports,
|
|
2029
|
+
"node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
2036
2030
|
"use strict";
|
|
2037
|
-
|
|
2031
|
+
module.exports = function equal(a, b) {
|
|
2038
2032
|
if (a === b)
|
|
2039
2033
|
return true;
|
|
2040
2034
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
@@ -2077,9 +2071,9 @@ var require_fast_deep_equal = __commonJS({
|
|
|
2077
2071
|
|
|
2078
2072
|
// node_modules/json-schema-traverse/index.js
|
|
2079
2073
|
var require_json_schema_traverse = __commonJS({
|
|
2080
|
-
"node_modules/json-schema-traverse/index.js"(exports,
|
|
2074
|
+
"node_modules/json-schema-traverse/index.js"(exports, module) {
|
|
2081
2075
|
"use strict";
|
|
2082
|
-
var traverse =
|
|
2076
|
+
var traverse = module.exports = function(schema, opts, cb) {
|
|
2083
2077
|
if (typeof opts == "function") {
|
|
2084
2078
|
cb = opts;
|
|
2085
2079
|
opts = {};
|
|
@@ -3085,8 +3079,8 @@ var require_compile = __commonJS({
|
|
|
3085
3079
|
|
|
3086
3080
|
// node_modules/ajv/dist/refs/data.json
|
|
3087
3081
|
var require_data = __commonJS({
|
|
3088
|
-
"node_modules/ajv/dist/refs/data.json"(exports,
|
|
3089
|
-
|
|
3082
|
+
"node_modules/ajv/dist/refs/data.json"(exports, module) {
|
|
3083
|
+
module.exports = {
|
|
3090
3084
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
3091
3085
|
description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
3092
3086
|
type: "object",
|
|
@@ -3104,10 +3098,10 @@ var require_data = __commonJS({
|
|
|
3104
3098
|
|
|
3105
3099
|
// node_modules/uri-js/dist/es5/uri.all.js
|
|
3106
3100
|
var require_uri_all = __commonJS({
|
|
3107
|
-
"node_modules/uri-js/dist/es5/uri.all.js"(exports,
|
|
3101
|
+
"node_modules/uri-js/dist/es5/uri.all.js"(exports, module) {
|
|
3108
3102
|
"use strict";
|
|
3109
3103
|
(function(global, factory) {
|
|
3110
|
-
typeof exports === "object" && typeof
|
|
3104
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global.URI = global.URI || {});
|
|
3111
3105
|
})(exports, function(exports2) {
|
|
3112
3106
|
"use strict";
|
|
3113
3107
|
function merge() {
|
|
@@ -6561,8 +6555,8 @@ var require_discriminator = __commonJS({
|
|
|
6561
6555
|
|
|
6562
6556
|
// node_modules/ajv/dist/refs/json-schema-draft-07.json
|
|
6563
6557
|
var require_json_schema_draft_07 = __commonJS({
|
|
6564
|
-
"node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports,
|
|
6565
|
-
|
|
6558
|
+
"node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) {
|
|
6559
|
+
module.exports = {
|
|
6566
6560
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
6567
6561
|
$id: "http://json-schema.org/draft-07/schema#",
|
|
6568
6562
|
title: "Core schema meta-schema",
|
|
@@ -6718,7 +6712,7 @@ var require_json_schema_draft_07 = __commonJS({
|
|
|
6718
6712
|
|
|
6719
6713
|
// node_modules/ajv/dist/ajv.js
|
|
6720
6714
|
var require_ajv = __commonJS({
|
|
6721
|
-
"node_modules/ajv/dist/ajv.js"(exports,
|
|
6715
|
+
"node_modules/ajv/dist/ajv.js"(exports, module) {
|
|
6722
6716
|
"use strict";
|
|
6723
6717
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6724
6718
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
@@ -6747,7 +6741,7 @@ var require_ajv = __commonJS({
|
|
|
6747
6741
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
|
|
6748
6742
|
}
|
|
6749
6743
|
};
|
|
6750
|
-
|
|
6744
|
+
module.exports = exports = Ajv2;
|
|
6751
6745
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6752
6746
|
exports.default = Ajv2;
|
|
6753
6747
|
var validate_1 = require_validate();
|
|
@@ -7025,7 +7019,7 @@ var require_limit = __commonJS({
|
|
|
7025
7019
|
|
|
7026
7020
|
// node_modules/ajv-formats/dist/index.js
|
|
7027
7021
|
var require_dist = __commonJS({
|
|
7028
|
-
"node_modules/ajv-formats/dist/index.js"(exports,
|
|
7022
|
+
"node_modules/ajv-formats/dist/index.js"(exports, module) {
|
|
7029
7023
|
"use strict";
|
|
7030
7024
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7031
7025
|
var formats_1 = require_formats();
|
|
@@ -7059,23 +7053,15 @@ var require_dist = __commonJS({
|
|
|
7059
7053
|
for (const f of list)
|
|
7060
7054
|
ajv2.addFormat(f, fs2[f]);
|
|
7061
7055
|
}
|
|
7062
|
-
|
|
7056
|
+
module.exports = exports = formatsPlugin;
|
|
7063
7057
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7064
7058
|
exports.default = formatsPlugin;
|
|
7065
7059
|
}
|
|
7066
7060
|
});
|
|
7067
7061
|
|
|
7068
|
-
// src/compiled.ts
|
|
7069
|
-
var compiled_exports = {};
|
|
7070
|
-
__export(compiled_exports, {
|
|
7071
|
-
getValidator: () => getValidator,
|
|
7072
|
-
tachyonMeta: () => tachyonMeta
|
|
7073
|
-
});
|
|
7074
|
-
module.exports = __toCommonJS(compiled_exports);
|
|
7075
|
-
|
|
7076
7062
|
// src/meta.ts
|
|
7077
7063
|
var tachyonMeta = {
|
|
7078
|
-
"version": "0.
|
|
7064
|
+
"version": "1.0.0",
|
|
7079
7065
|
"ids": {
|
|
7080
7066
|
"autohost": {
|
|
7081
7067
|
"slave": [
|
|
@@ -7198,25 +7184,27 @@ var tachyonMeta = {
|
|
|
7198
7184
|
};
|
|
7199
7185
|
|
|
7200
7186
|
// src/validator.ts
|
|
7201
|
-
var import_ajv = __toESM(require_ajv());
|
|
7202
|
-
var import_ajv_formats = __toESM(require_dist());
|
|
7203
|
-
|
|
7204
|
-
|
|
7187
|
+
var import_ajv = __toESM(require_ajv(), 1);
|
|
7188
|
+
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
7189
|
+
import fs from "node:fs";
|
|
7190
|
+
import path, { dirname } from "node:path";
|
|
7191
|
+
import { fileURLToPath } from "url";
|
|
7192
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
7193
|
+
var __dirname = dirname(__filename);
|
|
7205
7194
|
var meta = tachyonMeta;
|
|
7206
7195
|
var validators = /* @__PURE__ */ new Map();
|
|
7207
|
-
var ajv = new import_ajv.default();
|
|
7196
|
+
var ajv = new import_ajv.default.default();
|
|
7208
7197
|
var initialised = false;
|
|
7209
7198
|
function init() {
|
|
7210
7199
|
initialised = true;
|
|
7211
7200
|
import_ajv_formats.default.default(ajv);
|
|
7212
|
-
ajv.addKeyword("
|
|
7213
|
-
ajv.addKeyword("requiresRole");
|
|
7201
|
+
ajv.addKeyword("roles");
|
|
7214
7202
|
for (const serviceId in meta.ids) {
|
|
7215
7203
|
for (const endpointId in meta.ids[serviceId]) {
|
|
7216
7204
|
for (const commandType of meta.ids[serviceId][endpointId]) {
|
|
7217
7205
|
const commandId = `${serviceId}/${endpointId}/${commandType}`;
|
|
7218
|
-
const commandSchemaStr =
|
|
7219
|
-
|
|
7206
|
+
const commandSchemaStr = fs.readFileSync(
|
|
7207
|
+
path.join(__dirname, `./${serviceId}/${endpointId}/${commandType}.json`),
|
|
7220
7208
|
{ encoding: "utf-8" }
|
|
7221
7209
|
);
|
|
7222
7210
|
const commandSchema = JSON.parse(commandSchemaStr);
|
|
@@ -7242,11 +7230,10 @@ function getValidator(command) {
|
|
|
7242
7230
|
}
|
|
7243
7231
|
return validator;
|
|
7244
7232
|
}
|
|
7245
|
-
|
|
7246
|
-
0 && (module.exports = {
|
|
7233
|
+
export {
|
|
7247
7234
|
getValidator,
|
|
7248
7235
|
tachyonMeta
|
|
7249
|
-
}
|
|
7236
|
+
};
|
|
7250
7237
|
/*! Bundled license information:
|
|
7251
7238
|
|
|
7252
7239
|
uri-js/dist/es5/uri.all.js:
|
|
@@ -251,8 +251,15 @@
|
|
|
251
251
|
"type": "string"
|
|
252
252
|
},
|
|
253
253
|
"avatarUrl": {
|
|
254
|
-
"
|
|
255
|
-
|
|
254
|
+
"anyOf": [
|
|
255
|
+
{
|
|
256
|
+
"format": "uri",
|
|
257
|
+
"type": "string"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"type": "null"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
256
263
|
},
|
|
257
264
|
"clanId": {
|
|
258
265
|
"anyOf": [
|
|
@@ -308,8 +308,15 @@
|
|
|
308
308
|
"type": "string"
|
|
309
309
|
},
|
|
310
310
|
"avatarUrl": {
|
|
311
|
-
"
|
|
312
|
-
|
|
311
|
+
"anyOf": [
|
|
312
|
+
{
|
|
313
|
+
"format": "uri",
|
|
314
|
+
"type": "string"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"type": "null"
|
|
318
|
+
}
|
|
319
|
+
]
|
|
313
320
|
},
|
|
314
321
|
"clanId": {
|
|
315
322
|
"anyOf": [
|
|
@@ -237,8 +237,15 @@
|
|
|
237
237
|
"type": "string"
|
|
238
238
|
},
|
|
239
239
|
"avatarUrl": {
|
|
240
|
-
"
|
|
241
|
-
|
|
240
|
+
"anyOf": [
|
|
241
|
+
{
|
|
242
|
+
"format": "uri",
|
|
243
|
+
"type": "string"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"type": "null"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
242
249
|
},
|
|
243
250
|
"clanId": {
|
|
244
251
|
"anyOf": [
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tachyon-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "nodemon --watch src/** --ext ts --ignore src/meta.ts --exec npm run build",
|
|
7
|
-
"build": "
|
|
8
|
+
"build": "npx tsx src/index.ts",
|
|
8
9
|
"tidy": "npm run lint && npm run format",
|
|
9
10
|
"lint": "eslint . --ext .ts --fix",
|
|
10
11
|
"format": "prettier --write src/**/*.ts",
|