@warpfx/server 0.2.1 → 0.3.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 +118 -164
- package/dist/index.js +29 -29
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -66,10 +66,20 @@ interface ColumnDef {
|
|
|
66
66
|
/** Default value for this column when inserting a row without it. */
|
|
67
67
|
default?: unknown;
|
|
68
68
|
}
|
|
69
|
+
/** Table access mode for client sync. */
|
|
70
|
+
type AccessMode = "private" | "public";
|
|
69
71
|
/** Table definition in a warp.schema.json. */
|
|
70
72
|
interface TableDef {
|
|
71
73
|
/** Column definitions keyed by column name. */
|
|
72
74
|
columns: Record<string, ColumnDef>;
|
|
75
|
+
/**
|
|
76
|
+
* Client access mode — controls automatic sync to players.
|
|
77
|
+
*
|
|
78
|
+
* - `"private"` — Only the owning player receives their rows (scope = primary key).
|
|
79
|
+
* - `"public"` — All connected players receive all rows.
|
|
80
|
+
* - Omitted — Server-only, not synced to clients.
|
|
81
|
+
*/
|
|
82
|
+
access?: AccessMode;
|
|
73
83
|
}
|
|
74
84
|
/** The full warp.schema.json format. */
|
|
75
85
|
interface WarpSchema {
|
|
@@ -84,22 +94,22 @@ interface WarpSchema {
|
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
/**
|
|
87
|
-
* @
|
|
97
|
+
* @warpfx/server — Server-side SDK for Warp module development.
|
|
88
98
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
99
|
+
* Clean, minimal API for building FiveM server features with Warp.
|
|
100
|
+
* All calls delegate to the Warp core via FiveM resource exports.
|
|
91
101
|
*
|
|
92
102
|
* Usage:
|
|
93
|
-
* import {
|
|
103
|
+
* import { action, fn, command, error, table } from '@warpfx/server';
|
|
104
|
+
* import { accounts } from './db'; // auto-generated from schema
|
|
94
105
|
*
|
|
95
|
-
*
|
|
96
|
-
* const
|
|
97
|
-
*
|
|
98
|
-
* provide('economy', new EconomyService());
|
|
106
|
+
* action('deposit', async (player, { amount }) => {
|
|
107
|
+
* const account = accounts.find(player.citizenId);
|
|
108
|
+
* accounts.update(player.citizenId, { balance: account.balance + amount });
|
|
99
109
|
* });
|
|
100
110
|
*/
|
|
101
|
-
/** Player
|
|
102
|
-
interface
|
|
111
|
+
/** Player context passed to action/function handlers. */
|
|
112
|
+
interface Player {
|
|
103
113
|
/** FiveM server-side player ID. */
|
|
104
114
|
source: number;
|
|
105
115
|
/** Citizen ID (license identifier). */
|
|
@@ -124,216 +134,160 @@ interface PlayerRow {
|
|
|
124
134
|
type PlayerState = "connecting" | "connected" | "spawned";
|
|
125
135
|
/** Player entity with ECS component access. */
|
|
126
136
|
interface PlayerEntity {
|
|
127
|
-
/** FiveM server-side player ID. */
|
|
128
137
|
readonly source: number;
|
|
129
|
-
/** Citizen ID (license identifier). */
|
|
130
138
|
readonly citizenId: string;
|
|
131
|
-
/** Display name. */
|
|
132
139
|
readonly name: string;
|
|
133
|
-
/** Discord identifier (e.g. "discord:123456789"), if linked. */
|
|
134
140
|
readonly discordId: string | undefined;
|
|
135
|
-
/** Steam identifier (e.g. "steam:110000..."), if linked. */
|
|
136
141
|
readonly steamId: string | undefined;
|
|
137
|
-
/** Current lifecycle state. */
|
|
138
142
|
readonly state: PlayerState;
|
|
139
|
-
/** Get a component attached to this player. */
|
|
140
143
|
getComponent<T>(component: string): T | undefined;
|
|
141
|
-
/** Attach or replace a component on this player. */
|
|
142
144
|
setComponent<T>(component: string, data: T): void;
|
|
143
|
-
/** Check if this player has a specific component. */
|
|
144
145
|
hasComponent(component: string): boolean;
|
|
145
|
-
/** Remove a component from this player. */
|
|
146
146
|
removeComponent(component: string): boolean;
|
|
147
147
|
}
|
|
148
148
|
/** Typed event bus for server-side and network communication. */
|
|
149
149
|
interface ServerEventBus<TMap extends Record<string, any> = Record<string, any>> {
|
|
150
|
-
/** Subscribe to a local event. Returns an unsubscribe function. */
|
|
151
150
|
on<K extends string & keyof TMap>(event: K, handler: (data: TMap[K]) => void): () => void;
|
|
152
|
-
/** Unsubscribe from a local event. */
|
|
153
151
|
off<K extends string & keyof TMap>(event: K, handler: (data: TMap[K]) => void): void;
|
|
154
|
-
/** Emit a local event to all subscribers. */
|
|
155
152
|
emit<K extends string & keyof TMap>(event: K, data: TMap[K]): void;
|
|
156
|
-
/** Send an event to a specific client. */
|
|
157
153
|
emitClient<K extends string & keyof TMap>(event: K, target: number, data: TMap[K]): void;
|
|
158
|
-
/** Broadcast an event to all connected clients. */
|
|
159
154
|
emitAllClients<K extends string & keyof TMap>(event: K, data: TMap[K]): void;
|
|
160
|
-
/** Listen for events from clients. Returns an unsubscribe function. */
|
|
161
155
|
onClient<K extends string & keyof TMap>(event: K, handler: (source: number, data: TMap[K]) => void): () => void;
|
|
162
|
-
/** Unsubscribe from a client event. */
|
|
163
156
|
offClient<K extends string & keyof TMap>(event: K, handler: (source: number, data: TMap[K]) => void): void;
|
|
164
157
|
}
|
|
165
158
|
/** ECS-inspired entity component store. */
|
|
166
159
|
interface EntityStore {
|
|
167
|
-
/** Attach a component to an entity. */
|
|
168
160
|
attach<T>(entityId: string, component: string, data: T): void;
|
|
169
|
-
/** Get a component from an entity. Returns undefined if not found. */
|
|
170
161
|
get<T>(entityId: string, component: string): T | undefined;
|
|
171
|
-
/** Remove a component from an entity. */
|
|
172
162
|
detach(entityId: string, component: string): boolean;
|
|
173
|
-
/** Remove all components for an entity. */
|
|
174
163
|
removeEntity(entityId: string): void;
|
|
175
|
-
/** Check if an entity has a specific component. */
|
|
176
164
|
has(entityId: string, component: string): boolean;
|
|
177
|
-
/** Iterate all entities that have a specific component. */
|
|
178
165
|
query<T>(component: string): IterableIterator<[string, T]>;
|
|
179
166
|
}
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
/** Get the shared event bus instance. */
|
|
193
|
-
declare function getEvents<TMap extends Record<string, any> = Record<string, any>>(): ServerEventBus<TMap>;
|
|
194
|
-
/** Get the shared entity component store. */
|
|
195
|
-
declare function getEntities(): EntityStore;
|
|
196
|
-
/** Find a player by citizenId from the database cache. */
|
|
197
|
-
declare function getPlayer(citizenId: string): PlayerRow | null;
|
|
198
|
-
/** Get all cached players. */
|
|
199
|
-
declare function getPlayers(): PlayerRow[];
|
|
200
|
-
/**
|
|
201
|
-
* Get the player entity for a citizenId.
|
|
202
|
-
* Returns the entity with lifecycle state and component access.
|
|
203
|
-
*/
|
|
204
|
-
declare function getEntity(citizenId: string): PlayerEntity | null;
|
|
205
|
-
/**
|
|
206
|
-
* Transition a player to the "spawned" state.
|
|
207
|
-
* Call after character selection (e.g. from a multichar module).
|
|
208
|
-
* Fires all onPlayerSpawned hooks.
|
|
209
|
-
*/
|
|
210
|
-
declare function spawnPlayer(citizenId: string): void;
|
|
211
|
-
/** Register a callback for when a player connects (database confirmed). */
|
|
212
|
-
declare function onPlayerConnect(cb: (player: PlayerEventContext) => void): void;
|
|
213
|
-
/** Register a callback for when a player spawns (character selected). */
|
|
214
|
-
declare function onPlayerSpawned(cb: (player: PlayerEventContext) => void): void;
|
|
215
|
-
/** Register a callback for when a player disconnects. */
|
|
216
|
-
declare function onPlayerDisconnect(cb: (player: PlayerEventContext) => void): void;
|
|
217
|
-
/**
|
|
218
|
-
* Get the database bridge for direct table and reducer access.
|
|
219
|
-
* Advanced — most modules should use the event bus and DI instead.
|
|
220
|
-
*/
|
|
221
|
-
declare function getBridge(): any;
|
|
222
|
-
/** Subscribe to database tables. Call inside onReady(). */
|
|
223
|
-
declare function subscribe(queries: string[]): Promise<void>;
|
|
224
|
-
/** Sync configuration for a table. */
|
|
225
|
-
interface SyncConfig {
|
|
226
|
-
/** Who receives updates for this table. */
|
|
227
|
-
to: "owner" | "all";
|
|
228
|
-
/** Column name for owner filtering (required when to: 'owner'). */
|
|
229
|
-
scope?: string;
|
|
230
|
-
/** Primary key column for row identity (defaults to 'id'). */
|
|
231
|
-
key?: string;
|
|
167
|
+
/** Table handle for typed database operations. */
|
|
168
|
+
interface Table<T = any> {
|
|
169
|
+
/** Find a row by primary key. */
|
|
170
|
+
find(primaryKey: any): T | null;
|
|
171
|
+
/** Get all rows in the table. */
|
|
172
|
+
all(): T[];
|
|
173
|
+
/** Insert a new row. */
|
|
174
|
+
insert(data: T): Promise<void>;
|
|
175
|
+
/** Update an existing row by primary key (partial update). */
|
|
176
|
+
update(primaryKey: any, data: Partial<T>): Promise<void>;
|
|
177
|
+
/** Delete a row by primary key. */
|
|
178
|
+
delete(primaryKey: any): Promise<void>;
|
|
232
179
|
}
|
|
233
|
-
/**
|
|
234
|
-
interface
|
|
235
|
-
/** FiveM server-side player ID. */
|
|
236
|
-
source: number;
|
|
237
|
-
/** Player's citizen ID (license identifier). */
|
|
238
|
-
citizenId: string;
|
|
239
|
-
/** Player's display name. */
|
|
180
|
+
/** Parameter hint shown in command autocomplete. */
|
|
181
|
+
interface CommandParam {
|
|
240
182
|
name: string;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
183
|
+
help?: string;
|
|
184
|
+
}
|
|
185
|
+
/** Options for command(). */
|
|
186
|
+
interface CommandOptions {
|
|
187
|
+
description?: string;
|
|
188
|
+
ace?: string;
|
|
189
|
+
canUse?: (source: number) => boolean;
|
|
190
|
+
params?: CommandParam[];
|
|
191
|
+
}
|
|
192
|
+
/** Action error received from the server. */
|
|
193
|
+
interface ActionError {
|
|
194
|
+
action: string;
|
|
195
|
+
code: string;
|
|
196
|
+
message: string;
|
|
249
197
|
}
|
|
250
|
-
/** Action handler function. */
|
|
251
|
-
type ActionHandler = (ctx: ActionContext, payload: any) => Promise<void> | void;
|
|
252
|
-
/** Server function handler — returns a value back to the caller. */
|
|
253
|
-
type FunctionHandler<T = any> = (ctx: ActionContext, payload: any) => Promise<T> | T;
|
|
254
198
|
/**
|
|
255
|
-
* Register
|
|
199
|
+
* Register an action handler that clients can invoke.
|
|
256
200
|
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
201
|
+
* Actions are fire-and-forget mutations — the client sends data,
|
|
202
|
+
* the server validates and mutates, state syncs back automatically.
|
|
259
203
|
*
|
|
260
204
|
* @example
|
|
261
|
-
*
|
|
262
|
-
*
|
|
205
|
+
* action('deposit', async (player, { amount }) => {
|
|
206
|
+
* const account = accounts.find(player.citizenId);
|
|
207
|
+
* accounts.update(player.citizenId, { balance: account.balance + amount });
|
|
208
|
+
* });
|
|
263
209
|
*/
|
|
264
|
-
declare function
|
|
210
|
+
declare function action(name: string, handler: (player: Player, payload: any) => Promise<void> | void): void;
|
|
265
211
|
/**
|
|
266
|
-
* Register
|
|
212
|
+
* Register a server function that clients can call and await a result.
|
|
267
213
|
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
214
|
+
* Unlike actions (fire-and-forget), functions return a value to the caller.
|
|
215
|
+
* Use for request/response patterns like data fetches or validations.
|
|
270
216
|
*
|
|
271
217
|
* @example
|
|
272
|
-
*
|
|
273
|
-
*
|
|
218
|
+
* fn('getBalance', async (player, { targetId }) => {
|
|
219
|
+
* const account = accounts.find(targetId);
|
|
220
|
+
* return { balance: account?.balance ?? 0 };
|
|
274
221
|
* });
|
|
275
222
|
*/
|
|
276
|
-
declare function
|
|
223
|
+
declare function fn<T = any>(name: string, handler: (player: Player, payload: any) => Promise<T> | T): void;
|
|
277
224
|
/**
|
|
278
|
-
* Register a
|
|
279
|
-
*
|
|
280
|
-
* Unlike actions (fire-and-forget mutations), functions return a value
|
|
281
|
-
* to the caller. Use for request/response patterns like data fetches,
|
|
282
|
-
* calculations, or validations that need a result.
|
|
225
|
+
* Register a chat command with optional autocomplete.
|
|
283
226
|
*
|
|
284
227
|
* @example
|
|
285
|
-
*
|
|
286
|
-
* const account =
|
|
287
|
-
*
|
|
228
|
+
* command('balance', (player) => {
|
|
229
|
+
* const account = accounts.find(player.citizenId);
|
|
230
|
+
* player.notify(`Balance: $${account.balance}`);
|
|
288
231
|
* });
|
|
232
|
+
*
|
|
233
|
+
* command('give', {
|
|
234
|
+
* description: 'Give money to a player',
|
|
235
|
+
* params: [{ name: 'id' }, { name: 'amount' }],
|
|
236
|
+
* }, (player, args) => { ... });
|
|
289
237
|
*/
|
|
290
|
-
declare function
|
|
238
|
+
declare function command(name: string, handlerOrOptions: CommandOptions | ((player: Player, args: string[], raw: string) => void), handler?: (player: Player, args: string[], raw: string) => void): void;
|
|
291
239
|
/**
|
|
292
|
-
*
|
|
293
|
-
*
|
|
240
|
+
* Create an error to throw from action/function handlers.
|
|
241
|
+
* The error is sent back to the client with a structured code and message.
|
|
294
242
|
*
|
|
295
243
|
* @example
|
|
296
|
-
* throw
|
|
244
|
+
* throw error('NO_ACCOUNT', 'No account found');
|
|
297
245
|
*/
|
|
298
|
-
declare
|
|
299
|
-
code: string;
|
|
300
|
-
constructor(code: string, message?: string);
|
|
301
|
-
}
|
|
302
|
-
/** Parameter hint shown in command autocomplete. */
|
|
303
|
-
interface CommandParam {
|
|
304
|
-
/** Parameter name displayed in the suggestion (e.g. "id", "reason"). */
|
|
305
|
-
name: string;
|
|
306
|
-
/** Optional help text for the parameter. */
|
|
307
|
-
help?: string;
|
|
308
|
-
}
|
|
309
|
-
/** Options for registerCommand(). */
|
|
310
|
-
interface CommandOptions {
|
|
311
|
-
/** Short description shown in autocomplete. */
|
|
312
|
-
description?: string;
|
|
313
|
-
/** ACE permission required — players without it won't see the command. */
|
|
314
|
-
ace?: string;
|
|
315
|
-
/** Custom permission predicate (overrides ace check when provided). */
|
|
316
|
-
canUse?: (source: number) => boolean;
|
|
317
|
-
/** Parameter hints shown in autocomplete. */
|
|
318
|
-
params?: CommandParam[];
|
|
319
|
-
}
|
|
246
|
+
declare function error(code: string, message?: string): Error;
|
|
320
247
|
/**
|
|
321
|
-
*
|
|
248
|
+
* Get a table handle for database operations.
|
|
322
249
|
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* command arguments.
|
|
250
|
+
* The table name must be the full prefixed name (e.g. 'economy_accounts').
|
|
251
|
+
* For auto-generated handles with types, use the generated `db.ts` instead.
|
|
326
252
|
*
|
|
327
253
|
* @example
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* params: [{ name: 'id', help: 'Player server ID' }],
|
|
332
|
-
* }, (source, args) => {
|
|
333
|
-
* const targetId = parseInt(args[0], 10);
|
|
334
|
-
* // ...
|
|
335
|
-
* });
|
|
254
|
+
* const accounts = table<Account>('economy_accounts');
|
|
255
|
+
* const account = accounts.find(citizenId);
|
|
256
|
+
* await accounts.update(citizenId, { balance: 500 });
|
|
336
257
|
*/
|
|
337
|
-
declare function
|
|
258
|
+
declare function table<T = any>(name: string): Table<T>;
|
|
259
|
+
/**
|
|
260
|
+
* Register a callback to run when Warp is fully booted.
|
|
261
|
+
* If Warp is already ready, the callback fires immediately.
|
|
262
|
+
*/
|
|
263
|
+
declare function onReady(cb: () => void): void;
|
|
264
|
+
/** Check if Warp has finished booting. */
|
|
265
|
+
declare function isReady(): boolean;
|
|
266
|
+
/** Register a service that other modules can resolve via use(). */
|
|
267
|
+
declare function provide<T>(token: string, service: T): void;
|
|
268
|
+
/** Resolve a service registered by another module. */
|
|
269
|
+
declare function use<T = unknown>(token: string): T;
|
|
270
|
+
/** Get the shared event bus instance. */
|
|
271
|
+
declare function getEvents<TMap extends Record<string, any> = Record<string, any>>(): ServerEventBus<TMap>;
|
|
272
|
+
/** Get the shared entity component store. */
|
|
273
|
+
declare function getEntities(): EntityStore;
|
|
274
|
+
/** Find a player by citizenId from the database cache. */
|
|
275
|
+
declare function getPlayer(citizenId: string): PlayerRow | null;
|
|
276
|
+
/** Get all cached players. */
|
|
277
|
+
declare function getPlayers(): PlayerRow[];
|
|
278
|
+
/** Get the player entity for a citizenId. */
|
|
279
|
+
declare function getEntity(citizenId: string): PlayerEntity | null;
|
|
280
|
+
/** Transition a player to the "spawned" state. */
|
|
281
|
+
declare function spawnPlayer(citizenId: string): void;
|
|
282
|
+
/** Register a callback for when a player connects. */
|
|
283
|
+
declare function onPlayerConnect(cb: (player: Player) => void): void;
|
|
284
|
+
/** Register a callback for when a player spawns. */
|
|
285
|
+
declare function onPlayerSpawned(cb: (player: Player) => void): void;
|
|
286
|
+
/** Register a callback for when a player disconnects. */
|
|
287
|
+
declare function onPlayerDisconnect(cb: (player: Player) => void): void;
|
|
288
|
+
/** Get the database bridge for direct table and reducer access. */
|
|
289
|
+
declare function getBridge(): any;
|
|
290
|
+
/** Subscribe to database tables. */
|
|
291
|
+
declare function subscribe(queries: string[]): Promise<void>;
|
|
338
292
|
|
|
339
|
-
export { type
|
|
293
|
+
export { type AccessMode, type ActionError, type ColumnDef, type ColumnType, type CommandOptions, type CommandParam, type EntityStore, type Player, type PlayerEntity, type PlayerRow, type PlayerState, type ServerEventBus, type Table, type TableDef, type WarpSchema, action, command, error, fn, getBridge, getEntities, getEntity, getEvents, getPlayer, getPlayers, isReady, onPlayerConnect, onPlayerDisconnect, onPlayerSpawned, onReady, provide, spawnPlayer, subscribe, table, use };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
|
|
23
|
+
action: () => action,
|
|
24
|
+
command: () => command,
|
|
25
|
+
error: () => error,
|
|
26
|
+
fn: () => fn,
|
|
24
27
|
getBridge: () => getBridge,
|
|
25
28
|
getEntities: () => getEntities,
|
|
26
29
|
getEntity: () => getEntity,
|
|
@@ -33,18 +36,34 @@ __export(index_exports, {
|
|
|
33
36
|
onPlayerSpawned: () => onPlayerSpawned,
|
|
34
37
|
onReady: () => onReady,
|
|
35
38
|
provide: () => provide,
|
|
36
|
-
registerAction: () => registerAction,
|
|
37
|
-
registerCommand: () => registerCommand,
|
|
38
|
-
registerFunction: () => registerFunction,
|
|
39
|
-
registerSync: () => registerSync,
|
|
40
39
|
spawnPlayer: () => spawnPlayer,
|
|
41
40
|
subscribe: () => subscribe,
|
|
41
|
+
table: () => table,
|
|
42
42
|
use: () => use
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
45
|
function warp() {
|
|
46
46
|
return globalThis.exports["warp"];
|
|
47
47
|
}
|
|
48
|
+
function action(name, handler) {
|
|
49
|
+
warp().action(name, handler);
|
|
50
|
+
}
|
|
51
|
+
function fn(name, handler) {
|
|
52
|
+
warp().fn(name, handler);
|
|
53
|
+
}
|
|
54
|
+
function command(name, handlerOrOptions, handler) {
|
|
55
|
+
if (typeof handlerOrOptions === "function") {
|
|
56
|
+
warp().command(name, {}, handlerOrOptions);
|
|
57
|
+
} else {
|
|
58
|
+
warp().command(name, handlerOrOptions, handler);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function error(code, message) {
|
|
62
|
+
return warp().error(code, message);
|
|
63
|
+
}
|
|
64
|
+
function table(name) {
|
|
65
|
+
return warp().table(name);
|
|
66
|
+
}
|
|
48
67
|
function onReady(cb) {
|
|
49
68
|
warp().onReady(cb);
|
|
50
69
|
}
|
|
@@ -90,28 +109,12 @@ function getBridge() {
|
|
|
90
109
|
function subscribe(queries) {
|
|
91
110
|
return warp().subscribe(queries);
|
|
92
111
|
}
|
|
93
|
-
function registerSync(table, config) {
|
|
94
|
-
warp().registerSync(table, config);
|
|
95
|
-
}
|
|
96
|
-
function registerAction(name, handler) {
|
|
97
|
-
warp().registerAction(name, handler);
|
|
98
|
-
}
|
|
99
|
-
function registerFunction(name, handler) {
|
|
100
|
-
warp().registerFunction(name, handler);
|
|
101
|
-
}
|
|
102
|
-
var WarpError = class extends Error {
|
|
103
|
-
constructor(code, message) {
|
|
104
|
-
super(message ?? code);
|
|
105
|
-
this.code = code;
|
|
106
|
-
this.name = "WarpError";
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
function registerCommand(name, options, handler) {
|
|
110
|
-
warp().registerCommand(name, options, handler);
|
|
111
|
-
}
|
|
112
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
113
113
|
0 && (module.exports = {
|
|
114
|
-
|
|
114
|
+
action,
|
|
115
|
+
command,
|
|
116
|
+
error,
|
|
117
|
+
fn,
|
|
115
118
|
getBridge,
|
|
116
119
|
getEntities,
|
|
117
120
|
getEntity,
|
|
@@ -124,11 +127,8 @@ function registerCommand(name, options, handler) {
|
|
|
124
127
|
onPlayerSpawned,
|
|
125
128
|
onReady,
|
|
126
129
|
provide,
|
|
127
|
-
registerAction,
|
|
128
|
-
registerCommand,
|
|
129
|
-
registerFunction,
|
|
130
|
-
registerSync,
|
|
131
130
|
spawnPlayer,
|
|
132
131
|
subscribe,
|
|
132
|
+
table,
|
|
133
133
|
use
|
|
134
134
|
});
|