@feasibleone/blong 1.18.3 → 1.20.0

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,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.20.0](https://github.com/feasibleone/blong/compare/blong-v1.19.0...blong-v1.20.0) (2026-05-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * blong-dev ([8eb1aa4](https://github.com/feasibleone/blong/commit/8eb1aa4a8acb6a3dcdd52fb51582e0403efa4064))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * lint ([8cde9a7](https://github.com/feasibleone/blong/commit/8cde9a7b9d54d4556bf33b4f8f61d5c5597ca108))
14
+ * linting ([c45c515](https://github.com/feasibleone/blong/commit/c45c515c41d8dd7c9bb5b14e30a3d3e8afc75db8))
15
+ * linting ([f5ae3f9](https://github.com/feasibleone/blong/commit/f5ae3f9b563c6090080bf58f9b224a1b626b160e))
16
+ * linting ([fec5ee2](https://github.com/feasibleone/blong/commit/fec5ee2c4977e06a1d9d4d606dcb86dc9334aaa4))
17
+ * linting ([27102ca](https://github.com/feasibleone/blong/commit/27102ca91ddf21124439452486a086aa68fc8886))
18
+
19
+ ## [1.19.0](https://github.com/feasibleone/blong/compare/blong-v1.18.3...blong-v1.19.0) (2026-05-15)
20
+
21
+
22
+ ### Features
23
+
24
+ * snapshot testing ([ffae636](https://github.com/feasibleone/blong/commit/ffae6360d9f6a04b42e733fc6be291e1cd707bfa))
25
+
3
26
  ## [1.18.3](https://github.com/feasibleone/blong/compare/blong-v1.18.2...blong-v1.18.3) (2026-05-14)
4
27
 
5
28
 
package/dist/knex.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"knex.js","sourceRoot":"","sources":["../knex.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4EAA4E;AAC5E,6FAA6F;AAC7F,2BAA2B;AAu/F3B,eAAe,IAAI,CAAC;AACpB,OAAO,EAAC,IAAI,EAAC,CAAC"}
1
+ {"version":3,"file":"knex.js","sourceRoot":"","sources":["../knex.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4EAA4E;AAC5E,6FAA6F;AAC7F,2BAA2B;AAy/F3B,eAAe,IAAI,CAAC;AACpB,OAAO,EAAC,IAAI,EAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -12,7 +12,7 @@ import { Level, LogFn, Logger as PinoLogger } from 'pino';
12
12
  import React$1 from 'react';
13
13
  import { Readable, Writable } from 'stream';
14
14
  import { ConnectionOptions as ConnectionOptions_2, TLSSocket, TLSSocketOptions } from 'tls';
15
- import { Static, TArray, TBoolean, TFunction, TNever, TNumber, TObject, TSchema, TString, TUnknown, Type } from 'typebox';
15
+ import { Static, TArray, TBoolean, TFunction, TIntersect, TNever, TNumber, TObject, TSchema, TString, TUnknown, Type } from 'typebox';
16
16
 
17
17
  export type Method = "GET" | "POST" | "PUT" | "DELETE";
18
18
  export interface RequestArgs {
@@ -18198,7 +18198,10 @@ export interface IPlatformApi {
18198
18198
  configs: string[];
18199
18199
  }
18200
18200
  export interface IErrorFactory {
18201
- get(type?: string): unknown;
18201
+ get(type?: string): Record<string | symbol, {
18202
+ message: string;
18203
+ print?: string;
18204
+ } | string>;
18202
18205
  fetch(type: string): object;
18203
18206
  define(id: string, superType: string | {
18204
18207
  type: string;
@@ -18265,7 +18268,7 @@ export interface IRpcServer {
18265
18268
  setAttachCheckpoint?: (fn: ((meta: IMeta) => void) | undefined) => void;
18266
18269
  }
18267
18270
  export interface ILocal {
18268
- register: (methods: object, namespace: string, reply: boolean, pkg: {
18271
+ register: (methods: Record<string, (...params: unknown[]) => Promise<unknown>> | Array<(...params: unknown[]) => Promise<unknown>>, namespace: string, reply: boolean, pkg: {
18269
18272
  version: string;
18270
18273
  }) => void;
18271
18274
  unregister: (methods: string[], namespace: string) => void;
@@ -18329,11 +18332,11 @@ export interface IApi {
18329
18332
  rpc: IRpcServer;
18330
18333
  local: ILocal;
18331
18334
  registry: IRegistry;
18332
- register: (methods: object, namespace: string, id: string, pkg: {
18335
+ register: (methods: Record<string, (...params: unknown[]) => Promise<unknown>> | Array<(...params: unknown[]) => Promise<unknown>>, namespace: string, id: string, pkg: {
18333
18336
  version: string;
18334
18337
  }) => void;
18335
18338
  unregister: (methods: string[], namespace: string) => void;
18336
- subscribe: (methods: object, namespace: string, id: string, pkg: {
18339
+ subscribe: (methods: Record<string, (...params: unknown[]) => Promise<unknown>> | Array<(...params: unknown[]) => Promise<unknown>>, namespace: string, id: string, pkg: {
18337
18340
  version: string;
18338
18341
  }) => void;
18339
18342
  unsubscribe: (methods: string[], namespace: string) => void;
@@ -18615,7 +18618,7 @@ export interface IStep {
18615
18618
  method?: string;
18616
18619
  }
18617
18620
  export type Sequence = (boolean | string | IStep)[];
18618
- export type ApiSchema = TObject | TArray | TBoolean | TString | TNumber | TUnknown;
18621
+ export type ApiSchema = TObject | TArray | TBoolean | TString | TNumber | TUnknown | TIntersect;
18619
18622
  export type GatewaySchema = ({
18620
18623
  params: ApiSchema;
18621
18624
  result: ApiSchema;
@@ -18648,7 +18651,24 @@ export type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV2.PathItemObje
18648
18651
  export type ThenableProxy = Promise<unknown> & {
18649
18652
  [key: string]: ThenableProxy;
18650
18653
  };
18651
- export type ChainStep = ((assert: typeof Assert, context: {
18654
+ /**
18655
+ * Augmented assert passed to every chain step. The `snapshot()` method is
18656
+ * injected at runtime by the test executor, so handlers can call it directly
18657
+ * without `(assert as any)` casts. Import this type from `@feasibleone/blong`
18658
+ * instead of `typeof Assert` from `node:assert` in test handlers.
18659
+ */
18660
+ export type IAssert = typeof Assert & {
18661
+ /**
18662
+ * Deferred (no-args): snapshot the step's return value under the step name.
18663
+ * Optional object form: `assert.snapshot({mask: ['id']})` adds a per-call mask.
18664
+ * Explicit form: `assert.snapshot(value, 'name', {mask?})` writes immediately.
18665
+ */
18666
+ snapshot(valueOrOpts?: unknown, name?: string, opts?: {
18667
+ mask?: string[];
18668
+ }): void;
18669
+ matchSnapshot(value: unknown, name?: string): void;
18670
+ };
18671
+ export type ChainStep = ((assert: IAssert, context: {
18652
18672
  $meta: IMeta;
18653
18673
  } & Record<string, Promise<unknown[]> & ThenableProxy>) => Promise<object>) | object;
18654
18674
  export type CheckpointFn = (this: IMeta, name: string, data?: unknown) => void;
@@ -18658,11 +18678,39 @@ export interface ILib {
18658
18678
  rename: <T extends object>(object: T, name: string) => T & {
18659
18679
  name: string;
18660
18680
  };
18661
- /** @deprecated The framework now auto-names step arrays from handler names. */
18662
- group: (name: string) => (handlers: ChainStep[]) => ChainStep[] & {
18681
+ /**
18682
+ * Create a named group of chain steps. The group name is used in test reports.
18683
+ * Optionally configure the group with `autoSnapshot: true` to automatically snapshot the
18684
+ * return the steps and the common mask to apply to all snapshots taken within the group.
18685
+ *
18686
+ * @param name
18687
+ * @param config
18688
+ * @returns
18689
+ */
18690
+ group: (name: string, config?: {
18691
+ autoSnapshot?: boolean;
18692
+ mask?: string[];
18693
+ }) => (handlers: ChainStep[]) => ChainStep[] & {
18694
+ name: string;
18695
+ };
18696
+ /**
18697
+ * Create a named snapshot checkpoint marker to place inside a `group()` steps array.
18698
+ * Without extra arguments the `'*'` wildcard waits for all pending steps.
18699
+ * With step names only those steps are awaited before the context snapshot is taken.
18700
+ *
18701
+ * @example
18702
+ * group('my-test')([
18703
+ * stepA,
18704
+ * stepB,
18705
+ * checkpoint('after-b', 'stepA', 'stepB'), // wait for A & B, then snapshot
18706
+ * stepC,
18707
+ * checkpoint('final'), // wait for all, then snapshot
18708
+ * ])
18709
+ */
18710
+ checkpoint: (name: string, ...markers: string[]) => string[] & {
18663
18711
  name: string;
18664
18712
  };
18665
- assert: typeof Assert | undefined;
18713
+ assert: IAssert | undefined;
18666
18714
  yaml: {
18667
18715
  parse: <T>(source: string, options?: unknown) => T;
18668
18716
  parseAllDocuments: <T>(source: string, options?: unknown) => T;
package/dist/types.js CHANGED
@@ -16,7 +16,6 @@ export class Internal {
16
16
  async stop() {
17
17
  return this;
18
18
  }
19
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
19
  async start(..._args) {
21
20
  return this;
22
21
  }
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,IAAI,GAWP,MAAM,SAAS,CAAC;AAQjB,OAAO,KAAK,MAAM,mBAAmB,CAAC;AA6wBtC,MAAM,IAAI,GAAW,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAG9C,MAAM,OAAgB,QAAQ;IAC1B,IAAI,CAAoB;IACd,GAAG,CAA8B;IAC3C,YAAmB,GAAkB;QACjC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,CAAC;IACzB,CAAC;IACS,KAAK,GAAkB,CAAC,GAAG,IAA+B,EAAE,EAAE;QACpE,MAAM,MAAM,GAAG,KAAK,CAAqB,GAAG,IAAI,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI;YAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC,CAAC,CAAC;QAChF,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IACK,KAAK,CAAC,IAAI;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,6DAA6D;IACtD,KAAK,CAAC,KAAK,CAAC,GAAG,KAAgB;QAClC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CACnB,UAA4B,EACZ,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;AAqCnF;;;;;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C,cAAc,CAAC,UAAqD,EAAE,IAAI,EAAE;IAC/E,KAAK,EAAE,QAAQ;CAClB,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,OAAO,GAAG,CACnB,UAA8B,EACU,EAAE,CAC1C,MAAM,CAAC,cAAc,CAAC,UAAsD,EAAE,IAAI,EAAE;IAChF,KAAK,EAAE,SAAS;CACnB,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,KAAK,GAAG,CACjB,UAA4C,EACQ,EAAE,CACtD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG,CACnB,UAAiC,EACU,EAAE,CAC7C,MAAM,CAAC,cAAc,CAAC,UAAyD,EAAE,IAAI,EAAE;IACnF,KAAK,EAAE,SAAS;CACnB,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,UAAiC,EACe,EAAE,CAClD,MAAM,CAAC,cAAc,CAAC,UAA8D,EAAE,IAAI,EAAE;IACxF,KAAK,EAAE,cAAc;CACxB,CAAC,CAAC;AAeP,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAiC,EAAS,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAEnF,eAAe;IACX,OAAO;IACP,aAAa;IACb,OAAO;IACP,UAAU;IACV,GAAG;IACH,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,OAAO;IACP,IAAI;CACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feasibleone/blong",
3
- "version": "1.18.3",
3
+ "version": "1.20.0",
4
4
  "description": "API and DRY focused RAD framework https://feasibleone.github.io/blong-docs",
5
5
  "keywords": [
6
6
  "blong",
@@ -46,11 +46,12 @@
46
46
  "openapi-types": "^12.1.3",
47
47
  "react": "^19.1.0",
48
48
  "tarn": "^3.0.2",
49
- "typescript": "^5.9.3"
49
+ "typescript": "^5.9.3",
50
+ "@feasibleone/blong-dev": "1.0.0"
50
51
  },
51
52
  "scripts": {
52
53
  "build": "heft build --clean;dts-bundle-generator --config dts-gen.config.json",
53
- "ci-lint": "tsc --noEmit",
54
+ "ci-lint": "blong-dev lint",
54
55
  "ci-publish": "node ../../common/scripts/install-run-rush-pnpm.js publish --access public --provenance"
55
56
  }
56
57
  }
package/types.ts CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  type TArray,
17
17
  type TBoolean,
18
18
  type TFunction,
19
+ type TIntersect,
19
20
  type TNever,
20
21
  type TNumber,
21
22
  type TObject,
@@ -165,7 +166,7 @@ export interface IPlatformApi {
165
166
  }
166
167
 
167
168
  export interface IErrorFactory {
168
- get(type?: string): unknown;
169
+ get(type?: string): Record<string | symbol, {message: string; print?: string} | string>;
169
170
  fetch(type: string): object;
170
171
  define(
171
172
  id: string,
@@ -237,7 +238,14 @@ export interface IRpcServer {
237
238
  }
238
239
 
239
240
  export interface ILocal {
240
- register: (methods: object, namespace: string, reply: boolean, pkg: {version: string}) => void;
241
+ register: (
242
+ methods:
243
+ | Record<string, (...params: unknown[]) => Promise<unknown>>
244
+ | Array<(...params: unknown[]) => Promise<unknown>>,
245
+ namespace: string,
246
+ reply: boolean,
247
+ pkg: {version: string},
248
+ ) => void;
241
249
  unregister: (methods: string[], namespace: string) => void;
242
250
  get: (name: string) => {method: (...params: unknown[]) => Promise<unknown[]>};
243
251
  }
@@ -307,9 +315,23 @@ export interface IApi {
307
315
  rpc: IRpcServer;
308
316
  local: ILocal;
309
317
  registry: IRegistry;
310
- register: (methods: object, namespace: string, id: string, pkg: {version: string}) => void;
318
+ register: (
319
+ methods:
320
+ | Record<string, (...params: unknown[]) => Promise<unknown>>
321
+ | Array<(...params: unknown[]) => Promise<unknown>>,
322
+ namespace: string,
323
+ id: string,
324
+ pkg: {version: string},
325
+ ) => void;
311
326
  unregister: (methods: string[], namespace: string) => void;
312
- subscribe: (methods: object, namespace: string, id: string, pkg: {version: string}) => void;
327
+ subscribe: (
328
+ methods:
329
+ | Record<string, (...params: unknown[]) => Promise<unknown>>
330
+ | Array<(...params: unknown[]) => Promise<unknown>>,
331
+ namespace: string,
332
+ id: string,
333
+ pkg: {version: string},
334
+ ) => void;
313
335
  unsubscribe: (methods: string[], namespace: string) => void;
314
336
  dispatch: (...params: unknown[]) => boolean | Promise<unknown>;
315
337
  methodId: (name: string) => string;
@@ -636,7 +658,7 @@ export interface IStep {
636
658
  }
637
659
  export type Sequence = (boolean | string | IStep)[];
638
660
 
639
- export type ApiSchema = TObject | TArray | TBoolean | TString | TNumber | TUnknown;
661
+ export type ApiSchema = TObject | TArray | TBoolean | TString | TNumber | TUnknown | TIntersect;
640
662
 
641
663
  export type GatewaySchema = (
642
664
  | {
@@ -675,9 +697,26 @@ export type GatewaySchema = (
675
697
  export type SchemaObject = OpenAPIV3_1.SchemaObject | OpenAPIV2.SchemaObject;
676
698
  export type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV2.PathItemObject;
677
699
  export type ThenableProxy = Promise<unknown> & {[key: string]: ThenableProxy};
700
+
701
+ /**
702
+ * Augmented assert passed to every chain step. The `snapshot()` method is
703
+ * injected at runtime by the test executor, so handlers can call it directly
704
+ * without `(assert as any)` casts. Import this type from `@feasibleone/blong`
705
+ * instead of `typeof Assert` from `node:assert` in test handlers.
706
+ */
707
+ export type IAssert = typeof Assert & {
708
+ /**
709
+ * Deferred (no-args): snapshot the step's return value under the step name.
710
+ * Optional object form: `assert.snapshot({mask: ['id']})` adds a per-call mask.
711
+ * Explicit form: `assert.snapshot(value, 'name', {mask?})` writes immediately.
712
+ */
713
+ snapshot(valueOrOpts?: unknown, name?: string, opts?: {mask?: string[]}): void;
714
+ matchSnapshot(value: unknown, name?: string): void;
715
+ };
716
+
678
717
  export type ChainStep =
679
718
  | ((
680
- assert: typeof Assert,
719
+ assert: IAssert,
681
720
  context: {
682
721
  $meta: IMeta;
683
722
  } & Record<string, Promise<unknown[]> & ThenableProxy>,
@@ -690,9 +729,35 @@ export interface ILib {
690
729
  type: typeof Type;
691
730
  error: <T>(errors: T) => Record<keyof T, (params?: unknown, $meta?: IMeta) => ITypedError>;
692
731
  rename: <T extends object>(object: T, name: string) => T & {name: string};
693
- /** @deprecated The framework now auto-names step arrays from handler names. */
694
- group: (name: string) => (handlers: ChainStep[]) => ChainStep[] & {name: string};
695
- assert: typeof Assert | undefined;
732
+ /**
733
+ * Create a named group of chain steps. The group name is used in test reports.
734
+ * Optionally configure the group with `autoSnapshot: true` to automatically snapshot the
735
+ * return the steps and the common mask to apply to all snapshots taken within the group.
736
+ *
737
+ * @param name
738
+ * @param config
739
+ * @returns
740
+ */
741
+ group: (
742
+ name: string,
743
+ config?: {autoSnapshot?: boolean; mask?: string[]},
744
+ ) => (handlers: ChainStep[]) => ChainStep[] & {name: string};
745
+ /**
746
+ * Create a named snapshot checkpoint marker to place inside a `group()` steps array.
747
+ * Without extra arguments the `'*'` wildcard waits for all pending steps.
748
+ * With step names only those steps are awaited before the context snapshot is taken.
749
+ *
750
+ * @example
751
+ * group('my-test')([
752
+ * stepA,
753
+ * stepB,
754
+ * checkpoint('after-b', 'stepA', 'stepB'), // wait for A & B, then snapshot
755
+ * stepC,
756
+ * checkpoint('final'), // wait for all, then snapshot
757
+ * ])
758
+ */
759
+ checkpoint: (name: string, ...markers: string[]) => string[] & {name: string};
760
+ assert: IAssert | undefined;
696
761
  yaml: {
697
762
  parse: <T>(source: string, options?: unknown) => T;
698
763
  parseAllDocuments: <T>(source: string, options?: unknown) => T;
@@ -829,7 +894,6 @@ export abstract class Internal {
829
894
  public async stop(): Promise<unknown> {
830
895
  return this;
831
896
  }
832
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
833
897
  public async start(..._args: unknown[]): Promise<unknown> {
834
898
  return this;
835
899
  }