@walkeros/source-demo 0.0.0-next-20251219153324

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 elbWalker GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ <div align="center">
2
+ <a href="https://www.walkeros.io">
3
+ <img alt="elbwalker" src="https://www.walkeros.io/img/elbwalker-logo.png" height="40px" />
4
+ </a>
5
+ </div>
6
+
7
+ # walkerOS Source Demo
8
+
9
+ A demo source that generates walkerOS events from configuration - perfect for
10
+ testing, demonstrations, and examples.
11
+
12
+ > Learn more at [walkeros.io/docs](https://www.walkeros.io/docs/sources/)
13
+
14
+ ## What It Does
15
+
16
+ - Generates walkerOS events from a configuration array
17
+ - Supports delayed event execution for testing scenarios
18
+ - Zero external dependencies - ideal for demos and testing
19
+ - Simple push interface compatible with walkerOS architecture
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install @walkeros/source-demo
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```typescript
30
+ import { startFlow } from '@walkeros/collector';
31
+ import { sourceDemo } from '@walkeros/source-demo';
32
+
33
+ const { collector } = await startFlow({
34
+ sources: {
35
+ demo: {
36
+ code: sourceDemo,
37
+ config: {
38
+ settings: {
39
+ events: [
40
+ { name: 'page view', data: { title: 'Home' } },
41
+ { name: 'product view', data: { id: 'P123' }, delay: 1000 },
42
+ ],
43
+ },
44
+ },
45
+ },
46
+ },
47
+ });
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ | Name | Type | Description | Required |
53
+ | ------ | --------------------- | ------------------------------ | -------- |
54
+ | events | `Array<PartialEvent>` | Array of events to generate | Yes |
55
+ | delay | `number` (per event) | Optional delay in milliseconds | No |
56
+
57
+ ## Example
58
+
59
+ Complete example showing the demo source with a destination:
60
+
61
+ ```typescript
62
+ import { startFlow } from '@walkeros/collector';
63
+ import { sourceDemo } from '@walkeros/source-demo';
64
+ import { destinationDemo } from '@walkeros/destination-demo';
65
+
66
+ const { collector } = await startFlow({
67
+ sources: {
68
+ demo: {
69
+ code: sourceDemo,
70
+ config: {
71
+ settings: {
72
+ events: [
73
+ {
74
+ name: 'page view',
75
+ data: { title: 'Home Page', path: '/' },
76
+ },
77
+ {
78
+ name: 'product view',
79
+ data: { id: 'P123', name: 'Laptop', price: 999 },
80
+ delay: 1000, // Wait 1 second before firing
81
+ },
82
+ {
83
+ name: 'order complete',
84
+ data: { id: 'O456', value: 999 },
85
+ delay: 2000, // Wait 2 seconds before firing
86
+ },
87
+ ],
88
+ },
89
+ },
90
+ },
91
+ },
92
+ destinations: {
93
+ demo: destinationDemo,
94
+ },
95
+ });
96
+
97
+ // Events will be generated automatically with specified delays
98
+ ```
99
+
100
+ ## Contribute
101
+
102
+ We welcome contributions! Please see our
103
+ [contribution guidelines](https://github.com/elbwalker/walkerOS) for more
104
+ information.
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,52 @@
1
+ import { Source, WalkerOS, Elb } from '@walkeros/core';
2
+
3
+ interface Settings {
4
+ events: Array<WalkerOS.PartialEvent & {
5
+ delay?: number;
6
+ }>;
7
+ }
8
+ interface Mapping {
9
+ }
10
+ type Push = Elb.Fn;
11
+ interface Env extends Source.BaseEnv {
12
+ elb: Elb.Fn;
13
+ }
14
+ type Types = Source.Types<Settings, Mapping, Push, Env>;
15
+
16
+ type types_Env = Env;
17
+ type types_Mapping = Mapping;
18
+ type types_Push = Push;
19
+ type types_Settings = Settings;
20
+ type types_Types = Types;
21
+ declare namespace types {
22
+ export type { types_Env as Env, types_Mapping as Mapping, types_Push as Push, types_Settings as Settings, types_Types as Types };
23
+ }
24
+
25
+ declare const init: Env | undefined;
26
+ declare const push: Env;
27
+ /**
28
+ * Simulation tracking paths
29
+ */
30
+ declare const simulation: string[];
31
+
32
+ declare const env_init: typeof init;
33
+ declare const env_push: typeof push;
34
+ declare const env_simulation: typeof simulation;
35
+ declare namespace env {
36
+ export { env_init as init, env_push as push, env_simulation as simulation };
37
+ }
38
+
39
+ declare const index_env: typeof env;
40
+ declare namespace index {
41
+ export { index_env as env };
42
+ }
43
+
44
+ /**
45
+ * Demo source for walkerOS
46
+ *
47
+ * Pushes configured events to the collector with optional delays.
48
+ * Perfect for testing and demonstrations without external dependencies.
49
+ */
50
+ declare const sourceDemo: Source.Init<Types>;
51
+
52
+ export { types as SourceDemo, sourceDemo as default, index as examples, sourceDemo };
@@ -0,0 +1,52 @@
1
+ import { Source, WalkerOS, Elb } from '@walkeros/core';
2
+
3
+ interface Settings {
4
+ events: Array<WalkerOS.PartialEvent & {
5
+ delay?: number;
6
+ }>;
7
+ }
8
+ interface Mapping {
9
+ }
10
+ type Push = Elb.Fn;
11
+ interface Env extends Source.BaseEnv {
12
+ elb: Elb.Fn;
13
+ }
14
+ type Types = Source.Types<Settings, Mapping, Push, Env>;
15
+
16
+ type types_Env = Env;
17
+ type types_Mapping = Mapping;
18
+ type types_Push = Push;
19
+ type types_Settings = Settings;
20
+ type types_Types = Types;
21
+ declare namespace types {
22
+ export type { types_Env as Env, types_Mapping as Mapping, types_Push as Push, types_Settings as Settings, types_Types as Types };
23
+ }
24
+
25
+ declare const init: Env | undefined;
26
+ declare const push: Env;
27
+ /**
28
+ * Simulation tracking paths
29
+ */
30
+ declare const simulation: string[];
31
+
32
+ declare const env_init: typeof init;
33
+ declare const env_push: typeof push;
34
+ declare const env_simulation: typeof simulation;
35
+ declare namespace env {
36
+ export { env_init as init, env_push as push, env_simulation as simulation };
37
+ }
38
+
39
+ declare const index_env: typeof env;
40
+ declare namespace index {
41
+ export { index_env as env };
42
+ }
43
+
44
+ /**
45
+ * Demo source for walkerOS
46
+ *
47
+ * Pushes configured events to the collector with optional delays.
48
+ * Perfect for testing and demonstrations without external dependencies.
49
+ */
50
+ declare const sourceDemo: Source.Init<Types>;
51
+
52
+ export { types as SourceDemo, sourceDemo as default, index as examples, sourceDemo };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},u={};n(u,{SourceDemo:()=>a,default:()=>d,examples:()=>c,sourceDemo:()=>y}),module.exports=(e=u,((e,n,u,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let c of o(n))s.call(e,c)||c===u||t(e,c,{get:()=>n[c],enumerable:!(a=r(n,c))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={},c={};n(c,{env:()=>l});var l={};n(l,{init:()=>m,push:()=>b,simulation:()=>g});var i=async()=>({ok:!0,successful:[],queued:[],failed:[]}),p=()=>{},f={error:p,info:p,debug:p,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>f},m=void 0,b={push:i,command:i,elb:i,logger:f},g=["call:elb"],y=async(e,t)=>{const{elb:r}=t,o={...e,settings:e?.settings||{events:[]}};return(o.settings?.events||[]).forEach(e=>{const{delay:t,...o}=e;setTimeout(()=>r(o),t||0)}),{type:"demo",config:o,push:r}},d=y;//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/types.ts","../src/examples/index.ts","../src/examples/env.ts"],"sourcesContent":["import type { Source } from '@walkeros/core';\nimport type { Types } from './types';\n\nexport * as SourceDemo from './types';\nexport * as examples from './examples';\n\n/**\n * Demo source for walkerOS\n *\n * Pushes configured events to the collector with optional delays.\n * Perfect for testing and demonstrations without external dependencies.\n */\nexport const sourceDemo: Source.Init<Types> = async (\n config: Partial<Source.Config<Types>>,\n env: Source.Env<Types>,\n): Promise<Source.Instance<Types>> => {\n const { elb } = env;\n\n const fullConfig: Source.Config<Types> = {\n ...config,\n settings: config?.settings || { events: [] },\n };\n\n const events = fullConfig.settings?.events || [];\n\n // Push each event with optional delay\n events.forEach((event) => {\n const { delay, ...partialEvent } = event;\n setTimeout(() => elb(partialEvent), delay || 0);\n });\n\n return {\n type: 'demo',\n config: fullConfig,\n push: elb,\n };\n};\n\nexport default sourceDemo;\n","import type { Source, Elb, WalkerOS } from '@walkeros/core';\n\nexport interface Settings {\n events: Array<WalkerOS.PartialEvent & { delay?: number }>;\n}\n\nexport interface Mapping {}\n\nexport type Push = Elb.Fn;\n\nexport interface Env extends Source.BaseEnv {\n elb: Elb.Fn;\n}\n\nexport type Types = Source.Types<Settings, Mapping, Push, Env>;\n","export * as env from './env';\n","import type { Env } from '../types';\nimport type { Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for source demo\n */\n\nconst noop = async () => ({\n ok: true,\n successful: [],\n queued: [],\n failed: [],\n});\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n scope: () => noopLogger,\n};\n\nexport const init: Env | undefined = undefined;\n\nexport const push: Env = {\n push: noop as Env['push'],\n command: noop as Env['command'],\n elb: noop as Env['elb'],\n logger: noopLogger,\n};\n\n/**\n * Simulation tracking paths\n */\nexport const simulation = ['call:elb'];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAM,OAAO,aAAa;AAAA,EACxB,IAAI;AAAA,EACJ,YAAY,CAAC;AAAA,EACb,QAAQ,CAAC;AAAA,EACT,QAAQ,CAAC;AACX;AAGA,IAAM,SAAS,MAAM;AAAC;AACtB,IAAM,aAA8B;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO,CAAC,YAA4B;AAClC,UAAM,OAAO,YAAY,WAAW,IAAI,MAAM,OAAO,IAAI;AAAA,EAC3D;AAAA,EACA,OAAO,MAAM;AACf;AAEO,IAAM,OAAwB;AAE9B,IAAM,OAAY;AAAA,EACvB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AAAA,EACL,QAAQ;AACV;AAKO,IAAM,aAAa,CAAC,UAAU;;;AH1B9B,IAAM,aAAiC,OAC5C,QACA,QACoC;AACpC,QAAM,EAAE,IAAI,IAAI;AAEhB,QAAM,aAAmC;AAAA,IACvC,GAAG;AAAA,IACH,UAAU,QAAQ,YAAY,EAAE,QAAQ,CAAC,EAAE;AAAA,EAC7C;AAEA,QAAM,SAAS,WAAW,UAAU,UAAU,CAAC;AAG/C,SAAO,QAAQ,CAAC,UAAU;AACxB,UAAM,EAAE,OAAO,GAAG,aAAa,IAAI;AACnC,eAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAAC;AAAA,EAChD,CAAC;AAED,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AACF;AAEA,IAAO,gBAAQ;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,s=(s,t)=>{for(var o in t)e(s,o,{get:t[o],enumerable:!0})},t={},o={};s(o,{env:()=>r});var r={};s(r,{init:()=>u,push:()=>c,simulation:()=>l});var n=async()=>({ok:!0,successful:[],queued:[],failed:[]}),a=()=>{},i={error:a,info:a,debug:a,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>i},u=void 0,c={push:n,command:n,elb:n,logger:i},l=["call:elb"],d=async(e,s)=>{const{elb:t}=s,o={...e,settings:e?.settings||{events:[]}};return(o.settings?.events||[]).forEach(e=>{const{delay:s,...o}=e;setTimeout(()=>t(o),s||0)}),{type:"demo",config:o,push:t}},f=d;export{t as SourceDemo,f as default,o as examples,d as sourceDemo};//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts","../src/examples/index.ts","../src/examples/env.ts","../src/index.ts"],"sourcesContent":["import type { Source, Elb, WalkerOS } from '@walkeros/core';\n\nexport interface Settings {\n events: Array<WalkerOS.PartialEvent & { delay?: number }>;\n}\n\nexport interface Mapping {}\n\nexport type Push = Elb.Fn;\n\nexport interface Env extends Source.BaseEnv {\n elb: Elb.Fn;\n}\n\nexport type Types = Source.Types<Settings, Mapping, Push, Env>;\n","export * as env from './env';\n","import type { Env } from '../types';\nimport type { Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for source demo\n */\n\nconst noop = async () => ({\n ok: true,\n successful: [],\n queued: [],\n failed: [],\n});\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n scope: () => noopLogger,\n};\n\nexport const init: Env | undefined = undefined;\n\nexport const push: Env = {\n push: noop as Env['push'],\n command: noop as Env['command'],\n elb: noop as Env['elb'],\n logger: noopLogger,\n};\n\n/**\n * Simulation tracking paths\n */\nexport const simulation = ['call:elb'];\n","import type { Source } from '@walkeros/core';\nimport type { Types } from './types';\n\nexport * as SourceDemo from './types';\nexport * as examples from './examples';\n\n/**\n * Demo source for walkerOS\n *\n * Pushes configured events to the collector with optional delays.\n * Perfect for testing and demonstrations without external dependencies.\n */\nexport const sourceDemo: Source.Init<Types> = async (\n config: Partial<Source.Config<Types>>,\n env: Source.Env<Types>,\n): Promise<Source.Instance<Types>> => {\n const { elb } = env;\n\n const fullConfig: Source.Config<Types> = {\n ...config,\n settings: config?.settings || { events: [] },\n };\n\n const events = fullConfig.settings?.events || [];\n\n // Push each event with optional delay\n events.forEach((event) => {\n const { delay, ...partialEvent } = event;\n setTimeout(() => elb(partialEvent), delay || 0);\n });\n\n return {\n type: 'demo',\n config: fullConfig,\n push: elb,\n };\n};\n\nexport default sourceDemo;\n"],"mappings":";;;;;;;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAM,OAAO,aAAa;AAAA,EACxB,IAAI;AAAA,EACJ,YAAY,CAAC;AAAA,EACb,QAAQ,CAAC;AAAA,EACT,QAAQ,CAAC;AACX;AAGA,IAAM,SAAS,MAAM;AAAC;AACtB,IAAM,aAA8B;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO,CAAC,YAA4B;AAClC,UAAM,OAAO,YAAY,WAAW,IAAI,MAAM,OAAO,IAAI;AAAA,EAC3D;AAAA,EACA,OAAO,MAAM;AACf;AAEO,IAAM,OAAwB;AAE9B,IAAM,OAAY;AAAA,EACvB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AAAA,EACL,QAAQ;AACV;AAKO,IAAM,aAAa,CAAC,UAAU;;;AC1B9B,IAAM,aAAiC,OAC5C,QACA,QACoC;AACpC,QAAM,EAAE,IAAI,IAAI;AAEhB,QAAM,aAAmC;AAAA,IACvC,GAAG;AAAA,IACH,UAAU,QAAQ,YAAY,EAAE,QAAQ,CAAC,EAAE;AAAA,EAC7C;AAEA,QAAM,SAAS,WAAW,UAAU,UAAU,CAAC;AAG/C,SAAO,QAAQ,CAAC,UAAU;AACxB,UAAM,EAAE,OAAO,GAAG,aAAa,IAAI;AACnC,eAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAAC;AAAA,EAChD,CAAC;AAED,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AACF;AAEA,IAAO,gBAAQ;","names":[]}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@walkeros/source-demo",
3
+ "description": "Demo source for walkerOS - generates events from config",
4
+ "version": "0.0.0-next-20251219153324",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist/**"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsup --silent",
21
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
22
+ "dev": "jest --watchAll --colors",
23
+ "lint": "tsc && eslint \"**/*.ts*\"",
24
+ "test": "jest"
25
+ },
26
+ "dependencies": {
27
+ "@walkeros/core": "0.0.0-next-20251219153324"
28
+ },
29
+ "repository": {
30
+ "url": "git+https://github.com/elbwalker/walkerOS.git",
31
+ "directory": "apps/demos/source"
32
+ },
33
+ "author": "elbwalker <hello@elbwalker.com>",
34
+ "homepage": "https://github.com/elbwalker/walkerOS#readme",
35
+ "bugs": {
36
+ "url": "https://github.com/elbwalker/walkerOS/issues"
37
+ },
38
+ "keywords": [
39
+ "walker",
40
+ "walkerOS",
41
+ "source",
42
+ "demo"
43
+ ]
44
+ }