@ccci/micro-server 1.1.10 → 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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BaseControllerHelper.unit.test.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { Application } from 'express';
2
2
  import Mailer from './Mailer';
3
3
  import BaseSocketHandler from './BaseSocketHandler';
4
- import { ApplicationOptionType } from '@/types/ApplicationOptionType';
4
+ import { ApplicationOptionType } from '../types/ApplicationOptionType';
5
5
  /**
6
6
  * Application Sever class
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { DataTypes, Model } from 'sequelize';
2
2
  import type { ModelAttributes } from "sequelize";
3
3
  import type IBaseModel from './IBaseModel';
4
- import { ModelOptions } from '@/types/BaseModelTypes';
4
+ import { ModelOptions } from '../types/BaseModelTypes';
5
5
  export default class BaseModel extends Model implements IBaseModel {
6
6
  id?: number;
7
7
  /**
@@ -1,6 +1,3 @@
1
- /// <reference types="bun-types" />
2
- /// <reference types="node" />
3
- /// <reference types="bun-types" />
4
1
  import type { Server, ServerWebSocket } from 'bun';
5
2
  export default class BaseSocketHandler {
6
3
  static channel: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * Retrieves the MIME type for a given file name based on its extension.
4
3
  * @param fileName - The name of the file to extract the MIME type for.
@@ -1,4 +1,4 @@
1
- import type { NotificationType, NotificationOptions } from '@/types/NotificationTypes';
1
+ import type { NotificationType, NotificationOptions } from '../types/NotificationTypes';
2
2
  import admin from 'firebase-admin';
3
3
  import { BatchResponse } from 'firebase-admin/lib/messaging/messaging-api';
4
4
  export default class PushNotifier {
@@ -1,8 +1,7 @@
1
- /// <reference types="node" />
2
1
  import { UploadedFile } from 'express-fileupload';
3
2
  import * as minio from 'minio';
4
3
  import { ApplicationOptionType } from '..';
5
- import { UploadedFileType, InitUpload, UploadChunk, CompleteUploadResult, UploadTypes, UploadPart } from '@/types/UploadedFileType';
4
+ import { UploadedFileType, InitUpload, UploadChunk, CompleteUploadResult, UploadTypes, UploadPart } from '../types/UploadedFileType';
6
5
  import { RemoveOptions } from 'minio';
7
6
  export default class Uploader {
8
7
  static client: minio.Client;
@@ -1,5 +1,3 @@
1
- /// <reference types="bun-types" />
2
- /// <reference types="bun-types" />
3
1
  import { ServerWebSocket } from 'bun';
4
2
  import BaseSocketHandler from './BaseSocketHandler';
5
3
  export default class WebSocketServer {
@@ -1,7 +1,6 @@
1
- /// <reference types="node" />
2
- import { ApplicationOptionType } from "@/types/ApplicationOptionType";
1
+ import { ApplicationOptionType } from "../types/ApplicationOptionType";
3
2
  import { S3, DeleteObjectRequest } from "@aws-sdk/client-s3";
4
- import { AttachmentMetadataType } from "@/types/AttachmentMetadataTypes";
3
+ import { AttachmentMetadataType } from "../types/AttachmentMetadataTypes";
5
4
  export default class UploaderS3 {
6
5
  static client: S3;
7
6
  static uploadSessions: Record<string, string>;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.1.10",
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 && bun run build:declaration",
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