@armoury/fivem-framework-common 1.0.22 → 1.0.23

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.
@@ -48,17 +48,28 @@ var EVENT_DIRECTIONS;
48
48
  })(EVENT_DIRECTIONS || (exports.EVENT_DIRECTIONS = EVENT_DIRECTIONS = {}));
49
49
  // TODO: Refactor this, so resources can add to it
50
50
  exports.DEFAULT_EVENTS = {
51
- onAccountAuthenticate: 'authentication:account-success',
51
+ /** Session */
52
+ onPlayerSessionCreated: 'armoury:session-created',
53
+ onPlayerSessionUpdated: 'armoury:session-updated',
54
+ onPlayerSessionDestroyed: 'armoury:session-destroyed',
55
+ /** Authentication */
56
+ onAuthenticationCreated: 'armoury:account-authentication-created',
57
+ onAuthenticationDestroyed: 'armoury:account-authentication-destroyed',
58
+ /** Connection */
52
59
  onPlayerConnect: 'playerJoining',
53
- onPlayerDeath: 'armoury:onPlayerDeath',
54
- onPlayerAuthenticate: 'authentication:player-authenticated',
55
- onPlayerLogout: 'armoury:player-logout',
56
60
  onPlayerDisconnect: 'playerDropped',
57
- onResourceStop: 'onResourceStop',
58
- onContextMenuItemPressed: 'armoury-overlay:context-menu-item-pressed',
61
+ /** Vehicle */
59
62
  onPlayerEnterVehicle: 'armoury:onPlayerEnterVehicle',
60
63
  onPlayerExitVehicle: 'armoury:onPlayerExitVehicle',
61
- onPlayerClientsidedCacheLoaded: 'armoury:player-resource-cache-loaded',
62
64
  onPlayerStartTowVehicle: 'armoury:onPlayerStartTowVehicle',
63
65
  onPlayerStopTowVehicle: 'armoury:onPlayerStopTowVehicle',
66
+ /** Native */
67
+ onResourceStop: 'onResourceStop',
68
+ /** Other */
69
+ onAccountAuthenticate: 'authentication:account-success',
70
+ onPlayerDeath: 'armoury:onPlayerDeath',
71
+ onPlayerAuthenticate: 'authentication:player-authenticated',
72
+ onPlayerLogout: 'armoury:player-logout',
73
+ onContextMenuItemPressed: 'armoury-overlay:context-menu-item-pressed',
74
+ onPlayerClientsidedCacheLoaded: 'armoury:player-resource-cache-loaded',
64
75
  };
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account"), exports);
18
18
  __exportStar(require("./character"), exports);
19
+ /** Session */
19
20
  __exportStar(require("./session"), exports);
21
+ __exportStar(require("./session-update-type"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionUpdateType = void 0;
4
+ var SessionUpdateType;
5
+ (function (SessionUpdateType) {
6
+ SessionUpdateType[SessionUpdateType["PrincipalUpdate"] = 0] = "PrincipalUpdate";
7
+ })(SessionUpdateType || (exports.SessionUpdateType = SessionUpdateType = {}));
@@ -6,7 +6,7 @@ class Session {
6
6
  this.id = id;
7
7
  this.platformId = platformId;
8
8
  this.lastKnownName = lastKnownName;
9
- this.principal = principal !== null && principal !== void 0 ? principal : id;
9
+ this.principal = principal;
10
10
  }
11
11
  }
12
12
  exports.Session = Session;
@@ -43,17 +43,28 @@ export var EVENT_DIRECTIONS;
43
43
  })(EVENT_DIRECTIONS || (EVENT_DIRECTIONS = {}));
44
44
  // TODO: Refactor this, so resources can add to it
45
45
  export const DEFAULT_EVENTS = {
46
- onAccountAuthenticate: 'authentication:account-success',
46
+ /** Session */
47
+ onPlayerSessionCreated: 'armoury:session-created',
48
+ onPlayerSessionUpdated: 'armoury:session-updated',
49
+ onPlayerSessionDestroyed: 'armoury:session-destroyed',
50
+ /** Authentication */
51
+ onAuthenticationCreated: 'armoury:account-authentication-created',
52
+ onAuthenticationDestroyed: 'armoury:account-authentication-destroyed',
53
+ /** Connection */
47
54
  onPlayerConnect: 'playerJoining',
48
- onPlayerDeath: 'armoury:onPlayerDeath',
49
- onPlayerAuthenticate: 'authentication:player-authenticated',
50
- onPlayerLogout: 'armoury:player-logout',
51
55
  onPlayerDisconnect: 'playerDropped',
52
- onResourceStop: 'onResourceStop',
53
- onContextMenuItemPressed: 'armoury-overlay:context-menu-item-pressed',
56
+ /** Vehicle */
54
57
  onPlayerEnterVehicle: 'armoury:onPlayerEnterVehicle',
55
58
  onPlayerExitVehicle: 'armoury:onPlayerExitVehicle',
56
- onPlayerClientsidedCacheLoaded: 'armoury:player-resource-cache-loaded',
57
59
  onPlayerStartTowVehicle: 'armoury:onPlayerStartTowVehicle',
58
60
  onPlayerStopTowVehicle: 'armoury:onPlayerStopTowVehicle',
61
+ /** Native */
62
+ onResourceStop: 'onResourceStop',
63
+ /** Other */
64
+ onAccountAuthenticate: 'authentication:account-success',
65
+ onPlayerDeath: 'armoury:onPlayerDeath',
66
+ onPlayerAuthenticate: 'authentication:player-authenticated',
67
+ onPlayerLogout: 'armoury:player-logout',
68
+ onContextMenuItemPressed: 'armoury-overlay:context-menu-item-pressed',
69
+ onPlayerClientsidedCacheLoaded: 'armoury:player-resource-cache-loaded',
59
70
  };
@@ -1,3 +1,5 @@
1
1
  export * from './account';
2
2
  export * from './character';
3
+ /** Session */
3
4
  export * from './session';
5
+ export * from './session-update-type';
@@ -0,0 +1,4 @@
1
+ export var SessionUpdateType;
2
+ (function (SessionUpdateType) {
3
+ SessionUpdateType[SessionUpdateType["PrincipalUpdate"] = 0] = "PrincipalUpdate";
4
+ })(SessionUpdateType || (SessionUpdateType = {}));
@@ -3,6 +3,6 @@ export class Session {
3
3
  this.id = id;
4
4
  this.platformId = platformId;
5
5
  this.lastKnownName = lastKnownName;
6
- this.principal = principal !== null && principal !== void 0 ? principal : id;
6
+ this.principal = principal;
7
7
  }
8
8
  }
@@ -1,3 +1,5 @@
1
1
  export * from './account';
2
2
  export * from './character';
3
+ /** Session */
3
4
  export * from './session';
5
+ export * from './session-update-type';
@@ -0,0 +1,3 @@
1
+ export declare enum SessionUpdateType {
2
+ PrincipalUpdate = 0
3
+ }
@@ -2,11 +2,12 @@ export interface Session {
2
2
  readonly id: number;
3
3
  readonly platformId: string;
4
4
  readonly lastKnownName: string;
5
- principal: number;
5
+ principal?: number;
6
6
  }
7
7
  export declare class Session {
8
8
  readonly id: number;
9
9
  readonly platformId: string;
10
10
  readonly lastKnownName: string;
11
- constructor(id: number, platformId: string, lastKnownName: string, principal?: number);
11
+ principal?: number | undefined;
12
+ constructor(id: number, platformId: string, lastKnownName: string, principal?: number | undefined);
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-framework-common",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "Shared APIs for the Armoury FiveM framework",
5
5
  "main": "dist/cjs/common/index.js",
6
6
  "module": "dist/esm/common/index.js",