@armoury/fivem-framework-server 1.0.7 → 1.0.9

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.
@@ -22,6 +22,7 @@ const core_1 = require("@mikro-orm/core");
22
22
  const injection_js_1 = require("injection-js");
23
23
  const default_entities_1 = require("./services/session/default-entities");
24
24
  const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
25
+ const path = require('node:path');
25
26
  exports.SERVER_PROVIDERS = [
26
27
  {
27
28
  provide: 'sessionItems',
@@ -64,7 +65,7 @@ async function Server_Init(_class, ...providers) {
64
65
  const database = (_a = Cfx.Server.GetConvar('mysql_connection_string', '').split(';')
65
66
  .find((item) => item.startsWith('database='))) === null || _a === void 0 ? void 0 : _a.split('=').slice(-1)[0];
66
67
  const test = await core_1.MikroORM.init({
67
- baseDir: __dirname + '/../..',
68
+ baseDir: path.resolve(Cfx.Server.GetResourcePath(Cfx.Server.GetCurrentResourceName()), '../..'),
68
69
  entities: [default_entities_1.Character],
69
70
  // entitiesTs: ['./src/**/*.entity.ts'],
70
71
  dbName: database,
@@ -4,6 +4,7 @@ import { MikroORM } from '@mikro-orm/core';
4
4
  import { ReflectiveInjector } from 'injection-js';
5
5
  import { Character, SessionAccountId, SessionCash, SessionHoursPlayed, SessionId, SessionLanguage, SessionLastLocation, SessionName } from './services/session/default-entities';
6
6
  import { Decorate } from '@armoury/fivem-framework-common';
7
+ const path = require('node:path');
7
8
  export const SERVER_PROVIDERS = [
8
9
  {
9
10
  provide: 'sessionItems',
@@ -46,7 +47,7 @@ export async function Server_Init(_class, ...providers) {
46
47
  const database = (_a = Cfx.Server.GetConvar('mysql_connection_string', '').split(';')
47
48
  .find((item) => item.startsWith('database='))) === null || _a === void 0 ? void 0 : _a.split('=').slice(-1)[0];
48
49
  const test = await MikroORM.init({
49
- baseDir: __dirname + '/../..',
50
+ baseDir: path.resolve(Cfx.Server.GetResourcePath(Cfx.Server.GetCurrentResourceName()), '../..'),
50
51
  entities: [Character],
51
52
  // entitiesTs: ['./src/**/*.entity.ts'],
52
53
  dbName: database,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-framework-server",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
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",
@@ -20,13 +20,16 @@
20
20
  "build:types": "tsc -p tsconfig.types.json && node ../../tools/move_ambientdeclaration.js server"
21
21
  },
22
22
  "dependencies": {
23
- "@armoury/fivem-framework-common": "1.0.7",
24
- "@mikro-orm/core": "^6.2.9",
25
- "@mikro-orm/mysql": "^6.2.9",
23
+ "@armoury/fivem-framework-common": "1.0.9",
26
24
  "injection-js": "^2.4.0",
27
25
  "reflect-metadata": "^0.2.1",
28
26
  "rxjs": "^7.8.1"
29
27
  },
28
+ "peerDependencies": {
29
+ "@armoury/fivem-framework-common": "1.0.7",
30
+ "@mikro-orm/core": "^6.2.9",
31
+ "@mikro-orm/mysql": "^6.2.9"
32
+ },
30
33
  "publishConfig": {
31
34
  "access": "public"
32
35
  }