@ccci/micro-server 1.1.12 → 1.1.13
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/decorators/Endpoints.d.ts +6 -2
- package/dist/index.js +109800 -103001
- package/dist/test/BaseControllerHelper.unit.test.d.ts +2 -0
- package/dist/utils/BaseSocketHandler.d.ts +0 -3
- package/dist/utils/Mixins.d.ts +0 -1
- package/dist/utils/Uploader.d.ts +0 -1
- package/dist/utils/WebSocketServer.d.ts +0 -2
- package/dist/utils/uploader-s3.d.ts +0 -1
- package/package.json +2 -2
- package/dist/utils/BaseRedis.d.ts +0 -36
- package/dist/utils/BaseRedisConnector.d.ts +0 -10
- package/dist/utils/RedisQueryHelper.d.ts +0 -38
package/dist/utils/Mixins.d.ts
CHANGED
package/dist/utils/Uploader.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccci/micro-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"description": "A collection of Commom Backend Utility Classes",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "bun build --target=node ./src/index.ts --outfile=dist/index.js
|
|
10
|
+
"build": "bun build --target=node ./src/index.ts --outfile=dist/index.js",
|
|
11
11
|
"build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json",
|
|
12
12
|
"postbuild": "rimraf tsconfig.types.tsbuildinfo",
|
|
13
13
|
"release": "bun run build && git add . && git commit -m 'release' && git push && npm version patch && npm publish"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { RedisClientType } from "redis";
|
|
2
|
-
import { BaseRedisConnector } from "./BaseRedisConnector";
|
|
3
|
-
import { type PaginatedResult, type QueryOptions } from "./RedisQueryHelper";
|
|
4
|
-
export declare class BaseRedis extends BaseRedisConnector {
|
|
5
|
-
private clientReady?;
|
|
6
|
-
protected constructor();
|
|
7
|
-
protected ready: () => Promise<RedisClientType>;
|
|
8
|
-
private chunk;
|
|
9
|
-
/**
|
|
10
|
-
* Bounded, index-driven collection sync:
|
|
11
|
-
* - Stores IDs in a sorted set (score from scoreSelector)
|
|
12
|
-
* - Stores each item in a per-item hash
|
|
13
|
-
* - Trims oldest items beyond maxItems and unlinks their hashes
|
|
14
|
-
*/
|
|
15
|
-
protected syncIndexedCollection: <T>(params: {
|
|
16
|
-
items: T[];
|
|
17
|
-
idSelector: (item: T) => string | number;
|
|
18
|
-
scoreSelector: (item: T) => number | Date;
|
|
19
|
-
indexKey: string;
|
|
20
|
-
itemPrefix: string;
|
|
21
|
-
maxItems: number;
|
|
22
|
-
ttlSeconds?: number;
|
|
23
|
-
batchSize?: number;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Read indexed collection into memory (bounded by maxItems).
|
|
27
|
-
* Applies QueryHelper for search/sort/paginate.
|
|
28
|
-
*/
|
|
29
|
-
protected getIndexedItems: <T>(params: {
|
|
30
|
-
indexKey: string;
|
|
31
|
-
itemPrefix: string;
|
|
32
|
-
options?: QueryOptions;
|
|
33
|
-
defaultSearchFields?: string[];
|
|
34
|
-
}) => Promise<T[] | PaginatedResult<T>>;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=BaseRedis.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type RedisClientType } from "redis";
|
|
2
|
-
export declare class BaseRedisConnector {
|
|
3
|
-
private static client;
|
|
4
|
-
private static connectPromise;
|
|
5
|
-
protected client: RedisClientType;
|
|
6
|
-
protected constructor();
|
|
7
|
-
ensureConnected(): Promise<void>;
|
|
8
|
-
disconnect(): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=BaseRedisConnector.d.ts.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export type QueryOptions = {
|
|
2
|
-
forceRefresh?: boolean;
|
|
3
|
-
paginate?: boolean;
|
|
4
|
-
limit?: number;
|
|
5
|
-
page?: number;
|
|
6
|
-
sort?: string;
|
|
7
|
-
search?: string;
|
|
8
|
-
fulltext?: boolean;
|
|
9
|
-
defaultSearchFields?: string[];
|
|
10
|
-
};
|
|
11
|
-
export type PaginatedResult<T> = {
|
|
12
|
-
rows: T[];
|
|
13
|
-
count: number;
|
|
14
|
-
meta: {
|
|
15
|
-
total: number;
|
|
16
|
-
limit: number;
|
|
17
|
-
page: number;
|
|
18
|
-
totalPages: number;
|
|
19
|
-
hasNextPage: boolean;
|
|
20
|
-
hasPrevPage: boolean;
|
|
21
|
-
sort: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type SearchOptions = {
|
|
25
|
-
fulltext?: boolean;
|
|
26
|
-
defaultFields?: string[];
|
|
27
|
-
};
|
|
28
|
-
export declare class QueryHelper {
|
|
29
|
-
private static getFieldValue;
|
|
30
|
-
private static buildHaystack;
|
|
31
|
-
private static matchesSearch;
|
|
32
|
-
static filterBySearch<T>(items: T[], search: string, options?: SearchOptions): T[];
|
|
33
|
-
static sort<T>(items: T[], sort: string): T[];
|
|
34
|
-
static paginate<T>(items: T[], limit: number, page: number, sort: string): PaginatedResult<T>;
|
|
35
|
-
static applyQuery<T>(items: T[], options?: QueryOptions): T[] | PaginatedResult<T>;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=RedisQueryHelper.d.ts.map
|