@walkeros/destination-demo 0.5.1-next.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +57 -0
- package/dist/index.d.ts +57 -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/package.json +2 -2
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Destination as Destination$1 } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
interface Settings {
|
|
4
|
+
name?: string;
|
|
5
|
+
values?: string[];
|
|
6
|
+
}
|
|
7
|
+
interface Mapping {
|
|
8
|
+
}
|
|
9
|
+
interface Env extends Destination$1.BaseEnv {
|
|
10
|
+
log?: (msg: string) => void;
|
|
11
|
+
}
|
|
12
|
+
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
13
|
+
type Destination = Destination$1.Instance<Types>;
|
|
14
|
+
type Config = Destination$1.Config<Types>;
|
|
15
|
+
type InitFn = Destination$1.InitFn<Types>;
|
|
16
|
+
type PushFn = Destination$1.PushFn<Types>;
|
|
17
|
+
|
|
18
|
+
type types_Config = Config;
|
|
19
|
+
type types_Destination = Destination;
|
|
20
|
+
type types_Env = Env;
|
|
21
|
+
type types_InitFn = InitFn;
|
|
22
|
+
type types_Mapping = Mapping;
|
|
23
|
+
type types_PushFn = PushFn;
|
|
24
|
+
type types_Settings = Settings;
|
|
25
|
+
type types_Types = Types;
|
|
26
|
+
declare namespace types {
|
|
27
|
+
export type { types_Config as Config, types_Destination as Destination, types_Env as Env, types_InitFn as InitFn, types_Mapping as Mapping, types_PushFn as PushFn, types_Settings as Settings, types_Types as Types };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const init: Env | undefined;
|
|
31
|
+
declare const push: Env;
|
|
32
|
+
/**
|
|
33
|
+
* Simulation tracking paths
|
|
34
|
+
*/
|
|
35
|
+
declare const simulation: string[];
|
|
36
|
+
|
|
37
|
+
declare const env_init: typeof init;
|
|
38
|
+
declare const env_push: typeof push;
|
|
39
|
+
declare const env_simulation: typeof simulation;
|
|
40
|
+
declare namespace env {
|
|
41
|
+
export { env_init as init, env_push as push, env_simulation as simulation };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const index_env: typeof env;
|
|
45
|
+
declare namespace index {
|
|
46
|
+
export { index_env as env };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Demo destination for walkerOS
|
|
51
|
+
*
|
|
52
|
+
* Logs events using env.log (or console.log fallback) with optional field filtering.
|
|
53
|
+
* Perfect for testing and demonstrations without external dependencies.
|
|
54
|
+
*/
|
|
55
|
+
declare const destinationDemo: Destination;
|
|
56
|
+
|
|
57
|
+
export { types as DestinationDemo, destinationDemo as default, destinationDemo, index as examples };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Destination as Destination$1 } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
interface Settings {
|
|
4
|
+
name?: string;
|
|
5
|
+
values?: string[];
|
|
6
|
+
}
|
|
7
|
+
interface Mapping {
|
|
8
|
+
}
|
|
9
|
+
interface Env extends Destination$1.BaseEnv {
|
|
10
|
+
log?: (msg: string) => void;
|
|
11
|
+
}
|
|
12
|
+
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
13
|
+
type Destination = Destination$1.Instance<Types>;
|
|
14
|
+
type Config = Destination$1.Config<Types>;
|
|
15
|
+
type InitFn = Destination$1.InitFn<Types>;
|
|
16
|
+
type PushFn = Destination$1.PushFn<Types>;
|
|
17
|
+
|
|
18
|
+
type types_Config = Config;
|
|
19
|
+
type types_Destination = Destination;
|
|
20
|
+
type types_Env = Env;
|
|
21
|
+
type types_InitFn = InitFn;
|
|
22
|
+
type types_Mapping = Mapping;
|
|
23
|
+
type types_PushFn = PushFn;
|
|
24
|
+
type types_Settings = Settings;
|
|
25
|
+
type types_Types = Types;
|
|
26
|
+
declare namespace types {
|
|
27
|
+
export type { types_Config as Config, types_Destination as Destination, types_Env as Env, types_InitFn as InitFn, types_Mapping as Mapping, types_PushFn as PushFn, types_Settings as Settings, types_Types as Types };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const init: Env | undefined;
|
|
31
|
+
declare const push: Env;
|
|
32
|
+
/**
|
|
33
|
+
* Simulation tracking paths
|
|
34
|
+
*/
|
|
35
|
+
declare const simulation: string[];
|
|
36
|
+
|
|
37
|
+
declare const env_init: typeof init;
|
|
38
|
+
declare const env_push: typeof push;
|
|
39
|
+
declare const env_simulation: typeof simulation;
|
|
40
|
+
declare namespace env {
|
|
41
|
+
export { env_init as init, env_push as push, env_simulation as simulation };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const index_env: typeof env;
|
|
45
|
+
declare namespace index {
|
|
46
|
+
export { index_env as env };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Demo destination for walkerOS
|
|
51
|
+
*
|
|
52
|
+
* Logs events using env.log (or console.log fallback) with optional field filtering.
|
|
53
|
+
* Perfect for testing and demonstrations without external dependencies.
|
|
54
|
+
*/
|
|
55
|
+
declare const destinationDemo: Destination;
|
|
56
|
+
|
|
57
|
+
export { types as DestinationDemo, destinationDemo as default, destinationDemo, index as examples };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,o=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,r=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},s={};r(s,{DestinationDemo:()=>l,default:()=>p,destinationDemo:()=>f,examples:()=>a}),module.exports=(e=s,((e,r,s,l)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let a of n(r))i.call(e,a)||a===s||o(e,a,{get:()=>r[a],enumerable:!(l=t(r,a))||l.enumerable});return e})(o({},"__esModule",{value:!0}),e));var l={},a={};r(a,{env:()=>c});var c={};r(c,{init:()=>g,push:()=>u,simulation:()=>m});var g={log:void 0},u={log:Object.assign(()=>{},{})},m=["call:log"],f={type:"demo",config:{settings:{name:"demo"}},init({config:e,env:o}){(o?.log||console.log)(`[${{name:"demo",...e?.settings}.name}] initialized`)},push(e,{config:o,env:t}){const n=t?.log||console.log,i={name:"demo",...o?.settings},r=i.values?function(e,o){const t={};for(const n of o){const o=n.split(".").reduce((e,o)=>e?.[o],e);void 0!==o&&(t[n]=o)}return t}(e,i.values):e;n(`[${i.name}] ${JSON.stringify(r,null,2)}`)}};var p=f;//# 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 { WalkerOS } from '@walkeros/core';\nimport type { Destination } from './types';\n\nexport * as DestinationDemo from './types';\nexport * as examples from './examples';\n\n/**\n * Demo destination for walkerOS\n *\n * Logs events using env.log (or console.log fallback) with optional field filtering.\n * Perfect for testing and demonstrations without external dependencies.\n */\nexport const destinationDemo: Destination = {\n type: 'demo',\n\n config: {\n settings: {\n name: 'demo',\n },\n },\n\n init({ config, env }) {\n // eslint-disable-next-line no-console\n const log = env?.log || console.log;\n const settings = { name: 'demo', ...config?.settings };\n\n // Log initialization\n log(`[${settings.name}] initialized`);\n },\n\n push(event, { config, env }) {\n // eslint-disable-next-line no-console\n const log = env?.log || console.log;\n const settings = { name: 'demo', ...config?.settings };\n\n const output = settings.values\n ? extractValues(\n event as unknown as Record<string, unknown>,\n settings.values,\n )\n : event;\n\n log(`[${settings.name}] ${JSON.stringify(output, null, 2)}`);\n },\n};\n\n/**\n * Extract values from object using dot notation paths\n */\nfunction extractValues(\n obj: Record<string, unknown>,\n paths: string[],\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const path of paths) {\n const value = path\n .split('.')\n .reduce<unknown>(\n (acc, key) => (acc as Record<string, unknown>)?.[key],\n obj,\n );\n if (value !== undefined) {\n result[path] = value;\n }\n }\n\n return result;\n}\n\nexport default destinationDemo;\n","import type { Destination as CoreDestination } from '@walkeros/core';\n\nexport interface Settings {\n name?: string;\n values?: string[];\n}\n\nexport interface Mapping {}\n\nexport interface Env extends CoreDestination.BaseEnv {\n log?: (msg: string) => void;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = CoreDestination.Instance<Types>;\nexport type Config = CoreDestination.Config<Types>;\nexport type InitFn = CoreDestination.InitFn<Types>;\nexport type PushFn = CoreDestination.PushFn<Types>;\n","export * as env from './env';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for destination demo\n */\n\nconst noop = () => {};\n\nexport const init: Env | undefined = {\n log: undefined,\n};\n\nexport const push: Env = {\n log: Object.assign(noop, {}) as Env['log'],\n};\n\n/**\n * Simulation tracking paths\n */\nexport const simulation = ['call:log'];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAM,OAAO,MAAM;AAAC;AAEb,IAAM,OAAwB;AAAA,EACnC,KAAK;AACP;AAEO,IAAM,OAAY;AAAA,EACvB,KAAK,OAAO,OAAO,MAAM,CAAC,CAAC;AAC7B;AAKO,IAAM,aAAa,CAAC,UAAU;;;AHP9B,IAAM,kBAA+B;AAAA,EAC1C,MAAM;AAAA,EAEN,QAAQ;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEA,KAAK,EAAE,QAAQ,IAAI,GAAG;AAEpB,UAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,UAAM,WAAW,EAAE,MAAM,QAAQ,GAAG,QAAQ,SAAS;AAGrD,QAAI,IAAI,SAAS,IAAI,eAAe;AAAA,EACtC;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,IAAI,GAAG;AAE3B,UAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,UAAM,WAAW,EAAE,MAAM,QAAQ,GAAG,QAAQ,SAAS;AAErD,UAAM,SAAS,SAAS,SACpB;AAAA,MACE;AAAA,MACA,SAAS;AAAA,IACX,IACA;AAEJ,QAAI,IAAI,SAAS,IAAI,KAAK,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC,EAAE;AAAA,EAC7D;AACF;AAKA,SAAS,cACP,KACA,OACyB;AACzB,QAAM,SAAkC,CAAC;AAEzC,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,KACX,MAAM,GAAG,EACT;AAAA,MACC,CAAC,KAAK,QAAS,MAAkC,GAAG;AAAA,MACpD;AAAA,IACF;AACF,QAAI,UAAU,QAAW;AACvB,aAAO,IAAI,IAAI;AAAA,IACjB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,gBAAQ;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,n=(n,o)=>{for(var i in o)e(n,i,{get:o[i],enumerable:!0})},o={},i={};n(i,{env:()=>t});var t={};n(t,{init:()=>s,push:()=>a,simulation:()=>l});var s={log:void 0},a={log:Object.assign(()=>{},{})},l=["call:log"],g={type:"demo",config:{settings:{name:"demo"}},init({config:e,env:n}){(n?.log||console.log)(`[${{name:"demo",...e?.settings}.name}] initialized`)},push(e,{config:n,env:o}){const i=o?.log||console.log,t={name:"demo",...n?.settings},s=t.values?function(e,n){const o={};for(const i of n){const n=i.split(".").reduce((e,n)=>e?.[n],e);void 0!==n&&(o[i]=n)}return o}(e,t.values):e;i(`[${t.name}] ${JSON.stringify(s,null,2)}`)}};var r=g;export{o as DestinationDemo,r as default,g as destinationDemo,i as examples};//# 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 { Destination as CoreDestination } from '@walkeros/core';\n\nexport interface Settings {\n name?: string;\n values?: string[];\n}\n\nexport interface Mapping {}\n\nexport interface Env extends CoreDestination.BaseEnv {\n log?: (msg: string) => void;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = CoreDestination.Instance<Types>;\nexport type Config = CoreDestination.Config<Types>;\nexport type InitFn = CoreDestination.InitFn<Types>;\nexport type PushFn = CoreDestination.PushFn<Types>;\n","export * as env from './env';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for destination demo\n */\n\nconst noop = () => {};\n\nexport const init: Env | undefined = {\n log: undefined,\n};\n\nexport const push: Env = {\n log: Object.assign(noop, {}) as Env['log'],\n};\n\n/**\n * Simulation tracking paths\n */\nexport const simulation = ['call:log'];\n","import type { WalkerOS } from '@walkeros/core';\nimport type { Destination } from './types';\n\nexport * as DestinationDemo from './types';\nexport * as examples from './examples';\n\n/**\n * Demo destination for walkerOS\n *\n * Logs events using env.log (or console.log fallback) with optional field filtering.\n * Perfect for testing and demonstrations without external dependencies.\n */\nexport const destinationDemo: Destination = {\n type: 'demo',\n\n config: {\n settings: {\n name: 'demo',\n },\n },\n\n init({ config, env }) {\n // eslint-disable-next-line no-console\n const log = env?.log || console.log;\n const settings = { name: 'demo', ...config?.settings };\n\n // Log initialization\n log(`[${settings.name}] initialized`);\n },\n\n push(event, { config, env }) {\n // eslint-disable-next-line no-console\n const log = env?.log || console.log;\n const settings = { name: 'demo', ...config?.settings };\n\n const output = settings.values\n ? extractValues(\n event as unknown as Record<string, unknown>,\n settings.values,\n )\n : event;\n\n log(`[${settings.name}] ${JSON.stringify(output, null, 2)}`);\n },\n};\n\n/**\n * Extract values from object using dot notation paths\n */\nfunction extractValues(\n obj: Record<string, unknown>,\n paths: string[],\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const path of paths) {\n const value = path\n .split('.')\n .reduce<unknown>(\n (acc, key) => (acc as Record<string, unknown>)?.[key],\n obj,\n );\n if (value !== undefined) {\n result[path] = value;\n }\n }\n\n return result;\n}\n\nexport default destinationDemo;\n"],"mappings":";;;;;;;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAM,OAAO,MAAM;AAAC;AAEb,IAAM,OAAwB;AAAA,EACnC,KAAK;AACP;AAEO,IAAM,OAAY;AAAA,EACvB,KAAK,OAAO,OAAO,MAAM,CAAC,CAAC;AAC7B;AAKO,IAAM,aAAa,CAAC,UAAU;;;ACP9B,IAAM,kBAA+B;AAAA,EAC1C,MAAM;AAAA,EAEN,QAAQ;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEA,KAAK,EAAE,QAAQ,IAAI,GAAG;AAEpB,UAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,UAAM,WAAW,EAAE,MAAM,QAAQ,GAAG,QAAQ,SAAS;AAGrD,QAAI,IAAI,SAAS,IAAI,eAAe;AAAA,EACtC;AAAA,EAEA,KAAK,OAAO,EAAE,QAAQ,IAAI,GAAG;AAE3B,UAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,UAAM,WAAW,EAAE,MAAM,QAAQ,GAAG,QAAQ,SAAS;AAErD,UAAM,SAAS,SAAS,SACpB;AAAA,MACE;AAAA,MACA,SAAS;AAAA,IACX,IACA;AAEJ,QAAI,IAAI,SAAS,IAAI,KAAK,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC,EAAE;AAAA,EAC7D;AACF;AAKA,SAAS,cACP,KACA,OACyB;AACzB,QAAM,SAAkC,CAAC;AAEzC,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,KACX,MAAM,GAAG,EACT;AAAA,MACC,CAAC,KAAK,QAAS,MAAkC,GAAG;AAAA,MACpD;AAAA,IACF;AACF,QAAI,UAAU,QAAW;AACvB,aAAO,IAAI,IAAI;AAAA,IACjB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/destination-demo",
|
|
3
3
|
"description": "Demo destination for walkerOS - logs events to console",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test": "jest"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@walkeros/core": "0.
|
|
27
|
+
"@walkeros/core": "0.6.0"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|