@pepys/kit 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -34,7 +34,8 @@ Test the plug-in with [`@pepys/testing`](../testing/README.md), and build it wit
34
34
 
35
35
  ## Features
36
36
 
37
- - `@pepys/kit`: the `define*` declarations and the deployment check.
37
+ - `@pepys/kit`: the `define*` declarations and the deployment check. `toStreamName` and
38
+ `toStreamOffset` give a family's `stream` and a number as the branded types that a fact log takes.
38
39
  - `@pepys/kit/generators`: the SQL schema and glue generators.
39
40
  - `@pepys/kit/send`: the client that signs and sends a fact batch.
40
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pepys/kit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Declare a pepys plug-in or deployment: fact families, sources, consumers, tables, links and queries",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,7 @@
1
+ import { toTagged } from '@zgeoff/std';
2
+ import type { DeclaredStreamName } from '../types.ts';
3
+ import type { StreamName } from './types.ts';
4
+
5
+ export function toStreamName(stream: DeclaredStreamName): StreamName {
6
+ return toTagged<StreamName>(stream);
7
+ }
@@ -0,0 +1,6 @@
1
+ import { toTagged } from '@zgeoff/std';
2
+ import type { StreamOffset } from './types.ts';
3
+
4
+ export function toStreamOffset(offset: number): StreamOffset {
5
+ return toTagged<StreamOffset>(offset);
6
+ }
package/src/index.ts CHANGED
@@ -25,6 +25,8 @@ export { parseStreamName } from './facts/parse-stream-name.ts';
25
25
  export { readFactBatch } from './sources/read-fact-batch.ts';
26
26
  export { receiveFactBatch } from './sources/receive-fact-batch.ts';
27
27
  export type { TableRow } from './tables/table-row.ts';
28
+ export { toStreamName } from './ids/to-stream-name.ts';
29
+ export { toStreamOffset } from './ids/to-stream-offset.ts';
28
30
  export type * from './consumers/types.ts';
29
31
  export type * from './deployments/types.ts';
30
32
  export type * from './ids/types.ts';