@armoury/fivem-framework-server 1.0.23 → 1.0.24

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.
@@ -19,17 +19,14 @@ exports.SERVER_EAGER_PROVIDERS = exports.SERVER_LAZY_PROVIDERS = void 0;
19
19
  exports.bootstrap = bootstrap;
20
20
  require("reflect-metadata");
21
21
  const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
22
- const database_1 = require("./database/database");
23
22
  const services_1 = require("./services");
24
23
  exports.SERVER_LAZY_PROVIDERS = [];
25
24
  exports.SERVER_EAGER_PROVIDERS = [
26
- database_1.Database.forChild(),
27
25
  services_1.SessionService,
28
26
  ];
29
27
  async function bootstrap(_class, options = {}) {
30
28
  return (0, fivem_framework_common_1.bootstrapWithProviders)(_class, exports.SERVER_LAZY_PROVIDERS, options, undefined, (key, index) => Cfx.Server.GetResourceMetadata(Cfx.Server.GetCurrentResourceName(), key, index), (resourceName) => Cfx.exports[resourceName], exports.SERVER_EAGER_PROVIDERS);
31
29
  }
32
- __exportStar(require("./database"), exports);
33
30
  __exportStar(require("./services"), exports);
34
31
  __exportStar(require("./models"), exports);
35
32
  __exportStar(require("@armoury/fivem-framework-common"), exports);
@@ -16,10 +16,6 @@ exports.SessionService = void 0;
16
16
  const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
17
17
  const injection_js_1 = require("injection-js");
18
18
  let SessionService = class SessionService {
19
- // TODO: Move to AccountsService inside @armoury/fivem-roleplay-gamemode-server
20
- // public constructor(
21
- // private readonly _repository: SessionRepository,
22
- // ) { }
23
19
  constructor(armouryResource) {
24
20
  this.armouryResource = armouryResource;
25
21
  }
@@ -38,6 +34,9 @@ let SessionService = class SessionService {
38
34
  getSessionByPlayerId(playerId) {
39
35
  return this.armouryResource.instance.getSessionByPlayerId(playerId);
40
36
  }
37
+ getSessionByPrincipal(principal) {
38
+ return this.armouryResource.instance.getSessionByPrincipal(principal);
39
+ }
41
40
  setPlayerPrincipal(playerId, principal) {
42
41
  this.armouryResource.instance.setPlayerPrincipal(playerId, principal);
43
42
  }
@@ -1,17 +1,14 @@
1
1
  /// <reference path = "../ambient.declarations.d.ts" />
2
2
  import 'reflect-metadata';
3
3
  import { bootstrapWithProviders } from '@armoury/fivem-framework-common';
4
- import { Database } from './database/database';
5
4
  import { SessionService } from './services';
6
5
  export const SERVER_LAZY_PROVIDERS = [];
7
6
  export const SERVER_EAGER_PROVIDERS = [
8
- Database.forChild(),
9
7
  SessionService,
10
8
  ];
11
9
  export async function bootstrap(_class, options = {}) {
12
10
  return bootstrapWithProviders(_class, SERVER_LAZY_PROVIDERS, options, undefined, (key, index) => Cfx.Server.GetResourceMetadata(Cfx.Server.GetCurrentResourceName(), key, index), (resourceName) => Cfx.exports[resourceName], SERVER_EAGER_PROVIDERS);
13
11
  }
14
- export * from './database';
15
12
  export * from './services';
16
13
  export * from './models';
17
14
  export * from '@armoury/fivem-framework-common';
@@ -13,10 +13,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  import { Resource, ResourceRef } from '@armoury/fivem-framework-common';
14
14
  import { Injectable } from 'injection-js';
15
15
  let SessionService = class SessionService {
16
- // TODO: Move to AccountsService inside @armoury/fivem-roleplay-gamemode-server
17
- // public constructor(
18
- // private readonly _repository: SessionRepository,
19
- // ) { }
20
16
  constructor(armouryResource) {
21
17
  this.armouryResource = armouryResource;
22
18
  }
@@ -35,6 +31,9 @@ let SessionService = class SessionService {
35
31
  getSessionByPlayerId(playerId) {
36
32
  return this.armouryResource.instance.getSessionByPlayerId(playerId);
37
33
  }
34
+ getSessionByPrincipal(principal) {
35
+ return this.armouryResource.instance.getSessionByPrincipal(principal);
36
+ }
38
37
  setPlayerPrincipal(playerId, principal) {
39
38
  this.armouryResource.instance.setPlayerPrincipal(playerId, principal);
40
39
  }
@@ -7,7 +7,6 @@ export declare const SERVER_EAGER_PROVIDERS: Provider[];
7
7
  export declare function bootstrap<T extends {
8
8
  new (...args: any[]): any;
9
9
  } & Provider>(_class: T, options?: BootstrapOptions): Promise<InstanceType<T>>;
10
- export * from './database';
11
10
  export * from './services';
12
11
  export * from './models';
13
12
  export * from '@armoury/fivem-framework-common';
@@ -7,5 +7,6 @@ export declare class SessionService {
7
7
  getAllPlayerPrincipals(): number[];
8
8
  isPlayerConnected(playerId: number): boolean;
9
9
  getSessionByPlayerId(playerId: number): Session;
10
+ getSessionByPrincipal(principal: number): Session;
10
11
  setPlayerPrincipal(playerId: number, principal: number): void;
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-framework-server",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Server APIs for the Armoury FiveM framework",
5
5
  "main": "dist/cjs/server/index.js",
6
6
  "module": "dist/esm/server/index.js",
@@ -27,14 +27,9 @@
27
27
  "rxjs": "^7.8.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@armoury/fivem-framework-common": "1.0.23",
31
- "drizzle-orm": "^0.45.4",
32
- "mysql2": "^3.24.5"
30
+ "@armoury/fivem-framework-common": "1.0.24"
33
31
  },
34
32
  "publishConfig": {
35
33
  "access": "public"
36
- },
37
- "devDependencies": {
38
- "drizzle-kit": "^0.31.11"
39
34
  }
40
35
  }