{"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\n/**\n * API server destination step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body, options)`\n * where `url` is the configured endpoint, `body` is the JSON-stringified\n * event data (or mapped data), and `options` carries headers/method/timeout.\n *\n * Each `out` tuple is `['sendServer', url, body, options]` mirroring the real\n * call signature. The test fixture injects the configured settings per example.\n */\nconst URL = 'https://api.example.com/events';\n\nexport const fullEvent: Flow.StepExample = {\n  title: 'Forward event data',\n  description:\n    'A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.',\n  in: getEvent('page view', {\n    timestamp: 1700000800,\n    data: { title: 'Docs', url: 'https://example.com/docs' },\n    source: { type: 'express', platform: 'server' },\n  }),\n  mapping: {\n    data: 'data',\n  },\n  out: [\n    [\n      'sendServer',\n      URL,\n      JSON.stringify({\n        title: 'Docs',\n        url: 'https://example.com/docs',\n      }),\n      { headers: undefined, method: undefined, timeout: undefined },\n    ],\n  ],\n};\n\nexport const customHeaders: Flow.StepExample = {\n  title: 'Custom headers',\n  description:\n    'A form submission is sent to the API with custom request headers such as an API key for authentication.',\n  in: getEvent('form submit', {\n    timestamp: 1700000801,\n    data: { type: 'contact', email: 'user@example.com' },\n    source: { type: 'express', platform: 'server' },\n  }),\n  mapping: {\n    data: 'data',\n  },\n  out: [\n    [\n      'sendServer',\n      URL,\n      JSON.stringify({\n        type: 'contact',\n        email: 'user@example.com',\n      }),\n      {\n        headers: { 'X-API-Key': 'YOUR_API_KEY' },\n        method: undefined,\n        timeout: undefined,\n      },\n    ],\n  ],\n};\n\nexport const customTransform: Flow.StepExample = {\n  title: 'Custom payload',\n  description:\n    'An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.',\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: 'express', platform: 'server' },\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    [\n      'sendServer',\n      URL,\n      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      { headers: undefined, method: undefined, timeout: undefined },\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,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