@feasibleone/blong 1.12.1 → 1.12.2

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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.12.2](https://github.com/feasibleone/blong/compare/blong-v1.12.1...blong-v1.12.2) (2026-03-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * types and remove duplicated code ([cb5eb2b](https://github.com/feasibleone/blong/commit/cb5eb2bc7898cee6256317667a39d95e05186316))
9
+
3
10
  ## [1.12.1](https://github.com/feasibleone/blong/compare/blong-v1.12.0...blong-v1.12.1) (2026-03-15)
4
11
 
5
12
 
package/dist/types.d.ts CHANGED
@@ -10,7 +10,7 @@ import { Duplex } from 'node:stream';
10
10
  import { Level, LogFn, Logger as PinoLogger } from 'pino';
11
11
  import { Readable, Writable } from 'stream';
12
12
  import { ConnectionOptions as ConnectionOptions_2, TLSSocket, TLSSocketOptions } from 'tls';
13
- import { Static, TArray, TBoolean, TFunction, TNever, TObject, TSchema, TString, Type } from 'typebox';
13
+ import { Static, TArray, TBoolean, TFunction, TNever, TNumber, TObject, TSchema, TString, TUnknown, Type } from 'typebox';
14
14
 
15
15
  export type Method = "GET" | "POST" | "PUT" | "DELETE";
16
16
  export interface RequestArgs {
@@ -17625,16 +17625,16 @@ export type RemoteMethod = (...params: unknown[]) => Promise<unknown>;
17625
17625
  export interface IRemote {
17626
17626
  remote: (methodName: string, options?: object) => RemoteMethod;
17627
17627
  dispatch: (...params: unknown[]) => boolean | Promise<unknown>;
17628
- start: () => Promise<void>;
17629
- stop: () => Promise<void>;
17628
+ start: () => Promise<IRemote>;
17629
+ stop: () => Promise<IRemote>;
17630
17630
  }
17631
17631
  export interface IRpcServer {
17632
17632
  register: (methods: object, namespace: string, reply: boolean, pkg: {
17633
17633
  version: string;
17634
17634
  }) => void;
17635
17635
  unregister: (methods: string[], namespace: string, reply: boolean) => void;
17636
- start: () => Promise<void>;
17637
- stop: () => Promise<void>;
17636
+ start: () => Promise<IRpcServer>;
17637
+ stop: () => Promise<IRpcServer>;
17638
17638
  }
17639
17639
  export interface ILocal {
17640
17640
  register: (methods: object, namespace: string, reply: boolean, pkg: {
@@ -17647,7 +17647,8 @@ export interface ILocal {
17647
17647
  }
17648
17648
  export interface IApiSchema {
17649
17649
  schema(def: {
17650
- namespace: Record<string, string | string[]>;
17650
+ namespace?: Record<string, string | string[]> | string[];
17651
+ url?: string;
17651
17652
  }, source: string): Promise<Record<string, GatewaySchema>>;
17652
17653
  generateFile(file: string): Promise<boolean>;
17653
17654
  generateDir(dir: string, files: Dirent[]): Promise<boolean>;
@@ -17657,8 +17658,8 @@ export interface IGateway {
17657
17658
  name: string;
17658
17659
  version: string;
17659
17660
  }) => void;
17660
- start: () => Promise<void>;
17661
- stop: () => Promise<void>;
17661
+ start: () => Promise<IGateway>;
17662
+ stop: () => Promise<IGateway>;
17662
17663
  }
17663
17664
  export type Handlers = ((params: {
17664
17665
  remote: unknown;
@@ -17669,9 +17670,9 @@ export type Handlers = ((params: {
17669
17670
  gateway: IGateway;
17670
17671
  }) => void)[];
17671
17672
  export interface IRegistry {
17672
- start: () => Promise<void>;
17673
+ start: (configOverride?: object) => Promise<IRegistry>;
17673
17674
  test: (tester?: unknown) => Promise<void>;
17674
- stop: () => Promise<void>;
17675
+ stop: () => Promise<IRegistry>;
17675
17676
  ports: Map<string, IAdapterFactory>;
17676
17677
  methods: Map<string, Handlers>;
17677
17678
  modules: Map<string | symbol, IRegistry[]>;
@@ -17750,7 +17751,7 @@ export interface IAdapter<T, C> {
17750
17751
  extends?: object | `adapter.${string}` | `orchestrator.${string}`;
17751
17752
  activeConfig?: (this: ReturnType<IAdapterFactory<T, C>>) => Partial<Config<T, C>>;
17752
17753
  init?: (this: ReturnType<IAdapterFactory<T, C>>, ...config: Partial<Config<T, C>>[]) => Promise<void>;
17753
- start?: (this: ReturnType<IAdapterFactory<T, C>>) => Promise<object>;
17754
+ start?: (this: ReturnType<IAdapterFactory<T, C>>, configOverride: object) => Promise<object>;
17754
17755
  ready?: (this: ReturnType<IAdapterFactory<T, C>>) => Promise<object>;
17755
17756
  stop?: (this: ReturnType<IAdapterFactory<T, C>>) => Promise<object>;
17756
17757
  connected?: (this: ReturnType<IAdapterFactory<T, C>>) => Promise<boolean>;
@@ -17824,7 +17825,7 @@ export interface IMeta {
17824
17825
  httpRequest?: {
17825
17826
  url: URL | string;
17826
17827
  state?: object;
17827
- headers: Record<string, string>;
17828
+ headers: Record<string, string | string[]>;
17828
17829
  };
17829
17830
  auth?: {
17830
17831
  mlek?: object | "header";
@@ -17958,16 +17959,19 @@ export interface IStep {
17958
17959
  method?: string;
17959
17960
  }
17960
17961
  export type Sequence = (boolean | string | IStep)[];
17962
+ export type ApiSchema = TObject | TArray | TBoolean | TString | TNumber | TUnknown;
17961
17963
  export type GatewaySchema = ({
17962
- params: TSchema;
17963
- result: TSchema;
17964
+ params: ApiSchema;
17965
+ result: ApiSchema;
17964
17966
  } | {
17965
- body: TSchema;
17966
- response: TSchema;
17967
+ body: {
17968
+ schema: ApiSchema;
17969
+ };
17970
+ response: ApiSchema;
17967
17971
  } | {
17968
17972
  method: "GET" | "POST" | "PUT" | "DELETE";
17969
17973
  path?: string;
17970
- response?: TSchema;
17974
+ response?: ApiSchema;
17971
17975
  } | {
17972
17976
  auth: false | "basic" | "login";
17973
17977
  } | {
@@ -18026,6 +18030,8 @@ export type ApiDefinition = (blong: IValidationProxy) => {
18026
18030
  namespace: Record<string, string | (string | Partial<OpenAPI.Document & {
18027
18031
  "x-blong-namespace": string;
18028
18032
  }>)[]>;
18033
+ } | {
18034
+ url: string;
18029
18035
  };
18030
18036
  export type PortHandler<T, C> = <R>(this: ReturnType<IAdapterFactory<T, C>>, params: {}, $meta: IMeta, context?: IContext) => Promise<R> | R;
18031
18037
  export type PortHandlerBound = <T>(params: {}, $meta: IMeta, context?: IContext) => Promise<T> | T;
@@ -18082,6 +18088,8 @@ export interface SolutionFactory<T extends TSchema = TNever> {
18082
18088
  type: typeof Type;
18083
18089
  }): IModuleConfig<T> | Promise<IModuleConfig<T>>;
18084
18090
  }
18091
+ declare const Kind: symbol;
18092
+ type Kind$1 = typeof Kind;
18085
18093
  export declare abstract class Internal {
18086
18094
  #private;
18087
18095
  protected log?: ReturnType<ILog["logger"]>;
@@ -18089,8 +18097,8 @@ export declare abstract class Internal {
18089
18097
  log: ILog;
18090
18098
  });
18091
18099
  protected merge: ILib["merge"];
18092
- stop(): Promise<void>;
18093
- start(...params: unknown[]): Promise<void>;
18100
+ stop(): Promise<unknown>;
18101
+ start(...params: unknown[]): Promise<unknown>;
18094
18102
  }
18095
18103
  export declare const handler: <T = Record<string, unknown>, C = AdapterContext>(definition: Definition<T, C>) => Definition<T, C>;
18096
18104
  export declare const library: <T = Record<string, unknown>>(definition: Lib<T>) => Lib<T>;
@@ -18122,6 +18130,7 @@ declare const _default: {
18122
18130
 
18123
18131
  export {
18124
18132
  Document$1 as Document,
18133
+ Kind$1 as Kind,
18125
18134
  _default as default,
18126
18135
  };
18127
18136
 
package/dist/types.js CHANGED
@@ -13,8 +13,12 @@ export class Internal {
13
13
  this.log = this.#log.logger(result.logLevel, { name: this.constructor.name });
14
14
  return result;
15
15
  };
16
- async stop() { }
17
- async start(...params) { }
16
+ async stop() {
17
+ return this;
18
+ }
19
+ async start(...params) {
20
+ return this;
21
+ }
18
22
  }
19
23
  export const handler = (definition) => Object.defineProperty(definition, Kind, { value: 'handler' });
20
24
  export const library = (definition) => Object.defineProperty(definition, Kind, { value: 'lib' });
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,IAAI,GASP,MAAM,SAAS,CAAC;AAMjB,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAqkBtC,MAAM,IAAI,GAAW,MAAM,CAAC,GAAG,CAAC,YAAY,CAA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AAc,CAAC,UAAU,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC,CAAC,CAAC;AAW7F,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAiC,EAAqB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEzF,eAAe;IACX,OAAO;IACP,OAAO;IACP,UAAU;IACV,GAAG;IACH,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,IAAI;CACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feasibleone/blong",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "description": "API and DRY focused RAD framework https://feasibleone.github.io/blong-docs",
5
5
  "keywords": [
6
6
  "blong",
package/types.ts CHANGED
@@ -547,10 +547,12 @@ export type ValidationDefinition = (
547
547
 
548
548
  export type ApiDefinition = (blong: IValidationProxy) =>
549
549
  | {
550
- namespace: Record<
551
- string,
552
- string | (string | Partial<OpenAPI.Document & {'x-blong-namespace': string}>)[]
553
- >;
550
+ namespace:
551
+ | string[]
552
+ | Record<
553
+ string,
554
+ string | (string | Partial<OpenAPI.Document & {'x-blong-namespace': string}>)[]
555
+ >;
554
556
  }
555
557
  | {
556
558
  url: string;