@walkeros/server-destination-sqlite 3.4.0-next-1776749829492
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 +132 -0
- package/dist/dev.d.mts +158 -0
- package/dist/dev.d.ts +158 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +110 -0
- package/dist/examples/index.d.ts +110 -0
- package/dist/examples/index.js +214 -0
- package/dist/examples/index.mjs +192 -0
- package/dist/index.d.mts +172 -0
- package/dist/index.d.ts +172 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/walkerOS.json +535 -0
- package/package.json +92 -0
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# @walkeros/server-destination-sqlite
|
|
2
|
+
|
|
3
|
+
Server-side SQLite destination for
|
|
4
|
+
[walkerOS](https://github.com/elbwalker/walkerOS). Writes events to a local
|
|
5
|
+
SQLite file (via `better-sqlite3`) or a remote Turso / libSQL / sqld database
|
|
6
|
+
(via `@libsql/client`). Driver is auto-selected from the connection URL. Both
|
|
7
|
+
SDKs are optional peer dependencies -- install only what you need.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @walkeros/server-destination-sqlite better-sqlite3
|
|
13
|
+
# or for remote Turso / libSQL
|
|
14
|
+
npm install @walkeros/server-destination-sqlite @libsql/client
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Local file:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"destinations": {
|
|
24
|
+
"sqlite": {
|
|
25
|
+
"package": "@walkeros/server-destination-sqlite",
|
|
26
|
+
"config": {
|
|
27
|
+
"settings": {
|
|
28
|
+
"sqlite": {
|
|
29
|
+
"url": "./events.db"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Remote Turso:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"destinations": {
|
|
43
|
+
"sqlite": {
|
|
44
|
+
"package": "@walkeros/server-destination-sqlite",
|
|
45
|
+
"config": {
|
|
46
|
+
"settings": {
|
|
47
|
+
"sqlite": {
|
|
48
|
+
"url": "libsql://my-db.turso.io",
|
|
49
|
+
"authToken": "$env.TURSO_TOKEN"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Settings
|
|
59
|
+
|
|
60
|
+
| Setting | Type | Required | Default | Description |
|
|
61
|
+
| ------------------ | -------------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `sqlite.url` | `string` | Yes | -- | Connection URL. `libsql://`, `http(s)://`, `ws(s)://` route to libSQL. Anything else is treated as a local file. Use `:memory:` for in-memory. |
|
|
63
|
+
| `sqlite.authToken` | `string` | No | -- | libSQL / Turso auth token. Ignored for local. |
|
|
64
|
+
| `sqlite.table` | `string` | No | `events` | Target table name. |
|
|
65
|
+
| `sqlite.schema` | `'auto' \| 'manual'` | No | `'auto'` | `auto` runs `CREATE TABLE IF NOT EXISTS` on init. `manual` skips creation (bring your own schema + mapping). |
|
|
66
|
+
|
|
67
|
+
## Per-rule mapping overrides
|
|
68
|
+
|
|
69
|
+
| Setting | Type | Description |
|
|
70
|
+
| ------------------------ | -------- | ------------------------------------ |
|
|
71
|
+
| `mapping.settings.table` | `string` | Override target table for this rule. |
|
|
72
|
+
|
|
73
|
+
## Auto Schema
|
|
74
|
+
|
|
75
|
+
With `schema: 'auto'` (the default), the first `init()` runs:
|
|
76
|
+
|
|
77
|
+
```sql
|
|
78
|
+
CREATE TABLE IF NOT EXISTS events (
|
|
79
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
80
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
81
|
+
timestamp INTEGER,
|
|
82
|
+
event_id TEXT,
|
|
83
|
+
name TEXT,
|
|
84
|
+
entity TEXT,
|
|
85
|
+
action TEXT,
|
|
86
|
+
session_id TEXT,
|
|
87
|
+
user_id TEXT,
|
|
88
|
+
page_url TEXT,
|
|
89
|
+
page_title TEXT,
|
|
90
|
+
referrer_url TEXT,
|
|
91
|
+
data TEXT,
|
|
92
|
+
globals TEXT,
|
|
93
|
+
consent TEXT
|
|
94
|
+
)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Nested JSON fields (`data`, `globals`, `consent`) are stored as JSON strings.
|
|
98
|
+
`page_url` comes from `source.id`; `page_title` from `data.title`;
|
|
99
|
+
`referrer_url` from `source.previous_id`.
|
|
100
|
+
|
|
101
|
+
## Drivers
|
|
102
|
+
|
|
103
|
+
- **Local** (`better-sqlite3`): sync native driver, ideal for single-host
|
|
104
|
+
deployments. URL is treated as a filesystem path. `:memory:` works too.
|
|
105
|
+
- **Remote** (`@libsql/client`): async HTTP/WSS driver for Turso, sqld, or
|
|
106
|
+
self-hosted libSQL. Auth via `authToken`.
|
|
107
|
+
|
|
108
|
+
Both are peer dependencies. The destination picks the driver at `init()` time
|
|
109
|
+
based on the URL prefix.
|
|
110
|
+
|
|
111
|
+
## Shutdown
|
|
112
|
+
|
|
113
|
+
The destination calls `close()` on the connection during `destroy()`.
|
|
114
|
+
User-provided clients (wired in via `env.client` or `settings.sqlite._client`)
|
|
115
|
+
are not closed.
|
|
116
|
+
|
|
117
|
+
## Limitations
|
|
118
|
+
|
|
119
|
+
- v1 issues one `INSERT` per event. A `pushBatch` path is planned for v2.
|
|
120
|
+
- Connection death is not auto-retried. A fatal driver error logs and drops
|
|
121
|
+
events until the flow restarts.
|
|
122
|
+
- `schema: 'manual'` skips `CREATE TABLE` but still uses the canonical column
|
|
123
|
+
layout for the prepared INSERT. If your custom table has a different shape,
|
|
124
|
+
also provide a mapping that produces matching args.
|
|
125
|
+
|
|
126
|
+
## Type Definitions
|
|
127
|
+
|
|
128
|
+
See [src/types/index.ts](./src/types/index.ts).
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT.
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { DestinationServer } from '@walkeros/server-core';
|
|
4
|
+
import { Flow } from '@walkeros/core';
|
|
5
|
+
|
|
6
|
+
declare const SqliteSettingsSchema: z.ZodObject<{
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
authToken: z.ZodOptional<z.ZodString>;
|
|
9
|
+
table: z.ZodOptional<z.ZodString>;
|
|
10
|
+
schema: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
auto: "auto";
|
|
12
|
+
manual: "manual";
|
|
13
|
+
}>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
16
|
+
sqlite: z.ZodObject<{
|
|
17
|
+
url: z.ZodString;
|
|
18
|
+
authToken: z.ZodOptional<z.ZodString>;
|
|
19
|
+
table: z.ZodOptional<z.ZodString>;
|
|
20
|
+
schema: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
auto: "auto";
|
|
22
|
+
manual: "manual";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
27
|
+
|
|
28
|
+
declare const MappingSchema: z.ZodObject<{
|
|
29
|
+
table: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
32
|
+
|
|
33
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
34
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
35
|
+
|
|
36
|
+
type index$1_Mapping = Mapping;
|
|
37
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
38
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
39
|
+
declare const index$1_SqliteSettingsSchema: typeof SqliteSettingsSchema;
|
|
40
|
+
declare const index$1_mapping: typeof mapping;
|
|
41
|
+
declare const index$1_settings: typeof settings;
|
|
42
|
+
declare namespace index$1 {
|
|
43
|
+
export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_SqliteSettingsSchema as SqliteSettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type SchemaMode = 'auto' | 'manual';
|
|
47
|
+
/**
|
|
48
|
+
* Thin cross-driver connection interface. Both drivers are adapted to this shape.
|
|
49
|
+
* Production code uses the adapters in src/drivers/*; tests inject a mock client
|
|
50
|
+
* via env.client to capture sql/args without touching a real database.
|
|
51
|
+
*/
|
|
52
|
+
interface SqliteClient {
|
|
53
|
+
/** Execute a SQL statement. Used for CREATE TABLE and ad-hoc commands. */
|
|
54
|
+
execute: (sql: string, args?: ReadonlyArray<unknown>) => Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Prepare a statement for repeated execution. Returned function binds args and runs.
|
|
57
|
+
*/
|
|
58
|
+
prepare: (sql: string) => (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
59
|
+
/** Close the connection. */
|
|
60
|
+
close: () => Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Factory that constructs an SqliteClient from the user's connection settings.
|
|
64
|
+
* Used by env.SqliteDriver so tests can inject a spy without mocking node_modules.
|
|
65
|
+
*/
|
|
66
|
+
type SqliteClientFactory = (url: string, authToken?: string) => Promise<SqliteClient>;
|
|
67
|
+
interface SqliteSettings {
|
|
68
|
+
/**
|
|
69
|
+
* Connection URL. Starts with `libsql://`, `http://`, `https://`, `wss://`, `ws://`
|
|
70
|
+
* → libSQL driver. Anything else → better-sqlite3 (treated as a file path).
|
|
71
|
+
* Special value `:memory:` → in-memory (better-sqlite3).
|
|
72
|
+
*/
|
|
73
|
+
url: string;
|
|
74
|
+
/** libSQL / Turso auth token. Ignored for better-sqlite3. */
|
|
75
|
+
authToken?: string;
|
|
76
|
+
/** Target table name. Defaults to `events`. */
|
|
77
|
+
table?: string;
|
|
78
|
+
/**
|
|
79
|
+
* `auto` runs `CREATE TABLE IF NOT EXISTS` with the canonical schema on init.
|
|
80
|
+
* `manual` skips CREATE TABLE. The user brings their own schema and mapping.
|
|
81
|
+
* Defaults to `auto`.
|
|
82
|
+
*/
|
|
83
|
+
schema?: SchemaMode;
|
|
84
|
+
_client?: SqliteClient;
|
|
85
|
+
_runInsert?: (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
86
|
+
_ownedClient?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface Settings {
|
|
89
|
+
sqlite: SqliteSettings;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Env -- optional driver override. Production leaves this undefined and the
|
|
93
|
+
* destination loads better-sqlite3 or @libsql/client dynamically. Tests
|
|
94
|
+
* provide a factory via `SqliteDriver` or a pre-built client via `client`.
|
|
95
|
+
*/
|
|
96
|
+
interface Env extends DestinationServer.Env {
|
|
97
|
+
SqliteDriver?: SqliteClientFactory;
|
|
98
|
+
client?: SqliteClient;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare const push: Env;
|
|
102
|
+
/**
|
|
103
|
+
* Simulation tracking paths. Specifies which function calls to record when
|
|
104
|
+
* running step examples through the collector.
|
|
105
|
+
*/
|
|
106
|
+
declare const simulation: string[];
|
|
107
|
+
|
|
108
|
+
declare const env_push: typeof push;
|
|
109
|
+
declare const env_simulation: typeof simulation;
|
|
110
|
+
declare namespace env {
|
|
111
|
+
export { env_push as push, env_simulation as simulation };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
116
|
+
*/
|
|
117
|
+
type SqliteStepExample = Flow.StepExample & {
|
|
118
|
+
settings?: Partial<Settings>;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Canonical insert into the default `events` table. `out` records the
|
|
122
|
+
* column args the prepared INSERT is bound with.
|
|
123
|
+
*/
|
|
124
|
+
declare const defaultInsert: SqliteStepExample;
|
|
125
|
+
/**
|
|
126
|
+
* Custom table name. Verifies table overrides while using the canonical column set.
|
|
127
|
+
*/
|
|
128
|
+
declare const customTable: SqliteStepExample;
|
|
129
|
+
/**
|
|
130
|
+
* Order event with numeric data. Confirms JSON serialization of nested values.
|
|
131
|
+
*/
|
|
132
|
+
declare const orderComplete: SqliteStepExample;
|
|
133
|
+
/**
|
|
134
|
+
* Table override per rule -- routes this event to a dedicated table.
|
|
135
|
+
*/
|
|
136
|
+
declare const tableOverride: SqliteStepExample;
|
|
137
|
+
/**
|
|
138
|
+
* Ignored event -- mapping.ignore: true produces no insert call.
|
|
139
|
+
*/
|
|
140
|
+
declare const ignoredEvent: SqliteStepExample;
|
|
141
|
+
|
|
142
|
+
type step_SqliteStepExample = SqliteStepExample;
|
|
143
|
+
declare const step_customTable: typeof customTable;
|
|
144
|
+
declare const step_defaultInsert: typeof defaultInsert;
|
|
145
|
+
declare const step_ignoredEvent: typeof ignoredEvent;
|
|
146
|
+
declare const step_orderComplete: typeof orderComplete;
|
|
147
|
+
declare const step_tableOverride: typeof tableOverride;
|
|
148
|
+
declare namespace step {
|
|
149
|
+
export { type step_SqliteStepExample as SqliteStepExample, step_customTable as customTable, step_defaultInsert as defaultInsert, step_ignoredEvent as ignoredEvent, step_orderComplete as orderComplete, step_tableOverride as tableOverride };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare const index_env: typeof env;
|
|
153
|
+
declare const index_step: typeof step;
|
|
154
|
+
declare namespace index {
|
|
155
|
+
export { index_env as env, index_step as step };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { DestinationServer } from '@walkeros/server-core';
|
|
4
|
+
import { Flow } from '@walkeros/core';
|
|
5
|
+
|
|
6
|
+
declare const SqliteSettingsSchema: z.ZodObject<{
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
authToken: z.ZodOptional<z.ZodString>;
|
|
9
|
+
table: z.ZodOptional<z.ZodString>;
|
|
10
|
+
schema: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
auto: "auto";
|
|
12
|
+
manual: "manual";
|
|
13
|
+
}>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
16
|
+
sqlite: z.ZodObject<{
|
|
17
|
+
url: z.ZodString;
|
|
18
|
+
authToken: z.ZodOptional<z.ZodString>;
|
|
19
|
+
table: z.ZodOptional<z.ZodString>;
|
|
20
|
+
schema: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
auto: "auto";
|
|
22
|
+
manual: "manual";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
27
|
+
|
|
28
|
+
declare const MappingSchema: z.ZodObject<{
|
|
29
|
+
table: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
32
|
+
|
|
33
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
34
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
35
|
+
|
|
36
|
+
type index$1_Mapping = Mapping;
|
|
37
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
38
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
39
|
+
declare const index$1_SqliteSettingsSchema: typeof SqliteSettingsSchema;
|
|
40
|
+
declare const index$1_mapping: typeof mapping;
|
|
41
|
+
declare const index$1_settings: typeof settings;
|
|
42
|
+
declare namespace index$1 {
|
|
43
|
+
export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_SqliteSettingsSchema as SqliteSettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type SchemaMode = 'auto' | 'manual';
|
|
47
|
+
/**
|
|
48
|
+
* Thin cross-driver connection interface. Both drivers are adapted to this shape.
|
|
49
|
+
* Production code uses the adapters in src/drivers/*; tests inject a mock client
|
|
50
|
+
* via env.client to capture sql/args without touching a real database.
|
|
51
|
+
*/
|
|
52
|
+
interface SqliteClient {
|
|
53
|
+
/** Execute a SQL statement. Used for CREATE TABLE and ad-hoc commands. */
|
|
54
|
+
execute: (sql: string, args?: ReadonlyArray<unknown>) => Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Prepare a statement for repeated execution. Returned function binds args and runs.
|
|
57
|
+
*/
|
|
58
|
+
prepare: (sql: string) => (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
59
|
+
/** Close the connection. */
|
|
60
|
+
close: () => Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Factory that constructs an SqliteClient from the user's connection settings.
|
|
64
|
+
* Used by env.SqliteDriver so tests can inject a spy without mocking node_modules.
|
|
65
|
+
*/
|
|
66
|
+
type SqliteClientFactory = (url: string, authToken?: string) => Promise<SqliteClient>;
|
|
67
|
+
interface SqliteSettings {
|
|
68
|
+
/**
|
|
69
|
+
* Connection URL. Starts with `libsql://`, `http://`, `https://`, `wss://`, `ws://`
|
|
70
|
+
* → libSQL driver. Anything else → better-sqlite3 (treated as a file path).
|
|
71
|
+
* Special value `:memory:` → in-memory (better-sqlite3).
|
|
72
|
+
*/
|
|
73
|
+
url: string;
|
|
74
|
+
/** libSQL / Turso auth token. Ignored for better-sqlite3. */
|
|
75
|
+
authToken?: string;
|
|
76
|
+
/** Target table name. Defaults to `events`. */
|
|
77
|
+
table?: string;
|
|
78
|
+
/**
|
|
79
|
+
* `auto` runs `CREATE TABLE IF NOT EXISTS` with the canonical schema on init.
|
|
80
|
+
* `manual` skips CREATE TABLE. The user brings their own schema and mapping.
|
|
81
|
+
* Defaults to `auto`.
|
|
82
|
+
*/
|
|
83
|
+
schema?: SchemaMode;
|
|
84
|
+
_client?: SqliteClient;
|
|
85
|
+
_runInsert?: (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
86
|
+
_ownedClient?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface Settings {
|
|
89
|
+
sqlite: SqliteSettings;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Env -- optional driver override. Production leaves this undefined and the
|
|
93
|
+
* destination loads better-sqlite3 or @libsql/client dynamically. Tests
|
|
94
|
+
* provide a factory via `SqliteDriver` or a pre-built client via `client`.
|
|
95
|
+
*/
|
|
96
|
+
interface Env extends DestinationServer.Env {
|
|
97
|
+
SqliteDriver?: SqliteClientFactory;
|
|
98
|
+
client?: SqliteClient;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare const push: Env;
|
|
102
|
+
/**
|
|
103
|
+
* Simulation tracking paths. Specifies which function calls to record when
|
|
104
|
+
* running step examples through the collector.
|
|
105
|
+
*/
|
|
106
|
+
declare const simulation: string[];
|
|
107
|
+
|
|
108
|
+
declare const env_push: typeof push;
|
|
109
|
+
declare const env_simulation: typeof simulation;
|
|
110
|
+
declare namespace env {
|
|
111
|
+
export { env_push as push, env_simulation as simulation };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
116
|
+
*/
|
|
117
|
+
type SqliteStepExample = Flow.StepExample & {
|
|
118
|
+
settings?: Partial<Settings>;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Canonical insert into the default `events` table. `out` records the
|
|
122
|
+
* column args the prepared INSERT is bound with.
|
|
123
|
+
*/
|
|
124
|
+
declare const defaultInsert: SqliteStepExample;
|
|
125
|
+
/**
|
|
126
|
+
* Custom table name. Verifies table overrides while using the canonical column set.
|
|
127
|
+
*/
|
|
128
|
+
declare const customTable: SqliteStepExample;
|
|
129
|
+
/**
|
|
130
|
+
* Order event with numeric data. Confirms JSON serialization of nested values.
|
|
131
|
+
*/
|
|
132
|
+
declare const orderComplete: SqliteStepExample;
|
|
133
|
+
/**
|
|
134
|
+
* Table override per rule -- routes this event to a dedicated table.
|
|
135
|
+
*/
|
|
136
|
+
declare const tableOverride: SqliteStepExample;
|
|
137
|
+
/**
|
|
138
|
+
* Ignored event -- mapping.ignore: true produces no insert call.
|
|
139
|
+
*/
|
|
140
|
+
declare const ignoredEvent: SqliteStepExample;
|
|
141
|
+
|
|
142
|
+
type step_SqliteStepExample = SqliteStepExample;
|
|
143
|
+
declare const step_customTable: typeof customTable;
|
|
144
|
+
declare const step_defaultInsert: typeof defaultInsert;
|
|
145
|
+
declare const step_ignoredEvent: typeof ignoredEvent;
|
|
146
|
+
declare const step_orderComplete: typeof orderComplete;
|
|
147
|
+
declare const step_tableOverride: typeof tableOverride;
|
|
148
|
+
declare namespace step {
|
|
149
|
+
export { type step_SqliteStepExample as SqliteStepExample, step_customTable as customTable, step_defaultInsert as defaultInsert, step_ignoredEvent as ignoredEvent, step_orderComplete as orderComplete, step_tableOverride as tableOverride };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare const index_env: typeof env;
|
|
153
|
+
declare const index_step: typeof step;
|
|
154
|
+
declare namespace index {
|
|
155
|
+
export { index_env as env, index_step as step };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,r)=>{for(var s in r)t(e,s,{get:r[s],enumerable:!0})},n={};o(n,{examples:()=>b,schemas:()=>a}),module.exports=(e=n,((e,o,n,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let l of s(o))i.call(e,l)||l===n||t(e,l,{get:()=>o[l],enumerable:!(a=r(o,l))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};o(a,{MappingSchema:()=>d,SettingsSchema:()=>m,SqliteSettingsSchema:()=>p,mapping:()=>g,settings:()=>v});var l=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),p=c.z.object({url:c.z.string().min(1).describe("SQLite connection URL. libsql://, http(s)://, ws(s):// route to libSQL/Turso. Anything else is treated as a local file path via better-sqlite3. Use ':memory:' for an ephemeral in-memory database."),authToken:c.z.string().describe("libSQL / Turso auth token. Ignored for better-sqlite3 (local) connections.").optional(),table:c.z.string().describe('Target table name. Defaults to "events".').optional(),schema:c.z.enum(["auto","manual"]).describe('"auto" creates the canonical events table with CREATE TABLE IF NOT EXISTS on init. "manual" skips table creation. The user brings their own schema and mapping.').optional()}),m=c.z.object({sqlite:p.describe("SQLite / libSQL configuration (like { url: './events.db' } or { url: 'libsql://my-db.turso.io', authToken: '...' })")}),u=require("@walkeros/core/dev"),d=u.z.object({table:u.z.string().describe("Override target table name for this rule. Takes precedence over settings.sqlite.table.").optional()}),v=(0,l.zodToSchema)(m),g=(0,l.zodToSchema)(d),b={};o(b,{env:()=>y,step:()=>O});var y={};o(y,{push:()=>h,simulation:()=>S});var f={execute:()=>Promise.resolve(),prepare:()=>()=>Promise.resolve(),close:()=>Promise.resolve()},h={SqliteDriver:()=>Promise.resolve(f)},S=["call:client.prepare","call:client.execute"],O={};o(O,{customTable:()=>q,defaultInsert:()=>T,ignoredEvent:()=>E,orderComplete:()=>w,tableOverride:()=>J});var N=require("@walkeros/core"),T={in:(0,N.getEvent)("page view",{timestamp:1700000100,id:"evt-1",user:{session:"sess-1",id:"user-42"},data:{title:"Home"},source:{type:"server",id:"https://example.com/",previous_id:"https://example.com/prev"},globals:{env:"prod"},consent:{analytics:!0}}),out:[["client.runInsert",[1700000100,"evt-1","page view","page","view","sess-1","user-42","https://example.com/","Home","https://example.com/prev",JSON.stringify({title:"Home"}),JSON.stringify({env:"prod"}),JSON.stringify({analytics:!0})]]]},q={in:(0,N.getEvent)("form submit",{timestamp:1700000101,id:"evt-2",user:{session:"sess-99",id:""},data:{type:"contact"},source:{type:"server",id:"https://example.com/contact",previous_id:""},globals:{},consent:{}}),settings:{sqlite:{url:":memory:",table:"siteEvents"}},out:[["client.runInsert",[1700000101,"evt-2","form submit","form","submit","sess-99","","https://example.com/contact","","",JSON.stringify({type:"contact"}),JSON.stringify({}),JSON.stringify({})]]]},w={in:(0,N.getEvent)("order complete",{timestamp:1700000102,id:"evt-3",user:{session:"",id:""},data:{id:"ORD-1",total:99},source:{type:"server",id:"",previous_id:""},globals:{},consent:{}}),out:[["client.runInsert",[1700000102,"evt-3","order complete","order","complete","","","","","",JSON.stringify({id:"ORD-1",total:99}),JSON.stringify({}),JSON.stringify({})]]]},J={in:(0,N.getEvent)("order complete",{timestamp:1700000103,id:"evt-4",user:{session:"",id:""},data:{id:"ORD-2",total:42},source:{type:"server",id:"",previous_id:""},globals:{},consent:{}}),mapping:{settings:{table:"orders"}},out:[["client.runInsert",[1700000103,"evt-4","order complete","order","complete","","","","","",JSON.stringify({id:"ORD-2",total:42}),JSON.stringify({}),JSON.stringify({})]]]},E={in:(0,N.getEvent)("debug noise",{timestamp:1700000104,id:"evt-5",source:{type:"server",id:"",previous_id:""}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n SqliteSettingsSchema,\n type Settings,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SqliteSettingsSchema = z.object({\n url: z\n .string()\n .min(1)\n .describe(\n \"SQLite connection URL. libsql://, http(s)://, ws(s):// route to libSQL/Turso. Anything else is treated as a local file path via better-sqlite3. Use ':memory:' for an ephemeral in-memory database.\",\n ),\n authToken: z\n .string()\n .describe(\n 'libSQL / Turso auth token. Ignored for better-sqlite3 (local) connections.',\n )\n .optional(),\n table: z\n .string()\n .describe('Target table name. Defaults to \"events\".')\n .optional(),\n schema: z\n .enum(['auto', 'manual'])\n .describe(\n '\"auto\" creates the canonical events table with CREATE TABLE IF NOT EXISTS on init. \"manual\" skips table creation. The user brings their own schema and mapping.',\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n sqlite: SqliteSettingsSchema.describe(\n \"SQLite / libSQL configuration (like { url: './events.db' } or { url: 'libsql://my-db.turso.io', authToken: '...' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n table: z\n .string()\n .describe(\n 'Override target table name for this rule. Takes precedence over settings.sqlite.table.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SqliteClient, SqliteClientFactory } from '../types';\n\n// Narrow helper type aliases so mock functions are typed without `any`.\ntype ExecuteFn = (sql: string, args?: ReadonlyArray<unknown>) => Promise<void>;\ntype PrepareFn = (\n sql: string,\n) => (args: ReadonlyArray<unknown>) => Promise<void>;\ntype CloseFn = () => Promise<void>;\n\nconst asyncExecute: ExecuteFn = () => Promise.resolve();\nconst asyncClose: CloseFn = () => Promise.resolve();\nconst asyncPrepare: PrepareFn = () => () => Promise.resolve();\n\nconst mockClient: SqliteClient = {\n execute: asyncExecute,\n prepare: asyncPrepare,\n close: asyncClose,\n};\n\nconst mockFactory: SqliteClientFactory = () => Promise.resolve(mockClient);\n\nexport const push: Env = {\n SqliteDriver: mockFactory,\n};\n\n/**\n * Simulation tracking paths. Specifies which function calls to record when\n * running step examples through the collector.\n */\nexport const simulation = ['call:client.prepare', 'call:client.execute'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SqliteStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Canonical insert into the default `events` table. `out` records the\n * column args the prepared INSERT is bound with.\n */\nexport const defaultInsert: SqliteStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000100,\n id: 'evt-1',\n user: { session: 'sess-1', id: 'user-42' },\n data: { title: 'Home' },\n source: {\n type: 'server',\n id: 'https://example.com/',\n previous_id: 'https://example.com/prev',\n },\n globals: { env: 'prod' },\n consent: { analytics: true },\n }),\n out: [\n [\n 'client.runInsert',\n [\n 1700000100,\n 'evt-1',\n 'page view',\n 'page',\n 'view',\n 'sess-1',\n 'user-42',\n 'https://example.com/',\n 'Home',\n 'https://example.com/prev',\n JSON.stringify({ title: 'Home' }),\n JSON.stringify({ env: 'prod' }),\n JSON.stringify({ analytics: true }),\n ],\n ],\n ],\n};\n\n/**\n * Custom table name. Verifies table overrides while using the canonical column set.\n */\nexport const customTable: SqliteStepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000101,\n id: 'evt-2',\n user: { session: 'sess-99', id: '' },\n data: { type: 'contact' },\n source: {\n type: 'server',\n id: 'https://example.com/contact',\n previous_id: '',\n },\n globals: {},\n consent: {},\n }),\n settings: {\n sqlite: {\n url: ':memory:',\n table: 'siteEvents',\n },\n },\n out: [\n [\n 'client.runInsert',\n [\n 1700000101,\n 'evt-2',\n 'form submit',\n 'form',\n 'submit',\n 'sess-99',\n '',\n 'https://example.com/contact',\n '',\n '',\n JSON.stringify({ type: 'contact' }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Order event with numeric data. Confirms JSON serialization of nested values.\n */\nexport const orderComplete: SqliteStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: 'evt-3',\n user: { session: '', id: '' },\n data: { id: 'ORD-1', total: 99 },\n source: { type: 'server', id: '', previous_id: '' },\n globals: {},\n consent: {},\n }),\n out: [\n [\n 'client.runInsert',\n [\n 1700000102,\n 'evt-3',\n 'order complete',\n 'order',\n 'complete',\n '',\n '',\n '',\n '',\n '',\n JSON.stringify({ id: 'ORD-1', total: 99 }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Table override per rule -- routes this event to a dedicated table.\n */\nexport const tableOverride: SqliteStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000103,\n id: 'evt-4',\n user: { session: '', id: '' },\n data: { id: 'ORD-2', total: 42 },\n source: { type: 'server', id: '', previous_id: '' },\n globals: {},\n consent: {},\n }),\n mapping: {\n settings: {\n table: 'orders',\n },\n },\n out: [\n [\n 'client.runInsert',\n [\n 1700000103,\n 'evt-4',\n 'order complete',\n 'order',\n 'complete',\n '',\n '',\n '',\n '',\n '',\n JSON.stringify({ id: 'ORD-2', total: 42 }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no insert call.\n */\nexport const ignoredEvent: SqliteStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000104,\n id: 'evt-5',\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,uBAAuB,aAAE,OAAO;AAAA,EAC3C,KAAK,aACF,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,WAAW,aACR,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,OAAO,EACP,SAAS,0CAA0C,EACnD,SAAS;AAAA,EACZ,QAAQ,aACL,KAAK,CAAC,QAAQ,QAAQ,CAAC,EACvB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,qBAAqB;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;;;AC/BD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,OAAO,cACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFGM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGbhD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,eAA0B,MAAM,QAAQ,QAAQ;AACtD,IAAM,aAAsB,MAAM,QAAQ,QAAQ;AAClD,IAAM,eAA0B,MAAM,MAAM,QAAQ,QAAQ;AAE5D,IAAM,aAA2B;AA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E,IAAI,SAAS,OAAO,GAAG;AAAA,IAC/B,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,IAClD,SAAS,CAAC;AAAA,IACV,SAAS,CAAC;AAAA,EACZ,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,UAAU,EAAE,IAAI,SAAS,OAAO,GAAG,CAAC;AAAA,QACzC,KAAK,UAAU,CAAC,CAAC;AAAA,QACjB,KAAK,UAAU,CAAC,CAAC;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,eAAkC;AAAA,EAC7C,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,s)=>{for(var i in s)e(t,i,{get:s[i],enumerable:!0})},s={};t(s,{MappingSchema:()=>l,SettingsSchema:()=>a,SqliteSettingsSchema:()=>o,mapping:()=>c,settings:()=>m});import{zodToSchema as i}from"@walkeros/core/dev";import{z as r}from"@walkeros/core/dev";var o=r.object({url:r.string().min(1).describe("SQLite connection URL. libsql://, http(s)://, ws(s):// route to libSQL/Turso. Anything else is treated as a local file path via better-sqlite3. Use ':memory:' for an ephemeral in-memory database."),authToken:r.string().describe("libSQL / Turso auth token. Ignored for better-sqlite3 (local) connections.").optional(),table:r.string().describe('Target table name. Defaults to "events".').optional(),schema:r.enum(["auto","manual"]).describe('"auto" creates the canonical events table with CREATE TABLE IF NOT EXISTS on init. "manual" skips table creation. The user brings their own schema and mapping.').optional()}),a=r.object({sqlite:o.describe("SQLite / libSQL configuration (like { url: './events.db' } or { url: 'libsql://my-db.turso.io', authToken: '...' })")});import{z as n}from"@walkeros/core/dev";var l=n.object({table:n.string().describe("Override target table name for this rule. Takes precedence over settings.sqlite.table.").optional()}),m=i(a),c=i(l),p={};t(p,{env:()=>d,step:()=>b});var d={};t(d,{push:()=>v,simulation:()=>g});var u={execute:()=>Promise.resolve(),prepare:()=>()=>Promise.resolve(),close:()=>Promise.resolve()},v={SqliteDriver:()=>Promise.resolve(u)},g=["call:client.prepare","call:client.execute"],b={};t(b,{customTable:()=>S,defaultInsert:()=>y,ignoredEvent:()=>N,orderComplete:()=>h,tableOverride:()=>O});import{getEvent as f}from"@walkeros/core";var y={in:f("page view",{timestamp:1700000100,id:"evt-1",user:{session:"sess-1",id:"user-42"},data:{title:"Home"},source:{type:"server",id:"https://example.com/",previous_id:"https://example.com/prev"},globals:{env:"prod"},consent:{analytics:!0}}),out:[["client.runInsert",[1700000100,"evt-1","page view","page","view","sess-1","user-42","https://example.com/","Home","https://example.com/prev",JSON.stringify({title:"Home"}),JSON.stringify({env:"prod"}),JSON.stringify({analytics:!0})]]]},S={in:f("form submit",{timestamp:1700000101,id:"evt-2",user:{session:"sess-99",id:""},data:{type:"contact"},source:{type:"server",id:"https://example.com/contact",previous_id:""},globals:{},consent:{}}),settings:{sqlite:{url:":memory:",table:"siteEvents"}},out:[["client.runInsert",[1700000101,"evt-2","form submit","form","submit","sess-99","","https://example.com/contact","","",JSON.stringify({type:"contact"}),JSON.stringify({}),JSON.stringify({})]]]},h={in:f("order complete",{timestamp:1700000102,id:"evt-3",user:{session:"",id:""},data:{id:"ORD-1",total:99},source:{type:"server",id:"",previous_id:""},globals:{},consent:{}}),out:[["client.runInsert",[1700000102,"evt-3","order complete","order","complete","","","","","",JSON.stringify({id:"ORD-1",total:99}),JSON.stringify({}),JSON.stringify({})]]]},O={in:f("order complete",{timestamp:1700000103,id:"evt-4",user:{session:"",id:""},data:{id:"ORD-2",total:42},source:{type:"server",id:"",previous_id:""},globals:{},consent:{}}),mapping:{settings:{table:"orders"}},out:[["client.runInsert",[1700000103,"evt-4","order complete","order","complete","","","","","",JSON.stringify({id:"ORD-2",total:42}),JSON.stringify({}),JSON.stringify({})]]]},N={in:f("debug noise",{timestamp:1700000104,id:"evt-5",source:{type:"server",id:"",previous_id:""}}),mapping:{ignore:!0},out:[]};export{p as examples,s as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n SqliteSettingsSchema,\n type Settings,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SqliteSettingsSchema = z.object({\n url: z\n .string()\n .min(1)\n .describe(\n \"SQLite connection URL. libsql://, http(s)://, ws(s):// route to libSQL/Turso. Anything else is treated as a local file path via better-sqlite3. Use ':memory:' for an ephemeral in-memory database.\",\n ),\n authToken: z\n .string()\n .describe(\n 'libSQL / Turso auth token. Ignored for better-sqlite3 (local) connections.',\n )\n .optional(),\n table: z\n .string()\n .describe('Target table name. Defaults to \"events\".')\n .optional(),\n schema: z\n .enum(['auto', 'manual'])\n .describe(\n '\"auto\" creates the canonical events table with CREATE TABLE IF NOT EXISTS on init. \"manual\" skips table creation. The user brings their own schema and mapping.',\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n sqlite: SqliteSettingsSchema.describe(\n \"SQLite / libSQL configuration (like { url: './events.db' } or { url: 'libsql://my-db.turso.io', authToken: '...' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n table: z\n .string()\n .describe(\n 'Override target table name for this rule. Takes precedence over settings.sqlite.table.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SqliteClient, SqliteClientFactory } from '../types';\n\n// Narrow helper type aliases so mock functions are typed without `any`.\ntype ExecuteFn = (sql: string, args?: ReadonlyArray<unknown>) => Promise<void>;\ntype PrepareFn = (\n sql: string,\n) => (args: ReadonlyArray<unknown>) => Promise<void>;\ntype CloseFn = () => Promise<void>;\n\nconst asyncExecute: ExecuteFn = () => Promise.resolve();\nconst asyncClose: CloseFn = () => Promise.resolve();\nconst asyncPrepare: PrepareFn = () => () => Promise.resolve();\n\nconst mockClient: SqliteClient = {\n execute: asyncExecute,\n prepare: asyncPrepare,\n close: asyncClose,\n};\n\nconst mockFactory: SqliteClientFactory = () => Promise.resolve(mockClient);\n\nexport const push: Env = {\n SqliteDriver: mockFactory,\n};\n\n/**\n * Simulation tracking paths. Specifies which function calls to record when\n * running step examples through the collector.\n */\nexport const simulation = ['call:client.prepare', 'call:client.execute'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SqliteStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Canonical insert into the default `events` table. `out` records the\n * column args the prepared INSERT is bound with.\n */\nexport const defaultInsert: SqliteStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000100,\n id: 'evt-1',\n user: { session: 'sess-1', id: 'user-42' },\n data: { title: 'Home' },\n source: {\n type: 'server',\n id: 'https://example.com/',\n previous_id: 'https://example.com/prev',\n },\n globals: { env: 'prod' },\n consent: { analytics: true },\n }),\n out: [\n [\n 'client.runInsert',\n [\n 1700000100,\n 'evt-1',\n 'page view',\n 'page',\n 'view',\n 'sess-1',\n 'user-42',\n 'https://example.com/',\n 'Home',\n 'https://example.com/prev',\n JSON.stringify({ title: 'Home' }),\n JSON.stringify({ env: 'prod' }),\n JSON.stringify({ analytics: true }),\n ],\n ],\n ],\n};\n\n/**\n * Custom table name. Verifies table overrides while using the canonical column set.\n */\nexport const customTable: SqliteStepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000101,\n id: 'evt-2',\n user: { session: 'sess-99', id: '' },\n data: { type: 'contact' },\n source: {\n type: 'server',\n id: 'https://example.com/contact',\n previous_id: '',\n },\n globals: {},\n consent: {},\n }),\n settings: {\n sqlite: {\n url: ':memory:',\n table: 'siteEvents',\n },\n },\n out: [\n [\n 'client.runInsert',\n [\n 1700000101,\n 'evt-2',\n 'form submit',\n 'form',\n 'submit',\n 'sess-99',\n '',\n 'https://example.com/contact',\n '',\n '',\n JSON.stringify({ type: 'contact' }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Order event with numeric data. Confirms JSON serialization of nested values.\n */\nexport const orderComplete: SqliteStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: 'evt-3',\n user: { session: '', id: '' },\n data: { id: 'ORD-1', total: 99 },\n source: { type: 'server', id: '', previous_id: '' },\n globals: {},\n consent: {},\n }),\n out: [\n [\n 'client.runInsert',\n [\n 1700000102,\n 'evt-3',\n 'order complete',\n 'order',\n 'complete',\n '',\n '',\n '',\n '',\n '',\n JSON.stringify({ id: 'ORD-1', total: 99 }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Table override per rule -- routes this event to a dedicated table.\n */\nexport const tableOverride: SqliteStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000103,\n id: 'evt-4',\n user: { session: '', id: '' },\n data: { id: 'ORD-2', total: 42 },\n source: { type: 'server', id: '', previous_id: '' },\n globals: {},\n consent: {},\n }),\n mapping: {\n settings: {\n table: 'orders',\n },\n },\n out: [\n [\n 'client.runInsert',\n [\n 1700000103,\n 'evt-4',\n 'order complete',\n 'order',\n 'complete',\n '',\n '',\n '',\n '',\n '',\n JSON.stringify({ id: 'ORD-2', total: 42 }),\n JSON.stringify({}),\n JSON.stringify({}),\n ],\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no insert call.\n */\nexport const ignoredEvent: SqliteStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000104,\n id: 'evt-5',\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,KAAK,EACF,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,WAAW,EACR,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,EACJ,OAAO,EACP,SAAS,0CAA0C,EACnD,SAAS;AAAA,EACZ,QAAQ,EACL,KAAK,CAAC,QAAQ,QAAQ,CAAC,EACvB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAEM,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,qBAAqB;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;;;AC/BD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,OAAOA,GACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFGM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM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AA,QACjB,KAAK,UAAU,CAAC,CAAC;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,gBAAmC;AAAA,EAC9C,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,MAAM,EAAE,SAAS,IAAI,IAAI,GAAG;AAAA,IAC5B,MAAM,EAAE,IAAI,SAAS,OAAO,GAAG;AAAA,IAC/B,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,IAClD,SAAS,CAAC;AAAA,IACV,SAAS,CAAC;AAAA,EACZ,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,UAAU,EAAE,IAAI,SAAS,OAAO,GAAG,CAAC;AAAA,QACzC,KAAK,UAAU,CAAC,CAAC;AAAA,QACjB,KAAK,UAAU,CAAC,CAAC;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,eAAkC;AAAA,EAC7C,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { DestinationServer } from '@walkeros/server-core';
|
|
2
|
+
import { Flow } from '@walkeros/core';
|
|
3
|
+
|
|
4
|
+
type SchemaMode = 'auto' | 'manual';
|
|
5
|
+
/**
|
|
6
|
+
* Thin cross-driver connection interface. Both drivers are adapted to this shape.
|
|
7
|
+
* Production code uses the adapters in src/drivers/*; tests inject a mock client
|
|
8
|
+
* via env.client to capture sql/args without touching a real database.
|
|
9
|
+
*/
|
|
10
|
+
interface SqliteClient {
|
|
11
|
+
/** Execute a SQL statement. Used for CREATE TABLE and ad-hoc commands. */
|
|
12
|
+
execute: (sql: string, args?: ReadonlyArray<unknown>) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Prepare a statement for repeated execution. Returned function binds args and runs.
|
|
15
|
+
*/
|
|
16
|
+
prepare: (sql: string) => (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
17
|
+
/** Close the connection. */
|
|
18
|
+
close: () => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Factory that constructs an SqliteClient from the user's connection settings.
|
|
22
|
+
* Used by env.SqliteDriver so tests can inject a spy without mocking node_modules.
|
|
23
|
+
*/
|
|
24
|
+
type SqliteClientFactory = (url: string, authToken?: string) => Promise<SqliteClient>;
|
|
25
|
+
interface SqliteSettings {
|
|
26
|
+
/**
|
|
27
|
+
* Connection URL. Starts with `libsql://`, `http://`, `https://`, `wss://`, `ws://`
|
|
28
|
+
* → libSQL driver. Anything else → better-sqlite3 (treated as a file path).
|
|
29
|
+
* Special value `:memory:` → in-memory (better-sqlite3).
|
|
30
|
+
*/
|
|
31
|
+
url: string;
|
|
32
|
+
/** libSQL / Turso auth token. Ignored for better-sqlite3. */
|
|
33
|
+
authToken?: string;
|
|
34
|
+
/** Target table name. Defaults to `events`. */
|
|
35
|
+
table?: string;
|
|
36
|
+
/**
|
|
37
|
+
* `auto` runs `CREATE TABLE IF NOT EXISTS` with the canonical schema on init.
|
|
38
|
+
* `manual` skips CREATE TABLE. The user brings their own schema and mapping.
|
|
39
|
+
* Defaults to `auto`.
|
|
40
|
+
*/
|
|
41
|
+
schema?: SchemaMode;
|
|
42
|
+
_client?: SqliteClient;
|
|
43
|
+
_runInsert?: (args: ReadonlyArray<unknown>) => Promise<void>;
|
|
44
|
+
_ownedClient?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface Settings {
|
|
47
|
+
sqlite: SqliteSettings;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Env -- optional driver override. Production leaves this undefined and the
|
|
51
|
+
* destination loads better-sqlite3 or @libsql/client dynamically. Tests
|
|
52
|
+
* provide a factory via `SqliteDriver` or a pre-built client via `client`.
|
|
53
|
+
*/
|
|
54
|
+
interface Env extends DestinationServer.Env {
|
|
55
|
+
SqliteDriver?: SqliteClientFactory;
|
|
56
|
+
client?: SqliteClient;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare const push: Env;
|
|
60
|
+
/**
|
|
61
|
+
* Simulation tracking paths. Specifies which function calls to record when
|
|
62
|
+
* running step examples through the collector.
|
|
63
|
+
*/
|
|
64
|
+
declare const simulation: string[];
|
|
65
|
+
|
|
66
|
+
declare const env_push: typeof push;
|
|
67
|
+
declare const env_simulation: typeof simulation;
|
|
68
|
+
declare namespace env {
|
|
69
|
+
export { env_push as push, env_simulation as simulation };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
74
|
+
*/
|
|
75
|
+
type SqliteStepExample = Flow.StepExample & {
|
|
76
|
+
settings?: Partial<Settings>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Canonical insert into the default `events` table. `out` records the
|
|
80
|
+
* column args the prepared INSERT is bound with.
|
|
81
|
+
*/
|
|
82
|
+
declare const defaultInsert: SqliteStepExample;
|
|
83
|
+
/**
|
|
84
|
+
* Custom table name. Verifies table overrides while using the canonical column set.
|
|
85
|
+
*/
|
|
86
|
+
declare const customTable: SqliteStepExample;
|
|
87
|
+
/**
|
|
88
|
+
* Order event with numeric data. Confirms JSON serialization of nested values.
|
|
89
|
+
*/
|
|
90
|
+
declare const orderComplete: SqliteStepExample;
|
|
91
|
+
/**
|
|
92
|
+
* Table override per rule -- routes this event to a dedicated table.
|
|
93
|
+
*/
|
|
94
|
+
declare const tableOverride: SqliteStepExample;
|
|
95
|
+
/**
|
|
96
|
+
* Ignored event -- mapping.ignore: true produces no insert call.
|
|
97
|
+
*/
|
|
98
|
+
declare const ignoredEvent: SqliteStepExample;
|
|
99
|
+
|
|
100
|
+
type step_SqliteStepExample = SqliteStepExample;
|
|
101
|
+
declare const step_customTable: typeof customTable;
|
|
102
|
+
declare const step_defaultInsert: typeof defaultInsert;
|
|
103
|
+
declare const step_ignoredEvent: typeof ignoredEvent;
|
|
104
|
+
declare const step_orderComplete: typeof orderComplete;
|
|
105
|
+
declare const step_tableOverride: typeof tableOverride;
|
|
106
|
+
declare namespace step {
|
|
107
|
+
export { type step_SqliteStepExample as SqliteStepExample, step_customTable as customTable, step_defaultInsert as defaultInsert, step_ignoredEvent as ignoredEvent, step_orderComplete as orderComplete, step_tableOverride as tableOverride };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export { env, step };
|