@armoury/fivem-framework-server 1.0.38 → 1.0.41
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/cjs/server/index.js +2 -1
- package/dist/cjs/server/models/index.js +0 -16
- package/dist/cjs/server/services/blips/blip.service.js +31 -0
- package/dist/cjs/server/services/index.js +2 -0
- package/dist/cjs/shared/models/index.js +1 -0
- package/dist/cjs/shared/models/stub.js +2 -0
- package/dist/esm/server/index.js +3 -2
- package/dist/esm/server/models/index.js +1 -1
- package/dist/esm/server/services/blips/blip.service.js +28 -0
- package/dist/esm/server/services/index.js +2 -0
- package/dist/esm/shared/models/index.js +1 -0
- package/dist/esm/shared/models/stub.js +1 -0
- package/dist/types/server/index.d.ts +0 -1
- package/dist/types/server/models/index.d.ts +0 -1
- package/dist/types/server/services/blips/blip.service.d.ts +10 -0
- package/dist/types/server/services/index.d.ts +2 -0
- package/dist/types/shared/models/index.d.ts +1 -0
- package/dist/types/shared/models/stub.d.ts +19 -0
- package/package.json +2 -2
package/dist/cjs/server/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
|
|
|
22
22
|
const services_1 = require("./services");
|
|
23
23
|
exports.SERVER_LAZY_PROVIDERS = [];
|
|
24
24
|
exports.SERVER_EAGER_PROVIDERS = [
|
|
25
|
+
services_1.Blip,
|
|
25
26
|
services_1.SessionService,
|
|
26
27
|
services_1.PickupService,
|
|
27
28
|
];
|
|
@@ -29,5 +30,5 @@ async function bootstrap(_class, options = {}) {
|
|
|
29
30
|
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);
|
|
30
31
|
}
|
|
31
32
|
__exportStar(require("./services"), exports);
|
|
32
|
-
|
|
33
|
+
// export * from './models';
|
|
33
34
|
__exportStar(require("@armoury/fivem-framework-common"), exports);
|
|
@@ -1,17 +1 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./session"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Blip = void 0;
|
|
10
|
+
const injection_js_1 = require("injection-js");
|
|
11
|
+
let Blip = class Blip {
|
|
12
|
+
static createLocalized(x, y, z, localizationKey, options) {
|
|
13
|
+
const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey });
|
|
14
|
+
return this.create(x, y, z, newOptions);
|
|
15
|
+
}
|
|
16
|
+
static create(x, y, z, options) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
|
|
19
|
+
const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
|
|
20
|
+
const blipId = lastBlipId + 1;
|
|
21
|
+
this._blipIds.push(blipId);
|
|
22
|
+
Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_b = options.localizationKey) !== null && _b !== void 0 ? _b : undefined);
|
|
23
|
+
Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
|
|
24
|
+
return blipId;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.Blip = Blip;
|
|
28
|
+
Blip._blipIds = [];
|
|
29
|
+
exports.Blip = Blip = __decorate([
|
|
30
|
+
(0, injection_js_1.Injectable)()
|
|
31
|
+
], Blip);
|
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/** Blips */
|
|
18
|
+
__exportStar(require("./blips/blip.service"), exports);
|
|
17
19
|
/** Session */
|
|
18
20
|
__exportStar(require("./session/session.service"), exports);
|
|
19
21
|
/** Pickups */
|
|
@@ -16,6 +16,7 @@ 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
|
+
__exportStar(require("./stub"), exports);
|
|
19
20
|
/** Session */
|
|
20
21
|
__exportStar(require("./session"), exports);
|
|
21
22
|
__exportStar(require("./session-update-type"), exports);
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference path = "../ambient.declarations.d.ts" />
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import { bootstrapWithProviders } from '@armoury/fivem-framework-common';
|
|
4
|
-
import { PickupService, SessionService } from './services';
|
|
4
|
+
import { Blip, PickupService, SessionService } from './services';
|
|
5
5
|
export const SERVER_LAZY_PROVIDERS = [];
|
|
6
6
|
export const SERVER_EAGER_PROVIDERS = [
|
|
7
|
+
Blip,
|
|
7
8
|
SessionService,
|
|
8
9
|
PickupService,
|
|
9
10
|
];
|
|
@@ -11,5 +12,5 @@ export async function bootstrap(_class, options = {}) {
|
|
|
11
12
|
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);
|
|
12
13
|
}
|
|
13
14
|
export * from './services';
|
|
14
|
-
export * from './models';
|
|
15
|
+
// export * from './models';
|
|
15
16
|
export * from '@armoury/fivem-framework-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from 'injection-js';
|
|
8
|
+
let Blip = class Blip {
|
|
9
|
+
static createLocalized(x, y, z, localizationKey, options) {
|
|
10
|
+
const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey });
|
|
11
|
+
return this.create(x, y, z, newOptions);
|
|
12
|
+
}
|
|
13
|
+
static create(x, y, z, options) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
|
|
16
|
+
const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
|
|
17
|
+
const blipId = lastBlipId + 1;
|
|
18
|
+
this._blipIds.push(blipId);
|
|
19
|
+
Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_b = options.localizationKey) !== null && _b !== void 0 ? _b : undefined);
|
|
20
|
+
Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
|
|
21
|
+
return blipId;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
Blip._blipIds = [];
|
|
25
|
+
Blip = __decorate([
|
|
26
|
+
Injectable()
|
|
27
|
+
], Blip);
|
|
28
|
+
export { Blip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './session';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class Blip {
|
|
2
|
+
private static _blipIds;
|
|
3
|
+
static createLocalized(x: number, y: number, z: number, localizationKey: string, options?: Omit<BlipCreateOptions, 'localizationKey'>): number;
|
|
4
|
+
static create(x: number, y: number, z: number, options?: BlipCreateOptions): number;
|
|
5
|
+
}
|
|
6
|
+
type BlipCreateOptions = {
|
|
7
|
+
localizationKey?: string;
|
|
8
|
+
toPlayerId?: number;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point for libraries that add model-specific fields to `Stub<T>`.
|
|
3
|
+
*
|
|
4
|
+
* Add one uniquely named property per model in a module augmentation. Each
|
|
5
|
+
* property should contain the model type and the fields added to its stub.
|
|
6
|
+
*/
|
|
7
|
+
export interface StubFieldRegistry {
|
|
8
|
+
}
|
|
9
|
+
type RegisteredStubFields<T> = {
|
|
10
|
+
[K in keyof StubFieldRegistry]: StubFieldRegistry[K] extends {
|
|
11
|
+
model: infer Model;
|
|
12
|
+
fields: infer Fields;
|
|
13
|
+
} ? T extends Model ? Fields : never : never;
|
|
14
|
+
}[keyof StubFieldRegistry];
|
|
15
|
+
/** A lightweight reference to a model, extended by registered model fields. */
|
|
16
|
+
export type Stub<T> = {
|
|
17
|
+
id?: number;
|
|
18
|
+
} & ([RegisteredStubFields<T>] extends [never] ? {} : RegisteredStubFields<T>);
|
|
19
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armoury/fivem-framework-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
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,7 +27,7 @@
|
|
|
27
27
|
"rxjs": "^7.8.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@armoury/fivem-framework-common": "1.0.
|
|
30
|
+
"@armoury/fivem-framework-common": "1.0.41"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|