@walkeros/server-source-aws 4.7.2-next-1791147139360 → 4.7.2
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/CHANGELOG.md +6 -2
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/walkerOS.json +8 -8
- package/package.json +3 -3
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lambda/examples/index.ts","../src/lambda/examples/env.ts","../src/lambda/examples/step.ts","../src/lambda/examples/trigger.ts","../src/sqs/examples/index.ts","../src/sqs/examples/env.ts","../src/sqs/examples/step.ts","../src/sqs/examples/trigger.ts","../src/lambda/schemas/index.ts","../src/lambda/schemas/settings.ts","../src/lambda/schemas/primitives.ts","../src/sqs/schemas/index.ts","../src/sqs/schemas/settings.ts","../src/sqs/schemas/setup.ts","../src/schemas.ts","../src/dev.ts"],"sourcesContent":["export * as env from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for AWS Lambda source\n *\n * These environments provide standardized mock structures for testing\n * Lambda event handling without requiring actual Lambda deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing Lambda source\n *\n * Use this for testing Lambda event ingestion and request/response handling\n * without requiring a real AWS Lambda environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const lambdaPost: Flow.StepExample = {\n title: 'Lambda POST',\n description:\n 'An API Gateway v2 HTTP POST with a JSON body is converted into a walker elb event.',\n trigger: { type: 'POST' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'POST', path: '/collect' },\n requestId: 'req-123',\n },\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n },\n ],\n ],\n};\n\nexport const apiGatewayV1Post: Flow.StepExample = {\n title: 'API Gateway v1 POST',\n description:\n 'A REST API Gateway v1 POST request with a JSON body is converted into a walker elb event.',\n trigger: { type: 'POST' },\n in: {\n httpMethod: 'POST',\n path: '/collect',\n requestContext: {\n requestId: 'req-789',\n identity: { sourceIp: '203.0.113.42' },\n },\n queryStringParameters: null,\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n },\n ],\n ],\n};\n\nexport const lambdaGet: Flow.StepExample = {\n title: 'Lambda GET',\n description:\n 'An API Gateway v2 HTTP GET with query parameters is parsed into an elb event payload.',\n trigger: { type: 'GET' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'GET', path: '/collect' },\n requestId: 'req-456',\n },\n rawQueryString: 'e=page+view&d=%7B%22title%22%3A%22Home%22%7D',\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n e: 'page view',\n d: '{\"title\":\"Home\"}',\n },\n ],\n ],\n};\n\nexport const lambdaPostForwardsSource: Flow.StepExample = {\n title: 'Lambda POST with provenance',\n description:\n 'A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.',\n trigger: { type: 'POST' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'POST', path: '/collect' },\n requestId: 'req-321',\n },\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n source: { release: { web: 'r1' } },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n source: { release: { web: 'r1' } },\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport type { LambdaEvent, LambdaContext, LambdaResult } from '../types';\nimport { startFlow } from '@walkeros/collector';\n\nexport interface Content {\n [key: string]: unknown;\n}\n\nexport interface Result {\n statusCode: number;\n body: unknown;\n headers: Record<string, string>;\n}\n\n/**\n * Find the lambda source instance from the collector's registered sources.\n */\nfunction findLambdaSource(collector: Collector.Instance) {\n for (const source of Object.values(collector.sources || {})) {\n if ((source as { type?: string }).type === 'lambda') return source;\n }\n}\n\n/**\n * Lambda source createTrigger.\n *\n * Boots the collector via startFlow, then invokes the Lambda source's push()\n * with a real API Gateway event and a minimal Lambda context.\n *\n * Content is the raw Lambda event object (API Gateway v1 or v2 format).\n * Result contains statusCode, parsed body, and headers.\n *\n * @example\n * const { trigger, flow } = await createTrigger(config);\n * const result = await trigger('POST')({ version: '2.0', ... });\n * console.log(result.statusCode, result.body);\n */\nconst createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n // Lazy startFlow\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findLambdaSource(flow.collector);\n if (!source) throw new Error('Lambda source not found in collector');\n\n // Create minimal Lambda context\n const lambdaContext = {\n awsRequestId: `test-${Date.now()}`,\n } as unknown as LambdaContext;\n\n // Call source.push with the raw Lambda event + context\n const pushFn = (\n source as unknown as {\n push: (...args: unknown[]) => Promise<LambdaResult>;\n }\n ).push;\n const lambdaResult = await pushFn(\n content as unknown as LambdaEvent,\n lambdaContext,\n );\n\n // Parse response\n let body: unknown;\n try {\n body = JSON.parse(lambdaResult.body || '{}');\n } catch {\n body = lambdaResult.body;\n }\n\n const headers: Record<string, string> = {};\n if (lambdaResult.headers) {\n for (const [k, v] of Object.entries(lambdaResult.headers)) {\n if (v !== undefined) headers[k] = String(v);\n }\n }\n\n return {\n statusCode: lambdaResult.statusCode,\n body,\n headers,\n };\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/**\n * Legacy trigger — takes a source instance directly.\n * Preserved for CLI simulate path.\n */\nfunction trigger(source: {\n push: (event: LambdaEvent, context: LambdaContext) => Promise<LambdaResult>;\n}): (content: Content) => Promise<LambdaResult> {\n return async (content: Content) => {\n const lambdaEvent = { ...(content as Record<string, unknown>) };\n\n // Adapt body format: step examples may use `name`, source expects `event`\n if (lambdaEvent.body && typeof lambdaEvent.body === 'string') {\n const body = JSON.parse(lambdaEvent.body);\n if (body.name && !body.event) {\n lambdaEvent.body = JSON.stringify({\n ...body,\n event: body.name,\n name: undefined,\n });\n }\n }\n\n const context: LambdaContext = {\n awsRequestId: 'test-req',\n } as unknown as LambdaContext;\n\n return source.push(lambdaEvent as unknown as LambdaEvent, context);\n };\n}\n\nexport { createTrigger, trigger };\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\nexport type { Content, Result } from './trigger';\n","import type {\n CreateQueueCommandOutput,\n DeleteMessageCommandOutput,\n GetQueueAttributesCommandOutput,\n GetQueueUrlCommandOutput,\n ReceiveMessageCommandOutput,\n SQSClientConfig,\n} from '@aws-sdk/client-sqs';\nimport type { Env, SqsClient } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment for the AWS SQS source.\n *\n * `push` injects a structural SQS client (`env.AWS.SQSClient`), so a\n * simulated run never reaches AWS and its `send` calls can be recorded. The\n * unit tests keep substituting the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sqs')`; they use `push` without the client.\n */\n\nconst noopFn = (): void => undefined;\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\nconst createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\n return fn;\n};\n\nconst QUEUE_URL =\n 'https://sqs.eu-central-1.amazonaws.com/000000000000/walkeros-events';\nconst QUEUE_ARN = 'arn:aws:sqs:eu-central-1:000000000000:walkeros-events';\n\n/** A long poll that finds nothing, kept short so a simulated run ends fast. */\nconst RECEIVE_WAIT_MS = 100;\n\n/** One response that satisfies every command the source sends. */\ntype SqsResponse = GetQueueUrlCommandOutput &\n GetQueueAttributesCommandOutput &\n ReceiveMessageCommandOutput &\n DeleteMessageCommandOutput &\n CreateQueueCommandOutput;\n\nfunction isReceive(command: object): boolean {\n if (!('input' in command)) return false;\n const { input } = command;\n return (\n typeof input === 'object' && input !== null && 'WaitTimeSeconds' in input\n );\n}\n\n/**\n * Answers every command with the queue URL and ARN and an empty receive, so\n * init resolves the queue and the long-poll loop idles without messages.\n */\nclass MockSQSClient implements SqsClient {\n constructor(public config?: SQSClientConfig) {}\n\n async send(command: object): Promise<SqsResponse> {\n if (isReceive(command)) {\n await new Promise<void>((resolve) =>\n setTimeout(resolve, RECEIVE_WAIT_MS),\n );\n }\n return {\n $metadata: {},\n QueueUrl: QUEUE_URL,\n Attributes: { QueueArn: QUEUE_ARN },\n Messages: [],\n };\n }\n\n destroy(): void {}\n}\n\nfunction createEnv(): Env {\n return {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n };\n}\n\n/** Standard mock environment, with the structural client for simulate. */\nexport const push: Env = Object.assign(createEnv(), {\n AWS: { SQSClient: MockSQSClient },\n});\n\n/**\n * The same environment without the client, for unit tests that substitute the\n * SDK module-wide with `jest.mock`.\n */\nexport const moduleMockEnv: Env = createEnv();\n\n/** Every request (queue lookup, receive, delete) goes through `send`. */\nexport const simulation = ['call:AWS.SQSClient.send'];\n","import type { Flow } from '@walkeros/core';\n\n/**\n * SQS source step examples.\n *\n * Each `in` is a partial SQS Message-like (MessageId, Body, optional\n * ReceiptHandle). The trigger synthesizes the missing fields and dispatches\n * through the source's `push()` (the same pipeline the long-poll loop uses).\n * `out` records the terminal state recorded by the trigger as\n * `[method, ...args]` entries.\n */\n\nconst eventPayload = {\n event: 'page view',\n data: { title: 'Documentation', url: 'https://example.com/docs' },\n};\n\nconst orderPayload = {\n event: 'order complete',\n data: { id: 'ORD-500', total: 199.99, currency: 'EUR' },\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view from SQS',\n description:\n 'A standard SQS message body containing a walker elb event payload as JSON.',\n in: {\n MessageId: 'm-1',\n Body: JSON.stringify(eventPayload),\n },\n out: [['message.ack', 'm-1']],\n};\n\nexport const orderComplete: Flow.StepExample = {\n title: 'Order complete from SQS',\n description: 'Order complete event flowing through the long-poll loop.',\n in: {\n MessageId: 'm-2',\n Body: JSON.stringify(orderPayload),\n },\n out: [['message.ack', 'm-2']],\n};\n\nexport const decoderText: Flow.StepExample = {\n title: 'Text decoder',\n description:\n 'When decoder is \"text\", the body string flows under data.payload.',\n in: { MessageId: 'm-3', Body: 'raw text payload' },\n out: [['message.ack', 'm-3']],\n};\n\nexport const malformedJson: Flow.StepExample = {\n title: 'Malformed JSON nacks',\n description:\n 'Default decoder is JSON. A malformed body throws DecoderError; the source nacks (skips DeleteMessage) so the message redelivers.',\n in: { MessageId: 'm-4', Body: '{not json' },\n out: [['message.nack', 'm-4']],\n};\n","import type { Collector, Trigger } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport type { SyntheticMessage, SyntheticPushResult } from '../types';\n\n/**\n * Content shape for the SQS source trigger.\n *\n * The trigger synthesizes a SyntheticMessage from this partial input and\n * dispatches it through the source's `push()` (the same pipeline the\n * long-poll loop uses).\n */\nexport interface Content {\n MessageId: string;\n Body: string;\n ReceiptHandle?: string;\n Attributes?: Record<string, string>;\n MessageAttributes?: Record<\n string,\n { DataType: string; StringValue?: string }\n >;\n}\n\n/**\n * Trigger result: the recorded ack/nack as `[method, MessageId]` entries.\n * Mirrors the destination's `[method, ...args]` recording shape.\n */\nexport type Result = Array<[string, ...unknown[]]>;\n\ninterface SqsSourceLike {\n type: string;\n push: (content?: SyntheticMessage) => Promise<SyntheticPushResult | void>;\n}\n\nfunction isSqsSource(value: unknown): value is SqsSourceLike {\n if (typeof value !== 'object' || value === null) return false;\n const candidate: { type?: unknown; push?: unknown } = value;\n return candidate.type === 'sqs' && typeof candidate.push === 'function';\n}\n\nfunction findSource(collector: Collector.Instance): SqsSourceLike | undefined {\n for (const source of Object.values(collector.sources ?? {})) {\n if (isSqsSource(source)) return source;\n }\n return undefined;\n}\n\n/**\n * SQS source createTrigger.\n *\n * Boots the collector via startFlow, finds the registered SQS source, and\n * invokes its `push()` with a synthesized message. The source dispatches the\n * synthetic message through the same handler the long-poll loop uses,\n * exercising the full decode / forward / ack-nack pipeline without touching\n * real SQS infrastructure.\n */\nexport const createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findSource(flow.collector);\n if (!source) {\n throw new Error(\n 'sqs source not registered in collector, ensure it is configured in sources',\n );\n }\n\n const synthetic: SyntheticMessage = {\n MessageId: content.MessageId,\n Body: content.Body,\n ReceiptHandle: content.ReceiptHandle,\n Attributes: content.Attributes,\n MessageAttributes: content.MessageAttributes,\n };\n\n const result = await source.push(synthetic);\n const recorded: Result = [];\n if (result && typeof result === 'object') {\n if (result.acked) recorded.push(['message.ack', content.MessageId]);\n if (result.nacked) recorded.push(['message.nack', content.MessageId]);\n }\n return recorded;\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * AWS Lambda source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .default(true),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(900000) // AWS Lambda max timeout: 15 minutes\n .describe('Request timeout in milliseconds (max: 900000 for Lambda)')\n .default(30000),\n\n enablePixelTracking: z\n .boolean()\n .describe(\n 'Enable GET requests with 1x1 transparent GIF response for pixel tracking',\n )\n .default(true),\n\n maxBatchSize: z\n .number()\n .int()\n .min(1)\n .describe('Maximum number of events accepted in a single batch request')\n .default(100),\n\n healthPath: z\n .string()\n .describe('Health check endpoint path (e.g., /health)')\n .default('/health'),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema exports (for website PropertyTable + MCP package_get).\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS SQS source settings schema.\n *\n * Required: queueName. All other fields optional with sensible defaults\n * applied at runtime by `getConfig`.\n */\nexport const SettingsSchema = z.object({\n queueName: z\n .string()\n .min(1)\n .describe(\n 'SQS queue short name (like walkeros-events). Required for both setup and runtime poll.',\n ),\n region: z\n .string()\n .describe('AWS region (like eu-central-1). Default: eu-central-1.')\n .optional(),\n queueUrl: z\n .string()\n .url()\n .describe(\n 'Optional pre-resolved queue URL. When set, init skips the GetQueueUrl lookup.',\n )\n .optional(),\n client: z\n .any()\n .describe(\n 'Pre-configured AWS SQSClient instance. Bypasses construction when supplied.',\n )\n .optional(),\n config: z\n .any()\n .describe(\n 'AWS SDK SQSClientConfig (credentials, endpoint overrides, retries).',\n )\n .optional(),\n decoder: z\n .enum(['json', 'text', 'raw'])\n .describe(\n 'Decoder for the message body. json (default) parses JSON, text forwards UTF-8, raw forwards a Buffer.',\n )\n .optional(),\n maxMessages: z\n .number()\n .int()\n .min(1)\n .max(10)\n .describe('SQS receive batch size. Cap 10. Default: 10.')\n .optional(),\n waitTimeSeconds: z\n .number()\n .int()\n .min(0)\n .max(20)\n .describe('Long-poll duration in seconds. Cap 20. Default: 20.')\n .optional(),\n visibilityTimeout: z\n .number()\n .int()\n .nonnegative()\n .describe(\n 'Per-receive visibility timeout override. Default: queue-configured value.',\n )\n .optional(),\n shutdownTimeoutMs: z\n .number()\n .int()\n .positive()\n .describe(\n 'Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes.',\n )\n .optional(),\n onPushError: z\n .enum(['nack', 'ack'])\n .describe(\n 'Behavior when forwarding to the collector throws. nack (default) skips DeleteMessage so the message redelivers; ack drops it.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS SQS source setup schema.\n *\n * Provisioning options for `walkeros setup source.<id>`. Authoritative-apply:\n * declared state is written via a single CreateQueueCommand; non-declared\n * tags or attributes are left untouched.\n */\nconst TagsSchema = z.record(z.string(), z.string());\n\nexport const SetupSchema = z.object({\n region: z.string().min(1).describe('AWS region.').optional(),\n fifoQueue: z\n .boolean()\n .describe(\n 'FIFO queue with content-based deduplication. Auto-appends .fifo suffix to the queue name.',\n )\n .optional(),\n visibilityTimeoutSeconds: z\n .number()\n .int()\n .nonnegative()\n .describe('Visibility timeout in seconds. Default: 30.')\n .optional(),\n messageRetentionSeconds: z\n .number()\n .int()\n .positive()\n .describe('Message retention period in seconds. Default: 345600 (4 days).')\n .optional(),\n maximumMessageSize: z\n .number()\n .int()\n .min(1024)\n .max(262144)\n .describe('Max message size in bytes. Default: 262144 (256 KB).')\n .optional(),\n kmsMasterKeyId: z\n .string()\n .describe('KMS key alias or ID for at-rest encryption.')\n .optional(),\n deadLetterQueue: z\n .object({\n arn: z\n .string()\n .describe(\n 'ARN of an existing DLQ. Mutually exclusive with create: true.',\n )\n .optional(),\n create: z\n .boolean()\n .describe('Create a sibling DLQ named <queueName>-dlq. Default: false.')\n .optional(),\n maxReceiveCount: z\n .number()\n .int()\n .min(1)\n .max(1000)\n .describe('Max receive count before message goes to DLQ. Default: 5.')\n .optional(),\n })\n .describe('Optional dead-letter queue.')\n .optional(),\n tags: TagsSchema.describe(\n 'Tags applied to the queue (and inherited by an auto-created DLQ).',\n ).optional(),\n subscribeToSnsTopic: z\n .object({\n topicArn: z.string().min(1).describe('Topic ARN to subscribe to.'),\n rawMessageDelivery: z\n .boolean()\n .describe('Deliver SNS messages without the SNS envelope.')\n .optional(),\n filterPolicy: z\n .record(z.string(), z.unknown())\n .describe('SNS filter policy applied at subscription level.')\n .optional(),\n })\n .describe(\n 'Optional SNS topic subscription. Creates the subscription and the matching queue policy.',\n )\n .optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","// Lambda (default sub-source).\nexport { settings, SettingsSchema, type Settings } from './lambda/schemas';\nexport * from './lambda/schemas/primitives';\n\n// SQS sub-source. Prefixed so the website's <Configuration> snippet can\n// remap data.schemas.sqsSettings / sqsSetup onto data.schemas.settings.\nexport { settings as sqsSettings } from './sqs/schemas';\nexport { setup as sqsSetup } from './sqs/schemas';\n","import * as lambdaExamplesNs from './lambda/examples';\nimport * as sqsExamplesNs from './sqs/examples';\nimport * as lambdaSchemasNs from './lambda/schemas';\nimport * as sqsSchemasNs from './sqs/schemas';\n\nexport * as schemas from './schemas';\nexport * as examples from './lambda/examples';\nexport * as sqsExamples from './sqs/examples';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n sourceLambda: lambdaExamplesNs,\n sourceSqs: sqsExamplesNs,\n};\n\n/** Schemas per export, keyed by the export names in package.json. */\nexport const exportSchemas = {\n sourceLambda: { settings: lambdaSchemasNs.settings },\n sourceSqs: {\n settings: sqsSchemasNs.settings,\n setup: sqsSchemasNs.setup,\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAWA,IAAM,kBAAkB,MAAc;AACpC,QAAMA,OAAM,MACV,QAAQ,QAAQ;AAAA,IACd,IAAI;AAAA,EACN,CAAC;AACH,SAAOA;AACT;AAGA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AAA,EACF,EACC,SAAS;AACd,CAAC;;;AF3EM,IAAMC,YAAWC,aAAYC,eAAc;AAC3C,IAAM,QAAQD,aAAY,WAAW;;;AGT5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAE;AAAA,EAAA;AAAA;;;ACUO,IAAM,iBAAiB;AAAA,EAC5B,cAAc;AAAA,EACd,WAAWC;AACb;AAGO,IAAM,gBAAgB;AAAA,EAC3B,cAAc,EAAE,SAAmC;AAAA,EACnD,WAAW;AAAA,IACT,UAAuBC;AAAA,IACvB;AAAA,EACF;AACF;","names":["fn","trigger","k","v","examples_exports","createTrigger","env_exports","step_exports","env_exports","push","noopFn","noopLogger","createMockElbFn","fn","step_exports","createTrigger","trigger","result","z","z","z","zodToSchema","z","SettingsSchema","z","settings","zodToSchema","SettingsSchema","settings","examples_exports","settings"]}
|
|
1
|
+
{"version":3,"sources":["../src/lambda/examples/index.ts","../src/lambda/examples/env.ts","../src/lambda/examples/step.ts","../src/lambda/examples/trigger.ts","../src/sqs/examples/index.ts","../src/sqs/examples/env.ts","../src/sqs/examples/step.ts","../src/sqs/examples/trigger.ts","../src/lambda/schemas/index.ts","../src/lambda/schemas/settings.ts","../src/lambda/schemas/primitives.ts","../src/sqs/schemas/index.ts","../src/sqs/schemas/settings.ts","../src/sqs/schemas/setup.ts","../src/schemas.ts","../src/dev.ts"],"sourcesContent":["export * as env from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for AWS Lambda source\n *\n * These environments provide standardized mock structures for testing\n * Lambda event handling without requiring actual Lambda deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing Lambda source\n *\n * Use this for testing Lambda event ingestion and request/response handling\n * without requiring a real AWS Lambda environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const lambdaPost: Flow.StepExample = {\n title: 'Lambda POST',\n description:\n 'An API Gateway v2 HTTP POST with a JSON body is converted into a walker elb event.',\n trigger: { type: 'POST' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'POST', path: '/collect' },\n requestId: 'req-123',\n },\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n },\n ],\n ],\n};\n\nexport const apiGatewayV1Post: Flow.StepExample = {\n title: 'API Gateway v1 POST',\n description:\n 'A REST API Gateway v1 POST request with a JSON body is converted into a walker elb event.',\n trigger: { type: 'POST' },\n in: {\n httpMethod: 'POST',\n path: '/collect',\n requestContext: {\n requestId: 'req-789',\n identity: { sourceIp: '203.0.113.42' },\n },\n queryStringParameters: null,\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n },\n ],\n ],\n};\n\nexport const lambdaGet: Flow.StepExample = {\n title: 'Lambda GET',\n description:\n 'An API Gateway v2 HTTP GET with query parameters is parsed into an elb event payload.',\n trigger: { type: 'GET' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'GET', path: '/collect' },\n requestId: 'req-456',\n },\n rawQueryString: 'e=page+view&d=%7B%22title%22%3A%22Home%22%7D',\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n e: 'page view',\n d: '{\"title\":\"Home\"}',\n },\n ],\n ],\n};\n\nexport const lambdaPostForwardsSource: Flow.StepExample = {\n title: 'Lambda POST with provenance',\n description:\n 'A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.',\n trigger: { type: 'POST' },\n in: {\n version: '2.0',\n requestContext: {\n http: { method: 'POST', path: '/collect' },\n requestId: 'req-321',\n },\n body: JSON.stringify({\n name: 'page view',\n data: { title: 'Home' },\n source: { release: { web: 'r1' } },\n }),\n isBase64Encoded: false,\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home' },\n source: { release: { web: 'r1' } },\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport type { LambdaEvent, LambdaContext, LambdaResult } from '../types';\nimport { startFlow } from '@walkeros/collector';\n\nexport interface Content {\n [key: string]: unknown;\n}\n\nexport interface Result {\n statusCode: number;\n body: unknown;\n headers: Record<string, string>;\n}\n\n/**\n * Find the lambda source instance from the collector's registered sources.\n */\nfunction findLambdaSource(collector: Collector.Instance) {\n for (const source of Object.values(collector.sources || {})) {\n if ((source as { type?: string }).type === 'lambda') return source;\n }\n}\n\n/**\n * Lambda source createTrigger.\n *\n * Boots the collector via startFlow, then invokes the Lambda source's push()\n * with a real API Gateway event and a minimal Lambda context.\n *\n * Content is the raw Lambda event object (API Gateway v1 or v2 format).\n * Result contains statusCode, parsed body, and headers.\n *\n * @example\n * const { trigger, flow } = await createTrigger(config);\n * const result = await trigger('POST')({ version: '2.0', ... });\n * console.log(result.statusCode, result.body);\n */\nconst createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n // Lazy startFlow\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findLambdaSource(flow.collector);\n if (!source) throw new Error('Lambda source not found in collector');\n\n // Create minimal Lambda context\n const lambdaContext = {\n awsRequestId: `test-${Date.now()}`,\n } as unknown as LambdaContext;\n\n // Call source.push with the raw Lambda event + context\n const pushFn = (\n source as unknown as {\n push: (...args: unknown[]) => Promise<LambdaResult>;\n }\n ).push;\n const lambdaResult = await pushFn(\n content as unknown as LambdaEvent,\n lambdaContext,\n );\n\n // Parse response\n let body: unknown;\n try {\n body = JSON.parse(lambdaResult.body || '{}');\n } catch {\n body = lambdaResult.body;\n }\n\n const headers: Record<string, string> = {};\n if (lambdaResult.headers) {\n for (const [k, v] of Object.entries(lambdaResult.headers)) {\n if (v !== undefined) headers[k] = String(v);\n }\n }\n\n return {\n statusCode: lambdaResult.statusCode,\n body,\n headers,\n };\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/**\n * Legacy trigger — takes a source instance directly.\n * Preserved for CLI simulate path.\n */\nfunction trigger(source: {\n push: (event: LambdaEvent, context: LambdaContext) => Promise<LambdaResult>;\n}): (content: Content) => Promise<LambdaResult> {\n return async (content: Content) => {\n const lambdaEvent = { ...(content as Record<string, unknown>) };\n\n // Adapt body format: step examples may use `name`, source expects `event`\n if (lambdaEvent.body && typeof lambdaEvent.body === 'string') {\n const body = JSON.parse(lambdaEvent.body);\n if (body.name && !body.event) {\n lambdaEvent.body = JSON.stringify({\n ...body,\n event: body.name,\n name: undefined,\n });\n }\n }\n\n const context: LambdaContext = {\n awsRequestId: 'test-req',\n } as unknown as LambdaContext;\n\n return source.push(lambdaEvent as unknown as LambdaEvent, context);\n };\n}\n\nexport { createTrigger, trigger };\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\nexport type { Content, Result } from './trigger';\n","import type {\n CreateQueueCommandOutput,\n DeleteMessageCommandOutput,\n GetQueueAttributesCommandOutput,\n GetQueueUrlCommandOutput,\n ReceiveMessageCommandOutput,\n SQSClientConfig,\n} from '@aws-sdk/client-sqs';\nimport type { Env, SqsClient } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment for the AWS SQS source.\n *\n * `push` injects a structural SQS client (`env.AWS.SQSClient`), so a\n * simulated run never reaches AWS and its `send` calls can be recorded. The\n * unit tests keep substituting the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sqs')`; they use `push` without the client.\n */\n\nconst noopFn = (): void => undefined;\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\nconst createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\n return fn;\n};\n\nconst QUEUE_URL =\n 'https://sqs.eu-central-1.amazonaws.com/000000000000/walkeros-events';\nconst QUEUE_ARN = 'arn:aws:sqs:eu-central-1:000000000000:walkeros-events';\n\n/** A long poll that finds nothing, kept short so a simulated run ends fast. */\nconst RECEIVE_WAIT_MS = 100;\n\n/** One response that satisfies every command the source sends. */\ntype SqsResponse = GetQueueUrlCommandOutput &\n GetQueueAttributesCommandOutput &\n ReceiveMessageCommandOutput &\n DeleteMessageCommandOutput &\n CreateQueueCommandOutput;\n\nfunction isReceive(command: object): boolean {\n if (!('input' in command)) return false;\n const { input } = command;\n return (\n typeof input === 'object' && input !== null && 'WaitTimeSeconds' in input\n );\n}\n\n/**\n * Answers every command with the queue URL and ARN and an empty receive, so\n * init resolves the queue and the long-poll loop idles without messages.\n */\nclass MockSQSClient implements SqsClient {\n constructor(public config?: SQSClientConfig) {}\n\n async send(command: object): Promise<SqsResponse> {\n if (isReceive(command)) {\n await new Promise<void>((resolve) =>\n setTimeout(resolve, RECEIVE_WAIT_MS),\n );\n }\n return {\n $metadata: {},\n QueueUrl: QUEUE_URL,\n Attributes: { QueueArn: QUEUE_ARN },\n Messages: [],\n };\n }\n\n destroy(): void {}\n}\n\nfunction createEnv(): Env {\n return {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n };\n}\n\n/** Standard mock environment, with the structural client for simulate. */\nexport const push: Env = Object.assign(createEnv(), {\n AWS: { SQSClient: MockSQSClient },\n});\n\n/**\n * The same environment without the client, for unit tests that substitute the\n * SDK module-wide with `jest.mock`.\n */\nexport const moduleMockEnv: Env = createEnv();\n\n/** Every request (queue lookup, receive, delete) goes through `send`. */\nexport const simulation = ['call:AWS.SQSClient.send'];\n","import type { Flow } from '@walkeros/core';\n\n/**\n * SQS source step examples.\n *\n * Each `in` is a partial SQS Message-like (MessageId, Body, optional\n * ReceiptHandle). The trigger synthesizes the missing fields and dispatches\n * through the source's `push()` (the same pipeline the long-poll loop uses).\n * `out` records the terminal state recorded by the trigger as\n * `[method, ...args]` entries.\n */\n\nconst eventPayload = {\n event: 'page view',\n data: { title: 'Documentation', url: 'https://example.com/docs' },\n};\n\nconst orderPayload = {\n event: 'order complete',\n data: { id: 'ORD-500', total: 199.99, currency: 'EUR' },\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view from SQS',\n description:\n 'A standard SQS message body containing a walker elb event payload as JSON.',\n in: {\n MessageId: 'm-1',\n Body: JSON.stringify(eventPayload),\n },\n out: [['message.ack', 'm-1']],\n};\n\nexport const orderComplete: Flow.StepExample = {\n title: 'Order complete from SQS',\n description: 'Order complete event flowing through the long-poll loop.',\n in: {\n MessageId: 'm-2',\n Body: JSON.stringify(orderPayload),\n },\n out: [['message.ack', 'm-2']],\n};\n\nexport const decoderText: Flow.StepExample = {\n title: 'Text decoder',\n description:\n 'When decoder is \"text\", the body string flows under data.payload.',\n in: { MessageId: 'm-3', Body: 'raw text payload' },\n out: [['message.ack', 'm-3']],\n};\n\nexport const malformedJson: Flow.StepExample = {\n title: 'Malformed JSON nacks',\n description:\n 'Default decoder is JSON. A malformed body throws DecoderError; the source nacks (skips DeleteMessage) so the message redelivers.',\n in: { MessageId: 'm-4', Body: '{not json' },\n out: [['message.nack', 'm-4']],\n};\n","import type { Collector, Trigger } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport type { SyntheticMessage, SyntheticPushResult } from '../types';\n\n/**\n * Content shape for the SQS source trigger.\n *\n * The trigger synthesizes a SyntheticMessage from this partial input and\n * dispatches it through the source's `push()` (the same pipeline the\n * long-poll loop uses).\n */\nexport interface Content {\n MessageId: string;\n Body: string;\n ReceiptHandle?: string;\n Attributes?: Record<string, string>;\n MessageAttributes?: Record<\n string,\n { DataType: string; StringValue?: string }\n >;\n}\n\n/**\n * Trigger result: the recorded ack/nack as `[method, MessageId]` entries.\n * Mirrors the destination's `[method, ...args]` recording shape.\n */\nexport type Result = Array<[string, ...unknown[]]>;\n\ninterface SqsSourceLike {\n type: string;\n push: (content?: SyntheticMessage) => Promise<SyntheticPushResult | void>;\n}\n\nfunction isSqsSource(value: unknown): value is SqsSourceLike {\n if (typeof value !== 'object' || value === null) return false;\n const candidate: { type?: unknown; push?: unknown } = value;\n return candidate.type === 'sqs' && typeof candidate.push === 'function';\n}\n\nfunction findSource(collector: Collector.Instance): SqsSourceLike | undefined {\n for (const source of Object.values(collector.sources ?? {})) {\n if (isSqsSource(source)) return source;\n }\n return undefined;\n}\n\n/**\n * SQS source createTrigger.\n *\n * Boots the collector via startFlow, finds the registered SQS source, and\n * invokes its `push()` with a synthesized message. The source dispatches the\n * synthetic message through the same handler the long-poll loop uses,\n * exercising the full decode / forward / ack-nack pipeline without touching\n * real SQS infrastructure.\n */\nexport const createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findSource(flow.collector);\n if (!source) {\n throw new Error(\n 'sqs source not registered in collector, ensure it is configured in sources',\n );\n }\n\n const synthetic: SyntheticMessage = {\n MessageId: content.MessageId,\n Body: content.Body,\n ReceiptHandle: content.ReceiptHandle,\n Attributes: content.Attributes,\n MessageAttributes: content.MessageAttributes,\n };\n\n const result = await source.push(synthetic);\n const recorded: Result = [];\n if (result && typeof result === 'object') {\n if (result.acked) recorded.push(['message.ack', content.MessageId]);\n if (result.nacked) recorded.push(['message.nack', content.MessageId]);\n }\n return recorded;\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * AWS Lambda source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .default(true),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(900000) // AWS Lambda max timeout: 15 minutes\n .describe('Request timeout in milliseconds (max: 900000 for Lambda)')\n .default(30000),\n\n enablePixelTracking: z\n .boolean()\n .describe(\n 'Enable GET requests with 1x1 transparent GIF response for pixel tracking',\n )\n .default(true),\n\n maxBatchSize: z\n .number()\n .int()\n .min(1)\n .describe('Maximum number of events accepted in a single batch request')\n .default(100),\n\n healthPath: z\n .string()\n .describe('Health check endpoint path (e.g., /health)')\n .default('/health'),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema exports (for website PropertyTable + MCP package_get).\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS SQS source settings schema.\n *\n * Required: queueName. All other fields optional with sensible defaults\n * applied at runtime by `getConfig`.\n */\nexport const SettingsSchema = z.object({\n queueName: z\n .string()\n .min(1)\n .describe(\n 'SQS queue short name (like walkeros-events). Required for both setup and runtime poll.',\n ),\n region: z\n .string()\n .describe('AWS region (like eu-central-1). Default: eu-central-1.')\n .optional(),\n queueUrl: z\n .string()\n .url()\n .describe(\n 'Optional pre-resolved queue URL. When set, init skips the GetQueueUrl lookup.',\n )\n .optional(),\n client: z\n .any()\n .describe(\n 'Pre-configured AWS SQSClient instance. Bypasses construction when supplied.',\n )\n .optional(),\n config: z\n .any()\n .describe(\n 'AWS SDK SQSClientConfig (credentials, endpoint overrides, retries).',\n )\n .optional(),\n decoder: z\n .enum(['json', 'text', 'raw'])\n .describe(\n 'Decoder for the message body. json (default) parses JSON, text forwards UTF-8, raw forwards a Buffer.',\n )\n .optional(),\n maxMessages: z\n .number()\n .int()\n .min(1)\n .max(10)\n .describe('SQS receive batch size. Cap 10. Default: 10.')\n .optional(),\n waitTimeSeconds: z\n .number()\n .int()\n .min(0)\n .max(20)\n .describe('Long-poll duration in seconds. Cap 20. Default: 20.')\n .optional(),\n visibilityTimeout: z\n .number()\n .int()\n .nonnegative()\n .describe(\n 'Per-receive visibility timeout override. Default: queue-configured value.',\n )\n .optional(),\n shutdownTimeoutMs: z\n .number()\n .int()\n .positive()\n .describe(\n 'Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes.',\n )\n .optional(),\n onPushError: z\n .enum(['nack', 'ack'])\n .describe(\n 'Behavior when forwarding to the collector throws. nack (default) skips DeleteMessage so the message redelivers; ack drops it.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS SQS source setup schema.\n *\n * Provisioning options for `walkeros setup source.<id>`. Authoritative-apply:\n * declared state is written via a single CreateQueueCommand; non-declared\n * tags or attributes are left untouched.\n */\nconst TagsSchema = z.record(z.string(), z.string());\n\nexport const SetupSchema = z.object({\n region: z.string().min(1).describe('AWS region.').optional(),\n fifoQueue: z\n .boolean()\n .describe(\n 'FIFO queue with content-based deduplication. Auto-appends .fifo suffix to the queue name.',\n )\n .optional(),\n visibilityTimeoutSeconds: z\n .number()\n .int()\n .nonnegative()\n .describe('Visibility timeout in seconds. Default: 30.')\n .optional(),\n messageRetentionSeconds: z\n .number()\n .int()\n .positive()\n .describe('Message retention period in seconds. Default: 345600 (4 days).')\n .optional(),\n maximumMessageSize: z\n .number()\n .int()\n .min(1024)\n .max(262144)\n .describe('Max message size in bytes. Default: 262144 (256 KB).')\n .optional(),\n kmsMasterKeyId: z\n .string()\n .describe('KMS key alias or ID for at-rest encryption.')\n .optional(),\n deadLetterQueue: z\n .object({\n arn: z\n .string()\n .describe(\n 'ARN of an existing DLQ. Mutually exclusive with create: true.',\n )\n .optional(),\n create: z\n .boolean()\n .describe('Create a sibling DLQ named <queueName>-dlq. Default: false.')\n .optional(),\n maxReceiveCount: z\n .number()\n .int()\n .min(1)\n .max(1000)\n .describe('Max receive count before message goes to DLQ. Default: 5.')\n .optional(),\n })\n .describe('Optional dead-letter queue.')\n .optional(),\n tags: TagsSchema.describe(\n 'Tags applied to the queue (and inherited by an auto-created DLQ).',\n ).optional(),\n subscribeToSnsTopic: z\n .object({\n topicArn: z.string().min(1).describe('Topic ARN to subscribe to.'),\n rawMessageDelivery: z\n .boolean()\n .describe('Deliver SNS messages without the SNS envelope.')\n .optional(),\n filterPolicy: z\n .record(z.string(), z.unknown())\n .describe('SNS filter policy applied at subscription level.')\n .optional(),\n })\n .describe(\n 'Optional SNS topic subscription. Creates the subscription and the matching queue policy.',\n )\n .optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","// Lambda (default sub-source).\nexport { settings, SettingsSchema, type Settings } from './lambda/schemas';\nexport * from './lambda/schemas/primitives';\n\n// SQS sub-source. Prefixed so the website's <Configuration> snippet can\n// remap data.schemas.sqsSettings / sqsSetup onto data.schemas.settings.\nexport { settings as sqsSettings } from './sqs/schemas';\nexport { setup as sqsSetup } from './sqs/schemas';\n","import * as lambdaExamplesNs from './lambda/examples';\nimport * as sqsExamplesNs from './sqs/examples';\nimport * as lambdaSchemasNs from './lambda/schemas';\nimport * as sqsSchemasNs from './sqs/schemas';\n\nexport * as schemas from './schemas';\nexport * as examples from './lambda/examples';\nexport * as sqsExamples from './sqs/examples';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n sourceLambda: lambdaExamplesNs,\n sourceSqs: sqsExamplesNs,\n};\n\n/** Schemas per export, keyed by the export names in package.json. */\nexport const exportSchemas = {\n sourceLambda: { settings: lambdaSchemasNs.settings },\n sourceSqs: {\n settings: sqsSchemasNs.settings,\n setup: sqsSchemasNs.set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B;AAAA,IACjE,oBAAoBA,GACjB,QAAQ,EACR,SAAS,gDAAgD,EACzD,SAAS;AAAA,IACZ,cAAcA,GACX,OAAOA,GAAE,OAAO,GAAGA,GAAE,QAAQ,CAAC,EAC9B,SAAS,kDAAkD,EAC3D,SAAS;AAAA,EACd,CAAC,EACA;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AF3EM,IAAMC,YAAWC,aAAYC,eAAc;AAC3C,IAAM,QAAQD,aAAY,WAAW;;;AGT5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAE;AAAA,EAAA;AAAA;;;ACUO,IAAM,iBAAiB;AAAA,EAC5B,cAAc;AAAA,EACd,WAAWC;AACb;AAGO,IAAM,gBAAgB;AAAA,EAC3B,cAAc,EAAE,SAAmC;AAAA,EACnD,WAAW;AAAA,IACT,UAAuBC;AAAA,IACvB;AAAA,EACF;AACF;","names":["fn","trigger","k","v","examples_exports","createTrigger","env_exports","step_exports","env_exports","push","noopFn","noopLogger","createMockElbFn","fn","step_exports","createTrigger","trigger","result","z","z","z","zodToSchema","z","SettingsSchema","z","settings","zodToSchema","SettingsSchema","settings","examples_exports","settings"]}
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-source-aws",
|
|
4
|
-
"version": "4.7.2
|
|
4
|
+
"version": "4.7.2",
|
|
5
5
|
"type": "source",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
},
|
|
285
285
|
"examples": {
|
|
286
286
|
"createTrigger": {
|
|
287
|
-
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await
|
|
287
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await ho(e);t={collector:n.collector,elb:n.elb}}const o=function(e){for(const t of Object.values(e.sources||{}))if(\"lambda\"===t.type)return t}(t.collector);if(!o)throw new Error(\"Lambda source not found in collector\");const r={awsRequestId:`test-${Date.now()}`},s=o.push,i=await s(n,r);let a;try{a=JSON.parse(i.body||\"{}\")}catch{a=i.body}const c={};if(i.headers)for(const[e,t]of Object.entries(i.headers))void 0!==t&&(c[e]=String(t));return{statusCode:i.statusCode,body:a,headers:c}}}}"
|
|
288
288
|
},
|
|
289
289
|
"env": {
|
|
290
290
|
"push": {
|
|
@@ -449,13 +449,13 @@
|
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
451
|
"trigger": {
|
|
452
|
-
"$code": "function
|
|
452
|
+
"$code": "function vo(e){return async t=>{const n={...t};if(n.body&&\"string\"==typeof n.body){const e=JSON.parse(n.body);e.name&&!e.event&&(n.body=JSON.stringify({...e,event:e.name,name:void 0}))}return e.push(n,{awsRequestId:\"test-req\"})}}"
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
"exportExamples": {
|
|
456
456
|
"sourceLambda": {
|
|
457
457
|
"createTrigger": {
|
|
458
|
-
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await
|
|
458
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await ho(e);t={collector:n.collector,elb:n.elb}}const o=function(e){for(const t of Object.values(e.sources||{}))if(\"lambda\"===t.type)return t}(t.collector);if(!o)throw new Error(\"Lambda source not found in collector\");const r={awsRequestId:`test-${Date.now()}`},s=o.push,i=await s(n,r);let a;try{a=JSON.parse(i.body||\"{}\")}catch{a=i.body}const c={};if(i.headers)for(const[e,t]of Object.entries(i.headers))void 0!==t&&(c[e]=String(t));return{statusCode:i.statusCode,body:a,headers:c}}}}"
|
|
459
459
|
},
|
|
460
460
|
"env": {
|
|
461
461
|
"push": {
|
|
@@ -620,12 +620,12 @@
|
|
|
620
620
|
}
|
|
621
621
|
},
|
|
622
622
|
"trigger": {
|
|
623
|
-
"$code": "function
|
|
623
|
+
"$code": "function vo(e){return async t=>{const n={...t};if(n.body&&\"string\"==typeof n.body){const e=JSON.parse(n.body);e.name&&!e.event&&(n.body=JSON.stringify({...e,event:e.name,name:void 0}))}return e.push(n,{awsRequestId:\"test-req\"})}}"
|
|
624
624
|
}
|
|
625
625
|
},
|
|
626
626
|
"sourceSqs": {
|
|
627
627
|
"createTrigger": {
|
|
628
|
-
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await
|
|
628
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{if(!t){const n=await ho(e);t={collector:n.collector,elb:n.elb}}const o=function(e){for(const t of Object.values(e.sources??{}))if(Do(t))return t}(t.collector);if(!o)throw new Error(\"sqs source not registered in collector, ensure it is configured in sources\");const r={MessageId:n.MessageId,Body:n.Body,ReceiptHandle:n.ReceiptHandle,Attributes:n.Attributes,MessageAttributes:n.MessageAttributes},s=await o.push(r),i=[];return s&&\"object\"==typeof s&&(s.acked&&i.push([\"message.ack\",n.MessageId]),s.nacked&&i.push([\"message.nack\",n.MessageId])),i}}}"
|
|
629
629
|
},
|
|
630
630
|
"env": {
|
|
631
631
|
"moduleMockEnv": {
|
|
@@ -658,7 +658,7 @@
|
|
|
658
658
|
"$code": "()=>{}"
|
|
659
659
|
},
|
|
660
660
|
"scope": {
|
|
661
|
-
"$code": "()=>
|
|
661
|
+
"$code": "()=>ko"
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
},
|
|
@@ -692,7 +692,7 @@
|
|
|
692
692
|
"$code": "()=>{}"
|
|
693
693
|
},
|
|
694
694
|
"scope": {
|
|
695
|
-
"$code": "()=>
|
|
695
|
+
"$code": "()=>ko"
|
|
696
696
|
}
|
|
697
697
|
},
|
|
698
698
|
"AWS": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-source-aws",
|
|
3
3
|
"description": "AWS server sources for walkerOS (Lambda, API Gateway, Function URLs)",
|
|
4
|
-
"version": "4.7.2
|
|
4
|
+
"version": "4.7.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@aws-sdk/client-sqs": "^3.952.0",
|
|
25
25
|
"@aws-sdk/client-sns": "^3.952.0",
|
|
26
|
-
"@walkeros/core": "4.7.2
|
|
26
|
+
"@walkeros/core": "4.7.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@types/aws-lambda": "^8.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/aws-lambda": "^8.10.159",
|
|
33
|
-
"@walkeros/collector": "4.7.2
|
|
33
|
+
"@walkeros/collector": "4.7.2"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|