@wovin/core 0.0.1-RC9 → 0.0.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.
Files changed (143) hide show
  1. package/dist/applog/applog-helpers.d.ts +23 -0
  2. package/dist/applog/applog-helpers.d.ts.map +1 -0
  3. package/dist/applog/applog-utils.d.ts +41 -0
  4. package/dist/applog/applog-utils.d.ts.map +1 -0
  5. package/dist/applog/datom-types.d.ts +84 -0
  6. package/dist/applog/datom-types.d.ts.map +1 -0
  7. package/dist/applog.d.ts +4 -70
  8. package/dist/applog.d.ts.map +1 -0
  9. package/dist/applog.min.js +2 -0
  10. package/dist/chunk-5R2ELTEJ.min.js +40 -0
  11. package/dist/chunk-5R2ELTEJ.min.js.map +1 -0
  12. package/dist/chunk-7IDQIMQO.min.js +1 -0
  13. package/dist/chunk-F3MRAJXL.min.js +2 -0
  14. package/dist/{types.js.map → chunk-F3MRAJXL.min.js.map} +1 -1
  15. package/dist/chunk-HHXZXKNM.min.js +7 -0
  16. package/dist/chunk-HHXZXKNM.min.js.map +1 -0
  17. package/dist/chunk-KESATLM4.min.js +8 -0
  18. package/dist/chunk-KESATLM4.min.js.map +1 -0
  19. package/dist/chunk-LECZSORU.min.js +2 -0
  20. package/dist/chunk-LECZSORU.min.js.map +1 -0
  21. package/dist/chunk-NGPPHX5A.min.js +2 -0
  22. package/dist/chunk-NGPPHX5A.min.js.map +1 -0
  23. package/dist/chunk-PL6CNZTW.min.js +2 -0
  24. package/dist/chunk-PL6CNZTW.min.js.map +1 -0
  25. package/dist/chunk-RPPZKO5L.min.js +1 -0
  26. package/dist/index.d.ts +8 -12
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.min.js +2 -0
  29. package/dist/index.min.js.map +1 -0
  30. package/dist/ipfs/car.d.ts +15 -0
  31. package/dist/ipfs/car.d.ts.map +1 -0
  32. package/dist/ipfs/ipfs-utils.d.ts +17 -0
  33. package/dist/ipfs/ipfs-utils.d.ts.map +1 -0
  34. package/dist/ipfs.d.ts +3 -36
  35. package/dist/ipfs.d.ts.map +1 -0
  36. package/dist/ipfs.min.js +2 -0
  37. package/dist/mobx/mobx-utils.d.ts +67 -0
  38. package/dist/mobx/mobx-utils.d.ts.map +1 -0
  39. package/dist/pubsub/connector.d.ts +7 -0
  40. package/dist/pubsub/connector.d.ts.map +1 -0
  41. package/dist/pubsub/publication.d.ts +6 -0
  42. package/dist/pubsub/publication.d.ts.map +1 -0
  43. package/dist/{pubsub.d.cts → pubsub/pubsub-types.d.ts} +7 -12
  44. package/dist/pubsub/pubsub-types.d.ts.map +1 -0
  45. package/dist/pubsub.d.ts +4 -41
  46. package/dist/pubsub.d.ts.map +1 -0
  47. package/dist/pubsub.min.js +2 -0
  48. package/dist/query/basic.d.ts +65 -0
  49. package/dist/query/basic.d.ts.map +1 -0
  50. package/dist/query/divergences.d.ts +12 -0
  51. package/dist/query/divergences.d.ts.map +1 -0
  52. package/dist/query/matchers.d.ts +4 -0
  53. package/dist/query/matchers.d.ts.map +1 -0
  54. package/dist/query.d.ts +5 -0
  55. package/dist/query.d.ts.map +1 -0
  56. package/dist/query.min.js +2 -0
  57. package/dist/query.min.js.map +1 -0
  58. package/dist/stream/basic.d.ts +34 -0
  59. package/dist/stream/basic.d.ts.map +1 -0
  60. package/dist/stream/filters.d.ts +38 -0
  61. package/dist/stream/filters.d.ts.map +1 -0
  62. package/dist/{mapped-8h8bwRuM.d.ts → stream/mapped.d.ts} +5 -6
  63. package/dist/stream/mapped.d.ts.map +1 -0
  64. package/dist/{writeable-0WbsIiQn.d.cts → stream/writeable.d.ts} +7 -6
  65. package/dist/stream/writeable.d.ts.map +1 -0
  66. package/dist/stream.d.ts +5 -44
  67. package/dist/stream.d.ts.map +1 -0
  68. package/dist/stream.min.js +2 -0
  69. package/dist/stream.min.js.map +1 -0
  70. package/dist/types/typescript-utils.d.ts +33 -0
  71. package/dist/types/typescript-utils.d.ts.map +1 -0
  72. package/dist/types.d.ts +2 -4
  73. package/dist/types.d.ts.map +1 -0
  74. package/dist/types.min.js +2 -0
  75. package/dist/types.min.js.map +1 -0
  76. package/dist/utils.d.ts +1 -2
  77. package/dist/utils.d.ts.map +1 -0
  78. package/dist/utils.min.js +1 -0
  79. package/dist/utils.min.js.map +1 -0
  80. package/package.json +80 -46
  81. package/dist/applog.cjs +0 -85
  82. package/dist/applog.cjs.map +0 -1
  83. package/dist/applog.d.cts +0 -70
  84. package/dist/applog.js +0 -85
  85. package/dist/chunk-F3FYYIAV.js +0 -11
  86. package/dist/chunk-GT5X2WN4.cjs +0 -59
  87. package/dist/chunk-GT5X2WN4.cjs.map +0 -1
  88. package/dist/chunk-JSAJQXI2.cjs +0 -577
  89. package/dist/chunk-JSAJQXI2.cjs.map +0 -1
  90. package/dist/chunk-KDR7QXOQ.js +0 -56
  91. package/dist/chunk-KDR7QXOQ.js.map +0 -1
  92. package/dist/chunk-KGTU6PJ3.js +0 -577
  93. package/dist/chunk-KGTU6PJ3.js.map +0 -1
  94. package/dist/chunk-KHY3SRML.js +0 -768
  95. package/dist/chunk-KHY3SRML.js.map +0 -1
  96. package/dist/chunk-OOC3HK3E.cjs +0 -56
  97. package/dist/chunk-OOC3HK3E.cjs.map +0 -1
  98. package/dist/chunk-QXNFGJ5R.js +0 -59
  99. package/dist/chunk-QXNFGJ5R.js.map +0 -1
  100. package/dist/chunk-UOPZAYFM.cjs +0 -11
  101. package/dist/chunk-UOPZAYFM.cjs.map +0 -1
  102. package/dist/chunk-ZPOYKHY6.cjs +0 -768
  103. package/dist/chunk-ZPOYKHY6.cjs.map +0 -1
  104. package/dist/index.cjs +0 -87
  105. package/dist/index.cjs.map +0 -1
  106. package/dist/index.d.cts +0 -12
  107. package/dist/index.js +0 -87
  108. package/dist/index.js.map +0 -1
  109. package/dist/ipfs.cjs +0 -28
  110. package/dist/ipfs.cjs.map +0 -1
  111. package/dist/ipfs.d.cts +0 -36
  112. package/dist/ipfs.js +0 -28
  113. package/dist/mapped-mkKwhQgZ.d.cts +0 -20
  114. package/dist/pubsub.cjs +0 -14
  115. package/dist/pubsub.cjs.map +0 -1
  116. package/dist/pubsub.js +0 -14
  117. package/dist/pubsub.js.map +0 -1
  118. package/dist/queries.cjs +0 -112
  119. package/dist/queries.cjs.map +0 -1
  120. package/dist/queries.d.cts +0 -141
  121. package/dist/queries.d.ts +0 -141
  122. package/dist/queries.js +0 -112
  123. package/dist/queries.js.map +0 -1
  124. package/dist/stream.cjs +0 -37
  125. package/dist/stream.cjs.map +0 -1
  126. package/dist/stream.d.cts +0 -44
  127. package/dist/stream.js +0 -37
  128. package/dist/types-A9kYLtyU.d.cts +0 -153
  129. package/dist/types-A9kYLtyU.d.ts +0 -153
  130. package/dist/types.cjs +0 -46
  131. package/dist/types.cjs.map +0 -1
  132. package/dist/types.d.cts +0 -4
  133. package/dist/types.js +0 -46
  134. package/dist/utils.cjs +0 -1
  135. package/dist/utils.cjs.map +0 -1
  136. package/dist/utils.d.cts +0 -2
  137. package/dist/utils.js +0 -1
  138. package/dist/writeable-r_920qCb.d.ts +0 -16
  139. /package/dist/{applog.js.map → applog.min.js.map} +0 -0
  140. /package/dist/{chunk-F3FYYIAV.js.map → chunk-7IDQIMQO.min.js.map} +0 -0
  141. /package/dist/{ipfs.js.map → chunk-RPPZKO5L.min.js.map} +0 -0
  142. /package/dist/{stream.js.map → ipfs.min.js.map} +0 -0
  143. /package/dist/{utils.js.map → pubsub.min.js.map} +0 -0
@@ -1,153 +0,0 @@
1
- import * as _sinclair_typebox from '@sinclair/typebox';
2
- import { Type, TSchema, Static } from '@sinclair/typebox';
3
- import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
4
- import { CID } from 'multiformats/cid';
5
-
6
- type ApplogStreamEvent = {
7
- added: readonly Applog[];
8
- removed: readonly Applog[] | null;
9
- } | {
10
- init: readonly Applog[];
11
- };
12
- declare function isInitEvent(event: ApplogStreamEvent): event is {
13
- init: readonly Applog[];
14
- };
15
- declare abstract class ApplogStream {
16
- protected _applogs: Applog[];
17
- readonly name: string;
18
- readonly filters: string[];
19
- readonly parents: ApplogStream[] | null;
20
- protected _subscribers: ((event: ApplogStreamEvent) => void)[];
21
- constructor(parents: ApplogStream | ApplogStream[] | null, filters: string[], _applogs: Applog[], name: string);
22
- abstract get readOnly(): boolean;
23
- subscribe(callback: (event: ApplogStreamEvent) => void): () => void;
24
- unsubscribe(callback: (event: ApplogStreamEvent) => void): void;
25
- protected notifySubscribers(event: ApplogStreamEvent): void;
26
- get applogs(): readonly Applog[];
27
- map<R>(fn: (applog: Applog) => R): R[];
28
- get firstLog(): Applog;
29
- get latestLog(): Applog;
30
- hasApplog(applog: Applog, byRef: boolean): boolean;
31
- hasApplogWithDiffTs(applog: ApplogForInsert): Applog;
32
- get isEmpty(): boolean;
33
- get size(): number;
34
- get untrackedSize(): number;
35
- get nameAndSizeUntracked(): string;
36
- get prettyName(): string;
37
- }
38
-
39
- declare const ApplogStreamTB: _sinclair_typebox.TUnsafe<ApplogStream>;
40
- declare const StringTB: (options?: _sinclair_typebox.StringOptions) => _sinclair_typebox.TString;
41
- declare const OptionalTB: <T extends _sinclair_typebox.TSchema>(schema: T) => _sinclair_typebox.TOptional<T>;
42
- declare const BooleanTB: (options?: _sinclair_typebox.SchemaOptions) => _sinclair_typebox.TBoolean;
43
- declare const ObjectTB: <T extends _sinclair_typebox.TProperties>(properties: T, options?: _sinclair_typebox.ObjectOptions) => _sinclair_typebox.TObject<T>;
44
- declare const NumberTB: (options?: _sinclair_typebox.NumericOptions<number>) => _sinclair_typebox.TNumber;
45
- declare const Str: typeof StringTB;
46
- declare const Num: typeof NumberTB;
47
- declare const Obj: typeof ObjectTB;
48
- declare const Opt: typeof OptionalTB;
49
- declare const Bool: typeof BooleanTB;
50
- declare const STR: ReturnType<typeof Type.String>;
51
- declare const NUM: ReturnType<typeof Type.Number>;
52
- declare const BOOL: ReturnType<typeof Type.Boolean>;
53
- type DefaultTrue = true | boolean;
54
- declare const DefaultTrue: DefaultTrue;
55
- type DefaultFalse = false | boolean;
56
- declare const DefaultFalse: DefaultFalse;
57
- type GenericObject = Record<string, any>;
58
- type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
59
- type PartialBy<T, K extends keyof T> = Omit$1<T, K> & Partial<Pick<T, K>>;
60
- type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
61
- type CoerceToString<T> = T extends string ? T : never;
62
- /**
63
- * Define nominal type of U based on type of T. Similar to Opaque types in Flow
64
- */
65
- type Tagged<T, Tag> = T & {
66
- tag?: Tag;
67
- };
68
- type LastElementOf<T extends readonly unknown[]> = T extends readonly [...unknown[], infer Last] ? Last : never;
69
- declare function checkParityTB(): void;
70
- /** solidjs Setter requires returning something, which I often don't */
71
- type GenericSetter<T> = (newValue: T) => void;
72
-
73
- declare const Nullable: <T extends TSchema>(schema: T) => _sinclair_typebox.TUnion<[T, _sinclair_typebox.TNull]>;
74
- declare const EntityID_LENGTH = 7;
75
- declare const EntityID: _sinclair_typebox.TString;
76
- type EntityID = Static<typeof EntityID>;
77
- type DatomPart = string;
78
- type CidString = Tagged<string, CID>;
79
- type AgentID = EntityID;
80
- type Attribute = string;
81
- type ApplogValue = string | boolean | Number | null;
82
- interface Atom {
83
- en: EntityID;
84
- at: Attribute;
85
- vl: ApplogValue;
86
- }
87
- type AgentHash = string;
88
- type Timestamp = string;
89
- interface Applog extends Atom {
90
- cid: CidString;
91
- pv?: CidString;
92
- ts: Timestamp;
93
- ag: AgentHash;
94
- }
95
- type ApplogNoCid = Omit<Applog, 'cid'>;
96
- type ApplogOptionalCid = PartialBy<Applog, 'cid'>;
97
- type ApplogForInsert = PartialBy<ApplogNoCid, 'ts'>;
98
- type ApplogForInsertOptionalAgent = PartialBy<ApplogForInsert, 'ag'>;
99
- type AtomPattern = Atom | Applog;
100
- interface DatalogStateIdentifier {
101
- lastTS: Timestamp;
102
- }
103
- type ValueOrMatcher<T> = T | readonly T[] | ((value: T) => boolean);
104
- type WithMatchers<T extends Record<string, any>> = {
105
- [K in keyof T & string as `${K}` | `!${K}`]?: ValueOrMatcher<T[K]>;
106
- };
107
- type DatalogQueryPattern = Partial<WithMatchers<Applog>>;
108
- type DatalogQueryPatternArray = DatalogQueryPattern[];
109
- interface DatalogQuery<SELECT extends string> {
110
- find: readonly SELECT[];
111
- where: DatalogQueryPatternArray;
112
- onlyLatest?: boolean;
113
- }
114
- type DatalogQueryResultEntry<SELECT extends string> = Record<StripPrefix<'?', SELECT>, DatomPart>;
115
- type DatalogQueryResultRows<SELECT extends string> = DatalogQueryResultEntry<SELECT>[];
116
- interface SearchContext {
117
- [key: string]: ApplogValue;
118
- }
119
- interface SearchContextWithLog {
120
- context: SearchContext;
121
- applog?: Applog;
122
- }
123
- type ResultContext = SearchContext | null;
124
- type StripPrefix<TPrefix extends string, T extends string> = T extends `${TPrefix}${infer R}` ? R : never;
125
- declare const CIDTB: _sinclair_typebox.TString;
126
- type CIDTB = Static<typeof EntityID>;
127
- declare const URL: _sinclair_typebox.TString;
128
- type URL = Static<typeof URL>;
129
- declare const AppLogTB: _sinclair_typebox.TObject<{
130
- en: _sinclair_typebox.TString;
131
- at: _sinclair_typebox.TString;
132
- vl: _sinclair_typebox.TUnion<[_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNumber]>, _sinclair_typebox.TNull]>;
133
- ts: _sinclair_typebox.TString;
134
- ag: _sinclair_typebox.TString;
135
- }>;
136
- type AppLogTB = Static<typeof AppLogTB>;
137
- declare const AppLogTBC: _sinclair_typebox_compiler.TypeCheck<_sinclair_typebox.TObject<{
138
- en: _sinclair_typebox.TString;
139
- at: _sinclair_typebox.TString;
140
- vl: _sinclair_typebox.TUnion<[_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNumber]>, _sinclair_typebox.TNull]>;
141
- ts: _sinclair_typebox.TString;
142
- ag: _sinclair_typebox.TString;
143
- }>>;
144
- declare const getApplogTypeErrors: (obj: any) => _sinclair_typebox_compiler.ValueError[];
145
- declare const isValidApplog: (value: unknown) => value is {
146
- ts: string;
147
- ag: string;
148
- en: string;
149
- at: string;
150
- vl: string | number | boolean;
151
- };
152
-
153
- export { type Tagged as $, ApplogStream as A, ApplogStreamTB as B, type CidString as C, type DatalogQueryPattern as D, EntityID_LENGTH as E, Str as F, Num as G, Opt as H, Bool as I, STR as J, NUM as K, BOOL as L, DefaultTrue as M, Nullable as N, Obj as O, DefaultFalse as P, type GenericObject as Q, type ResultContext as R, type SearchContext as S, type Timestamp as T, URL as U, type ValueOrMatcher as V, type WithMatchers as W, type Omit$1 as X, type PartialBy as Y, type PromiseType as Z, type CoerceToString as _, type ApplogStreamEvent as a, type LastElementOf as a0, checkParityTB as a1, type GenericSetter as a2, type ApplogValue as b, type Applog as c, type ApplogForInsert as d, type ApplogForInsertOptionalAgent as e, type ApplogNoCid as f, type DatalogQueryResultEntry as g, EntityID as h, isInitEvent as i, type DatomPart as j, type AgentID as k, type Attribute as l, type Atom as m, type AgentHash as n, type ApplogOptionalCid as o, type AtomPattern as p, type DatalogStateIdentifier as q, type DatalogQueryPatternArray as r, type DatalogQuery as s, type DatalogQueryResultRows as t, type SearchContextWithLog as u, CIDTB as v, AppLogTB as w, AppLogTBC as x, getApplogTypeErrors as y, isValidApplog as z };
@@ -1,153 +0,0 @@
1
- import * as _sinclair_typebox from '@sinclair/typebox';
2
- import { Type, TSchema, Static } from '@sinclair/typebox';
3
- import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
4
- import { CID } from 'multiformats/cid';
5
-
6
- type ApplogStreamEvent = {
7
- added: readonly Applog[];
8
- removed: readonly Applog[] | null;
9
- } | {
10
- init: readonly Applog[];
11
- };
12
- declare function isInitEvent(event: ApplogStreamEvent): event is {
13
- init: readonly Applog[];
14
- };
15
- declare abstract class ApplogStream {
16
- protected _applogs: Applog[];
17
- readonly name: string;
18
- readonly filters: string[];
19
- readonly parents: ApplogStream[] | null;
20
- protected _subscribers: ((event: ApplogStreamEvent) => void)[];
21
- constructor(parents: ApplogStream | ApplogStream[] | null, filters: string[], _applogs: Applog[], name: string);
22
- abstract get readOnly(): boolean;
23
- subscribe(callback: (event: ApplogStreamEvent) => void): () => void;
24
- unsubscribe(callback: (event: ApplogStreamEvent) => void): void;
25
- protected notifySubscribers(event: ApplogStreamEvent): void;
26
- get applogs(): readonly Applog[];
27
- map<R>(fn: (applog: Applog) => R): R[];
28
- get firstLog(): Applog;
29
- get latestLog(): Applog;
30
- hasApplog(applog: Applog, byRef: boolean): boolean;
31
- hasApplogWithDiffTs(applog: ApplogForInsert): Applog;
32
- get isEmpty(): boolean;
33
- get size(): number;
34
- get untrackedSize(): number;
35
- get nameAndSizeUntracked(): string;
36
- get prettyName(): string;
37
- }
38
-
39
- declare const ApplogStreamTB: _sinclair_typebox.TUnsafe<ApplogStream>;
40
- declare const StringTB: (options?: _sinclair_typebox.StringOptions) => _sinclair_typebox.TString;
41
- declare const OptionalTB: <T extends _sinclair_typebox.TSchema>(schema: T) => _sinclair_typebox.TOptional<T>;
42
- declare const BooleanTB: (options?: _sinclair_typebox.SchemaOptions) => _sinclair_typebox.TBoolean;
43
- declare const ObjectTB: <T extends _sinclair_typebox.TProperties>(properties: T, options?: _sinclair_typebox.ObjectOptions) => _sinclair_typebox.TObject<T>;
44
- declare const NumberTB: (options?: _sinclair_typebox.NumericOptions<number>) => _sinclair_typebox.TNumber;
45
- declare const Str: typeof StringTB;
46
- declare const Num: typeof NumberTB;
47
- declare const Obj: typeof ObjectTB;
48
- declare const Opt: typeof OptionalTB;
49
- declare const Bool: typeof BooleanTB;
50
- declare const STR: ReturnType<typeof Type.String>;
51
- declare const NUM: ReturnType<typeof Type.Number>;
52
- declare const BOOL: ReturnType<typeof Type.Boolean>;
53
- type DefaultTrue = true | boolean;
54
- declare const DefaultTrue: DefaultTrue;
55
- type DefaultFalse = false | boolean;
56
- declare const DefaultFalse: DefaultFalse;
57
- type GenericObject = Record<string, any>;
58
- type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
59
- type PartialBy<T, K extends keyof T> = Omit$1<T, K> & Partial<Pick<T, K>>;
60
- type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
61
- type CoerceToString<T> = T extends string ? T : never;
62
- /**
63
- * Define nominal type of U based on type of T. Similar to Opaque types in Flow
64
- */
65
- type Tagged<T, Tag> = T & {
66
- tag?: Tag;
67
- };
68
- type LastElementOf<T extends readonly unknown[]> = T extends readonly [...unknown[], infer Last] ? Last : never;
69
- declare function checkParityTB(): void;
70
- /** solidjs Setter requires returning something, which I often don't */
71
- type GenericSetter<T> = (newValue: T) => void;
72
-
73
- declare const Nullable: <T extends TSchema>(schema: T) => _sinclair_typebox.TUnion<[T, _sinclair_typebox.TNull]>;
74
- declare const EntityID_LENGTH = 7;
75
- declare const EntityID: _sinclair_typebox.TString;
76
- type EntityID = Static<typeof EntityID>;
77
- type DatomPart = string;
78
- type CidString = Tagged<string, CID>;
79
- type AgentID = EntityID;
80
- type Attribute = string;
81
- type ApplogValue = string | boolean | Number | null;
82
- interface Atom {
83
- en: EntityID;
84
- at: Attribute;
85
- vl: ApplogValue;
86
- }
87
- type AgentHash = string;
88
- type Timestamp = string;
89
- interface Applog extends Atom {
90
- cid: CidString;
91
- pv?: CidString;
92
- ts: Timestamp;
93
- ag: AgentHash;
94
- }
95
- type ApplogNoCid = Omit<Applog, 'cid'>;
96
- type ApplogOptionalCid = PartialBy<Applog, 'cid'>;
97
- type ApplogForInsert = PartialBy<ApplogNoCid, 'ts'>;
98
- type ApplogForInsertOptionalAgent = PartialBy<ApplogForInsert, 'ag'>;
99
- type AtomPattern = Atom | Applog;
100
- interface DatalogStateIdentifier {
101
- lastTS: Timestamp;
102
- }
103
- type ValueOrMatcher<T> = T | readonly T[] | ((value: T) => boolean);
104
- type WithMatchers<T extends Record<string, any>> = {
105
- [K in keyof T & string as `${K}` | `!${K}`]?: ValueOrMatcher<T[K]>;
106
- };
107
- type DatalogQueryPattern = Partial<WithMatchers<Applog>>;
108
- type DatalogQueryPatternArray = DatalogQueryPattern[];
109
- interface DatalogQuery<SELECT extends string> {
110
- find: readonly SELECT[];
111
- where: DatalogQueryPatternArray;
112
- onlyLatest?: boolean;
113
- }
114
- type DatalogQueryResultEntry<SELECT extends string> = Record<StripPrefix<'?', SELECT>, DatomPart>;
115
- type DatalogQueryResultRows<SELECT extends string> = DatalogQueryResultEntry<SELECT>[];
116
- interface SearchContext {
117
- [key: string]: ApplogValue;
118
- }
119
- interface SearchContextWithLog {
120
- context: SearchContext;
121
- applog?: Applog;
122
- }
123
- type ResultContext = SearchContext | null;
124
- type StripPrefix<TPrefix extends string, T extends string> = T extends `${TPrefix}${infer R}` ? R : never;
125
- declare const CIDTB: _sinclair_typebox.TString;
126
- type CIDTB = Static<typeof EntityID>;
127
- declare const URL: _sinclair_typebox.TString;
128
- type URL = Static<typeof URL>;
129
- declare const AppLogTB: _sinclair_typebox.TObject<{
130
- en: _sinclair_typebox.TString;
131
- at: _sinclair_typebox.TString;
132
- vl: _sinclair_typebox.TUnion<[_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNumber]>, _sinclair_typebox.TNull]>;
133
- ts: _sinclair_typebox.TString;
134
- ag: _sinclair_typebox.TString;
135
- }>;
136
- type AppLogTB = Static<typeof AppLogTB>;
137
- declare const AppLogTBC: _sinclair_typebox_compiler.TypeCheck<_sinclair_typebox.TObject<{
138
- en: _sinclair_typebox.TString;
139
- at: _sinclair_typebox.TString;
140
- vl: _sinclair_typebox.TUnion<[_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNumber]>, _sinclair_typebox.TNull]>;
141
- ts: _sinclair_typebox.TString;
142
- ag: _sinclair_typebox.TString;
143
- }>>;
144
- declare const getApplogTypeErrors: (obj: any) => _sinclair_typebox_compiler.ValueError[];
145
- declare const isValidApplog: (value: unknown) => value is {
146
- ts: string;
147
- ag: string;
148
- en: string;
149
- at: string;
150
- vl: string | number | boolean;
151
- };
152
-
153
- export { type Tagged as $, ApplogStream as A, ApplogStreamTB as B, type CidString as C, type DatalogQueryPattern as D, EntityID_LENGTH as E, Str as F, Num as G, Opt as H, Bool as I, STR as J, NUM as K, BOOL as L, DefaultTrue as M, Nullable as N, Obj as O, DefaultFalse as P, type GenericObject as Q, type ResultContext as R, type SearchContext as S, type Timestamp as T, URL as U, type ValueOrMatcher as V, type WithMatchers as W, type Omit$1 as X, type PartialBy as Y, type PromiseType as Z, type CoerceToString as _, type ApplogStreamEvent as a, type LastElementOf as a0, checkParityTB as a1, type GenericSetter as a2, type ApplogValue as b, type Applog as c, type ApplogForInsert as d, type ApplogForInsertOptionalAgent as e, type ApplogNoCid as f, type DatalogQueryResultEntry as g, EntityID as h, isInitEvent as i, type DatomPart as j, type AgentID as k, type Attribute as l, type Atom as m, type AgentHash as n, type ApplogOptionalCid as o, type AtomPattern as p, type DatalogStateIdentifier as q, type DatalogQueryPatternArray as r, type DatalogQuery as s, type DatalogQueryResultRows as t, type SearchContextWithLog as u, CIDTB as v, AppLogTB as w, AppLogTBC as x, getApplogTypeErrors as y, isValidApplog as z };
package/dist/types.cjs DELETED
@@ -1,46 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-JSAJQXI2.cjs');
2
-
3
-
4
- var _chunkZPOYKHY6cjs = require('./chunk-ZPOYKHY6.cjs');
5
- require('./chunk-GT5X2WN4.cjs');
6
- require('./chunk-UOPZAYFM.cjs');
7
-
8
- // src/types/typescript-utils.ts
9
- var _typebox = require('@sinclair/typebox');
10
- var _system = require('@sinclair/typebox/system');
11
- var ApplogStreamTB = _system.TypeSystem.Type("ApplogStream", (options, value) => {
12
- return value instanceof _chunkZPOYKHY6cjs.ApplogStream;
13
- })();
14
- var { String: StringTB, Optional: OptionalTB, Boolean: BooleanTB, Object: ObjectTB, Number: NumberTB } = _typebox.Type;
15
- var Str = StringTB.bind(_typebox.Type);
16
- var Num = NumberTB.bind(_typebox.Type);
17
- var Obj = ObjectTB.bind(_typebox.Type);
18
- var Opt = OptionalTB.bind(_typebox.Type);
19
- var Bool = BooleanTB.bind(_typebox.Type);
20
- var STR = Str();
21
- var NUM = Num();
22
- var BOOL = Bool();
23
- var DefaultTrue = true;
24
- var DefaultFalse = false;
25
- function checkParityTB() {
26
- const s1 = Str();
27
- const s2 = Str();
28
- const n1 = Num();
29
- const n2 = Num();
30
- console.log({ s1, s2, n1, n2 });
31
- }
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- exports.ApplogStreamTB = ApplogStreamTB; exports.BOOL = BOOL; exports.Bool = Bool; exports.DefaultFalse = DefaultFalse; exports.DefaultTrue = DefaultTrue; exports.NUM = NUM; exports.Num = Num; exports.Obj = Obj; exports.Opt = Opt; exports.STR = STR; exports.Str = Str; exports.checkParityTB = checkParityTB;
46
- //# sourceMappingURL=types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types/typescript-utils.ts"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,QAAQ,SAAS;AAC1B,SAAS,kBAAkB;AAIpB,IAAM,iBAAiB,WAAW,KAAmB,gBAAgB,CAAC,SAAS,UAAU;AAC/F,SAAO,iBAAiB;AACzB,CAAC,EAAE;AACH,IAAM,EAAE,QAAQ,UAAU,UAAU,YAAY,SAAS,WAAW,QAAQ,UAAU,QAAQ,SAAS,IAAI;AACpG,IAAM,MAAuB,SAAS,KAAK,CAAC;AAC5C,IAAM,MAAuB,SAAS,KAAK,CAAC;AAC5C,IAAM,MAAuB,SAAS,KAAK,CAAC;AAC5C,IAAM,MAAyB,WAAW,KAAK,CAAC;AAChD,IAAM,OAAyB,UAAU,KAAK,CAAC;AAE/C,IAAM,MAAmC,IAAI;AAC7C,IAAM,MAAmC,IAAI;AAC7C,IAAM,OAAqC,KAAK;AAGhD,IAAM,cAA2B;AAGjC,IAAM,eAA6B;AAwBnC,SAAS,gBAAgB;AAI/B,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,IAAI;AACf,UAAQ,IAAI,EAAE,IAAI,IAAI,IAAI,GAAG,CAAC;AAC/B","sourcesContent":["import { Type as T } from '@sinclair/typebox'\nimport { TypeSystem } from '@sinclair/typebox/system'\nimport type { CID } from 'multiformats'\nimport { ApplogStream } from '../stream'\n\nexport const ApplogStreamTB = TypeSystem.Type<ApplogStream>('ApplogStream', (options, value) => {\n\treturn value instanceof ApplogStream\n})()\nconst { String: StringTB, Optional: OptionalTB, Boolean: BooleanTB, Object: ObjectTB, Number: NumberTB } = T\nexport const Str: typeof StringTB = StringTB.bind(T)\nexport const Num: typeof NumberTB = NumberTB.bind(T)\nexport const Obj: typeof ObjectTB = ObjectTB.bind(T)\nexport const Opt: typeof OptionalTB = OptionalTB.bind(T)\nexport const Bool: typeof BooleanTB = BooleanTB.bind(T)\n\nexport const STR: ReturnType<typeof T.String> = Str()\nexport const NUM: ReturnType<typeof T.Number> = Num()\nexport const BOOL: ReturnType<typeof T.Boolean> = Bool()\n\nexport type DefaultTrue = true | boolean\nexport const DefaultTrue: DefaultTrue = true\n\nexport type DefaultFalse = false | boolean\nexport const DefaultFalse: DefaultFalse = false\n\nexport type GenericObject = Record<string, any>\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>\nexport type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never\n\nexport type CoerceToString<T> = T extends string ? T : never\n\n/**\n * Define nominal type of U based on type of T. Similar to Opaque types in Flow\n */\nexport type Tagged<T, Tag> = T & { tag?: Tag }\n\n// export interface Service {\n// \tendpoint?: URL\n// \ttoken: string\n// \trateLimiter?: RateLimiter\n// \tfetch?: typeof _fetch\n// }\n\n// https://stackoverflow.com/a/76276541\nexport type LastElementOf<T extends readonly unknown[]> = T extends readonly [...unknown[], infer Last] ? Last : never\n\nexport function checkParityTB() {\n\t/* Most examples are constantly calling Type.*() - needed to check if its really needed\n https://github.com/sinclairzx81/typebox/issues/587#issuecomment-1712457623\n */\n\tconst s1 = Str()\n\tconst s2 = Str()\n\tconst n1 = Num()\n\tconst n2 = Num()\n\tconsole.log({ s1, s2, n1, n2 })\n}\n\n/** solidjs Setter requires returning something, which I often don't */\nexport type GenericSetter<T> = (newValue: T) => void\n"]}
package/dist/types.d.cts DELETED
@@ -1,4 +0,0 @@
1
- export { B as ApplogStreamTB, L as BOOL, I as Bool, _ as CoerceToString, P as DefaultFalse, M as DefaultTrue, Q as GenericObject, a2 as GenericSetter, a0 as LastElementOf, K as NUM, G as Num, O as Obj, X as Omit, H as Opt, Y as PartialBy, Z as PromiseType, J as STR, F as Str, $ as Tagged, a1 as checkParityTB } from './types-A9kYLtyU.cjs';
2
- import '@sinclair/typebox';
3
- import '@sinclair/typebox/compiler';
4
- import 'multiformats/cid';
package/dist/types.js DELETED
@@ -1,46 +0,0 @@
1
- import "./chunk-KGTU6PJ3.js";
2
- import {
3
- ApplogStream
4
- } from "./chunk-KHY3SRML.js";
5
- import "./chunk-QXNFGJ5R.js";
6
- import "./chunk-F3FYYIAV.js";
7
-
8
- // src/types/typescript-utils.ts
9
- import { Type as T } from "@sinclair/typebox";
10
- import { TypeSystem } from "@sinclair/typebox/system";
11
- var ApplogStreamTB = TypeSystem.Type("ApplogStream", (options, value) => {
12
- return value instanceof ApplogStream;
13
- })();
14
- var { String: StringTB, Optional: OptionalTB, Boolean: BooleanTB, Object: ObjectTB, Number: NumberTB } = T;
15
- var Str = StringTB.bind(T);
16
- var Num = NumberTB.bind(T);
17
- var Obj = ObjectTB.bind(T);
18
- var Opt = OptionalTB.bind(T);
19
- var Bool = BooleanTB.bind(T);
20
- var STR = Str();
21
- var NUM = Num();
22
- var BOOL = Bool();
23
- var DefaultTrue = true;
24
- var DefaultFalse = false;
25
- function checkParityTB() {
26
- const s1 = Str();
27
- const s2 = Str();
28
- const n1 = Num();
29
- const n2 = Num();
30
- console.log({ s1, s2, n1, n2 });
31
- }
32
- export {
33
- ApplogStreamTB,
34
- BOOL,
35
- Bool,
36
- DefaultFalse,
37
- DefaultTrue,
38
- NUM,
39
- Num,
40
- Obj,
41
- Opt,
42
- STR,
43
- Str,
44
- checkParityTB
45
- };
46
- //# sourceMappingURL=types.js.map
package/dist/utils.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";//# sourceMappingURL=utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
package/dist/utils.d.cts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/utils.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=utils.js.map
@@ -1,16 +0,0 @@
1
- import { A as ApplogStream, c as Applog, d as ApplogForInsert } from './types-A9kYLtyU.js';
2
-
3
- declare abstract class WriteableApplogStream extends ApplogStream {
4
- constructor(parents: ApplogStream | ApplogStream[] | null, filters: string[], applogs: Applog[], name: string);
5
- insert(appLogsToInsert: ApplogForInsert[]): Applog[];
6
- get readOnly(): boolean;
7
- protected abstract persist(logs: Applog[]): any;
8
- }
9
- declare class ApplogStreamInMemory extends WriteableApplogStream {
10
- readonly _readOnly: boolean;
11
- constructor(applogs: Applog[], filters: string[], name: string, _readOnly: boolean, parents?: ApplogStream | ApplogStream[] | null);
12
- get readOnly(): boolean;
13
- protected persist(logs: Applog[]): void;
14
- }
15
-
16
- export { ApplogStreamInMemory as A, WriteableApplogStream as W };
File without changes
File without changes
File without changes
File without changes