@walkeros/server-destination-aws 4.7.0-next-1790722899482 → 4.7.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/CHANGELOG.md +21 -3
- package/README.md +16 -3
- package/dist/dev.d.mts +76 -50
- package/dist/dev.d.ts +76 -50
- 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/examples/index.d.mts +47 -35
- package/dist/examples/index.d.ts +47 -35
- package/dist/examples/index.js +181 -102
- package/dist/examples/index.mjs +179 -100
- package/dist/index.d.mts +161 -60
- package/dist/index.d.ts +161 -60
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/schemas.mjs.map +1 -1
- package/dist/walkerOS.json +1331 -129
- package/package.json +4 -3
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas.ts","../src/firehose/schemas/index.ts","../src/firehose/schemas/settings.ts","../src/firehose/schemas/mapping.ts","../src/sns/schemas/index.ts","../src/sns/schemas/settings.ts","../src/sns/schemas/mapping.ts","../src/sns/schemas/setup.ts","../src/examples/index.ts","../src/firehose/examples/index.ts","../src/firehose/examples/env.ts","../src/firehose/examples/step.ts","../src/sns/examples/index.ts","../src/sns/examples/env.ts","../src/sns/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n\nimport * as firehoseExamplesNs from './firehose/examples';\nimport * as snsExamplesNs from './sns/examples';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n destinationFirehose: firehoseExamplesNs,\n destinationSNS: snsExamplesNs,\n};\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\n\nexport {\n settings as firehoseSettings,\n mapping as firehoseMapping,\n firehose,\n} from './firehose/schemas';\n\nexport {\n settings as snsSettings,\n mapping as snsMapping,\n setup as snsSetup,\n} from './sns/schemas';\n\n// Backwards-compatible aliases (firehose is the package's default sub-destination).\nexport { settings, mapping } from './firehose/schemas';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema, FirehoseConfigSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n type Settings,\n FirehoseConfigSchema,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n\n// Nested JSON Schema for Firehose subpage\nexport const firehose = zodToSchema(FirehoseConfigSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const FirehoseConfigSchema = z.object({\n streamName: z\n .string()\n .min(1)\n .describe(\n 'Name of the Kinesis Data Firehose delivery stream (like walker-events)',\n ),\n client: z\n .any()\n .describe(\n 'Pre-configured AWS Firehose client instance (like new FirehoseClient(config))',\n )\n .optional(),\n region: z\n .string()\n .describe('AWS region for the Firehose service (like us-east-1)')\n .optional(),\n config: z\n .any()\n .describe(\n 'AWS SDK client configuration options (like { credentials: awsCredentials })',\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n firehose: FirehoseConfigSchema.describe(\n \"AWS Firehose configuration settings (like { streamName: 'walker-events', region: 'us-east-1' })\",\n ).optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS Firehose Mapping Schema\n * AWS Firehose has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport {\n SetupSchema,\n SetupSubscriptionSchema,\n type Setup,\n type SetupSubscription,\n} from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n topicName: z\n .string()\n .min(1)\n .describe('SNS topic name (like walkeros-events). Required.'),\n region: z.string().describe('AWS region (like eu-central-1).').optional(),\n client: z.any().describe('Pre-configured AWS SNSClient instance.').optional(),\n config: z\n .any()\n .describe('AWS SDK SNSClient configuration options.')\n .optional(),\n topicArn: z\n .string()\n .describe(\n 'Topic ARN. Populated by init() from CreateTopic. Operators may pre-set to skip the runtime CreateTopic call.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * SNS Mapping Schema.\n *\n * `messageAttributes` is `Mapping.Map`: each value resolves per event to the\n * SDK's `{ DataType, StringValue }` shape. Schema accepts any structure;\n * runtime mapping resolution coerces shape via `getMappingValue`.\n *\n * `messageGroupId` and `messageDeduplicationId` are `Mapping.Value`: a string\n * path or a value-config object.\n */\nexport const MappingSchema = z.object({\n messageAttributes: z.record(z.string(), z.unknown()).optional(),\n messageGroupId: z.unknown().optional(),\n messageDeduplicationId: z.unknown().optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSubscriptionSchema = z.object({\n protocol: z.enum(['sqs', 'lambda', 'https', 'http', 'email', 'sms']),\n endpoint: z.string().min(1),\n rawMessageDelivery: z.boolean().optional(),\n filterPolicy: z.record(z.string(), z.unknown()).optional(),\n deadLetterTargetArn: z.string().optional(),\n});\n\nexport const SetupSchema = z.object({\n region: z.string().optional(),\n displayName: z.string().optional(),\n fifoTopic: z.boolean().optional(),\n kmsMasterKeyId: z.string().optional(),\n tags: z.record(z.string(), z.string()).optional(),\n subscriptions: z.array(SetupSubscriptionSchema).optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\nexport type SetupSubscription = z.infer<typeof SetupSubscriptionSchema>;\n","export * as firehose from '../firehose/examples';\nexport * as sns from '../sns/examples';\n// Re-export env at top level for env-loader compatibility (matches web pattern)\nexport * as env from '../firehose/examples/env';\nexport * as step from '../firehose/examples/step';\n","export * as env from './env';\nexport * as step from './step';\n","import type { PutRecordBatchCommandInput } from '@aws-sdk/client-firehose';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment configurations for AWS Firehose destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual AWS SDK dependencies.\n */\n\n// Mock FirehoseClient class\nclass MockFirehoseClient implements SendClient {\n config: unknown;\n\n constructor(config?: unknown) {\n this.config = config;\n }\n\n async send(_command: object) {\n // Simulate successful response\n return {\n RecordId: 'mock-record-id',\n ResponseMetadata: {\n RequestId: 'mock-request-id',\n },\n };\n }\n}\n\n// Mock PutRecordBatchCommand class. The build minifies class names; the tag\n// keeps the SDK command name in printed simulate output.\nclass MockPutRecordBatchCommand {\n readonly input: PutRecordBatchCommandInput;\n\n constructor(input: PutRecordBatchCommandInput) {\n this.input = input;\n }\n\n get [Symbol.toStringTag](): string {\n return 'PutRecordBatchCommand';\n }\n}\n\nexport const push: Env = {\n // Environment for push operations\n AWS: {\n FirehoseClient: MockFirehoseClient,\n PutRecordBatchCommand: MockPutRecordBatchCommand,\n },\n};\n\nexport const simulation = ['call:AWS.FirehoseClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * Default firehose push -- client.send(new PutRecordBatchCommand({...}))\n * Records contain the full event JSON-stringified as Buffer Data.\n */\nexport const firehoseRecord: Flow.StepExample = {\n title: 'Page view record',\n description:\n 'A page view is sent to Kinesis Firehose as a single record with the full event JSON-stringified into the Data buffer.',\n in: getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n\n/**\n * Order event -- same pattern, full event serialized in Records[0].Data.\n */\nexport const orderEvent: Flow.StepExample = {\n title: 'Order record',\n description:\n 'An order complete event is serialized and delivered to Firehose as a batch record for downstream storage.',\n in: getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n\n/**\n * User signup -- full event including user fields is serialized to Firehose.\n */\nexport const userSignupEvent: Flow.StepExample = {\n title: 'User signup record',\n description:\n 'A user signup event including user fields is streamed to Firehose as a JSON record.',\n in: getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS SNS destination.\n *\n * `push` is the mock env simulate injects: the SNS and STS clients answer\n * every `send` locally, so nothing reaches AWS. Each command keeps its\n * `input`, so a recorded `send` shows the request (`CreateTopic` at init,\n * `Publish` per event). Unit tests still substitute the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sns')`.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\n\n// The build minifies class names; the tag keeps the SDK command name in\n// printed simulate output (`{\"PublishCommand\":{\"input\":...}}`).\nclass MockCommand<Input> {\n constructor(public readonly input: Input) {}\n}\n\nclass MockCreateTopicCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['CreateTopicCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'CreateTopicCommand';\n }\n}\nclass MockPublishCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['PublishCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'PublishCommand';\n }\n}\nclass MockGetTopicAttributesCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['GetTopicAttributesCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'GetTopicAttributesCommand';\n }\n}\nclass MockSubscribeCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['SubscribeCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'SubscribeCommand';\n }\n}\nclass MockGetCallerIdentityCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['GetCallerIdentityCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'GetCallerIdentityCommand';\n }\n}\n\nclass MockSNSClient implements SendClient {\n constructor(public config?: object) {}\n async send(command: object): Promise<unknown> {\n if (command instanceof MockCreateTopicCommand)\n return { TopicArn: TOPIC_ARN };\n if (command instanceof MockPublishCommand)\n return { MessageId: 'mock-message-id' };\n return {};\n }\n}\n\nclass MockSTSClient implements SendClient {\n constructor(public config?: object) {}\n async send(): Promise<unknown> {\n return { Account: '123456789012' };\n }\n}\n\nexport const push: Env = {\n AWS: {\n SNSClient: MockSNSClient,\n CreateTopicCommand: MockCreateTopicCommand,\n PublishCommand: MockPublishCommand,\n GetTopicAttributesCommand: MockGetTopicAttributesCommand,\n SubscribeCommand: MockSubscribeCommand,\n STSClient: MockSTSClient,\n GetCallerIdentityCommand: MockGetCallerIdentityCommand,\n },\n};\n\n/** Every request goes through `send`; the command in `args[0]` names it. */\nexport const simulation = ['call:AWS.SNSClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * SNS step examples. Each example's `out` is the array of recorded mock\n * calls produced by `push()`. The recording shape is:\n * ['client.send', commandInput]\n *\n * The destination JSON-stringifies the event into the Publish call's Message\n * field. Mapping entries (messageGroupId, messageDeduplicationId,\n * messageAttributes) resolve per event via getMappingValue.\n */\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n user: { id: 'usr-789' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst productViewEvt = getEvent('product view', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { id: 'SKU-1', tenant_id: 'acme' },\n source: { type: 'express', platform: 'server' },\n});\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view publish',\n description:\n 'A page view event is JSON-stringified and published as the Message of an SNS Publish call.',\n in: pageEvent,\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events',\n Message: JSON.stringify(pageEvent),\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order publish with FIFO group (path-resolved)',\n description:\n 'An order complete event is published with a FIFO messageGroupId resolved from the event via the mapping path \"user.id\". `messageGroupId` is a `Mapping.Value`, so a string path is sufficient; no literal is hard-coded.',\n in: orderEvt,\n mapping: { settings: { messageGroupId: 'user.id' } },\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events.fifo',\n Message: JSON.stringify(orderEvt),\n MessageGroupId: 'usr-789',\n },\n ],\n ],\n};\n\nexport const attributedPublish: Flow.StepExample = {\n title: 'Publish with per-event message attributes',\n description:\n 'Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.',\n in: productViewEvt,\n mapping: {\n settings: {\n messageAttributes: {\n schema_version: { value: { DataType: 'String', StringValue: 'v4' } },\n tenant: { value: { DataType: 'String', StringValue: 'acme' } },\n },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events',\n Message: JSON.stringify(productViewEvt),\n MessageAttributes: {\n schema_version: { DataType: 'String', StringValue: 'v4' },\n tenant: { DataType: 'String', StringValue: 'acme' },\n },\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA;AAAA;;;ACAA,IAAAC,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,uBAAuB,aAAE,OAAO;AAAA,EAC3C,YAAY,aACT,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,QAAQ,aACL,OAAO,EACP,SAAS,sDA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;AAAA,MACR,mBAAmB;AAAA,QACjB,gBAAgB,EAAE,OAAO,EAAE,UAAU,UAAU,aAAa,KAAK,EAAE;AAAA,QACnE,QAAQ,EAAE,OAAO,EAAE,UAAU,UAAU,aAAa,OAAO,EAAE;AAAA,MAC/D;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,SAAS,KAAK,UAAU,cAAc;AAAA,QACtC,mBAAmB;AAAA,UACjB,gBAAgB,EAAE,UAAU,UAAU,aAAa,KAAK;AAAA,UACxD,QAAQ,EAAE,UAAU,UAAU,aAAa,OAAO;AAAA,QACpD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AfzFO,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB;AAAA,EACrB,gBAAgBE;AAClB;","names":["examples_exports","mapping","settings","import_dev","import_dev","import_dev","import_dev","SettingsSchema","import_dev","MappingSchema","import_dev","settings","SettingsSchema","mapping","MappingSchema","examples_exports","examples_exports","env_exports","step_exports","env_exports","push","simulation","step_exports","orderEvent","import_core","examples_exports"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/firehose/examples/index.ts","../src/firehose/examples/env.ts","../src/firehose/examples/step.ts","../src/lib/payload.ts","../src/firehose/lib/records.ts","../src/sns/examples/index.ts","../src/sns/examples/env.ts","../src/sns/examples/step.ts","../src/firehose/schemas/index.ts","../src/firehose/schemas/settings.ts","../src/firehose/schemas/mapping.ts","../src/sns/schemas/index.ts","../src/sns/schemas/settings.ts","../src/sns/schemas/mapping.ts","../src/sns/schemas/setup.ts","../src/schemas.ts","../src/examples/index.ts","../src/hints.ts"],"sourcesContent":["import * as firehoseExamplesNs from './firehose/examples';\nimport * as snsExamplesNs from './sns/examples';\nimport * as firehoseSchemasNs from './firehose/schemas';\nimport * as snsSchemasNs from './sns/schemas';\n\nexport * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n destinationFirehose: firehoseExamplesNs,\n destinationSNS: snsExamplesNs,\n};\n\n/** Schemas per export, keyed by the export names in package.json. */\nexport const exportSchemas = {\n destinationFirehose: {\n settings: firehoseSchemasNs.settings,\n mapping: firehoseSchemasNs.mapping,\n },\n destinationSNS: {\n settings: snsSchemasNs.settings,\n mapping: snsSchemasNs.mapping,\n setup: snsSchemasNs.setup,\n },\n};\n","export * as env from './env';\nexport * as step from './step';\n","import type { PutRecordBatchCommandInput } from '@aws-sdk/client-firehose';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS Firehose destination.\n *\n * `push` is the mock env simulate injects: the client answers every `send`\n * locally, so nothing reaches AWS. Each command keeps its `input`, so a\n * recorded `send` shows the request.\n */\n\ninterface RecordsInput {\n Records: unknown[];\n}\n\nfunction hasRecords(value: unknown): value is RecordsInput {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'Records' in value &&\n Array.isArray(value.Records)\n );\n}\n\n// Mock FirehoseClient class: every record is accepted.\nclass MockFirehoseClient implements SendClient {\n config: unknown;\n\n constructor(config?: unknown) {\n this.config = config;\n }\n\n async send(command: object) {\n const input = 'input' in command ? command.input : undefined;\n const records = hasRecords(input) ? input.Records : [];\n return {\n FailedPutCount: 0,\n Encrypted: false,\n RequestResponses: records.map((_, index) => ({\n RecordId: `mock-record-id-${index}`,\n })),\n };\n }\n\n destroy(): void {}\n}\n\n// Mock PutRecordBatchCommand class. The build minifies class names; the tag\n// keeps the SDK command name in printed simulate output.\nclass MockPutRecordBatchCommand {\n readonly input: PutRecordBatchCommandInput;\n\n constructor(input: PutRecordBatchCommandInput) {\n this.input = input;\n }\n\n get [Symbol.toStringTag](): string {\n return 'PutRecordBatchCommand';\n }\n}\n\nexport const push: Env = {\n AWS: {\n FirehoseClient: MockFirehoseClient,\n PutRecordBatchCommand: MockPutRecordBatchCommand,\n },\n};\n\nexport const simulation = ['call:AWS.FirehoseClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport { toRecordData } from '../lib/records';\n\n/**\n * Firehose step examples. Each `out` is the recorded\n * `client.send(new PutRecordBatchCommand(input))` call. A record is the full\n * event as JSON plus a newline, or the mapped `data` when a mapping produced\n * an object.\n */\n\nconst STREAM = 'walkeros-events';\n\n/**\n * The copy-paste config: the stream, its region, and keys from `$secret`.\n * `init` builds one client from it, offline, with a per-attempt timeout of a\n * quarter of the collector's 10 s race, so the SDK's three attempts end\n * before the collector stops waiting.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Init builds one FirehoseClient for the stream region with the credentials from config.credentials and a 2500 ms per-attempt timeout. Nothing is sent until the first event.',\n in: {\n settings: { streamName: STREAM, region: 'eu-central-1' },\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n },\n out: [\n [\n 'new FirehoseClient',\n {\n region: 'eu-central-1',\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n requestHandler: { requestTimeout: 2500, throwOnRequestTimeout: true },\n },\n ],\n ],\n};\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst signupEvt = getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n});\n\nfunction sent(payload: unknown): Flow.StepExample['out'] {\n return [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [{ Data: toRecordData(payload) }],\n },\n ],\n ];\n}\n\nexport const firehoseRecord: Flow.StepExample = {\n title: 'Page view record',\n description:\n 'A page view is sent to Firehose as one record: the full event as JSON followed by a newline.',\n in: pageEvent,\n mapping: undefined,\n out: sent(pageEvent),\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order record',\n description:\n 'An order complete event is serialized and delivered to Firehose as one newline-terminated record.',\n in: orderEvt,\n mapping: undefined,\n out: sent(orderEvt),\n};\n\nexport const userSignupEvent: Flow.StepExample = {\n title: 'User signup record',\n description:\n 'A user signup event including user fields is streamed to Firehose as a JSON record.',\n in: signupEvt,\n mapping: undefined,\n out: sent(signupEvt),\n};\n\nexport const mappedRecord: Flow.StepExample = {\n title: 'Mapped record',\n description:\n 'A mapping that produces an object sends that object as the record instead of the full event. Keep the event id in it for deduplication.',\n in: orderEvt,\n mapping: {\n data: {\n map: {\n id: 'id',\n name: 'name',\n order_id: 'data.id',\n total: 'data.total',\n },\n },\n },\n out: sent({\n id: 'ev-1700001001',\n name: 'order complete',\n order_id: 'ORD-400',\n total: 99.99,\n }),\n};\n","import type { WalkerOS } from '@walkeros/core';\nimport { isObject } from '@walkeros/core';\n\n/**\n * What one record or message carries: the mapped `data` when the mapping\n * produced an object, else the full event.\n */\nexport function toPayload(event: WalkerOS.Event, data?: unknown): object {\n return isObject(data) ? data : event;\n}\n","export { toPayload } from '../../lib/payload';\n\n/** Most records one `PutRecordBatch` call accepts. */\nexport const MAX_RECORDS_PER_CALL = 500;\n\n/**\n * Raw bytes per call, kept below the documented 4 MiB request limit with room\n * for the base64 encoding and the JSON envelope of the request.\n */\nexport const MAX_BYTES_PER_CALL = 2_900_000;\n\n/** Largest record Firehose accepts, newline included. */\nexport const MAX_RECORD_BYTES = 1_000_000;\n\n/** The record bytes: the payload as JSON, plus `\\n` unless `newline` is false. */\nexport function toRecordData(payload: unknown, newline = true): Buffer {\n const json = JSON.stringify(payload);\n if (typeof json !== 'string')\n throw new TypeError('The payload does not serialize to JSON.');\n return Buffer.from(newline ? `${json}\\n` : json);\n}\n\n/** One record on its way out, with its index in the delivery. */\nexport interface PlannedRecord {\n index: number;\n data: Buffer;\n}\n\n/** A record refused before sending; it is never sent. */\nexport interface RefusedRecord {\n index: number;\n code: 'RecordTooLarge' | 'InvalidRecord';\n detail: string;\n cause?: unknown;\n}\n\nexport interface Plan {\n chunks: PlannedRecord[][];\n refused: RefusedRecord[];\n}\n\n/**\n * Turns payloads into records and splits them into calls of at most\n * `MAX_RECORDS_PER_CALL` records and `MAX_BYTES_PER_CALL` bytes, in order.\n * A record that cannot be serialized or is too large is refused on its own,\n * so it never fails its neighbours.\n */\nexport function planChunks(\n payloads: readonly unknown[],\n newline: boolean,\n): Plan {\n const chunks: PlannedRecord[][] = [];\n const refused: RefusedRecord[] = [];\n let current: PlannedRecord[] = [];\n let currentBytes = 0;\n\n payloads.forEach((payload, index) => {\n let data: Buffer;\n try {\n data = toRecordData(payload, newline);\n } catch (error) {\n refused.push({\n index,\n code: 'InvalidRecord',\n detail: `Record ${index} does not serialize to JSON: ${error instanceof Error ? error.message : String(error)}`,\n cause: error,\n });\n return;\n }\n\n if (data.byteLength > MAX_RECORD_BYTES) {\n refused.push({\n index,\n code: 'RecordTooLarge',\n detail: `Record ${index} is ${data.byteLength} bytes, over the ${MAX_RECORD_BYTES} byte limit.`,\n });\n return;\n }\n\n if (\n current.length >= MAX_RECORDS_PER_CALL ||\n currentBytes + data.byteLength > MAX_BYTES_PER_CALL\n ) {\n chunks.push(current);\n current = [];\n currentBytes = 0;\n }\n\n current.push({ index, data });\n currentBytes += data.byteLength;\n });\n\n if (current.length > 0) chunks.push(current);\n return { chunks, refused };\n}\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n CreateTopicCommandInput,\n GetTopicAttributesCommandInput,\n PublishCommandInput,\n SubscribeCommandInput,\n} from '@aws-sdk/client-sns';\nimport type { GetCallerIdentityCommandInput } from '@aws-sdk/client-sts';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS SNS destination.\n *\n * `push` is the mock env simulate injects: the SNS and STS clients answer\n * every `send` locally, so nothing reaches AWS. Each command keeps its\n * `input`, so a recorded `send` shows the request (`Publish` per event).\n * Unit tests still substitute the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sns')`.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\n\n// The build minifies class names; the tag keeps the SDK command name in\n// printed simulate output (`{\"PublishCommand\":{\"input\":...}}`).\nclass MockCommand<Input> {\n constructor(public readonly input: Input) {}\n}\n\nclass MockCreateTopicCommand extends MockCommand<CreateTopicCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'CreateTopicCommand';\n }\n}\nclass MockPublishCommand extends MockCommand<PublishCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'PublishCommand';\n }\n}\nclass MockGetTopicAttributesCommand extends MockCommand<GetTopicAttributesCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'GetTopicAttributesCommand';\n }\n}\nclass MockSubscribeCommand extends MockCommand<SubscribeCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'SubscribeCommand';\n }\n}\nclass MockGetCallerIdentityCommand extends MockCommand<GetCallerIdentityCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'GetCallerIdentityCommand';\n }\n}\n\nclass MockSNSClient implements SendClient {\n constructor(public config?: object) {}\n async send(command: object): Promise<unknown> {\n if (command instanceof MockCreateTopicCommand)\n return { TopicArn: TOPIC_ARN };\n if (command instanceof MockPublishCommand)\n return { MessageId: 'mock-message-id' };\n return {};\n }\n destroy(): void {}\n}\n\nclass MockSTSClient implements SendClient {\n constructor(public config?: object) {}\n async send(): Promise<unknown> {\n return {\n Account: '123456789012',\n Arn: 'arn:aws:iam::123456789012:user/walkeros',\n };\n }\n destroy(): void {}\n}\n\nexport const push: Env = {\n AWS: {\n SNSClient: MockSNSClient,\n CreateTopicCommand: MockCreateTopicCommand,\n PublishCommand: MockPublishCommand,\n GetTopicAttributesCommand: MockGetTopicAttributesCommand,\n SubscribeCommand: MockSubscribeCommand,\n STSClient: MockSTSClient,\n GetCallerIdentityCommand: MockGetCallerIdentityCommand,\n },\n};\n\n/** Every request goes through `send`; the command in `args[0]` names it. */\nexport const simulation = ['call:AWS.SNSClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * SNS step examples. Each example's `out` is the array of recorded mock\n * calls produced by `push()`. The recording shape is:\n * ['client.send', commandInput]\n *\n * The destination JSON-stringifies the event (or the mapped `data` object)\n * into the Publish call's Message field. Mapping entries (messageGroupId,\n * messageDeduplicationId, messageAttributes) resolve per event via\n * getMappingValue. On a FIFO topic the deduplication id defaults to the\n * event id.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\nconst FIFO_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events.fifo';\n\n/**\n * The copy-paste config: the topic ARN, which also names the region, and\n * keys from `$secret`. `init` builds one client from it, offline; nothing is\n * sent until the first event.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Init builds one SNSClient in the region of the topic ARN with the credentials from config.credentials and a 2500 ms per-attempt timeout. No topic is created and nothing is sent until the first event.',\n in: {\n settings: { topicArn: TOPIC_ARN },\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n },\n out: [\n [\n 'new SNSClient',\n {\n region: 'eu-central-1',\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n requestHandler: { requestTimeout: 2500, throwOnRequestTimeout: true },\n },\n ],\n ],\n};\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n user: { id: 'usr-789' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst productViewEvt = getEvent('product view', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { id: 'SKU-1', tenant_id: 'acme' },\n source: { type: 'express', platform: 'server' },\n});\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view publish',\n description:\n 'A page view event is JSON-stringified and published as the Message of an SNS Publish call.',\n in: pageEvent,\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify(pageEvent),\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order publish with FIFO group (path-resolved)',\n description:\n 'An order complete event is published to a FIFO topic with a messageGroupId resolved from the event via the mapping path \"user.id\". The deduplication id defaults to the event id.',\n in: orderEvt,\n mapping: { settings: { messageGroupId: 'user.id' } },\n out: [\n [\n 'client.send',\n {\n TopicArn: FIFO_ARN,\n Message: JSON.stringify(orderEvt),\n MessageGroupId: 'usr-789',\n MessageDeduplicationId: 'ev-1700001001',\n },\n ],\n ],\n};\n\nexport const attributedPublish: Flow.StepExample = {\n title: 'Publish with per-event message attributes',\n description:\n 'Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.',\n in: productViewEvt,\n mapping: {\n settings: {\n messageAttributes: {\n schema_version: { value: { DataType: 'String', StringValue: 'v4' } },\n tenant: { value: { DataType: 'String', StringValue: 'acme' } },\n },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify(productViewEvt),\n MessageAttributes: {\n schema_version: { DataType: 'String', StringValue: 'v4' },\n tenant: { DataType: 'String', StringValue: 'acme' },\n },\n },\n ],\n ],\n};\n\nexport const mappedMessage: Flow.StepExample = {\n title: 'Mapped message',\n description:\n 'A mapping that produces an object publishes that object as the Message instead of the full event. Keep the event id in it for deduplication.',\n in: orderEvt,\n mapping: {\n data: {\n map: { id: 'id', name: 'name', order_id: 'data.id', total: 'data.total' },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify({\n id: 'ev-1700001001',\n name: 'order complete',\n order_id: 'ORD-400',\n total: 99.99,\n }),\n },\n ],\n ],\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema, FirehoseConfigSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n type Settings,\n FirehoseConfigSchema,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n\n// Nested JSON Schema for Firehose subpage\nexport const firehose = zodToSchema(FirehoseConfigSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst streamName = z\n .string()\n .min(1)\n .describe('Name of the Firehose stream (like walkeros-events). Required.')\n .optional();\n\nconst region = z\n .string()\n .describe(\n 'AWS region of the stream (like eu-central-1). Default: AWS_REGION or the active profile, else eu-central-1.',\n );\n\nconst client = z\n .any()\n .describe(\n 'A FirehoseClient of your own. Used as is and never closed by the destination.',\n );\n\nconst config = z\n .any()\n .describe(\n 'Raw FirehoseClient options passed to the SDK (like { endpoint, maxAttempts }). Put keys in config.credentials instead.',\n );\n\n/** @deprecated The nested form, still read as an alias of the flat fields. */\nexport const FirehoseConfigSchema = z.object({\n streamName,\n client: client.optional(),\n region: region.optional(),\n config: config.optional(),\n});\n\nexport const SettingsSchema = z.object({\n // Optional in the schema only so the deprecated alias still validates;\n // init throws when neither form names a stream.\n streamName,\n region: region.optional(),\n newline: z\n .boolean()\n .describe(\n 'Append a newline to every record (default true). Set false when the stream adds its own new line delimiter.',\n )\n .optional(),\n config: config.optional(),\n client: client.optional(),\n firehose: FirehoseConfigSchema.describe(\n 'Deprecated: use the flat fields streamName, region, config and client.',\n ).optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS Firehose Mapping Schema\n * Firehose has no rule-level settings: a rule's `data` becomes the record.\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport {\n SetupSchema,\n SetupSubscriptionSchema,\n type Setup,\n type SetupSubscription,\n} from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n topicArn: z\n .string()\n .describe(\n 'Topic ARN (like arn:aws:sns:eu-central-1:123456789012:walkeros-events). Region and topic name derive from it. Required unless topicName is set.',\n )\n .optional(),\n topicName: z\n .string()\n .min(1)\n .describe(\n 'Topic name (like walkeros-events). Used by walkeros setup; without topicArn the ARN is completed with the account id at the first publish.',\n )\n .optional(),\n region: z\n .string()\n .describe(\n 'AWS region (like eu-central-1). Default: the region in topicArn, AWS_REGION or the active profile, else eu-central-1.',\n )\n .optional(),\n client: z\n .any()\n .describe(\n 'An SNSClient of your own. Used as is and never closed by the destination.',\n )\n .optional(),\n config: z\n .any()\n .describe(\n 'Raw SNSClient options passed to the SDK. Put keys in config.credentials instead.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * SNS Mapping Schema.\n *\n * `messageAttributes` is `Mapping.Map`: each value resolves per event to the\n * SDK's `{ DataType, StringValue }` shape. Schema accepts any structure;\n * runtime mapping resolution coerces shape via `getMappingValue`.\n *\n * `messageGroupId` and `messageDeduplicationId` are `Mapping.Value`: a string\n * path or a value-config object.\n */\nexport const MappingSchema = z.object({\n messageAttributes: z.record(z.string(), z.unknown()).optional(),\n messageGroupId: z.unknown().optional(),\n messageDeduplicationId: z.unknown().optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSubscriptionSchema = z.object({\n protocol: z.enum(['sqs', 'lambda', 'https', 'http', 'email', 'sms']),\n endpoint: z.string().min(1),\n rawMessageDelivery: z.boolean().optional(),\n filterPolicy: z.record(z.string(), z.unknown()).optional(),\n deadLetterTargetArn: z.string().optional(),\n});\n\nexport const SetupSchema = z.object({\n region: z.string().optional(),\n displayName: z.string().optional(),\n fifoTopic: z.boolean().optional(),\n kmsMasterKeyId: z.string().optional(),\n tags: z.record(z.string(), z.string()).optional(),\n subscriptions: z.array(SetupSubscriptionSchema).optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\nexport type SetupSubscription = z.infer<typeof SetupSubscriptionSchema>;\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\n\nexport {\n settings as firehoseSettings,\n mapping as firehoseMapping,\n firehose,\n} from './firehose/schemas';\n\nexport {\n settings as snsSettings,\n mapping as snsMapping,\n setup as snsSetup,\n} from './sns/schemas';\n\n// Backwards-compatible aliases (firehose is the package's default sub-destination).\nexport { settings, mapping } from './firehose/schemas';\n","export * as firehose from '../firehose/examples';\nexport * as sns from '../sns/examples';\n// Re-export env at top level for env-loader compatibility (matches web pattern)\nexport * as env from '../firehose/examples/env';\nexport * as step from '../firehose/examples/step';\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'minimal-config': {\n text: 'Firehose needs settings.streamName (plus settings.region when the stream is not in AWS_REGION or eu-central-1). SNS needs settings.topicArn; region and topic name derive from it. Off AWS, add config.credentials. Nothing is sent and no credentials are loaded until the first event.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"streamName\": \"walkeros-events\", \"region\": \"eu-central-1\" }, \"credentials\": { \"accessKeyId\": \"$secret.AWS_ACCESS_KEY_ID\", \"secretAccessKey\": \"$secret.AWS_SECRET_ACCESS_KEY\" } }',\n },\n {\n lang: 'json',\n code: '{ \"settings\": { \"topicArn\": \"arn:aws:sns:eu-central-1:123456789012:walkeros-events\" } }',\n },\n ],\n },\n 'auth-credentials': {\n text: 'On AWS compute an attached IAM role needs no config at all. Elsewhere, config.credentials ({ accessKeyId, secretAccessKey, sessionToken? }, or the same as a JSON string) wins over settings.config.credentials, which wins over the AWS default chain (AWS_* variables, AWS_PROFILE, ECS, EC2 and web identity roles; Kubernetes can go keyless with AWS_ROLE_ARN plus AWS_WEB_IDENTITY_TOKEN_FILE). Back every value with $secret; never write a literal key. Credentials are shape-checked at init and loaded only at the first send.',\n code: [\n {\n lang: 'json',\n code: '{ \"credentials\": { \"accessKeyId\": \"$secret.AWS_ACCESS_KEY_ID\", \"secretAccessKey\": \"$secret.AWS_SECRET_ACCESS_KEY\" } }',\n },\n ],\n },\n 'firehose-records': {\n text: 'Each record is the mapped data object, or the full event when the mapping produced none, followed by a newline. Set settings.newline: false when the stream adds its own new line delimiter. Batching is on by default (500 records or 1 s); calls carry at most 500 records and 2,900,000 bytes, and a record over 1,000,000 bytes fails as RecordTooLarge without being sent.',\n },\n 'delivery-guarantee': {\n text: 'Delivery is at least once: deduplicate downstream on event.id, and keep id in mapped data. A record AWS rejects is reported as failed with code, status and retryable. There is no retry beyond the built-in AWS SDK retry: a rejected record goes to the in-memory dead letter queue of the collector, which nothing replays yet. On SNS FIFO topics MessageDeduplicationId defaults to event.id.',\n },\n 'troubleshoot-errors': {\n text: 'Every failure carries code, status and retryable, and its message names the stream or topic and the region. ResourceNotFoundException: wrong settings.streamName or region. AccessDeniedException / AuthorizationErrorException: the credentials lack firehose:PutRecordBatch or sns:Publish. UnrecognizedClientException, InvalidSignatureException, ExpiredTokenException or no credentials found: check config.credentials or the environment. SNS NotFoundException: the topic does not exist; run walkeros setup or set settings.topicArn. NULL rows in Athena: the stream adds its own new line delimiter too, so set newline: false. InvalidConfig at start: a missing or conflicting setting, named in the message.',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAeA,SAAS,WAAW,OAAuC;AACzD,SACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,MAAM,QAAQ,MAAM,OAAO;AAE/B;AAGA,IAAM,qBAAN,MAA+C;AAAA,EAC7C;AAAA,EAEA,YAAYC,SAAkB;AAC5B,SAAK,SAASA;AAAA,EAChB;AAAA,EAEA,MAAM,KAAK,SAAiB;AAC1B,UAAM,QAAQ,WAAW,UAAU,QAAQ,QAAQ;AACnD,UAAM,UAAU,WAAW,KAAK,IAAI,MAAM,UAAU,CAAC;AACrD,WAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,kBAAkB,QAAQ,IAAI,CAAC,GAAG,WAAW;AAAA,QAC3C,UAAU,kBAAkB,KAAK;AAAA,MACnC,EAAE;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,UAAgB;AAAA,EAAC;AACnB;AAIA,IAAM,4BAAN,MAAgC;AAAA,EACrB;AAAA,EAET,YAAY,OAAmC;AAC7C,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,KAAK,OAAO,WAAW,IAAY;AACjC,WAAO;AAAA,EACT;AACF;AAEO,IAAM,OAAY;AAAA,EACvB,KAAK;AAAA,IACH,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,EACzB;AACF;AAEO,IAAM,aAAa,CAAC,8BAA8B;;;ACpEzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAC,eAAyB;;;ACAzB,kBAAyB;;;ACclB,SAAS,aA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;;;AHHM,IAAMC,gBAAW,yBAAYC,eAAc;AAC3C,IAAMC,eAAU,yBAAYC,cAAa;AACzC,IAAM,YAAQ,yBAAY,WAAW;;;AIhB5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA;AAAA;;;ACAA,IAAAC,oBAAA;AAAA,SAAAA,mBAAA;AAAA;AAAA;AAAA,aAAAA;AAAA,EAAA;AAAA;;;ACEO,IAAM,QAAoB;AAAA,EAC/B,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,EACR;AAAA,EACA,sBAAsB;AAAA,IACpB,MAAM;AAAA,EACR;AAAA,EACA,uBAAuB;AAAA,IACrB,MAAM;AAAA,EACR;AACF;;;AlBxBO,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB;AAAA,EACrB,gBAAgBC;AAClB;AAGO,IAAM,gBAAgB;AAAA,EAC3B,qBAAqB;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AAAA,EACA,gBAAgB;AAAA,IACd,UAAuBC;AAAA,IACvB,SAAsBC;AAAA,IACtB;AAAA,EACF;AACF;","names":["examples_exports","config","import_core","examples_exports","env_exports","step_exports","env_exports","push","simulation","config","step_exports","init","orderEvent","import_core","TOPIC_ARN","pageEvent","orderEvt","import_dev","import_dev","import_dev","import_dev","SettingsSchema","import_dev","MappingSchema","import_dev","settings","SettingsSchema","mapping","MappingSchema","mapping","settings","examples_exports","examples_exports","settings","mapping"]}
|
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,{firehose:()=>d,firehoseMapping:()=>c,firehoseSettings:()=>l,mapping:()=>c,settings:()=>l,snsMapping:()=>w,snsSettings:()=>y,snsSetup:()=>k});import{zodToSchema as s}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var a=i.object({streamName:i.string().min(1).describe("Name of the Kinesis Data Firehose delivery stream (like walker-events)"),client:i.any().describe("Pre-configured AWS Firehose client instance (like new FirehoseClient(config))").optional(),region:i.string().describe("AWS region for the Firehose service (like us-east-1)").optional(),config:i.any().describe("AWS SDK client configuration options (like { credentials: awsCredentials })").optional()}),o=i.object({firehose:a.describe("AWS Firehose configuration settings (like { streamName: 'walker-events', region: 'us-east-1' })").optional()});import{z as n}from"@walkeros/core/dev";var p=n.object({}),l=s(o),c=s(p),d=s(a);import{zodToSchema as m}from"@walkeros/core/dev";import{z as u}from"@walkeros/core/dev";var g=u.object({topicName:u.string().min(1).describe("SNS topic name (like walkeros-events). Required."),region:u.string().describe("AWS region (like eu-central-1).").optional(),client:u.any().describe("Pre-configured AWS SNSClient instance.").optional(),config:u.any().describe("AWS SDK SNSClient configuration options.").optional(),topicArn:u.string().describe("Topic ARN. Populated by init() from CreateTopic. Operators may pre-set to skip the runtime CreateTopic call.").optional()});import{z as v}from"@walkeros/core/dev";var f=v.object({messageAttributes:v.record(v.string(),v.unknown()).optional(),messageGroupId:v.unknown().optional(),messageDeduplicationId:v.unknown().optional()});import{z as S}from"@walkeros/core/dev";var h=S.object({protocol:S.enum(["sqs","lambda","https","http","email","sms"]),endpoint:S.string().min(1),rawMessageDelivery:S.boolean().optional(),filterPolicy:S.record(S.string(),S.unknown()).optional(),deadLetterTargetArn:S.string().optional()}),b=S.object({region:S.string().optional(),displayName:S.string().optional(),fifoTopic:S.boolean().optional(),kmsMasterKeyId:S.string().optional(),tags:S.record(S.string(),S.string()).optional(),subscriptions:S.array(h).optional()}),y=m(g),w=m(f),k=m(b),A={};t(A,{env:()=>T,firehose:()=>C,sns:()=>P,step:()=>O});var C={};t(C,{env:()=>T,step:()=>O});var T={};t(T,{push:()=>x,simulation:()=>D});var N=class{input;constructor(e){this.input=e}get[Symbol.toStringTag](){return"PutRecordBatchCommand"}},x={AWS:{FirehoseClient:class{config;constructor(e){this.config=e}async send(e){return{RecordId:"mock-record-id",ResponseMetadata:{RequestId:"mock-request-id"}}}},PutRecordBatchCommand:N}},D=["call:AWS.FirehoseClient.send"],O={};t(O,{firehoseRecord:()=>F,orderEvent:()=>M,userSignupEvent:()=>I});import{getEvent as R}from"@walkeros/core";var F={title:"Page view record",description:"A page view is sent to Kinesis Firehose as a single record with the full event JSON-stringified into the Data buffer.",in:R("page view",{id:"ev-1700001000",timestamp:1700001e3,data:{title:"Home",url:"https://example.com/"},source:{type:"express",platform:"server"}}),mapping:void 0,out:[["client.send",{DeliveryStreamName:"walkeros-events",Records:[{Data:Buffer.from(JSON.stringify(R("page view",{id:"ev-1700001000",timestamp:1700001e3,data:{title:"Home",url:"https://example.com/"},source:{type:"express",platform:"server"}})))}]}]]},M={title:"Order record",description:"An order complete event is serialized and delivered to Firehose as a batch record for downstream storage.",in:R("order complete",{id:"ev-1700001001",timestamp:1700001001,data:{id:"ORD-400",total:99.99,currency:"EUR"},source:{type:"express",platform:"server"}}),mapping:void 0,out:[["client.send",{DeliveryStreamName:"walkeros-events",Records:[{Data:Buffer.from(JSON.stringify(R("order complete",{id:"ev-1700001001",timestamp:1700001001,data:{id:"ORD-400",total:99.99,currency:"EUR"},source:{type:"express",platform:"server"}})))}]}]]},I={title:"User signup record",description:"A user signup event including user fields is streamed to Firehose as a JSON record.",in:R("user signup",{id:"ev-1700001002",timestamp:1700001002,data:{plan:"pro",source:"landing-page"},user:{id:"usr-789",email:"new@example.com"},source:{type:"express",platform:"server"}}),mapping:void 0,out:[["client.send",{DeliveryStreamName:"walkeros-events",Records:[{Data:Buffer.from(JSON.stringify(R("user signup",{id:"ev-1700001002",timestamp:1700001002,data:{plan:"pro",source:"landing-page"},user:{id:"usr-789",email:"new@example.com"},source:{type:"express",platform:"server"}})))}]}]]},P={};t(P,{env:()=>W,step:()=>U});var W={};t(W,{push:()=>z,simulation:()=>B});var G=class{constructor(e){this.input=e}input},J=class extends G{get[Symbol.toStringTag](){return"CreateTopicCommand"}},j=class extends G{get[Symbol.toStringTag](){return"PublishCommand"}},E=class extends G{get[Symbol.toStringTag](){return"GetTopicAttributesCommand"}},K=class extends G{get[Symbol.toStringTag](){return"SubscribeCommand"}},V=class extends G{get[Symbol.toStringTag](){return"GetCallerIdentityCommand"}},z={AWS:{SNSClient:class{constructor(e){this.config=e}config;async send(e){return e instanceof J?{TopicArn:"arn:aws:sns:eu-central-1:123456789012:walkeros-events"}:e instanceof j?{MessageId:"mock-message-id"}:{}}},CreateTopicCommand:J,PublishCommand:j,GetTopicAttributesCommand:E,SubscribeCommand:K,STSClient:class{constructor(e){this.config=e}config;async send(){return{Account:"123456789012"}}},GetCallerIdentityCommand:V}},B=["call:AWS.SNSClient.send"],U={};t(U,{attributedPublish:()=>Y,orderEvent:()=>X,pageView:()=>Q});import{getEvent as q}from"@walkeros/core";var H=q("page view",{id:"ev-1700001000",timestamp:1700001e3,data:{title:"Home",url:"https://example.com/"},source:{type:"express",platform:"server"}}),_=q("order complete",{id:"ev-1700001001",timestamp:1700001001,data:{id:"ORD-400",total:99.99,currency:"EUR"},user:{id:"usr-789"},source:{type:"express",platform:"server"}}),L=q("product view",{id:"ev-1700001002",timestamp:1700001002,data:{id:"SKU-1",tenant_id:"acme"},source:{type:"express",platform:"server"}}),Q={title:"Page view publish",description:"A page view event is JSON-stringified and published as the Message of an SNS Publish call.",in:H,mapping:void 0,out:[["client.send",{TopicArn:"arn:aws:sns:eu-central-1:000000000000:walkeros-events",Message:JSON.stringify(H)}]]},X={title:"Order publish with FIFO group (path-resolved)",description:'An order complete event is published with a FIFO messageGroupId resolved from the event via the mapping path "user.id". `messageGroupId` is a `Mapping.Value`, so a string path is sufficient; no literal is hard-coded.',in:_,mapping:{settings:{messageGroupId:"user.id"}},out:[["client.send",{TopicArn:"arn:aws:sns:eu-central-1:000000000000:walkeros-events.fifo",Message:JSON.stringify(_),MessageGroupId:"usr-789"}]]},Y={title:"Publish with per-event message attributes",description:"Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.",in:L,mapping:{settings:{messageAttributes:{schema_version:{value:{DataType:"String",StringValue:"v4"}},tenant:{value:{DataType:"String",StringValue:"acme"}}}}},out:[["client.send",{TopicArn:"arn:aws:sns:eu-central-1:000000000000:walkeros-events",Message:JSON.stringify(L),MessageAttributes:{schema_version:{DataType:"String",StringValue:"v4"},tenant:{DataType:"String",StringValue:"acme"}}}]]},Z={destinationFirehose:C,destinationSNS:P};export{A as examples,Z as exportExamples,r as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,t=(t,i)=>{for(var s in i)e(t,s,{get:i[s],enumerable:!0})},i={};t(i,{env:()=>s,step:()=>a});var s={};t(s,{push:()=>r,simulation:()=>o});var n=class{input;constructor(e){this.input=e}get[Symbol.toStringTag](){return"PutRecordBatchCommand"}},r={AWS:{FirehoseClient:class{config;constructor(e){this.config=e}async send(e){const t="input"in e?e.input:void 0;var i;return{FailedPutCount:0,Encrypted:!1,RequestResponses:("object"==typeof(i=t)&&null!==i&&"Records"in i&&Array.isArray(i.Records)?t.Records:[]).map((e,t)=>({RecordId:`mock-record-id-${t}`}))}}destroy(){}},PutRecordBatchCommand:n}},o=["call:AWS.FirehoseClient.send"],a={};t(a,{firehoseRecord:()=>v,init:()=>m,mappedRecord:()=>w,orderEvent:()=>f,userSignupEvent:()=>y});import{getEvent as c}from"@walkeros/core";import{isObject as d}from"@walkeros/core";function l(e,t=!0){const i=JSON.stringify(e);if("string"!=typeof i)throw new TypeError("The payload does not serialize to JSON.");return Buffer.from(t?`${i}\n`:i)}var p="walkeros-events",m={title:"Initialization",description:"Init builds one FirehoseClient for the stream region with the credentials from config.credentials and a 2500 ms per-attempt timeout. Nothing is sent until the first event.",in:{settings:{streamName:p,region:"eu-central-1"},credentials:{accessKeyId:"$secret.AWS_ACCESS_KEY_ID",secretAccessKey:"$secret.AWS_SECRET_ACCESS_KEY"}},out:[["new FirehoseClient",{region:"eu-central-1",credentials:{accessKeyId:"$secret.AWS_ACCESS_KEY_ID",secretAccessKey:"$secret.AWS_SECRET_ACCESS_KEY"},requestHandler:{requestTimeout:2500,throwOnRequestTimeout:!0}}]]},u=c("page view",{id:"ev-1700001000",timestamp:1700001e3,data:{title:"Home",url:"https://example.com/"},source:{type:"express",platform:"server"}}),g=c("order complete",{id:"ev-1700001001",timestamp:1700001001,data:{id:"ORD-400",total:99.99,currency:"EUR"},source:{type:"express",platform:"server"}}),h=c("user signup",{id:"ev-1700001002",timestamp:1700001002,data:{plan:"pro",source:"landing-page"},user:{id:"usr-789",email:"new@example.com"},source:{type:"express",platform:"server"}});function S(e){return[["client.send",{DeliveryStreamName:p,Records:[{Data:l(e)}]}]]}var v={title:"Page view record",description:"A page view is sent to Firehose as one record: the full event as JSON followed by a newline.",in:u,mapping:void 0,out:S(u)},f={title:"Order record",description:"An order complete event is serialized and delivered to Firehose as one newline-terminated record.",in:g,mapping:void 0,out:S(g)},y={title:"User signup record",description:"A user signup event including user fields is streamed to Firehose as a JSON record.",in:h,mapping:void 0,out:S(h)},w={title:"Mapped record",description:"A mapping that produces an object sends that object as the record instead of the full event. Keep the event id in it for deduplication.",in:g,mapping:{data:{map:{id:"id",name:"name",order_id:"data.id",total:"data.total"}}},out:S({id:"ev-1700001001",name:"order complete",order_id:"ORD-400",total:99.99})},A={};t(A,{env:()=>b,step:()=>K});var b={};t(b,{push:()=>I,simulation:()=>R});var E=class{constructor(e){this.input=e}input},C=class extends E{get[Symbol.toStringTag](){return"CreateTopicCommand"}},_=class extends E{get[Symbol.toStringTag](){return"PublishCommand"}},N=class extends E{get[Symbol.toStringTag](){return"GetTopicAttributesCommand"}},k=class extends E{get[Symbol.toStringTag](){return"SubscribeCommand"}},T=class extends E{get[Symbol.toStringTag](){return"GetCallerIdentityCommand"}},I={AWS:{SNSClient:class{constructor(e){this.config=e}config;async send(e){return e instanceof C?{TopicArn:"arn:aws:sns:eu-central-1:123456789012:walkeros-events"}:e instanceof _?{MessageId:"mock-message-id"}:{}}destroy(){}},CreateTopicCommand:C,PublishCommand:_,GetTopicAttributesCommand:N,SubscribeCommand:k,STSClient:class{constructor(e){this.config=e}config;async send(){return{Account:"123456789012",Arn:"arn:aws:iam::123456789012:user/walkeros"}}destroy(){}},GetCallerIdentityCommand:T}},R=["call:AWS.SNSClient.send"],K={};t(K,{attributedPublish:()=>$,init:()=>O,mappedMessage:()=>Y,orderEvent:()=>P,pageView:()=>j});import{getEvent as x}from"@walkeros/core";var D="arn:aws:sns:eu-central-1:123456789012:walkeros-events",O={title:"Initialization",description:"Init builds one SNSClient in the region of the topic ARN with the credentials from config.credentials and a 2500 ms per-attempt timeout. No topic is created and nothing is sent until the first event.",in:{settings:{topicArn:D},credentials:{accessKeyId:"$secret.AWS_ACCESS_KEY_ID",secretAccessKey:"$secret.AWS_SECRET_ACCESS_KEY"}},out:[["new SNSClient",{region:"eu-central-1",credentials:{accessKeyId:"$secret.AWS_ACCESS_KEY_ID",secretAccessKey:"$secret.AWS_SECRET_ACCESS_KEY"},requestHandler:{requestTimeout:2500,throwOnRequestTimeout:!0}}]]},W=x("page view",{id:"ev-1700001000",timestamp:1700001e3,data:{title:"Home",url:"https://example.com/"},source:{type:"express",platform:"server"}}),F=x("order complete",{id:"ev-1700001001",timestamp:1700001001,data:{id:"ORD-400",total:99.99,currency:"EUR"},user:{id:"usr-789"},source:{type:"express",platform:"server"}}),M=x("product view",{id:"ev-1700001002",timestamp:1700001002,data:{id:"SKU-1",tenant_id:"acme"},source:{type:"express",platform:"server"}}),j={title:"Page view publish",description:"A page view event is JSON-stringified and published as the Message of an SNS Publish call.",in:W,mapping:void 0,out:[["client.send",{TopicArn:D,Message:JSON.stringify(W)}]]},P={title:"Order publish with FIFO group (path-resolved)",description:'An order complete event is published to a FIFO topic with a messageGroupId resolved from the event via the mapping path "user.id". The deduplication id defaults to the event id.',in:F,mapping:{settings:{messageGroupId:"user.id"}},out:[["client.send",{TopicArn:"arn:aws:sns:eu-central-1:123456789012:walkeros-events.fifo",Message:JSON.stringify(F),MessageGroupId:"usr-789",MessageDeduplicationId:"ev-1700001001"}]]},$={title:"Publish with per-event message attributes",description:"Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.",in:M,mapping:{settings:{messageAttributes:{schema_version:{value:{DataType:"String",StringValue:"v4"}},tenant:{value:{DataType:"String",StringValue:"acme"}}}}},out:[["client.send",{TopicArn:D,Message:JSON.stringify(M),MessageAttributes:{schema_version:{DataType:"String",StringValue:"v4"},tenant:{DataType:"String",StringValue:"acme"}}}]]},Y={title:"Mapped message",description:"A mapping that produces an object publishes that object as the Message instead of the full event. Keep the event id in it for deduplication.",in:F,mapping:{data:{map:{id:"id",name:"name",order_id:"data.id",total:"data.total"}}},out:[["client.send",{TopicArn:D,Message:JSON.stringify({id:"ev-1700001001",name:"order complete",order_id:"ORD-400",total:99.99})}]]};import{zodToSchema as q}from"@walkeros/core/dev";import{z}from"@walkeros/core/dev";var G=z.string().min(1).describe("Name of the Firehose stream (like walkeros-events). Required.").optional(),J=z.string().describe("AWS region of the stream (like eu-central-1). Default: AWS_REGION or the active profile, else eu-central-1."),U=z.any().describe("A FirehoseClient of your own. Used as is and never closed by the destination."),B=z.any().describe("Raw FirehoseClient options passed to the SDK (like { endpoint, maxAttempts }). Put keys in config.credentials instead."),L=z.object({streamName:G,client:U.optional(),region:J.optional(),config:B.optional()}),V=z.object({streamName:G,region:J.optional(),newline:z.boolean().describe("Append a newline to every record (default true). Set false when the stream adds its own new line delimiter.").optional(),config:B.optional(),client:U.optional(),firehose:L.describe("Deprecated: use the flat fields streamName, region, config and client.").optional()});import{z as H}from"@walkeros/core/dev";var Q=H.object({}),X=q(V),Z=q(Q),ee=q(L);import{zodToSchema as te}from"@walkeros/core/dev";import{z as ie}from"@walkeros/core/dev";var se=ie.object({topicArn:ie.string().describe("Topic ARN (like arn:aws:sns:eu-central-1:123456789012:walkeros-events). Region and topic name derive from it. Required unless topicName is set.").optional(),topicName:ie.string().min(1).describe("Topic name (like walkeros-events). Used by walkeros setup; without topicArn the ARN is completed with the account id at the first publish.").optional(),region:ie.string().describe("AWS region (like eu-central-1). Default: the region in topicArn, AWS_REGION or the active profile, else eu-central-1.").optional(),client:ie.any().describe("An SNSClient of your own. Used as is and never closed by the destination.").optional(),config:ie.any().describe("Raw SNSClient options passed to the SDK. Put keys in config.credentials instead.").optional()});import{z as ne}from"@walkeros/core/dev";var re=ne.object({messageAttributes:ne.record(ne.string(),ne.unknown()).optional(),messageGroupId:ne.unknown().optional(),messageDeduplicationId:ne.unknown().optional()});import{z as oe}from"@walkeros/core/dev";var ae=oe.object({protocol:oe.enum(["sqs","lambda","https","http","email","sms"]),endpoint:oe.string().min(1),rawMessageDelivery:oe.boolean().optional(),filterPolicy:oe.record(oe.string(),oe.unknown()).optional(),deadLetterTargetArn:oe.string().optional()}),ce=oe.object({region:oe.string().optional(),displayName:oe.string().optional(),fifoTopic:oe.boolean().optional(),kmsMasterKeyId:oe.string().optional(),tags:oe.record(oe.string(),oe.string()).optional(),subscriptions:oe.array(ae).optional()}),de=te(se),le=te(re),pe=te(ce),me={};t(me,{firehose:()=>ee,firehoseMapping:()=>Z,firehoseSettings:()=>X,mapping:()=>Z,settings:()=>X,snsMapping:()=>le,snsSettings:()=>de,snsSetup:()=>pe});var ue={};t(ue,{env:()=>s,firehose:()=>i,sns:()=>A,step:()=>a});var ge={"minimal-config":{text:"Firehose needs settings.streamName (plus settings.region when the stream is not in AWS_REGION or eu-central-1). SNS needs settings.topicArn; region and topic name derive from it. Off AWS, add config.credentials. Nothing is sent and no credentials are loaded until the first event.",code:[{lang:"json",code:'{ "settings": { "streamName": "walkeros-events", "region": "eu-central-1" }, "credentials": { "accessKeyId": "$secret.AWS_ACCESS_KEY_ID", "secretAccessKey": "$secret.AWS_SECRET_ACCESS_KEY" } }'},{lang:"json",code:'{ "settings": { "topicArn": "arn:aws:sns:eu-central-1:123456789012:walkeros-events" } }'}]},"auth-credentials":{text:"On AWS compute an attached IAM role needs no config at all. Elsewhere, config.credentials ({ accessKeyId, secretAccessKey, sessionToken? }, or the same as a JSON string) wins over settings.config.credentials, which wins over the AWS default chain (AWS_* variables, AWS_PROFILE, ECS, EC2 and web identity roles; Kubernetes can go keyless with AWS_ROLE_ARN plus AWS_WEB_IDENTITY_TOKEN_FILE). Back every value with $secret; never write a literal key. Credentials are shape-checked at init and loaded only at the first send.",code:[{lang:"json",code:'{ "credentials": { "accessKeyId": "$secret.AWS_ACCESS_KEY_ID", "secretAccessKey": "$secret.AWS_SECRET_ACCESS_KEY" } }'}]},"firehose-records":{text:"Each record is the mapped data object, or the full event when the mapping produced none, followed by a newline. Set settings.newline: false when the stream adds its own new line delimiter. Batching is on by default (500 records or 1 s); calls carry at most 500 records and 2,900,000 bytes, and a record over 1,000,000 bytes fails as RecordTooLarge without being sent."},"delivery-guarantee":{text:"Delivery is at least once: deduplicate downstream on event.id, and keep id in mapped data. A record AWS rejects is reported as failed with code, status and retryable. There is no retry beyond the built-in AWS SDK retry: a rejected record goes to the in-memory dead letter queue of the collector, which nothing replays yet. On SNS FIFO topics MessageDeduplicationId defaults to event.id."},"troubleshoot-errors":{text:"Every failure carries code, status and retryable, and its message names the stream or topic and the region. ResourceNotFoundException: wrong settings.streamName or region. AccessDeniedException / AuthorizationErrorException: the credentials lack firehose:PutRecordBatch or sns:Publish. UnrecognizedClientException, InvalidSignatureException, ExpiredTokenException or no credentials found: check config.credentials or the environment. SNS NotFoundException: the topic does not exist; run walkeros setup or set settings.topicArn. NULL rows in Athena: the stream adds its own new line delimiter too, so set newline: false. InvalidConfig at start: a missing or conflicting setting, named in the message."}},he={destinationFirehose:i,destinationSNS:A},Se={destinationFirehose:{settings:X,mapping:Z},destinationSNS:{settings:de,mapping:le,setup:pe}};export{ue as examples,he as exportExamples,Se as exportSchemas,ge as hints,me as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas.ts","../src/firehose/schemas/index.ts","../src/firehose/schemas/settings.ts","../src/firehose/schemas/mapping.ts","../src/sns/schemas/index.ts","../src/sns/schemas/settings.ts","../src/sns/schemas/mapping.ts","../src/sns/schemas/setup.ts","../src/examples/index.ts","../src/firehose/examples/index.ts","../src/firehose/examples/env.ts","../src/firehose/examples/step.ts","../src/sns/examples/index.ts","../src/sns/examples/env.ts","../src/sns/examples/step.ts","../src/dev.ts"],"sourcesContent":["// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\n\nexport {\n settings as firehoseSettings,\n mapping as firehoseMapping,\n firehose,\n} from './firehose/schemas';\n\nexport {\n settings as snsSettings,\n mapping as snsMapping,\n setup as snsSetup,\n} from './sns/schemas';\n\n// Backwards-compatible aliases (firehose is the package's default sub-destination).\nexport { settings, mapping } from './firehose/schemas';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema, FirehoseConfigSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n type Settings,\n FirehoseConfigSchema,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n\n// Nested JSON Schema for Firehose subpage\nexport const firehose = zodToSchema(FirehoseConfigSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const FirehoseConfigSchema = z.object({\n streamName: z\n .string()\n .min(1)\n .describe(\n 'Name of the Kinesis Data Firehose delivery stream (like walker-events)',\n ),\n client: z\n .any()\n .describe(\n 'Pre-configured AWS Firehose client instance (like new FirehoseClient(config))',\n )\n .optional(),\n region: z\n .string()\n .describe('AWS region for the Firehose service (like us-east-1)')\n .optional(),\n config: z\n .any()\n .describe(\n 'AWS SDK client configuration options (like { credentials: awsCredentials })',\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n firehose: FirehoseConfigSchema.describe(\n \"AWS Firehose configuration settings (like { streamName: 'walker-events', region: 'us-east-1' })\",\n ).optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS Firehose Mapping Schema\n * AWS Firehose has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport {\n SetupSchema,\n SetupSubscriptionSchema,\n type Setup,\n type SetupSubscription,\n} from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n topicName: z\n .string()\n .min(1)\n .describe('SNS topic name (like walkeros-events). Required.'),\n region: z.string().describe('AWS region (like eu-central-1).').optional(),\n client: z.any().describe('Pre-configured AWS SNSClient instance.').optional(),\n config: z\n .any()\n .describe('AWS SDK SNSClient configuration options.')\n .optional(),\n topicArn: z\n .string()\n .describe(\n 'Topic ARN. Populated by init() from CreateTopic. Operators may pre-set to skip the runtime CreateTopic call.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * SNS Mapping Schema.\n *\n * `messageAttributes` is `Mapping.Map`: each value resolves per event to the\n * SDK's `{ DataType, StringValue }` shape. Schema accepts any structure;\n * runtime mapping resolution coerces shape via `getMappingValue`.\n *\n * `messageGroupId` and `messageDeduplicationId` are `Mapping.Value`: a string\n * path or a value-config object.\n */\nexport const MappingSchema = z.object({\n messageAttributes: z.record(z.string(), z.unknown()).optional(),\n messageGroupId: z.unknown().optional(),\n messageDeduplicationId: z.unknown().optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSubscriptionSchema = z.object({\n protocol: z.enum(['sqs', 'lambda', 'https', 'http', 'email', 'sms']),\n endpoint: z.string().min(1),\n rawMessageDelivery: z.boolean().optional(),\n filterPolicy: z.record(z.string(), z.unknown()).optional(),\n deadLetterTargetArn: z.string().optional(),\n});\n\nexport const SetupSchema = z.object({\n region: z.string().optional(),\n displayName: z.string().optional(),\n fifoTopic: z.boolean().optional(),\n kmsMasterKeyId: z.string().optional(),\n tags: z.record(z.string(), z.string()).optional(),\n subscriptions: z.array(SetupSubscriptionSchema).optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\nexport type SetupSubscription = z.infer<typeof SetupSubscriptionSchema>;\n","export * as firehose from '../firehose/examples';\nexport * as sns from '../sns/examples';\n// Re-export env at top level for env-loader compatibility (matches web pattern)\nexport * as env from '../firehose/examples/env';\nexport * as step from '../firehose/examples/step';\n","export * as env from './env';\nexport * as step from './step';\n","import type { PutRecordBatchCommandInput } from '@aws-sdk/client-firehose';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment configurations for AWS Firehose destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual AWS SDK dependencies.\n */\n\n// Mock FirehoseClient class\nclass MockFirehoseClient implements SendClient {\n config: unknown;\n\n constructor(config?: unknown) {\n this.config = config;\n }\n\n async send(_command: object) {\n // Simulate successful response\n return {\n RecordId: 'mock-record-id',\n ResponseMetadata: {\n RequestId: 'mock-request-id',\n },\n };\n }\n}\n\n// Mock PutRecordBatchCommand class. The build minifies class names; the tag\n// keeps the SDK command name in printed simulate output.\nclass MockPutRecordBatchCommand {\n readonly input: PutRecordBatchCommandInput;\n\n constructor(input: PutRecordBatchCommandInput) {\n this.input = input;\n }\n\n get [Symbol.toStringTag](): string {\n return 'PutRecordBatchCommand';\n }\n}\n\nexport const push: Env = {\n // Environment for push operations\n AWS: {\n FirehoseClient: MockFirehoseClient,\n PutRecordBatchCommand: MockPutRecordBatchCommand,\n },\n};\n\nexport const simulation = ['call:AWS.FirehoseClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * Default firehose push -- client.send(new PutRecordBatchCommand({...}))\n * Records contain the full event JSON-stringified as Buffer Data.\n */\nexport const firehoseRecord: Flow.StepExample = {\n title: 'Page view record',\n description:\n 'A page view is sent to Kinesis Firehose as a single record with the full event JSON-stringified into the Data buffer.',\n in: getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n\n/**\n * Order event -- same pattern, full event serialized in Records[0].Data.\n */\nexport const orderEvent: Flow.StepExample = {\n title: 'Order record',\n description:\n 'An order complete event is serialized and delivered to Firehose as a batch record for downstream storage.',\n in: getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n\n/**\n * User signup -- full event including user fields is serialized to Firehose.\n */\nexport const userSignupEvent: Flow.StepExample = {\n title: 'User signup record',\n description:\n 'A user signup event including user fields is streamed to Firehose as a JSON record.',\n in: getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: 'walkeros-events',\n Records: [\n {\n Data: Buffer.from(\n JSON.stringify(\n getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n ),\n ),\n },\n ],\n },\n ],\n ],\n};\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS SNS destination.\n *\n * `push` is the mock env simulate injects: the SNS and STS clients answer\n * every `send` locally, so nothing reaches AWS. Each command keeps its\n * `input`, so a recorded `send` shows the request (`CreateTopic` at init,\n * `Publish` per event). Unit tests still substitute the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sns')`.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\n\n// The build minifies class names; the tag keeps the SDK command name in\n// printed simulate output (`{\"PublishCommand\":{\"input\":...}}`).\nclass MockCommand<Input> {\n constructor(public readonly input: Input) {}\n}\n\nclass MockCreateTopicCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['CreateTopicCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'CreateTopicCommand';\n }\n}\nclass MockPublishCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['PublishCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'PublishCommand';\n }\n}\nclass MockGetTopicAttributesCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['GetTopicAttributesCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'GetTopicAttributesCommand';\n }\n}\nclass MockSubscribeCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['SubscribeCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'SubscribeCommand';\n }\n}\nclass MockGetCallerIdentityCommand extends MockCommand<\n ConstructorParameters<Env['AWS']['GetCallerIdentityCommand']>[0]\n> {\n get [Symbol.toStringTag](): string {\n return 'GetCallerIdentityCommand';\n }\n}\n\nclass MockSNSClient implements SendClient {\n constructor(public config?: object) {}\n async send(command: object): Promise<unknown> {\n if (command instanceof MockCreateTopicCommand)\n return { TopicArn: TOPIC_ARN };\n if (command instanceof MockPublishCommand)\n return { MessageId: 'mock-message-id' };\n return {};\n }\n}\n\nclass MockSTSClient implements SendClient {\n constructor(public config?: object) {}\n async send(): Promise<unknown> {\n return { Account: '123456789012' };\n }\n}\n\nexport const push: Env = {\n AWS: {\n SNSClient: MockSNSClient,\n CreateTopicCommand: MockCreateTopicCommand,\n PublishCommand: MockPublishCommand,\n GetTopicAttributesCommand: MockGetTopicAttributesCommand,\n SubscribeCommand: MockSubscribeCommand,\n STSClient: MockSTSClient,\n GetCallerIdentityCommand: MockGetCallerIdentityCommand,\n },\n};\n\n/** Every request goes through `send`; the command in `args[0]` names it. */\nexport const simulation = ['call:AWS.SNSClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * SNS step examples. Each example's `out` is the array of recorded mock\n * calls produced by `push()`. The recording shape is:\n * ['client.send', commandInput]\n *\n * The destination JSON-stringifies the event into the Publish call's Message\n * field. Mapping entries (messageGroupId, messageDeduplicationId,\n * messageAttributes) resolve per event via getMappingValue.\n */\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n user: { id: 'usr-789' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst productViewEvt = getEvent('product view', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { id: 'SKU-1', tenant_id: 'acme' },\n source: { type: 'express', platform: 'server' },\n});\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view publish',\n description:\n 'A page view event is JSON-stringified and published as the Message of an SNS Publish call.',\n in: pageEvent,\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events',\n Message: JSON.stringify(pageEvent),\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order publish with FIFO group (path-resolved)',\n description:\n 'An order complete event is published with a FIFO messageGroupId resolved from the event via the mapping path \"user.id\". `messageGroupId` is a `Mapping.Value`, so a string path is sufficient; no literal is hard-coded.',\n in: orderEvt,\n mapping: { settings: { messageGroupId: 'user.id' } },\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events.fifo',\n Message: JSON.stringify(orderEvt),\n MessageGroupId: 'usr-789',\n },\n ],\n ],\n};\n\nexport const attributedPublish: Flow.StepExample = {\n title: 'Publish with per-event message attributes',\n description:\n 'Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.',\n in: productViewEvt,\n mapping: {\n settings: {\n messageAttributes: {\n schema_version: { value: { DataType: 'String', StringValue: 'v4' } },\n tenant: { value: { DataType: 'String', StringValue: 'acme' } },\n },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: 'arn:aws:sns:eu-central-1:000000000000:walkeros-events',\n Message: JSON.stringify(productViewEvt),\n MessageAttributes: {\n schema_version: { DataType: 'String', StringValue: 'v4' },\n tenant: { DataType: 'String', StringValue: 'acme' },\n },\n },\n ],\n ],\n};\n","export * as schemas from './schemas';\nexport * as examples from './examples';\n\nimport * as firehoseExamplesNs from './firehose/examples';\nimport * as snsExamplesNs from './sns/examples';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n destinationFirehose: firehoseExamplesNs,\n destinationSNS: snsExamplesNs,\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,mBAAAC;AAAA,EAAA;AAAA;;;ACAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,YAAY,EACT,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,QAAQ,EACL,OAAO,EACP,SAAS,sDAAsD,EAC/D,SAAS;AAAA,EACZ,QAAQ,EACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAEM,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,UAAU,qBAAqB;AAAA,IAC7B;AAAA,EACF,EAAE,SAAS;AACb,CAAC;;;AC/BD,SAAS,KAAAC,UAAS;AAMX,IAAM,gBAAgBA,GAAE,OAAO,CAAC,CAAC;;;AFMjC,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;AAGzC,IAAM,WAAW,YAAY,oBAAoB;;;AGhBxD,SAAS,eAAAC,oBAAmB;;;ACA5B,SAAS,KAAAC,UAAS;AAEX,IAAMC,kBAA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,aAAa,OAAO;AAAA,QACpD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACzFO,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB;AAAA,EACrB,gBAAgBE;AAClB;","names":["mapping","settings","z","zodToSchema","z","SettingsSchema","z","MappingSchema","z","settings","zodToSchema","SettingsSchema","mapping","MappingSchema","examples_exports","examples_exports","env_exports","step_exports","env_exports","push","simulation","step_exports","orderEvent","getEvent","examples_exports"]}
|
|
1
|
+
{"version":3,"sources":["../src/firehose/examples/index.ts","../src/firehose/examples/env.ts","../src/firehose/examples/step.ts","../src/lib/payload.ts","../src/firehose/lib/records.ts","../src/sns/examples/index.ts","../src/sns/examples/env.ts","../src/sns/examples/step.ts","../src/firehose/schemas/index.ts","../src/firehose/schemas/settings.ts","../src/firehose/schemas/mapping.ts","../src/sns/schemas/index.ts","../src/sns/schemas/settings.ts","../src/sns/schemas/mapping.ts","../src/sns/schemas/setup.ts","../src/schemas.ts","../src/examples/index.ts","../src/hints.ts","../src/dev.ts"],"sourcesContent":["export * as env from './env';\nexport * as step from './step';\n","import type { PutRecordBatchCommandInput } from '@aws-sdk/client-firehose';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS Firehose destination.\n *\n * `push` is the mock env simulate injects: the client answers every `send`\n * locally, so nothing reaches AWS. Each command keeps its `input`, so a\n * recorded `send` shows the request.\n */\n\ninterface RecordsInput {\n Records: unknown[];\n}\n\nfunction hasRecords(value: unknown): value is RecordsInput {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'Records' in value &&\n Array.isArray(value.Records)\n );\n}\n\n// Mock FirehoseClient class: every record is accepted.\nclass MockFirehoseClient implements SendClient {\n config: unknown;\n\n constructor(config?: unknown) {\n this.config = config;\n }\n\n async send(command: object) {\n const input = 'input' in command ? command.input : undefined;\n const records = hasRecords(input) ? input.Records : [];\n return {\n FailedPutCount: 0,\n Encrypted: false,\n RequestResponses: records.map((_, index) => ({\n RecordId: `mock-record-id-${index}`,\n })),\n };\n }\n\n destroy(): void {}\n}\n\n// Mock PutRecordBatchCommand class. The build minifies class names; the tag\n// keeps the SDK command name in printed simulate output.\nclass MockPutRecordBatchCommand {\n readonly input: PutRecordBatchCommandInput;\n\n constructor(input: PutRecordBatchCommandInput) {\n this.input = input;\n }\n\n get [Symbol.toStringTag](): string {\n return 'PutRecordBatchCommand';\n }\n}\n\nexport const push: Env = {\n AWS: {\n FirehoseClient: MockFirehoseClient,\n PutRecordBatchCommand: MockPutRecordBatchCommand,\n },\n};\n\nexport const simulation = ['call:AWS.FirehoseClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport { toRecordData } from '../lib/records';\n\n/**\n * Firehose step examples. Each `out` is the recorded\n * `client.send(new PutRecordBatchCommand(input))` call. A record is the full\n * event as JSON plus a newline, or the mapped `data` when a mapping produced\n * an object.\n */\n\nconst STREAM = 'walkeros-events';\n\n/**\n * The copy-paste config: the stream, its region, and keys from `$secret`.\n * `init` builds one client from it, offline, with a per-attempt timeout of a\n * quarter of the collector's 10 s race, so the SDK's three attempts end\n * before the collector stops waiting.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Init builds one FirehoseClient for the stream region with the credentials from config.credentials and a 2500 ms per-attempt timeout. Nothing is sent until the first event.',\n in: {\n settings: { streamName: STREAM, region: 'eu-central-1' },\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n },\n out: [\n [\n 'new FirehoseClient',\n {\n region: 'eu-central-1',\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n requestHandler: { requestTimeout: 2500, throwOnRequestTimeout: true },\n },\n ],\n ],\n};\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst signupEvt = getEvent('user signup', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\n});\n\nfunction sent(payload: unknown): Flow.StepExample['out'] {\n return [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [{ Data: toRecordData(payload) }],\n },\n ],\n ];\n}\n\nexport const firehoseRecord: Flow.StepExample = {\n title: 'Page view record',\n description:\n 'A page view is sent to Firehose as one record: the full event as JSON followed by a newline.',\n in: pageEvent,\n mapping: undefined,\n out: sent(pageEvent),\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order record',\n description:\n 'An order complete event is serialized and delivered to Firehose as one newline-terminated record.',\n in: orderEvt,\n mapping: undefined,\n out: sent(orderEvt),\n};\n\nexport const userSignupEvent: Flow.StepExample = {\n title: 'User signup record',\n description:\n 'A user signup event including user fields is streamed to Firehose as a JSON record.',\n in: signupEvt,\n mapping: undefined,\n out: sent(signupEvt),\n};\n\nexport const mappedRecord: Flow.StepExample = {\n title: 'Mapped record',\n description:\n 'A mapping that produces an object sends that object as the record instead of the full event. Keep the event id in it for deduplication.',\n in: orderEvt,\n mapping: {\n data: {\n map: {\n id: 'id',\n name: 'name',\n order_id: 'data.id',\n total: 'data.total',\n },\n },\n },\n out: sent({\n id: 'ev-1700001001',\n name: 'order complete',\n order_id: 'ORD-400',\n total: 99.99,\n }),\n};\n","import type { WalkerOS } from '@walkeros/core';\nimport { isObject } from '@walkeros/core';\n\n/**\n * What one record or message carries: the mapped `data` when the mapping\n * produced an object, else the full event.\n */\nexport function toPayload(event: WalkerOS.Event, data?: unknown): object {\n return isObject(data) ? data : event;\n}\n","export { toPayload } from '../../lib/payload';\n\n/** Most records one `PutRecordBatch` call accepts. */\nexport const MAX_RECORDS_PER_CALL = 500;\n\n/**\n * Raw bytes per call, kept below the documented 4 MiB request limit with room\n * for the base64 encoding and the JSON envelope of the request.\n */\nexport const MAX_BYTES_PER_CALL = 2_900_000;\n\n/** Largest record Firehose accepts, newline included. */\nexport const MAX_RECORD_BYTES = 1_000_000;\n\n/** The record bytes: the payload as JSON, plus `\\n` unless `newline` is false. */\nexport function toRecordData(payload: unknown, newline = true): Buffer {\n const json = JSON.stringify(payload);\n if (typeof json !== 'string')\n throw new TypeError('The payload does not serialize to JSON.');\n return Buffer.from(newline ? `${json}\\n` : json);\n}\n\n/** One record on its way out, with its index in the delivery. */\nexport interface PlannedRecord {\n index: number;\n data: Buffer;\n}\n\n/** A record refused before sending; it is never sent. */\nexport interface RefusedRecord {\n index: number;\n code: 'RecordTooLarge' | 'InvalidRecord';\n detail: string;\n cause?: unknown;\n}\n\nexport interface Plan {\n chunks: PlannedRecord[][];\n refused: RefusedRecord[];\n}\n\n/**\n * Turns payloads into records and splits them into calls of at most\n * `MAX_RECORDS_PER_CALL` records and `MAX_BYTES_PER_CALL` bytes, in order.\n * A record that cannot be serialized or is too large is refused on its own,\n * so it never fails its neighbours.\n */\nexport function planChunks(\n payloads: readonly unknown[],\n newline: boolean,\n): Plan {\n const chunks: PlannedRecord[][] = [];\n const refused: RefusedRecord[] = [];\n let current: PlannedRecord[] = [];\n let currentBytes = 0;\n\n payloads.forEach((payload, index) => {\n let data: Buffer;\n try {\n data = toRecordData(payload, newline);\n } catch (error) {\n refused.push({\n index,\n code: 'InvalidRecord',\n detail: `Record ${index} does not serialize to JSON: ${error instanceof Error ? error.message : String(error)}`,\n cause: error,\n });\n return;\n }\n\n if (data.byteLength > MAX_RECORD_BYTES) {\n refused.push({\n index,\n code: 'RecordTooLarge',\n detail: `Record ${index} is ${data.byteLength} bytes, over the ${MAX_RECORD_BYTES} byte limit.`,\n });\n return;\n }\n\n if (\n current.length >= MAX_RECORDS_PER_CALL ||\n currentBytes + data.byteLength > MAX_BYTES_PER_CALL\n ) {\n chunks.push(current);\n current = [];\n currentBytes = 0;\n }\n\n current.push({ index, data });\n currentBytes += data.byteLength;\n });\n\n if (current.length > 0) chunks.push(current);\n return { chunks, refused };\n}\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n CreateTopicCommandInput,\n GetTopicAttributesCommandInput,\n PublishCommandInput,\n SubscribeCommandInput,\n} from '@aws-sdk/client-sns';\nimport type { GetCallerIdentityCommandInput } from '@aws-sdk/client-sts';\nimport type { Env, SendClient } from '../types';\n\n/**\n * Example environment for the AWS SNS destination.\n *\n * `push` is the mock env simulate injects: the SNS and STS clients answer\n * every `send` locally, so nothing reaches AWS. Each command keeps its\n * `input`, so a recorded `send` shows the request (`Publish` per event).\n * Unit tests still substitute the SDK module-wide via\n * `jest.mock('@aws-sdk/client-sns')`.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\n\n// The build minifies class names; the tag keeps the SDK command name in\n// printed simulate output (`{\"PublishCommand\":{\"input\":...}}`).\nclass MockCommand<Input> {\n constructor(public readonly input: Input) {}\n}\n\nclass MockCreateTopicCommand extends MockCommand<CreateTopicCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'CreateTopicCommand';\n }\n}\nclass MockPublishCommand extends MockCommand<PublishCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'PublishCommand';\n }\n}\nclass MockGetTopicAttributesCommand extends MockCommand<GetTopicAttributesCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'GetTopicAttributesCommand';\n }\n}\nclass MockSubscribeCommand extends MockCommand<SubscribeCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'SubscribeCommand';\n }\n}\nclass MockGetCallerIdentityCommand extends MockCommand<GetCallerIdentityCommandInput> {\n get [Symbol.toStringTag](): string {\n return 'GetCallerIdentityCommand';\n }\n}\n\nclass MockSNSClient implements SendClient {\n constructor(public config?: object) {}\n async send(command: object): Promise<unknown> {\n if (command instanceof MockCreateTopicCommand)\n return { TopicArn: TOPIC_ARN };\n if (command instanceof MockPublishCommand)\n return { MessageId: 'mock-message-id' };\n return {};\n }\n destroy(): void {}\n}\n\nclass MockSTSClient implements SendClient {\n constructor(public config?: object) {}\n async send(): Promise<unknown> {\n return {\n Account: '123456789012',\n Arn: 'arn:aws:iam::123456789012:user/walkeros',\n };\n }\n destroy(): void {}\n}\n\nexport const push: Env = {\n AWS: {\n SNSClient: MockSNSClient,\n CreateTopicCommand: MockCreateTopicCommand,\n PublishCommand: MockPublishCommand,\n GetTopicAttributesCommand: MockGetTopicAttributesCommand,\n SubscribeCommand: MockSubscribeCommand,\n STSClient: MockSTSClient,\n GetCallerIdentityCommand: MockGetCallerIdentityCommand,\n },\n};\n\n/** Every request goes through `send`; the command in `args[0]` names it. */\nexport const simulation = ['call:AWS.SNSClient.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * SNS step examples. Each example's `out` is the array of recorded mock\n * calls produced by `push()`. The recording shape is:\n * ['client.send', commandInput]\n *\n * The destination JSON-stringifies the event (or the mapped `data` object)\n * into the Publish call's Message field. Mapping entries (messageGroupId,\n * messageDeduplicationId, messageAttributes) resolve per event via\n * getMappingValue. On a FIFO topic the deduplication id defaults to the\n * event id.\n */\n\nconst TOPIC_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events';\nconst FIFO_ARN = 'arn:aws:sns:eu-central-1:123456789012:walkeros-events.fifo';\n\n/**\n * The copy-paste config: the topic ARN, which also names the region, and\n * keys from `$secret`. `init` builds one client from it, offline; nothing is\n * sent until the first event.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Init builds one SNSClient in the region of the topic ARN with the credentials from config.credentials and a 2500 ms per-attempt timeout. No topic is created and nothing is sent until the first event.',\n in: {\n settings: { topicArn: TOPIC_ARN },\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n },\n out: [\n [\n 'new SNSClient',\n {\n region: 'eu-central-1',\n credentials: {\n accessKeyId: '$secret.AWS_ACCESS_KEY_ID',\n secretAccessKey: '$secret.AWS_SECRET_ACCESS_KEY',\n },\n requestHandler: { requestTimeout: 2500, throwOnRequestTimeout: true },\n },\n ],\n ],\n};\n\nconst pageEvent = getEvent('page view', {\n id: 'ev-1700001000',\n timestamp: 1700001000,\n data: { title: 'Home', url: 'https://example.com/' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst orderEvt = getEvent('order complete', {\n id: 'ev-1700001001',\n timestamp: 1700001001,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n user: { id: 'usr-789' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst productViewEvt = getEvent('product view', {\n id: 'ev-1700001002',\n timestamp: 1700001002,\n data: { id: 'SKU-1', tenant_id: 'acme' },\n source: { type: 'express', platform: 'server' },\n});\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view publish',\n description:\n 'A page view event is JSON-stringified and published as the Message of an SNS Publish call.',\n in: pageEvent,\n mapping: undefined,\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify(pageEvent),\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order publish with FIFO group (path-resolved)',\n description:\n 'An order complete event is published to a FIFO topic with a messageGroupId resolved from the event via the mapping path \"user.id\". The deduplication id defaults to the event id.',\n in: orderEvt,\n mapping: { settings: { messageGroupId: 'user.id' } },\n out: [\n [\n 'client.send',\n {\n TopicArn: FIFO_ARN,\n Message: JSON.stringify(orderEvt),\n MessageGroupId: 'usr-789',\n MessageDeduplicationId: 'ev-1700001001',\n },\n ],\n ],\n};\n\nexport const attributedPublish: Flow.StepExample = {\n title: 'Publish with per-event message attributes',\n description:\n 'Demonstrates `messageAttributes` as `Mapping.Map`: each attribute value resolves per event. Operators express the SDK shape (`{ DataType, StringValue }`) per entry.',\n in: productViewEvt,\n mapping: {\n settings: {\n messageAttributes: {\n schema_version: { value: { DataType: 'String', StringValue: 'v4' } },\n tenant: { value: { DataType: 'String', StringValue: 'acme' } },\n },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify(productViewEvt),\n MessageAttributes: {\n schema_version: { DataType: 'String', StringValue: 'v4' },\n tenant: { DataType: 'String', StringValue: 'acme' },\n },\n },\n ],\n ],\n};\n\nexport const mappedMessage: Flow.StepExample = {\n title: 'Mapped message',\n description:\n 'A mapping that produces an object publishes that object as the Message instead of the full event. Keep the event id in it for deduplication.',\n in: orderEvt,\n mapping: {\n data: {\n map: { id: 'id', name: 'name', order_id: 'data.id', total: 'data.total' },\n },\n },\n out: [\n [\n 'client.send',\n {\n TopicArn: TOPIC_ARN,\n Message: JSON.stringify({\n id: 'ev-1700001001',\n name: 'order complete',\n order_id: 'ORD-400',\n total: 99.99,\n }),\n },\n ],\n ],\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema, FirehoseConfigSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport {\n SettingsSchema,\n type Settings,\n FirehoseConfigSchema,\n} from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n\n// Nested JSON Schema for Firehose subpage\nexport const firehose = zodToSchema(FirehoseConfigSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst streamName = z\n .string()\n .min(1)\n .describe('Name of the Firehose stream (like walkeros-events). Required.')\n .optional();\n\nconst region = z\n .string()\n .describe(\n 'AWS region of the stream (like eu-central-1). Default: AWS_REGION or the active profile, else eu-central-1.',\n );\n\nconst client = z\n .any()\n .describe(\n 'A FirehoseClient of your own. Used as is and never closed by the destination.',\n );\n\nconst config = z\n .any()\n .describe(\n 'Raw FirehoseClient options passed to the SDK (like { endpoint, maxAttempts }). Put keys in config.credentials instead.',\n );\n\n/** @deprecated The nested form, still read as an alias of the flat fields. */\nexport const FirehoseConfigSchema = z.object({\n streamName,\n client: client.optional(),\n region: region.optional(),\n config: config.optional(),\n});\n\nexport const SettingsSchema = z.object({\n // Optional in the schema only so the deprecated alias still validates;\n // init throws when neither form names a stream.\n streamName,\n region: region.optional(),\n newline: z\n .boolean()\n .describe(\n 'Append a newline to every record (default true). Set false when the stream adds its own new line delimiter.',\n )\n .optional(),\n config: config.optional(),\n client: client.optional(),\n firehose: FirehoseConfigSchema.describe(\n 'Deprecated: use the flat fields streamName, region, config and client.',\n ).optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * AWS Firehose Mapping Schema\n * Firehose has no rule-level settings: a rule's `data` becomes the record.\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport {\n SetupSchema,\n SetupSubscriptionSchema,\n type Setup,\n type SetupSubscription,\n} from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n topicArn: z\n .string()\n .describe(\n 'Topic ARN (like arn:aws:sns:eu-central-1:123456789012:walkeros-events). Region and topic name derive from it. Required unless topicName is set.',\n )\n .optional(),\n topicName: z\n .string()\n .min(1)\n .describe(\n 'Topic name (like walkeros-events). Used by walkeros setup; without topicArn the ARN is completed with the account id at the first publish.',\n )\n .optional(),\n region: z\n .string()\n .describe(\n 'AWS region (like eu-central-1). Default: the region in topicArn, AWS_REGION or the active profile, else eu-central-1.',\n )\n .optional(),\n client: z\n .any()\n .describe(\n 'An SNSClient of your own. Used as is and never closed by the destination.',\n )\n .optional(),\n config: z\n .any()\n .describe(\n 'Raw SNSClient options passed to the SDK. Put keys in config.credentials instead.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * SNS Mapping Schema.\n *\n * `messageAttributes` is `Mapping.Map`: each value resolves per event to the\n * SDK's `{ DataType, StringValue }` shape. Schema accepts any structure;\n * runtime mapping resolution coerces shape via `getMappingValue`.\n *\n * `messageGroupId` and `messageDeduplicationId` are `Mapping.Value`: a string\n * path or a value-config object.\n */\nexport const MappingSchema = z.object({\n messageAttributes: z.record(z.string(), z.unknown()).optional(),\n messageGroupId: z.unknown().optional(),\n messageDeduplicationId: z.unknown().optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSubscriptionSchema = z.object({\n protocol: z.enum(['sqs', 'lambda', 'https', 'http', 'email', 'sms']),\n endpoint: z.string().min(1),\n rawMessageDelivery: z.boolean().optional(),\n filterPolicy: z.record(z.string(), z.unknown()).optional(),\n deadLetterTargetArn: z.string().optional(),\n});\n\nexport const SetupSchema = z.object({\n region: z.string().optional(),\n displayName: z.string().optional(),\n fifoTopic: z.boolean().optional(),\n kmsMasterKeyId: z.string().optional(),\n tags: z.record(z.string(), z.string()).optional(),\n subscriptions: z.array(SetupSubscriptionSchema).optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\nexport type SetupSubscription = z.infer<typeof SetupSubscriptionSchema>;\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\n\nexport {\n settings as firehoseSettings,\n mapping as firehoseMapping,\n firehose,\n} from './firehose/schemas';\n\nexport {\n settings as snsSettings,\n mapping as snsMapping,\n setup as snsSetup,\n} from './sns/schemas';\n\n// Backwards-compatible aliases (firehose is the package's default sub-destination).\nexport { settings, mapping } from './firehose/schemas';\n","export * as firehose from '../firehose/examples';\nexport * as sns from '../sns/examples';\n// Re-export env at top level for env-loader compatibility (matches web pattern)\nexport * as env from '../firehose/examples/env';\nexport * as step from '../firehose/examples/step';\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'minimal-config': {\n text: 'Firehose needs settings.streamName (plus settings.region when the stream is not in AWS_REGION or eu-central-1). SNS needs settings.topicArn; region and topic name derive from it. Off AWS, add config.credentials. Nothing is sent and no credentials are loaded until the first event.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"streamName\": \"walkeros-events\", \"region\": \"eu-central-1\" }, \"credentials\": { \"accessKeyId\": \"$secret.AWS_ACCESS_KEY_ID\", \"secretAccessKey\": \"$secret.AWS_SECRET_ACCESS_KEY\" } }',\n },\n {\n lang: 'json',\n code: '{ \"settings\": { \"topicArn\": \"arn:aws:sns:eu-central-1:123456789012:walkeros-events\" } }',\n },\n ],\n },\n 'auth-credentials': {\n text: 'On AWS compute an attached IAM role needs no config at all. Elsewhere, config.credentials ({ accessKeyId, secretAccessKey, sessionToken? }, or the same as a JSON string) wins over settings.config.credentials, which wins over the AWS default chain (AWS_* variables, AWS_PROFILE, ECS, EC2 and web identity roles; Kubernetes can go keyless with AWS_ROLE_ARN plus AWS_WEB_IDENTITY_TOKEN_FILE). Back every value with $secret; never write a literal key. Credentials are shape-checked at init and loaded only at the first send.',\n code: [\n {\n lang: 'json',\n code: '{ \"credentials\": { \"accessKeyId\": \"$secret.AWS_ACCESS_KEY_ID\", \"secretAccessKey\": \"$secret.AWS_SECRET_ACCESS_KEY\" } }',\n },\n ],\n },\n 'firehose-records': {\n text: 'Each record is the mapped data object, or the full event when the mapping produced none, followed by a newline. Set settings.newline: false when the stream adds its own new line delimiter. Batching is on by default (500 records or 1 s); calls carry at most 500 records and 2,900,000 bytes, and a record over 1,000,000 bytes fails as RecordTooLarge without being sent.',\n },\n 'delivery-guarantee': {\n text: 'Delivery is at least once: deduplicate downstream on event.id, and keep id in mapped data. A record AWS rejects is reported as failed with code, status and retryable. There is no retry beyond the built-in AWS SDK retry: a rejected record goes to the in-memory dead letter queue of the collector, which nothing replays yet. On SNS FIFO topics MessageDeduplicationId defaults to event.id.',\n },\n 'troubleshoot-errors': {\n text: 'Every failure carries code, status and retryable, and its message names the stream or topic and the region. ResourceNotFoundException: wrong settings.streamName or region. AccessDeniedException / AuthorizationErrorException: the credentials lack firehose:PutRecordBatch or sns:Publish. UnrecognizedClientException, InvalidSignatureException, ExpiredTokenException or no credentials found: check config.credentials or the environment. SNS NotFoundException: the topic does not exist; run walkeros setup or set settings.topicArn. NULL rows in Athena: the stream adds its own new line delimiter too, so set newline: false. InvalidConfig at start: a missing or conflicting setting, named in the message.',\n },\n};\n","import * as firehoseExamplesNs from './firehose/examples';\nimport * as snsExamplesNs from './sns/examples';\nimport * as firehoseSchemasNs from './firehose/schemas';\nimport * as snsSchemasNs from './sns/schemas';\n\nexport * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n\n/** Dev examples per export, keyed by the export names in package.json. */\nexport const exportExamples = {\n destinationFirehose: firehoseExamplesNs,\n destinationSNS: snsExamplesNs,\n};\n\n/** Schemas per export, keyed by the export names in package.json. */\nexport const exportSchemas = {\n destinationFirehose: {\n settings: firehoseSchemasNs.settings,\n mapping: firehoseSchemasNs.mapping,\n },\n destinationSNS: {\n settings: snsSchemasNs.settings,\n mapping: snsSchemasNs.mapping,\n setup: snsSchemasNs.setup,\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAeA,SAAS,WAAW,OAAuC;AACzD,SACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,MAAM,QAAQ,MAAM,OAAO;AAE/B;AAGA,IAAM,qBAAN,MAA+C;AAAA,EAC7C;AAAA,EAEA,YAAYA,SAAkB;AAC5B,SAAK,SAASA;AAAA,EAChB;AAA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AA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,EACR;AAAA,EACA,sBAAsB;AAAA,IACpB,MAAM;AAAA,EACR;AAAA,EACA,uBAAuB;AAAA,IACrB,MAAM;AAAA,EACR;AACF;;;ACxBO,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB;AAAA,EACrB,gBAAgBC;AAClB;AAGO,IAAM,gBAAgB;AAAA,EAC3B,qBAAqB;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AAAA,EACA,gBAAgB;AAAA,IACd,UAAuBC;AAAA,IACvB,SAAsBC;AAAA,IACtB;AAAA,EACF;AACF;","names":["config","examples_exports","env_exports","step_exports","env_exports","push","simulation","config","step_exports","init","orderEvent","getEvent","TOPIC_ARN","pageEvent","orderEvt","z","zodToSchema","z","SettingsSchema","z","MappingSchema","z","settings","zodToSchema","SettingsSchema","mapping","MappingSchema","mapping","settings","examples_exports","examples_exports","settings","mapping"]}
|
|
@@ -5,19 +5,27 @@ import { SNSClientConfig, CreateTopicCommandInput, PublishCommandInput, GetTopic
|
|
|
5
5
|
import { STSClientConfig, GetCallerIdentityCommandInput } from '@aws-sdk/client-sts';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The part of an AWS SDK v3 client this
|
|
9
|
-
*
|
|
10
|
-
* simulate) without a cast.
|
|
8
|
+
* The part of an AWS SDK v3 client this package calls: `send` with a command,
|
|
9
|
+
* and `destroy` on a client it created. The SDK clients satisfy it, and so
|
|
10
|
+
* does an injected mock (tests, simulate) without a cast.
|
|
11
11
|
*/
|
|
12
|
-
interface SendClient
|
|
12
|
+
interface SendClient {
|
|
13
13
|
send(command: object): Promise<unknown>;
|
|
14
|
+
destroy?(): void;
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
type FirehoseClientConstructor = new (config: FirehoseClientConfig) => SendClient;
|
|
18
|
+
type PutRecordBatchCommandConstructor = new (input: PutRecordBatchCommandInput) => {
|
|
19
|
+
readonly input: PutRecordBatchCommandInput;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Optional SDK overrides. Each one present wins over the SDK the package
|
|
23
|
+
* imports; tests and simulate inject mocks here.
|
|
24
|
+
*/
|
|
15
25
|
interface Env$1 extends DestinationServer.Env {
|
|
16
|
-
AWS
|
|
17
|
-
FirehoseClient
|
|
18
|
-
PutRecordBatchCommand
|
|
19
|
-
readonly input: PutRecordBatchCommandInput;
|
|
20
|
-
};
|
|
26
|
+
AWS?: {
|
|
27
|
+
FirehoseClient?: FirehoseClientConstructor;
|
|
28
|
+
PutRecordBatchCommand?: PutRecordBatchCommandConstructor;
|
|
21
29
|
};
|
|
22
30
|
}
|
|
23
31
|
|
|
@@ -29,50 +37,45 @@ declare namespace env$1 {
|
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
40
|
+
* The copy-paste config: the stream, its region, and keys from `$secret`.
|
|
41
|
+
* `init` builds one client from it, offline, with a per-attempt timeout of a
|
|
42
|
+
* quarter of the collector's 10 s race, so the SDK's three attempts end
|
|
43
|
+
* before the collector stops waiting.
|
|
34
44
|
*/
|
|
45
|
+
declare const init$1: Flow.StepExample;
|
|
35
46
|
declare const firehoseRecord: Flow.StepExample;
|
|
36
|
-
/**
|
|
37
|
-
* Order event -- same pattern, full event serialized in Records[0].Data.
|
|
38
|
-
*/
|
|
39
47
|
declare const orderEvent$1: Flow.StepExample;
|
|
40
|
-
/**
|
|
41
|
-
* User signup -- full event including user fields is serialized to Firehose.
|
|
42
|
-
*/
|
|
43
48
|
declare const userSignupEvent: Flow.StepExample;
|
|
49
|
+
declare const mappedRecord: Flow.StepExample;
|
|
44
50
|
|
|
45
51
|
declare const step$1_firehoseRecord: typeof firehoseRecord;
|
|
52
|
+
declare const step$1_mappedRecord: typeof mappedRecord;
|
|
46
53
|
declare const step$1_userSignupEvent: typeof userSignupEvent;
|
|
47
54
|
declare namespace step$1 {
|
|
48
|
-
export { step$1_firehoseRecord as firehoseRecord, orderEvent$1 as orderEvent, step$1_userSignupEvent as userSignupEvent };
|
|
55
|
+
export { step$1_firehoseRecord as firehoseRecord, init$1 as init, step$1_mappedRecord as mappedRecord, orderEvent$1 as orderEvent, step$1_userSignupEvent as userSignupEvent };
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
declare namespace index$1 {
|
|
52
59
|
export { env$1 as env, step$1 as step };
|
|
53
60
|
}
|
|
54
61
|
|
|
55
|
-
/**
|
|
56
|
-
* The part of an AWS SDK v3 client this destination calls: `send` with a
|
|
57
|
-
* command. `SNSClient` and `STSClient` satisfy it, and so does an injected
|
|
58
|
-
* mock (tests, simulate) without a cast.
|
|
59
|
-
*/
|
|
60
|
-
interface SendClient {
|
|
61
|
-
send(command: object): Promise<unknown>;
|
|
62
|
-
}
|
|
63
62
|
/** An AWS SDK v3 command class, as far as this destination builds one. */
|
|
64
63
|
type CommandConstructor<Input> = new (input: Input) => {
|
|
65
64
|
readonly input: Input;
|
|
66
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Optional SDK overrides. Each one present wins over the SDK the package
|
|
68
|
+
* imports; tests and simulate inject mocks here.
|
|
69
|
+
*/
|
|
67
70
|
interface Env extends DestinationServer.Env {
|
|
68
|
-
AWS
|
|
69
|
-
SNSClient
|
|
70
|
-
CreateTopicCommand
|
|
71
|
-
PublishCommand
|
|
72
|
-
GetTopicAttributesCommand
|
|
73
|
-
SubscribeCommand
|
|
74
|
-
STSClient
|
|
75
|
-
GetCallerIdentityCommand
|
|
71
|
+
AWS?: {
|
|
72
|
+
SNSClient?: new (config: SNSClientConfig) => SendClient;
|
|
73
|
+
CreateTopicCommand?: CommandConstructor<CreateTopicCommandInput>;
|
|
74
|
+
PublishCommand?: CommandConstructor<PublishCommandInput>;
|
|
75
|
+
GetTopicAttributesCommand?: CommandConstructor<GetTopicAttributesCommandInput>;
|
|
76
|
+
SubscribeCommand?: CommandConstructor<SubscribeCommandInput>;
|
|
77
|
+
STSClient?: new (config: STSClientConfig) => SendClient;
|
|
78
|
+
GetCallerIdentityCommand?: CommandConstructor<GetCallerIdentityCommandInput>;
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -86,15 +89,24 @@ declare namespace env {
|
|
|
86
89
|
export { env_push as push, env_simulation as simulation };
|
|
87
90
|
}
|
|
88
91
|
|
|
92
|
+
/**
|
|
93
|
+
* The copy-paste config: the topic ARN, which also names the region, and
|
|
94
|
+
* keys from `$secret`. `init` builds one client from it, offline; nothing is
|
|
95
|
+
* sent until the first event.
|
|
96
|
+
*/
|
|
97
|
+
declare const init: Flow.StepExample;
|
|
89
98
|
declare const pageView: Flow.StepExample;
|
|
90
99
|
declare const orderEvent: Flow.StepExample;
|
|
91
100
|
declare const attributedPublish: Flow.StepExample;
|
|
101
|
+
declare const mappedMessage: Flow.StepExample;
|
|
92
102
|
|
|
93
103
|
declare const step_attributedPublish: typeof attributedPublish;
|
|
104
|
+
declare const step_init: typeof init;
|
|
105
|
+
declare const step_mappedMessage: typeof mappedMessage;
|
|
94
106
|
declare const step_orderEvent: typeof orderEvent;
|
|
95
107
|
declare const step_pageView: typeof pageView;
|
|
96
108
|
declare namespace step {
|
|
97
|
-
export { step_attributedPublish as attributedPublish, step_orderEvent as orderEvent, step_pageView as pageView };
|
|
109
|
+
export { step_attributedPublish as attributedPublish, step_init as init, step_mappedMessage as mappedMessage, step_orderEvent as orderEvent, step_pageView as pageView };
|
|
98
110
|
}
|
|
99
111
|
|
|
100
112
|
declare const index_env: typeof env;
|