@prestizni-software/server-dem 0.2.54 → 0.2.55

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.2.55](https://github.com/Prestizni-Software/server-dem/compare/v0.2.54...v0.2.55) (2025-11-18)
6
+
5
7
  ### [0.2.54](https://github.com/Prestizni-Software/server-dem/compare/v0.2.53...v0.2.54) (2025-11-18)
6
8
 
7
9
  ### [0.2.53](https://github.com/Prestizni-Software/server-dem/compare/v0.2.52...v0.2.53) (2025-11-18)
@@ -0,0 +1,64 @@
1
+ import EventEmitter from "eventemitter3";
2
+ import { ObjectId } from "bson";
3
+ import "reflect-metadata";
4
+ type RefType = string | ObjectId;
5
+ export type EventEmitter3 = EventEmitter;
6
+ export type AutoProps<T> = {
7
+ readonly [K in keyof T]: T[K];
8
+ };
9
+ export type InstanceOf<T> = T extends Constructor<infer I> ? I : T;
10
+ export type Constructor<T> = new (...args: any[]) => T;
11
+ export type UnboxConstructor<T> = T extends new (...args: any[]) => infer I ? I : T;
12
+ export type LoggersType = {
13
+ info: (...args: any[]) => void;
14
+ debug: (...args: any[]) => void;
15
+ error: (...args: any[]) => void;
16
+ warn?: (...args: any[]) => void;
17
+ };
18
+ export type LoggersTypeInternal = LoggersType & {
19
+ warn: (...args: any[]) => void;
20
+ };
21
+ export type IsData<T> = T extends {
22
+ _id: any;
23
+ } ? T : never;
24
+ export type ServerResponse<T> = {
25
+ data: T;
26
+ message: string;
27
+ success: true;
28
+ } | {
29
+ data?: null;
30
+ message: string;
31
+ success: false;
32
+ };
33
+ export type ServerUpdateResponse<T> = {
34
+ data: Partial<IsData<T>>;
35
+ message: string;
36
+ success: true;
37
+ updateId: string;
38
+ };
39
+ export type ServerUpdateRequest<T> = {
40
+ _id: RefType;
41
+ key: string;
42
+ value: any;
43
+ };
44
+ export declare function classProp(target: any, propertyKey: string): void;
45
+ export declare function classRef(where: string): (target: any, propertyKey: string) => void;
46
+ export type Pretty<T> = {
47
+ [K in keyof T]: T[K];
48
+ };
49
+ export type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
50
+ export type StripPrototypePrefix<P extends string> = P extends "prototype" ? never : P extends `prototype.${infer Rest}` ? Rest : P;
51
+ export type Recurseable<T> = T extends object ? T extends Array<any> | Function ? never : T : never;
52
+ export type Join<K extends string, P extends string> = `${K}.${P}`;
53
+ export type OnlyClassKeys<T> = {
54
+ [K in keyof T]: K;
55
+ }[keyof T] & string;
56
+ export type Split<S extends string> = S extends `${infer L}.${infer R}` ? [L, ...Split<R>] : [S];
57
+ export type NonOptional<T> = Exclude<T, null | undefined>;
58
+ export type Paths<T, Depth extends number = 5, OriginalDepth extends number = Depth> = Depth extends never ? never : {
59
+ [K in OnlyClassKeys<NonOptional<T>>]: K extends "_id" ? StripPrototypePrefix<`${K}`> : StripPrototypePrefix<PathsHelper<K, NonOptional<T>[K], Depth, OriginalDepth>>;
60
+ }[OnlyClassKeys<NonOptional<T>>];
61
+ export type PathsHelper<K extends string, V, Depth extends number, OriginalDepth extends number> = Recurseable<V> extends never ? `${K}` : `${K}` | Join<K, Paths<V, Prev[Depth], OriginalDepth>>;
62
+ export type PathValue<T, Parts extends string[], Depth extends number = 5> = Depth extends 0 ? never : T extends unknown ? Parts extends [infer K, ...infer Rest] ? K extends string ? K extends keyof T ? Rest extends string[] ? Rest["length"] extends 0 ? T[K] : PathValue<T[K], Rest, Prev[Depth]> : never : never : never : T : never;
63
+ export type PathValueOf<T, P extends string, Depth extends number = 6> = PathValue<InstanceOf<T>, Split<P>, Depth>;
64
+ export {};
package/CommonTypes.js ADDED
@@ -0,0 +1,12 @@
1
+ import "reflect-metadata";
2
+ export function classProp(target, propertyKey) {
3
+ const props = Reflect.getMetadata("props", target) || [];
4
+ props.push(propertyKey);
5
+ Reflect.defineMetadata("props", props, target);
6
+ }
7
+ export function classRef(where) {
8
+ return function (target, propertyKey) {
9
+ Reflect.defineMetadata("isRef", where, target, propertyKey);
10
+ };
11
+ }
12
+ //# sourceMappingURL=CommonTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonTypes.js","sourceRoot":"","sources":["../CommonTypes.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAC;AAkD1B,MAAM,UAAU,SAAS,CAAC,MAAW,EAAE,WAAmB;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACzD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,UAAU,MAAW,EAAE,WAAmB;QAC/C,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prestizni-software/server-dem",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
4
4
  "description": "An solution for when making http requests is not a good solution",
5
5
  "keywords": [
6
6
  "websockets"