@walkeros/server-destination-api 2.2.0-next-1773136823705 → 3.0.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/README.md CHANGED
@@ -27,7 +27,7 @@ Configure in your Flow JSON:
27
27
 
28
28
  ```json
29
29
  {
30
- "version": 1,
30
+ "version": 3,
31
31
  "flows": {
32
32
  "default": {
33
33
  "server": {},
package/dist/dev.d.mts CHANGED
@@ -26,20 +26,28 @@ interface Env extends DestinationServer.Env {
26
26
 
27
27
  declare const init: Env | undefined;
28
28
  declare const standard: Env;
29
+ /**
30
+ * Simulation tracking paths
31
+ * Specifies which function calls to track during simulation
32
+ */
33
+ declare const simulation: string[];
29
34
 
30
35
  declare const env_init: typeof init;
36
+ declare const env_simulation: typeof simulation;
31
37
  declare const env_standard: typeof standard;
32
38
  declare namespace env {
33
- export { env_init as init, env_standard as standard };
39
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
34
40
  }
35
41
 
36
42
  declare const fullEvent: Flow.StepExample;
37
43
  declare const customHeaders: Flow.StepExample;
44
+ declare const customTransform: Flow.StepExample;
38
45
 
39
46
  declare const step_customHeaders: typeof customHeaders;
47
+ declare const step_customTransform: typeof customTransform;
40
48
  declare const step_fullEvent: typeof fullEvent;
41
49
  declare namespace step {
42
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
50
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
43
51
  }
44
52
 
45
53
  declare const index_env: typeof env;
package/dist/dev.d.ts CHANGED
@@ -26,20 +26,28 @@ interface Env extends DestinationServer.Env {
26
26
 
27
27
  declare const init: Env | undefined;
28
28
  declare const standard: Env;
29
+ /**
30
+ * Simulation tracking paths
31
+ * Specifies which function calls to track during simulation
32
+ */
33
+ declare const simulation: string[];
29
34
 
30
35
  declare const env_init: typeof init;
36
+ declare const env_simulation: typeof simulation;
31
37
  declare const env_standard: typeof standard;
32
38
  declare namespace env {
33
- export { env_init as init, env_standard as standard };
39
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
34
40
  }
35
41
 
36
42
  declare const fullEvent: Flow.StepExample;
37
43
  declare const customHeaders: Flow.StepExample;
44
+ declare const customTransform: Flow.StepExample;
38
45
 
39
46
  declare const step_customHeaders: typeof customHeaders;
47
+ declare const step_customTransform: typeof customTransform;
40
48
  declare const step_fullEvent: typeof fullEvent;
41
49
  declare namespace step {
42
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
50
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
43
51
  }
44
52
 
45
53
  declare const index_env: typeof env;
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},i={};a(i,{examples:()=>m,schemas:()=>n}),module.exports=(e=i,((e,a,i,n)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of o(a))s.call(e,d)||d===i||t(e,d,{get:()=>a[d],enumerable:!(n=r(a,d))||n.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n={};a(n,{SettingsSchema:()=>c,settings:()=>l});var d=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),c=p.z.object({url:p.z.string().url().describe("The API endpoint URL to send events to"),headers:p.z.record(p.z.string(),p.z.string()).describe("Custom HTTP headers to include with requests").optional(),method:p.z.string().describe("HTTP method to use (default: POST)").optional(),timeout:p.z.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),l=(0,d.zodToSchema)(c),m={};a(m,{env:()=>u,step:()=>g});var u={};a(u,{init:()=>v,standard:()=>b});var v={sendServer:void 0},b={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},g={};a(g,{customHeaders:()=>f,fullEvent:()=>h});var y=require("@walkeros/core"),h={in:(0,y.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},f={in:(0,y.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},i={};a(i,{examples:()=>p,schemas:()=>n}),module.exports=(e=i,((e,a,i,n)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of o(a))s.call(e,d)||d===i||t(e,d,{get:()=>a[d],enumerable:!(n=r(a,d))||n.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n={};a(n,{SettingsSchema:()=>c,settings:()=>m});var d=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),c=u.z.object({url:u.z.string().url().describe("The API endpoint URL to send events to"),headers:u.z.record(u.z.string(),u.z.string()).describe("Custom HTTP headers to include with requests").optional(),method:u.z.string().describe("HTTP method to use (default: POST)").optional(),timeout:u.z.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),m=(0,d.zodToSchema)(c),p={};a(p,{env:()=>l,step:()=>g});var l={};a(l,{init:()=>v,simulation:()=>b,standard:()=>y});var v={sendServer:void 0},y={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},b=["sendServer"],g={};a(g,{customHeaders:()=>O,customTransform:()=>_,fullEvent:()=>h});var f=require("@walkeros/core"),h={in:(0,f.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},O={in:(0,f.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},_={in:(0,f.getEvent)("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:{url:"https://api.example.com/events",body:JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"})}};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.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';\n\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,aACN,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,QAAQ,aAAE,OAAO,EAAE,SAAS,oCAAoC,EAAE,SAAS;AAAA,EAC3E,SAAS,aACN,OAAO,EACP,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AACd,CAAC;;;ADRM,IAAM,eAAW,yBAAY,cAAc;;;AENlD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,OAAwB;AAAA,EACnC,YAAY;AACd;AAEO,IAAM,WAAgB;AAAA,EAC3B,YAAY,OAAO,OAAO,MAAM;AAAA;AAAA,EAEhC,CAAC;AACH;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAyB;AAElB,IAAM,YAA8B;AAAA,EACzC,QAAI,sBAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,QAAQ,KAAK,2BAA2B;AAAA,IACvD,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,IACL,MAAM,KAAK,UAAU;AAAA,MACnB,OAAO;AAAA,MACP,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AACF;AAEO,IAAM,gBAAkC;AAAA,EAC7C,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,MAAM,WAAW,OAAO,mBAAmB;AAAA,IACnD,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,IACL,MAAM,KAAK,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,IACD,SAAS,EAAE,aAAa,eAAe;AAAA,EACzC;AACF;","names":["import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.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';\n\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n\nexport const customTransform: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,aACN,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,QAAQ,aAAE,OAAO,EAAE,SAAS,oCAAoC,EAAE,SAAS;AAAA,EAC3E,SAAS,aACN,OAAO,EACP,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AACd,CAAC;;;ADRM,IAAM,eAAW,yBAAY,cAAc;;;AENlD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,OAAwB;AAAA,EACnC,YAAY;AACd;AAEO,IAAM,WAAgB;AAAA,EAC3B,YAAY,OAAO,OAAO,MAAM;AAAA;AAAA,EAEhC,CAAC;AACH;AAMO,IAAM,aAAa,CAAC,YAAY;;;ACzBvC;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAyB;AAElB,IAAM,YAA8B;AAAA,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AK,UAAU;AAAA,MACnB,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MACb,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;","names":["import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=(t,r)=>{for(var s in r)e(t,s,{get:r[s],enumerable:!0})},r={};t(r,{SettingsSchema:()=>i,settings:()=>a});import{zodToSchema as s}from"@walkeros/core/dev";import{z as o}from"@walkeros/core/dev";var i=o.object({url:o.string().url().describe("The API endpoint URL to send events to"),headers:o.record(o.string(),o.string()).describe("Custom HTTP headers to include with requests").optional(),method:o.string().describe("HTTP method to use (default: POST)").optional(),timeout:o.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),a=s(i),m={};t(m,{env:()=>d,step:()=>c});var d={};t(d,{init:()=>n,standard:()=>p});var n={sendServer:void 0},p={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},c={};t(c,{customHeaders:()=>v,fullEvent:()=>u});import{getEvent as l}from"@walkeros/core";var u={in:l("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},v={in:l("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}};export{m as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,r)=>{for(var o in r)e(t,o,{get:r[o],enumerable:!0})},r={};t(r,{SettingsSchema:()=>a,settings:()=>i});import{zodToSchema as o}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var a=s.object({url:s.string().url().describe("The API endpoint URL to send events to"),headers:s.record(s.string(),s.string()).describe("Custom HTTP headers to include with requests").optional(),method:s.string().describe("HTTP method to use (default: POST)").optional(),timeout:s.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),i=o(a),d={};t(d,{env:()=>m,step:()=>u});var m={};t(m,{init:()=>n,simulation:()=>c,standard:()=>p});var n={sendServer:void 0},p={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},c=["sendServer"],u={};t(u,{customHeaders:()=>y,customTransform:()=>b,fullEvent:()=>v});import{getEvent as l}from"@walkeros/core";var v={in:l("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},y={in:l("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},b={in:l("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:{url:"https://api.example.com/events",body:JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"})}};export{d as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS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AAM,KAAK,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,IACD,SAAS,EAAE,aAAa,eAAe;AAAA,EACzC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n\nexport const customTransform: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,QAAQ,EAAE,OAAO,EAAE,SAAS,oCAAoC,EAAE,SAAS;AAAA,EAC3E,SAAS,EACN,OAAO,EACP,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AACd,CAAC;;;ADRM,IAAM,WAAW,YAAY,cAAc;;;AENlD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,O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AAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,IACL,MAAM,KAAK,UAAU;AAAA,MACnB,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MACb,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -7,20 +7,28 @@ interface Env extends DestinationServer.Env {
7
7
 
8
8
  declare const init: Env | undefined;
9
9
  declare const standard: Env;
10
+ /**
11
+ * Simulation tracking paths
12
+ * Specifies which function calls to track during simulation
13
+ */
14
+ declare const simulation: string[];
10
15
 
11
16
  declare const env_init: typeof init;
17
+ declare const env_simulation: typeof simulation;
12
18
  declare const env_standard: typeof standard;
13
19
  declare namespace env {
14
- export { env_init as init, env_standard as standard };
20
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
15
21
  }
16
22
 
17
23
  declare const fullEvent: Flow.StepExample;
18
24
  declare const customHeaders: Flow.StepExample;
25
+ declare const customTransform: Flow.StepExample;
19
26
 
20
27
  declare const step_customHeaders: typeof customHeaders;
28
+ declare const step_customTransform: typeof customTransform;
21
29
  declare const step_fullEvent: typeof fullEvent;
22
30
  declare namespace step {
23
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
31
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
24
32
  }
25
33
 
26
34
  export { env, step };
@@ -7,20 +7,28 @@ interface Env extends DestinationServer.Env {
7
7
 
8
8
  declare const init: Env | undefined;
9
9
  declare const standard: Env;
10
+ /**
11
+ * Simulation tracking paths
12
+ * Specifies which function calls to track during simulation
13
+ */
14
+ declare const simulation: string[];
10
15
 
11
16
  declare const env_init: typeof init;
17
+ declare const env_simulation: typeof simulation;
12
18
  declare const env_standard: typeof standard;
13
19
  declare namespace env {
14
- export { env_init as init, env_standard as standard };
20
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
15
21
  }
16
22
 
17
23
  declare const fullEvent: Flow.StepExample;
18
24
  declare const customHeaders: Flow.StepExample;
25
+ declare const customTransform: Flow.StepExample;
19
26
 
20
27
  declare const step_customHeaders: typeof customHeaders;
28
+ declare const step_customTransform: typeof customTransform;
21
29
  declare const step_fullEvent: typeof fullEvent;
22
30
  declare namespace step {
23
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
31
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
24
32
  }
25
33
 
26
34
  export { env, step };
@@ -29,6 +29,7 @@ module.exports = __toCommonJS(examples_exports);
29
29
  var env_exports = {};
30
30
  __export(env_exports, {
31
31
  init: () => init,
32
+ simulation: () => simulation,
32
33
  standard: () => standard
33
34
  });
34
35
  var noop = () => Promise.resolve({ ok: true });
@@ -40,11 +41,13 @@ var standard = {
40
41
  // Add any specific properties if needed for sendServer
41
42
  })
42
43
  };
44
+ var simulation = ["sendServer"];
43
45
 
44
46
  // src/examples/step.ts
45
47
  var step_exports = {};
46
48
  __export(step_exports, {
47
49
  customHeaders: () => customHeaders,
50
+ customTransform: () => customTransform,
48
51
  fullEvent: () => fullEvent
49
52
  });
50
53
  var import_core = require("@walkeros/core");
@@ -83,6 +86,35 @@ var customHeaders = {
83
86
  headers: { "X-API-Key": "YOUR_API_KEY" }
84
87
  }
85
88
  };
89
+ var customTransform = {
90
+ in: (0, import_core.getEvent)("order complete", {
91
+ timestamp: 1700000802,
92
+ data: { id: "ORD-500", total: 199.99, currency: "USD" },
93
+ user: { id: "buyer-42" },
94
+ source: { type: "server", id: "", previous_id: "" }
95
+ }),
96
+ mapping: {
97
+ data: {
98
+ map: {
99
+ order_id: "data.id",
100
+ amount: "data.total",
101
+ currency: "data.currency",
102
+ customer_id: "user.id",
103
+ event_type: "name"
104
+ }
105
+ }
106
+ },
107
+ out: {
108
+ url: "https://api.example.com/events",
109
+ body: JSON.stringify({
110
+ order_id: "ORD-500",
111
+ amount: 199.99,
112
+ currency: "USD",
113
+ customer_id: "buyer-42",
114
+ event_type: "order complete"
115
+ })
116
+ }
117
+ };
86
118
  // Annotate the CommonJS export names for ESM import in node:
87
119
  0 && (module.exports = {
88
120
  env,
@@ -8,6 +8,7 @@ var __export = (target, all) => {
8
8
  var env_exports = {};
9
9
  __export(env_exports, {
10
10
  init: () => init,
11
+ simulation: () => simulation,
11
12
  standard: () => standard
12
13
  });
13
14
  var noop = () => Promise.resolve({ ok: true });
@@ -19,11 +20,13 @@ var standard = {
19
20
  // Add any specific properties if needed for sendServer
20
21
  })
21
22
  };
23
+ var simulation = ["sendServer"];
22
24
 
23
25
  // src/examples/step.ts
24
26
  var step_exports = {};
25
27
  __export(step_exports, {
26
28
  customHeaders: () => customHeaders,
29
+ customTransform: () => customTransform,
27
30
  fullEvent: () => fullEvent
28
31
  });
29
32
  import { getEvent } from "@walkeros/core";
@@ -62,6 +65,35 @@ var customHeaders = {
62
65
  headers: { "X-API-Key": "YOUR_API_KEY" }
63
66
  }
64
67
  };
68
+ var customTransform = {
69
+ in: getEvent("order complete", {
70
+ timestamp: 1700000802,
71
+ data: { id: "ORD-500", total: 199.99, currency: "USD" },
72
+ user: { id: "buyer-42" },
73
+ source: { type: "server", id: "", previous_id: "" }
74
+ }),
75
+ mapping: {
76
+ data: {
77
+ map: {
78
+ order_id: "data.id",
79
+ amount: "data.total",
80
+ currency: "data.currency",
81
+ customer_id: "user.id",
82
+ event_type: "name"
83
+ }
84
+ }
85
+ },
86
+ out: {
87
+ url: "https://api.example.com/events",
88
+ body: JSON.stringify({
89
+ order_id: "ORD-500",
90
+ amount: 199.99,
91
+ currency: "USD",
92
+ customer_id: "buyer-42",
93
+ event_type: "order complete"
94
+ })
95
+ }
96
+ };
65
97
  export {
66
98
  env_exports as env,
67
99
  step_exports as step
package/dist/index.d.mts CHANGED
@@ -37,20 +37,28 @@ declare namespace index$1 {
37
37
 
38
38
  declare const init: Env | undefined;
39
39
  declare const standard: Env;
40
+ /**
41
+ * Simulation tracking paths
42
+ * Specifies which function calls to track during simulation
43
+ */
44
+ declare const simulation: string[];
40
45
 
41
46
  declare const env_init: typeof init;
47
+ declare const env_simulation: typeof simulation;
42
48
  declare const env_standard: typeof standard;
43
49
  declare namespace env {
44
- export { env_init as init, env_standard as standard };
50
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
45
51
  }
46
52
 
47
53
  declare const fullEvent: Flow.StepExample;
48
54
  declare const customHeaders: Flow.StepExample;
55
+ declare const customTransform: Flow.StepExample;
49
56
 
50
57
  declare const step_customHeaders: typeof customHeaders;
58
+ declare const step_customTransform: typeof customTransform;
51
59
  declare const step_fullEvent: typeof fullEvent;
52
60
  declare namespace step {
53
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
61
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
54
62
  }
55
63
 
56
64
  declare const index_env: typeof env;
package/dist/index.d.ts CHANGED
@@ -37,20 +37,28 @@ declare namespace index$1 {
37
37
 
38
38
  declare const init: Env | undefined;
39
39
  declare const standard: Env;
40
+ /**
41
+ * Simulation tracking paths
42
+ * Specifies which function calls to track during simulation
43
+ */
44
+ declare const simulation: string[];
40
45
 
41
46
  declare const env_init: typeof init;
47
+ declare const env_simulation: typeof simulation;
42
48
  declare const env_standard: typeof standard;
43
49
  declare namespace env {
44
- export { env_init as init, env_standard as standard };
50
+ export { env_init as init, env_simulation as simulation, env_standard as standard };
45
51
  }
46
52
 
47
53
  declare const fullEvent: Flow.StepExample;
48
54
  declare const customHeaders: Flow.StepExample;
55
+ declare const customTransform: Flow.StepExample;
49
56
 
50
57
  declare const step_customHeaders: typeof customHeaders;
58
+ declare const step_customTransform: typeof customTransform;
51
59
  declare const step_fullEvent: typeof fullEvent;
52
60
  declare namespace step {
53
- export { step_customHeaders as customHeaders, step_fullEvent as fullEvent };
61
+ export { step_customHeaders as customHeaders, step_customTransform as customTransform, step_fullEvent as fullEvent };
54
62
  }
55
63
 
56
64
  declare const index_env: typeof env;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var mod,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},index_exports={};__export(index_exports,{DestinationAPI:()=>types_exports,default:()=>index_default,destinationAPI:()=>destinationAPI,examples:()=>examples_exports}),module.exports=(mod=index_exports,((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to})(__defProp({},"__esModule",{value:!0}),mod));var import_core2=require("@walkeros/core"),import_server_core=require("@walkeros/server-core"),types_exports={},examples_exports={};__export(examples_exports,{env:()=>env_exports,step:()=>step_exports});var env_exports={};__export(env_exports,{init:()=>init,standard:()=>standard});var init={sendServer:void 0},standard={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},step_exports={};__export(step_exports,{customHeaders:()=>customHeaders,fullEvent:()=>fullEvent});var import_core=require("@walkeros/core"),fullEvent={in:(0,import_core.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},customHeaders={in:(0,import_core.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},destinationAPI={type:"api",config:{},env:{sendServer:import_server_core.sendServer},async push(event,{config:config,rule:rule,data:data,env:env,logger:logger}){const{settings:settings}=config,{url:url,headers:headers,method:method,transform:transform,timeout:timeout}=settings||{};if(!url)return;const eventData=(0,import_core2.isDefined)(data)?data:event,body=transform?transform(eventData,config,rule):JSON.stringify(eventData);null==logger||logger.debug("API destination sending request",{url:url,method:method||"POST",eventName:event.name});const sendServerFn=(null==env?void 0:env.sendServer)||import_server_core.sendServer,response=await sendServerFn(url,body,{headers:headers,method:method,timeout:timeout});null==logger||logger.debug("API destination response",{ok:null==response?void 0:response.ok})}},index_default=destinationAPI;//# sourceMappingURL=index.js.map
1
+ "use strict";var mod,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},index_exports={};__export(index_exports,{DestinationAPI:()=>types_exports,default:()=>index_default,destinationAPI:()=>destinationAPI,examples:()=>examples_exports}),module.exports=(mod=index_exports,((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to})(__defProp({},"__esModule",{value:!0}),mod));var import_core2=require("@walkeros/core"),import_server_core=require("@walkeros/server-core"),types_exports={},examples_exports={};__export(examples_exports,{env:()=>env_exports,step:()=>step_exports});var env_exports={};__export(env_exports,{init:()=>init,simulation:()=>simulation,standard:()=>standard});var init={sendServer:void 0},standard={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},simulation=["sendServer"],step_exports={};__export(step_exports,{customHeaders:()=>customHeaders,customTransform:()=>customTransform,fullEvent:()=>fullEvent});var import_core=require("@walkeros/core"),fullEvent={in:(0,import_core.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},customHeaders={in:(0,import_core.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},customTransform={in:(0,import_core.getEvent)("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:{url:"https://api.example.com/events",body:JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"})}},destinationAPI={type:"api",config:{},env:{sendServer:import_server_core.sendServer},async push(event,{config:config,rule:rule,data:data,env:env,logger:logger}){const{settings:settings}=config,{url:url,headers:headers,method:method,transform:transform,timeout:timeout}=settings||{};if(!url)return;const eventData=(0,import_core2.isDefined)(data)?data:event,body=transform?transform(eventData,config,rule):JSON.stringify(eventData);null==logger||logger.debug("API destination sending request",{url:url,method:method||"POST",eventName:event.name});const sendServerFn=(null==env?void 0:env.sendServer)||import_server_core.sendServer,response=await sendServerFn(url,body,{headers:headers,method:method,timeout:timeout});null==logger||logger.debug("API destination response",{ok:null==response?void 0:response.ok})}},index_default=destinationAPI;//# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types/index.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import type { Settings, Destination, Env } from './types';\nimport { isDefined } from '@walkeros/core';\nimport { sendServer } from '@walkeros/server-core';\n\n// Types\nexport * as DestinationAPI from './types';\n\n// Examples\nexport * as examples from './examples';\n\nexport const destinationAPI: Destination = {\n type: 'api',\n\n config: {},\n\n env: { sendServer },\n\n async push(event, { config, rule, data, env, logger }) {\n const { settings } = config;\n const { url, headers, method, transform, timeout } = settings || {};\n\n if (!url) return;\n\n const eventData = isDefined(data) ? data : event;\n const body = transform\n ? transform(eventData, config, rule) // Transform event data\n : JSON.stringify(eventData);\n\n logger?.debug('API destination sending request', {\n url,\n method: method || 'POST',\n eventName: event.name,\n });\n\n const sendServerFn = (env as Env)?.sendServer || sendServer;\n const response = await sendServerFn(url, body, {\n headers,\n method,\n timeout,\n });\n\n logger?.debug('API destination response', { ok: response?.ok });\n },\n};\n\nexport default destinationAPI;\n","import type {\n Mapping as WalkerOSMapping,\n SendDataValue,\n SendHeaders,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationServer, sendServer } from '@walkeros/server-core';\n\nexport interface Settings {\n url: string;\n headers?: SendHeaders;\n method?: string;\n transform?: Transform;\n timeout?: number;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationServer.Env {\n sendServer?: typeof sendServer;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationServer.Destination<Types>;\nexport type Config = DestinationServer.Config<Types>;\nexport type PushFn = DestinationServer.PushFn<Types>;\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n\nexport type Transform = (\n data?: unknown,\n config?: Config,\n mapping?: WalkerOSMapping.Rule<Mapping>,\n) => SendDataValue;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,eAA0B;AAC1B,yBAA2B;;;ACF3B;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,OAAwB;AAAA,EACnC,YAAY;AACd;AAEO,IAAM,WAAgB;AAAA,EAC3B,YAAY,OAAO,OAAO,MAAM;AAAA;AAAA,EAEhC,CAAC;AACH;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAyB;AAElB,IAAM,YAA8B;AAAA,EACzC,QAAI,sBAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,QAAQ,KAAK,2BAA2B;AAAA,IACvD,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,IACL,MAAM,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_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/types/index.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import type { Settings, Destination, Env } from './types';\nimport { isDefined } from '@walkeros/core';\nimport { sendServer } from '@walkeros/server-core';\n\n// Types\nexport * as DestinationAPI from './types';\n\n// Examples\nexport * as examples from './examples';\n\nexport const destinationAPI: Destination = {\n type: 'api',\n\n config: {},\n\n env: { sendServer },\n\n async push(event, { config, rule, data, env, logger }) {\n const { settings } = config;\n const { url, headers, method, transform, timeout } = settings || {};\n\n if (!url) return;\n\n const eventData = isDefined(data) ? data : event;\n const body = transform\n ? transform(eventData, config, rule) // Transform event data\n : JSON.stringify(eventData);\n\n logger?.debug('API destination sending request', {\n url,\n method: method || 'POST',\n eventName: event.name,\n });\n\n const sendServerFn = (env as Env)?.sendServer || sendServer;\n const response = await sendServerFn(url, body, {\n headers,\n method,\n timeout,\n });\n\n logger?.debug('API destination response', { ok: response?.ok });\n },\n};\n\nexport default destinationAPI;\n","import type {\n Mapping as WalkerOSMapping,\n SendDataValue,\n SendHeaders,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationServer, sendServer } from '@walkeros/server-core';\n\nexport interface Settings {\n url: string;\n headers?: SendHeaders;\n method?: string;\n transform?: Transform;\n timeout?: number;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationServer.Env {\n sendServer?: typeof sendServer;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationServer.Destination<Types>;\nexport type Config = DestinationServer.Config<Types>;\nexport type PushFn = DestinationServer.PushFn<Types>;\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n\nexport type Transform = (\n data?: unknown,\n config?: Config,\n mapping?: WalkerOSMapping.Rule<Mapping>,\n) => SendDataValue;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n\nexport const customTransform: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA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4BAA4B,EAAE,IAAI,qCAAU,GAAG;AAAA,EAC/D;AACF;AAEA,IAAO,gBAAQ;","names":["import_core"]}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})};import{isDefined}from"@walkeros/core";import{sendServer}from"@walkeros/server-core";var types_exports={},examples_exports={};__export(examples_exports,{env:()=>env_exports,step:()=>step_exports});var env_exports={};__export(env_exports,{init:()=>init,standard:()=>standard});var init={sendServer:void 0},standard={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},step_exports={};__export(step_exports,{customHeaders:()=>customHeaders,fullEvent:()=>fullEvent});import{getEvent}from"@walkeros/core";var fullEvent={in:getEvent("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},customHeaders={in:getEvent("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},destinationAPI={type:"api",config:{},env:{sendServer:sendServer},async push(event,{config:config,rule:rule,data:data,env:env,logger:logger}){const{settings:settings}=config,{url:url,headers:headers,method:method,transform:transform,timeout:timeout}=settings||{};if(!url)return;const eventData=isDefined(data)?data:event,body=transform?transform(eventData,config,rule):JSON.stringify(eventData);null==logger||logger.debug("API destination sending request",{url:url,method:method||"POST",eventName:event.name});const sendServerFn=(null==env?void 0:env.sendServer)||sendServer,response=await sendServerFn(url,body,{headers:headers,method:method,timeout:timeout});null==logger||logger.debug("API destination response",{ok:null==response?void 0:response.ok})}},index_default=destinationAPI;export{types_exports as DestinationAPI,index_default as default,destinationAPI,examples_exports as examples};//# sourceMappingURL=index.mjs.map
1
+ var __defProp=Object.defineProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})};import{isDefined}from"@walkeros/core";import{sendServer}from"@walkeros/server-core";var types_exports={},examples_exports={};__export(examples_exports,{env:()=>env_exports,step:()=>step_exports});var env_exports={};__export(env_exports,{init:()=>init,simulation:()=>simulation,standard:()=>standard});var init={sendServer:void 0},standard={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},simulation=["sendServer"],step_exports={};__export(step_exports,{customHeaders:()=>customHeaders,customTransform:()=>customTransform,fullEvent:()=>fullEvent});import{getEvent}from"@walkeros/core";var fullEvent={in:getEvent("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({title:"Docs",url:"https://example.com/docs"})}},customHeaders={in:getEvent("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:"data"},out:{url:"https://api.example.com/events",body:JSON.stringify({type:"contact",email:"user@example.com"}),headers:{"X-API-Key":"YOUR_API_KEY"}}},customTransform={in:getEvent("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"server",id:"",previous_id:""}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:{url:"https://api.example.com/events",body:JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"})}},destinationAPI={type:"api",config:{},env:{sendServer:sendServer},async push(event,{config:config,rule:rule,data:data,env:env,logger:logger}){const{settings:settings}=config,{url:url,headers:headers,method:method,transform:transform,timeout:timeout}=settings||{};if(!url)return;const eventData=isDefined(data)?data:event,body=transform?transform(eventData,config,rule):JSON.stringify(eventData);null==logger||logger.debug("API destination sending request",{url:url,method:method||"POST",eventName:event.name});const sendServerFn=(null==env?void 0:env.sendServer)||sendServer,response=await sendServerFn(url,body,{headers:headers,method:method,timeout:timeout});null==logger||logger.debug("API destination response",{ok:null==response?void 0:response.ok})}},index_default=destinationAPI;export{types_exports as DestinationAPI,index_default as default,destinationAPI,examples_exports as examples};//# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types/index.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import type { Settings, Destination, Env } from './types';\nimport { isDefined } from '@walkeros/core';\nimport { sendServer } from '@walkeros/server-core';\n\n// Types\nexport * as DestinationAPI from './types';\n\n// Examples\nexport * as examples from './examples';\n\nexport const destinationAPI: Destination = {\n type: 'api',\n\n config: {},\n\n env: { sendServer },\n\n async push(event, { config, rule, data, env, logger }) {\n const { settings } = config;\n const { url, headers, method, transform, timeout } = settings || {};\n\n if (!url) return;\n\n const eventData = isDefined(data) ? data : event;\n const body = transform\n ? transform(eventData, config, rule) // Transform event data\n : JSON.stringify(eventData);\n\n logger?.debug('API destination sending request', {\n url,\n method: method || 'POST',\n eventName: event.name,\n });\n\n const sendServerFn = (env as Env)?.sendServer || sendServer;\n const response = await sendServerFn(url, body, {\n headers,\n method,\n timeout,\n });\n\n logger?.debug('API destination response', { ok: response?.ok });\n },\n};\n\nexport default destinationAPI;\n","import type {\n Mapping as WalkerOSMapping,\n SendDataValue,\n SendHeaders,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationServer, sendServer } from '@walkeros/server-core';\n\nexport interface Settings {\n url: string;\n headers?: SendHeaders;\n method?: string;\n transform?: Transform;\n timeout?: number;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationServer.Env {\n sendServer?: typeof sendServer;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationServer.Destination<Types>;\nexport type Config = DestinationServer.Config<Types>;\nexport type PushFn = DestinationServer.PushFn<Types>;\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n\nexport type Transform = (\n data?: unknown,\n config?: Config,\n mapping?: WalkerOSMapping.Rule<Mapping>,\n) => SendDataValue;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n"],"mappings":";;;;;;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;;;ACF3B;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,OAAwB;AAAA,EACnC,YAAY;AACd;AAEO,IAAM,WAAgB;AAAA,EAC3B,YAAY,OAAO,OAAO,MAAM;AAAA;AAA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,IAAI,IACjC,KAAK,UAAU,SAAS;AAE5B,qCAAQ,MAAM,mCAAmC;AAAA,MAC/C;AAAA,MACA,QAAQ,UAAU;AAAA,MAClB,WAAW,MAAM;AAAA,IACnB;AAEA,UAAM,gBAAgB,2BAAa,eAAc;AACjD,UAAM,WAAW,MAAM,aAAa,KAAK,MAAM;AAAA,MAC7C;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,qCAAQ,MAAM,4BAA4B,EAAE,IAAI,qCAAU,GAAG;AAAA,EAC/D;AACF;AAEA,IAAO,gBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/types/index.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import type { Settings, Destination, Env } from './types';\nimport { isDefined } from '@walkeros/core';\nimport { sendServer } from '@walkeros/server-core';\n\n// Types\nexport * as DestinationAPI from './types';\n\n// Examples\nexport * as examples from './examples';\n\nexport const destinationAPI: Destination = {\n type: 'api',\n\n config: {},\n\n env: { sendServer },\n\n async push(event, { config, rule, data, env, logger }) {\n const { settings } = config;\n const { url, headers, method, transform, timeout } = settings || {};\n\n if (!url) return;\n\n const eventData = isDefined(data) ? data : event;\n const body = transform\n ? transform(eventData, config, rule) // Transform event data\n : JSON.stringify(eventData);\n\n logger?.debug('API destination sending request', {\n url,\n method: method || 'POST',\n eventName: event.name,\n });\n\n const sendServerFn = (env as Env)?.sendServer || sendServer;\n const response = await sendServerFn(url, body, {\n headers,\n method,\n timeout,\n });\n\n logger?.debug('API destination response', { ok: response?.ok });\n },\n};\n\nexport default destinationAPI;\n","import type {\n Mapping as WalkerOSMapping,\n SendDataValue,\n SendHeaders,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationServer, sendServer } from '@walkeros/server-core';\n\nexport interface Settings {\n url: string;\n headers?: SendHeaders;\n method?: string;\n transform?: Transform;\n timeout?: number;\n}\n\nexport interface Mapping {}\n\nexport interface Env extends DestinationServer.Env {\n sendServer?: typeof sendServer;\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env>;\n\nexport type Destination = DestinationServer.Destination<Types>;\nexport type Config = DestinationServer.Config<Types>;\nexport type PushFn = DestinationServer.PushFn<Types>;\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n\nexport type Transform = (\n data?: unknown,\n config?: Config,\n mapping?: WalkerOSMapping.Rule<Mapping>,\n) => SendDataValue;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const fullEvent: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n },\n};\n\nexport const customHeaders: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: 'data',\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n },\n};\n\nexport const customTransform: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: {\n url: 'https://api.example.com/events',\n body: JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n },\n};\n"],"mappings":";;;;;;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;;;ACF3B;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,OAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,CAAC;AAExC,IAAM,OAAwB;AAAA,EACnC,YAAY;AACd;AAEO,IAAM,WAAgB;AAAA,EAC3B,YAAY,OAAO,OAAO,MAAM;AAAA;AAAA,EAEhC,CAAC;AACH;AAMO,IAAM,aAAa,CAAC,YAAY;;;ACzBvC;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,SAAS,gBAAgB;AAElB,IAAM,YAA8B;AAAA,EACzC,IAAI,SAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,QAAQ,KAAK,2BAA2B;AAAA,IACvD,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,IACL,MAAM,KAAK,UAAU;AAAA,MACnB,OAAO;AAAA,MACP,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AACF;AAEO,IAAM,gBAAkC;AAAA,EAC7C,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,MAAM,WAAW,OAAO,mBAAmB;AAAA,IACnD,QAAQ,E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AU,WAAW,QAAQ,IAAI,IACjC,KAAK,UAAU,SAAS;AAE5B,qCAAQ,MAAM,mCAAmC;AAAA,MAC/C;AAAA,MACA,QAAQ,UAAU;AAAA,MAClB,WAAW,MAAM;AAAA,IACnB;AAEA,UAAM,gBAAgB,2BAAa,eAAc;AACjD,UAAM,WAAW,MAAM,aAAa,KAAK,MAAM;AAAA,MAC7C;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,qCAAQ,MAAM,4BAA4B,EAAE,IAAI,qCAAU,GAAG;AAAA,EAC/D;AACF;AAEA,IAAO,gBAAQ;","names":[]}
@@ -3,7 +3,9 @@
3
3
  "package": "@walkeros/server-destination-api",
4
4
  "version": "2.1.1",
5
5
  "type": "destination",
6
- "platform": "server"
6
+ "platform": "server",
7
+ "docs": "https://www.walkeros.io/docs/destinations/api/server",
8
+ "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/api/src"
7
9
  },
8
10
  "schemas": {
9
11
  "settings": {
@@ -44,6 +46,9 @@
44
46
  "examples": {
45
47
  "env": {
46
48
  "init": {},
49
+ "simulation": [
50
+ "sendServer"
51
+ ],
47
52
  "standard": {
48
53
  "sendServer": {
49
54
  "$code": "()=>Promise.resolve({ok:!0})"
@@ -122,6 +127,114 @@
122
127
  }
123
128
  }
124
129
  },
130
+ "customTransform": {
131
+ "in": {
132
+ "name": "order complete",
133
+ "data": {
134
+ "id": "ORD-500",
135
+ "total": 199.99,
136
+ "currency": "USD"
137
+ },
138
+ "context": {
139
+ "shopping": [
140
+ "complete",
141
+ 0
142
+ ]
143
+ },
144
+ "globals": {
145
+ "pagegroup": "shop"
146
+ },
147
+ "custom": {
148
+ "completely": "random"
149
+ },
150
+ "user": {
151
+ "id": "buyer-42"
152
+ },
153
+ "nested": [
154
+ {
155
+ "entity": "product",
156
+ "data": {
157
+ "id": "ers",
158
+ "name": "Everyday Ruck Snack",
159
+ "color": "black",
160
+ "size": "l",
161
+ "price": 420
162
+ },
163
+ "context": {
164
+ "shopping": [
165
+ "complete",
166
+ 0
167
+ ]
168
+ },
169
+ "nested": []
170
+ },
171
+ {
172
+ "entity": "product",
173
+ "data": {
174
+ "id": "cc",
175
+ "name": "Cool Cap",
176
+ "size": "one size",
177
+ "price": 42
178
+ },
179
+ "context": {
180
+ "shopping": [
181
+ "complete",
182
+ 0
183
+ ]
184
+ },
185
+ "nested": []
186
+ },
187
+ {
188
+ "entity": "gift",
189
+ "data": {
190
+ "name": "Surprise"
191
+ },
192
+ "context": {
193
+ "shopping": [
194
+ "complete",
195
+ 0
196
+ ]
197
+ },
198
+ "nested": []
199
+ }
200
+ ],
201
+ "consent": {
202
+ "functional": true
203
+ },
204
+ "id": "1700000802-gr0up-1",
205
+ "trigger": "load",
206
+ "entity": "order",
207
+ "action": "complete",
208
+ "timestamp": 1700000802,
209
+ "timing": 3.14,
210
+ "group": "gr0up",
211
+ "count": 1,
212
+ "version": {
213
+ "source": "2.1.1",
214
+ "tagging": 1
215
+ },
216
+ "source": {
217
+ "type": "server",
218
+ "id": "",
219
+ "previous_id": ""
220
+ }
221
+ },
222
+ "mapping": {
223
+ "data": {
224
+ "map": {
225
+ "order_id": "data.id",
226
+ "amount": "data.total",
227
+ "currency": "data.currency",
228
+ "customer_id": "user.id",
229
+ "event_type": "name"
230
+ }
231
+ }
232
+ },
233
+ "out": {
234
+ "url": "https://api.example.com/events",
235
+ "body": "{\"order_id\":\"ORD-500\",\"amount\":199.99,\"currency\":\"USD\",\"customer_id\":\"buyer-42\",\"event_type\":\"order complete\"}"
236
+ }
237
+ },
125
238
  "fullEvent": {
126
239
  "in": {
127
240
  "name": "page view",
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-api",
3
3
  "description": "API server destination for walkerOS",
4
- "version": "2.2.0-next-1773136823705",
4
+ "version": "3.0.0",
5
5
  "license": "MIT",
6
- "sideEffects": false,
7
6
  "main": "./dist/index.js",
8
7
  "module": "./dist/index.mjs",
9
8
  "types": "./dist/index.d.ts",
@@ -37,8 +36,8 @@
37
36
  "update": "npx npm-check-updates -u && npm update"
38
37
  },
39
38
  "dependencies": {
40
- "@walkeros/core": "2.2.0-next-1773136823705",
41
- "@walkeros/server-core": "2.2.0-next-1773136823705"
39
+ "@walkeros/core": "^3.0.0",
40
+ "@walkeros/server-core": "^3.0.0"
42
41
  },
43
42
  "devDependencies": {},
44
43
  "repository": {
@@ -52,7 +51,8 @@
52
51
  },
53
52
  "walkerOS": {
54
53
  "type": "destination",
55
- "platform": "server"
54
+ "platform": "server",
55
+ "docs": "https://www.walkeros.io/docs/destinations/api/server"
56
56
  },
57
57
  "keywords": [
58
58
  "walkerOS",