@walkeros/server-destination-aws 4.8.1 → 4.8.3-next-1793115089237
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 +51 -3
- package/dist/dev.d.mts +22 -4
- package/dist/dev.d.ts +22 -4
- 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 +22 -4
- package/dist/examples/index.d.ts +22 -4
- package/dist/examples/index.js +108 -51
- package/dist/examples/index.mjs +103 -46
- 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 +1508 -1105
- package/package.json +6 -4
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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Y,WAAW;;;AIhB5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAI;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;;;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"]}
|
|
1
|
+
{"version":3,"sources":["../src/firehose/examples/index.ts","../src/firehose/examples/env.ts","../src/firehose/examples/step.ts","../src/firehose/examples/minimal.ts","../src/sns/examples/index.ts","../src/sns/examples/env.ts","../src/sns/examples/step.ts","../src/sns/examples/minimal.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';\nexport { minimal } from './minimal';\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 { createEvent, getEvent } from '@walkeros/core';\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; each record's bytes are written out below.\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: 1700001000000,\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: 1700001001000,\n data: { id: 'ORD-400', value: 99.99, currency: 'EUR' },\n source: { type: 'express', platform: 'server' },\n});\n\nconst signupEvt = createEvent({\n name: 'user signup',\n id: 'ev-1700001002',\n timestamp: 1700001002000,\n data: { plan: 'pro', source: 'landing-page' },\n user: { id: 'usr-789', email: 'new@example.com' },\n source: { type: 'express', platform: 'server' },\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: [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [\n {\n Data: Buffer.from(\n '{\"name\":\"page view\",\"data\":{\"title\":\"Home\",\"url\":\"https://example.com/\"},\"context\":{\"dev\":[\"test\",1]},\"globals\":{\"pagegroup\":\"docs\"},\"custom\":{\"completely\":\"random\"},\"user\":{\"id\":\"us3r\",\"device\":\"c00k13\",\"session\":\"s3ss10n\"},\"nested\":[{\"entity\":\"child\",\"data\":{\"is\":\"subordinated\"}}],\"consent\":{\"functional\":true},\"id\":\"ev-1700001000\",\"trigger\":\"load\",\"entity\":\"page\",\"action\":\"view\",\"timestamp\":1700001000000,\"timing\":3.14,\"source\":{\"count\":1,\"trace\":\"0a1b2c3d4e5f60718293a4b5c6d7e8f9\",\"type\":\"express\",\"platform\":\"server\"}}\\n',\n ),\n },\n ],\n },\n ],\n ],\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: [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [\n {\n Data: Buffer.from(\n '{\"name\":\"order complete\",\"data\":{\"id\":\"ORD-400\",\"value\":99.99,\"currency\":\"EUR\"},\"context\":{\"shopping\":[\"complete\",0]},\"globals\":{\"pagegroup\":\"shop\"},\"custom\":{\"completely\":\"random\"},\"user\":{\"id\":\"us3r\",\"device\":\"c00k13\",\"session\":\"s3ss10n\"},\"nested\":[{\"entity\":\"product\",\"data\":{\"id\":\"ers\",\"name\":\"Everyday Ruck Snack\",\"color\":\"black\",\"size\":\"l\",\"price\":420},\"context\":{\"shopping\":[\"complete\",0]},\"nested\":[]},{\"entity\":\"product\",\"data\":{\"id\":\"cc\",\"name\":\"Cool Cap\",\"size\":\"one size\",\"price\":42},\"context\":{\"shopping\":[\"complete\",0]},\"nested\":[]},{\"entity\":\"gift\",\"data\":{\"name\":\"Surprise\"},\"context\":{\"shopping\":[\"complete\",0]},\"nested\":[]}],\"consent\":{\"functional\":true},\"id\":\"ev-1700001001\",\"trigger\":\"load\",\"entity\":\"order\",\"action\":\"complete\",\"timestamp\":1700001001000,\"timing\":3.14,\"source\":{\"count\":1,\"trace\":\"0a1b2c3d4e5f60718293a4b5c6d7e8f9\",\"type\":\"express\",\"platform\":\"server\"}}\\n',\n ),\n },\n ],\n },\n ],\n ],\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: [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [\n {\n Data: Buffer.from(\n '{\"name\":\"user signup\",\"data\":{\"plan\":\"pro\",\"source\":\"landing-page\"},\"context\":{\"dev\":[\"test\",1]},\"globals\":{\"lang\":\"elb\"},\"custom\":{\"completely\":\"random\"},\"user\":{\"id\":\"usr-789\",\"email\":\"new@example.com\"},\"nested\":[{\"entity\":\"child\",\"data\":{\"is\":\"subordinated\"}}],\"consent\":{\"functional\":true},\"id\":\"ev-1700001002\",\"trigger\":\"test\",\"entity\":\"user\",\"action\":\"signup\",\"timestamp\":1700001002000,\"timing\":3.14,\"source\":{\"count\":1,\"trace\":\"0a1b2c3d4e5f60718293a4b5c6d7e8f9\",\"type\":\"express\",\"platform\":\"server\"}}\\n',\n ),\n },\n ],\n },\n ],\n ],\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.value',\n },\n },\n },\n out: [\n [\n 'client.send',\n {\n DeliveryStreamName: STREAM,\n Records: [\n {\n Data: Buffer.from(\n '{\"id\":\"ev-1700001001\",\"name\":\"order complete\",\"order_id\":\"ORD-400\",\"total\":99.99}\\n',\n ),\n },\n ],\n },\n ],\n ],\n};\n\n/** A silent rule sends no record to Firehose. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no record to Firehose.',\n in: pageEvent,\n mapping: { silent: true },\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/**\n * The setting Firehose needs to deliver: the stream name. The region and the\n * credentials come from the AWS environment.\n */\nexport const minimal: Flow.MinimalExample = {\n settings: { streamName: 'walkeros-events' },\n};\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\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: 1700001000000,\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: 1700001001000,\n data: { id: 'ORD-400', value: 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: 1700001002000,\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.value' },\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\n/** A silent rule publishes no message to SNS. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true publishes no message to SNS.',\n in: pageEvent,\n mapping: { silent: true },\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/**\n * The setting SNS needs to deliver: the topic ARN. The credentials come from\n * the AWS environment.\n */\nexport const minimal: Flow.MinimalExample = {\n settings: {\n topicArn: 'arn:aws:sns:eu-central-1:123456789012:walkeros-events',\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\n .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 .refine(\n (settings) =>\n settings.streamName !== undefined ||\n settings.firehose?.streamName !== undefined,\n { message: 'Set settings.streamName' },\n )\n // The same rule in JSON Schema: the stream is named in one of both forms.\n .meta({\n anyOf: [\n { required: ['streamName'] },\n {\n required: ['firehose'],\n properties: { firehose: { required: ['streamName'] } },\n },\n ],\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\n .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 .refine(\n (settings) =>\n settings.topicArn !== undefined || settings.topicName !== undefined,\n { message: 'Set settings.topicArn or settings.topicName' },\n )\n // The same rule in JSON Schema: one of both names the topic.\n .meta({\n anyOf: [{ required: ['topicArn'] }, { required: ['topicName'] }],\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. 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; the AWS error itself stays on the error as its cause. 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. Code config 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;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;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,QA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AqB;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","minimal","step_exports","env_exports","push","simulation","config","step_exports","init","orderEvent","silentRule","getEvent","TOPIC_ARN","pageEvent","orderEvt","minimal","settings","z","zodToSchema","z","SettingsSchema","settings","z","MappingSchema","z","settings","zodToSchema","SettingsSchema","mapping","MappingSchema","mapping","settings","examples_exports","examples_exports","settings","mapping"]}
|
|
@@ -47,16 +47,24 @@ declare const firehoseRecord: Flow.StepExample;
|
|
|
47
47
|
declare const orderEvent$1: Flow.StepExample;
|
|
48
48
|
declare const userSignupEvent: Flow.StepExample;
|
|
49
49
|
declare const mappedRecord: Flow.StepExample;
|
|
50
|
+
/** A silent rule sends no record to Firehose. */
|
|
51
|
+
declare const silentRule$1: Flow.StepExample;
|
|
50
52
|
|
|
51
53
|
declare const step$1_firehoseRecord: typeof firehoseRecord;
|
|
52
54
|
declare const step$1_mappedRecord: typeof mappedRecord;
|
|
53
55
|
declare const step$1_userSignupEvent: typeof userSignupEvent;
|
|
54
56
|
declare namespace step$1 {
|
|
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 };
|
|
57
|
+
export { step$1_firehoseRecord as firehoseRecord, init$1 as init, step$1_mappedRecord as mappedRecord, orderEvent$1 as orderEvent, silentRule$1 as silentRule, step$1_userSignupEvent as userSignupEvent };
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The setting Firehose needs to deliver: the stream name. The region and the
|
|
62
|
+
* credentials come from the AWS environment.
|
|
63
|
+
*/
|
|
64
|
+
declare const minimal$1: Flow.MinimalExample;
|
|
65
|
+
|
|
58
66
|
declare namespace index$1 {
|
|
59
|
-
export { env$1 as env, step$1 as step };
|
|
67
|
+
export { env$1 as env, minimal$1 as minimal, step$1 as step };
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
/** An AWS SDK v3 command class, as far as this destination builds one. */
|
|
@@ -99,20 +107,30 @@ declare const pageView: Flow.StepExample;
|
|
|
99
107
|
declare const orderEvent: Flow.StepExample;
|
|
100
108
|
declare const attributedPublish: Flow.StepExample;
|
|
101
109
|
declare const mappedMessage: Flow.StepExample;
|
|
110
|
+
/** A silent rule publishes no message to SNS. */
|
|
111
|
+
declare const silentRule: Flow.StepExample;
|
|
102
112
|
|
|
103
113
|
declare const step_attributedPublish: typeof attributedPublish;
|
|
104
114
|
declare const step_init: typeof init;
|
|
105
115
|
declare const step_mappedMessage: typeof mappedMessage;
|
|
106
116
|
declare const step_orderEvent: typeof orderEvent;
|
|
107
117
|
declare const step_pageView: typeof pageView;
|
|
118
|
+
declare const step_silentRule: typeof silentRule;
|
|
108
119
|
declare namespace step {
|
|
109
|
-
export { step_attributedPublish as attributedPublish, step_init as init, step_mappedMessage as mappedMessage, step_orderEvent as orderEvent, step_pageView as pageView };
|
|
120
|
+
export { step_attributedPublish as attributedPublish, step_init as init, step_mappedMessage as mappedMessage, step_orderEvent as orderEvent, step_pageView as pageView, step_silentRule as silentRule };
|
|
110
121
|
}
|
|
111
122
|
|
|
123
|
+
/**
|
|
124
|
+
* The setting SNS needs to deliver: the topic ARN. The credentials come from
|
|
125
|
+
* the AWS environment.
|
|
126
|
+
*/
|
|
127
|
+
declare const minimal: Flow.MinimalExample;
|
|
128
|
+
|
|
112
129
|
declare const index_env: typeof env;
|
|
130
|
+
declare const index_minimal: typeof minimal;
|
|
113
131
|
declare const index_step: typeof step;
|
|
114
132
|
declare namespace index {
|
|
115
|
-
export { index_env as env, index_step as step };
|
|
133
|
+
export { index_env as env, index_minimal as minimal, index_step as step };
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
export { env$1 as env, index$1 as firehose, index as sns, step$1 as step };
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -47,16 +47,24 @@ declare const firehoseRecord: Flow.StepExample;
|
|
|
47
47
|
declare const orderEvent$1: Flow.StepExample;
|
|
48
48
|
declare const userSignupEvent: Flow.StepExample;
|
|
49
49
|
declare const mappedRecord: Flow.StepExample;
|
|
50
|
+
/** A silent rule sends no record to Firehose. */
|
|
51
|
+
declare const silentRule$1: Flow.StepExample;
|
|
50
52
|
|
|
51
53
|
declare const step$1_firehoseRecord: typeof firehoseRecord;
|
|
52
54
|
declare const step$1_mappedRecord: typeof mappedRecord;
|
|
53
55
|
declare const step$1_userSignupEvent: typeof userSignupEvent;
|
|
54
56
|
declare namespace step$1 {
|
|
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 };
|
|
57
|
+
export { step$1_firehoseRecord as firehoseRecord, init$1 as init, step$1_mappedRecord as mappedRecord, orderEvent$1 as orderEvent, silentRule$1 as silentRule, step$1_userSignupEvent as userSignupEvent };
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The setting Firehose needs to deliver: the stream name. The region and the
|
|
62
|
+
* credentials come from the AWS environment.
|
|
63
|
+
*/
|
|
64
|
+
declare const minimal$1: Flow.MinimalExample;
|
|
65
|
+
|
|
58
66
|
declare namespace index$1 {
|
|
59
|
-
export { env$1 as env, step$1 as step };
|
|
67
|
+
export { env$1 as env, minimal$1 as minimal, step$1 as step };
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
/** An AWS SDK v3 command class, as far as this destination builds one. */
|
|
@@ -99,20 +107,30 @@ declare const pageView: Flow.StepExample;
|
|
|
99
107
|
declare const orderEvent: Flow.StepExample;
|
|
100
108
|
declare const attributedPublish: Flow.StepExample;
|
|
101
109
|
declare const mappedMessage: Flow.StepExample;
|
|
110
|
+
/** A silent rule publishes no message to SNS. */
|
|
111
|
+
declare const silentRule: Flow.StepExample;
|
|
102
112
|
|
|
103
113
|
declare const step_attributedPublish: typeof attributedPublish;
|
|
104
114
|
declare const step_init: typeof init;
|
|
105
115
|
declare const step_mappedMessage: typeof mappedMessage;
|
|
106
116
|
declare const step_orderEvent: typeof orderEvent;
|
|
107
117
|
declare const step_pageView: typeof pageView;
|
|
118
|
+
declare const step_silentRule: typeof silentRule;
|
|
108
119
|
declare namespace step {
|
|
109
|
-
export { step_attributedPublish as attributedPublish, step_init as init, step_mappedMessage as mappedMessage, step_orderEvent as orderEvent, step_pageView as pageView };
|
|
120
|
+
export { step_attributedPublish as attributedPublish, step_init as init, step_mappedMessage as mappedMessage, step_orderEvent as orderEvent, step_pageView as pageView, step_silentRule as silentRule };
|
|
110
121
|
}
|
|
111
122
|
|
|
123
|
+
/**
|
|
124
|
+
* The setting SNS needs to deliver: the topic ARN. The credentials come from
|
|
125
|
+
* the AWS environment.
|
|
126
|
+
*/
|
|
127
|
+
declare const minimal: Flow.MinimalExample;
|
|
128
|
+
|
|
112
129
|
declare const index_env: typeof env;
|
|
130
|
+
declare const index_minimal: typeof minimal;
|
|
113
131
|
declare const index_step: typeof step;
|
|
114
132
|
declare namespace index {
|
|
115
|
-
export { index_env as env, index_step as step };
|
|
133
|
+
export { index_env as env, index_minimal as minimal, index_step as step };
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
export { env$1 as env, index$1 as firehose, index as sns, step$1 as step };
|
package/dist/examples/index.js
CHANGED
|
@@ -31,6 +31,7 @@ module.exports = __toCommonJS(examples_exports3);
|
|
|
31
31
|
var examples_exports = {};
|
|
32
32
|
__export(examples_exports, {
|
|
33
33
|
env: () => env_exports,
|
|
34
|
+
minimal: () => minimal,
|
|
34
35
|
step: () => step_exports
|
|
35
36
|
});
|
|
36
37
|
|
|
@@ -86,23 +87,10 @@ __export(step_exports, {
|
|
|
86
87
|
init: () => init,
|
|
87
88
|
mappedRecord: () => mappedRecord,
|
|
88
89
|
orderEvent: () => orderEvent,
|
|
90
|
+
silentRule: () => silentRule,
|
|
89
91
|
userSignupEvent: () => userSignupEvent
|
|
90
92
|
});
|
|
91
|
-
var import_core2 = require("@walkeros/core");
|
|
92
|
-
|
|
93
|
-
// src/lib/payload.ts
|
|
94
93
|
var import_core = require("@walkeros/core");
|
|
95
|
-
|
|
96
|
-
// src/firehose/lib/records.ts
|
|
97
|
-
function toRecordData(payload, newline = true) {
|
|
98
|
-
const json = JSON.stringify(payload);
|
|
99
|
-
if (typeof json !== "string")
|
|
100
|
-
throw new TypeError("The payload does not serialize to JSON.");
|
|
101
|
-
return Buffer.from(newline ? `${json}
|
|
102
|
-
` : json);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// src/firehose/examples/step.ts
|
|
106
94
|
var STREAM = "walkeros-events";
|
|
107
95
|
var init = {
|
|
108
96
|
title: "Initialization",
|
|
@@ -128,56 +116,88 @@ var init = {
|
|
|
128
116
|
]
|
|
129
117
|
]
|
|
130
118
|
};
|
|
131
|
-
var pageEvent = (0,
|
|
119
|
+
var pageEvent = (0, import_core.getEvent)("page view", {
|
|
132
120
|
id: "ev-1700001000",
|
|
133
|
-
timestamp:
|
|
121
|
+
timestamp: 1700001e6,
|
|
134
122
|
data: { title: "Home", url: "https://example.com/" },
|
|
135
123
|
source: { type: "express", platform: "server" }
|
|
136
124
|
});
|
|
137
|
-
var orderEvt = (0,
|
|
125
|
+
var orderEvt = (0, import_core.getEvent)("order complete", {
|
|
138
126
|
id: "ev-1700001001",
|
|
139
|
-
timestamp:
|
|
140
|
-
data: { id: "ORD-400",
|
|
127
|
+
timestamp: 1700001001e3,
|
|
128
|
+
data: { id: "ORD-400", value: 99.99, currency: "EUR" },
|
|
141
129
|
source: { type: "express", platform: "server" }
|
|
142
130
|
});
|
|
143
|
-
var signupEvt = (0,
|
|
131
|
+
var signupEvt = (0, import_core.createEvent)({
|
|
132
|
+
name: "user signup",
|
|
144
133
|
id: "ev-1700001002",
|
|
145
|
-
timestamp:
|
|
134
|
+
timestamp: 1700001002e3,
|
|
146
135
|
data: { plan: "pro", source: "landing-page" },
|
|
147
136
|
user: { id: "usr-789", email: "new@example.com" },
|
|
148
137
|
source: { type: "express", platform: "server" }
|
|
149
138
|
});
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
var firehoseRecord = {
|
|
140
|
+
title: "Page view record",
|
|
141
|
+
description: "A page view is sent to Firehose as one record: the full event as JSON followed by a newline.",
|
|
142
|
+
in: pageEvent,
|
|
143
|
+
mapping: void 0,
|
|
144
|
+
out: [
|
|
152
145
|
[
|
|
153
146
|
"client.send",
|
|
154
147
|
{
|
|
155
148
|
DeliveryStreamName: STREAM,
|
|
156
|
-
Records: [
|
|
149
|
+
Records: [
|
|
150
|
+
{
|
|
151
|
+
Data: Buffer.from(
|
|
152
|
+
'{"name":"page view","data":{"title":"Home","url":"https://example.com/"},"context":{"dev":["test",1]},"globals":{"pagegroup":"docs"},"custom":{"completely":"random"},"user":{"id":"us3r","device":"c00k13","session":"s3ss10n"},"nested":[{"entity":"child","data":{"is":"subordinated"}}],"consent":{"functional":true},"id":"ev-1700001000","trigger":"load","entity":"page","action":"view","timestamp":1700001000000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
]
|
|
157
156
|
}
|
|
158
157
|
]
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
var firehoseRecord = {
|
|
162
|
-
title: "Page view record",
|
|
163
|
-
description: "A page view is sent to Firehose as one record: the full event as JSON followed by a newline.",
|
|
164
|
-
in: pageEvent,
|
|
165
|
-
mapping: void 0,
|
|
166
|
-
out: sent(pageEvent)
|
|
158
|
+
]
|
|
167
159
|
};
|
|
168
160
|
var orderEvent = {
|
|
169
161
|
title: "Order record",
|
|
170
162
|
description: "An order complete event is serialized and delivered to Firehose as one newline-terminated record.",
|
|
171
163
|
in: orderEvt,
|
|
172
164
|
mapping: void 0,
|
|
173
|
-
out:
|
|
165
|
+
out: [
|
|
166
|
+
[
|
|
167
|
+
"client.send",
|
|
168
|
+
{
|
|
169
|
+
DeliveryStreamName: STREAM,
|
|
170
|
+
Records: [
|
|
171
|
+
{
|
|
172
|
+
Data: Buffer.from(
|
|
173
|
+
'{"name":"order complete","data":{"id":"ORD-400","value":99.99,"currency":"EUR"},"context":{"shopping":["complete",0]},"globals":{"pagegroup":"shop"},"custom":{"completely":"random"},"user":{"id":"us3r","device":"c00k13","session":"s3ss10n"},"nested":[{"entity":"product","data":{"id":"ers","name":"Everyday Ruck Snack","color":"black","size":"l","price":420},"context":{"shopping":["complete",0]},"nested":[]},{"entity":"product","data":{"id":"cc","name":"Cool Cap","size":"one size","price":42},"context":{"shopping":["complete",0]},"nested":[]},{"entity":"gift","data":{"name":"Surprise"},"context":{"shopping":["complete",0]},"nested":[]}],"consent":{"functional":true},"id":"ev-1700001001","trigger":"load","entity":"order","action":"complete","timestamp":1700001001000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
]
|
|
174
180
|
};
|
|
175
181
|
var userSignupEvent = {
|
|
176
182
|
title: "User signup record",
|
|
177
183
|
description: "A user signup event including user fields is streamed to Firehose as a JSON record.",
|
|
178
184
|
in: signupEvt,
|
|
179
185
|
mapping: void 0,
|
|
180
|
-
out:
|
|
186
|
+
out: [
|
|
187
|
+
[
|
|
188
|
+
"client.send",
|
|
189
|
+
{
|
|
190
|
+
DeliveryStreamName: STREAM,
|
|
191
|
+
Records: [
|
|
192
|
+
{
|
|
193
|
+
Data: Buffer.from(
|
|
194
|
+
'{"name":"user signup","data":{"plan":"pro","source":"landing-page"},"context":{"dev":["test",1]},"globals":{"lang":"elb"},"custom":{"completely":"random"},"user":{"id":"usr-789","email":"new@example.com"},"nested":[{"entity":"child","data":{"is":"subordinated"}}],"consent":{"functional":true},"id":"ev-1700001002","trigger":"test","entity":"user","action":"signup","timestamp":1700001002000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
]
|
|
181
201
|
};
|
|
182
202
|
var mappedRecord = {
|
|
183
203
|
title: "Mapped record",
|
|
@@ -189,22 +209,44 @@ var mappedRecord = {
|
|
|
189
209
|
id: "id",
|
|
190
210
|
name: "name",
|
|
191
211
|
order_id: "data.id",
|
|
192
|
-
total: "data.
|
|
212
|
+
total: "data.value"
|
|
193
213
|
}
|
|
194
214
|
}
|
|
195
215
|
},
|
|
196
|
-
out:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
216
|
+
out: [
|
|
217
|
+
[
|
|
218
|
+
"client.send",
|
|
219
|
+
{
|
|
220
|
+
DeliveryStreamName: STREAM,
|
|
221
|
+
Records: [
|
|
222
|
+
{
|
|
223
|
+
Data: Buffer.from(
|
|
224
|
+
'{"id":"ev-1700001001","name":"order complete","order_id":"ORD-400","total":99.99}\n'
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
]
|
|
231
|
+
};
|
|
232
|
+
var silentRule = {
|
|
233
|
+
public: false,
|
|
234
|
+
description: "A rule with silent: true sends no record to Firehose.",
|
|
235
|
+
in: pageEvent,
|
|
236
|
+
mapping: { silent: true },
|
|
237
|
+
out: []
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/firehose/examples/minimal.ts
|
|
241
|
+
var minimal = {
|
|
242
|
+
settings: { streamName: "walkeros-events" }
|
|
202
243
|
};
|
|
203
244
|
|
|
204
245
|
// src/sns/examples/index.ts
|
|
205
246
|
var examples_exports2 = {};
|
|
206
247
|
__export(examples_exports2, {
|
|
207
248
|
env: () => env_exports2,
|
|
249
|
+
minimal: () => minimal2,
|
|
208
250
|
step: () => step_exports2
|
|
209
251
|
});
|
|
210
252
|
|
|
@@ -295,9 +337,10 @@ __export(step_exports2, {
|
|
|
295
337
|
init: () => init2,
|
|
296
338
|
mappedMessage: () => mappedMessage,
|
|
297
339
|
orderEvent: () => orderEvent2,
|
|
298
|
-
pageView: () => pageView
|
|
340
|
+
pageView: () => pageView,
|
|
341
|
+
silentRule: () => silentRule2
|
|
299
342
|
});
|
|
300
|
-
var
|
|
343
|
+
var import_core2 = require("@walkeros/core");
|
|
301
344
|
var TOPIC_ARN2 = "arn:aws:sns:eu-central-1:123456789012:walkeros-events";
|
|
302
345
|
var FIFO_ARN = "arn:aws:sns:eu-central-1:123456789012:walkeros-events.fifo";
|
|
303
346
|
var init2 = {
|
|
@@ -324,22 +367,22 @@ var init2 = {
|
|
|
324
367
|
]
|
|
325
368
|
]
|
|
326
369
|
};
|
|
327
|
-
var pageEvent2 = (0,
|
|
370
|
+
var pageEvent2 = (0, import_core2.getEvent)("page view", {
|
|
328
371
|
id: "ev-1700001000",
|
|
329
|
-
timestamp:
|
|
372
|
+
timestamp: 1700001e6,
|
|
330
373
|
data: { title: "Home", url: "https://example.com/" },
|
|
331
374
|
source: { type: "express", platform: "server" }
|
|
332
375
|
});
|
|
333
|
-
var orderEvt2 = (0,
|
|
376
|
+
var orderEvt2 = (0, import_core2.getEvent)("order complete", {
|
|
334
377
|
id: "ev-1700001001",
|
|
335
|
-
timestamp:
|
|
336
|
-
data: { id: "ORD-400",
|
|
378
|
+
timestamp: 1700001001e3,
|
|
379
|
+
data: { id: "ORD-400", value: 99.99, currency: "EUR" },
|
|
337
380
|
user: { id: "usr-789" },
|
|
338
381
|
source: { type: "express", platform: "server" }
|
|
339
382
|
});
|
|
340
|
-
var productViewEvt = (0,
|
|
383
|
+
var productViewEvt = (0, import_core2.getEvent)("product view", {
|
|
341
384
|
id: "ev-1700001002",
|
|
342
|
-
timestamp:
|
|
385
|
+
timestamp: 1700001002e3,
|
|
343
386
|
data: { id: "SKU-1", tenant_id: "acme" },
|
|
344
387
|
source: { type: "express", platform: "server" }
|
|
345
388
|
});
|
|
@@ -407,7 +450,7 @@ var mappedMessage = {
|
|
|
407
450
|
in: orderEvt2,
|
|
408
451
|
mapping: {
|
|
409
452
|
data: {
|
|
410
|
-
map: { id: "id", name: "name", order_id: "data.id", total: "data.
|
|
453
|
+
map: { id: "id", name: "name", order_id: "data.id", total: "data.value" }
|
|
411
454
|
}
|
|
412
455
|
},
|
|
413
456
|
out: [
|
|
@@ -425,6 +468,20 @@ var mappedMessage = {
|
|
|
425
468
|
]
|
|
426
469
|
]
|
|
427
470
|
};
|
|
471
|
+
var silentRule2 = {
|
|
472
|
+
public: false,
|
|
473
|
+
description: "A rule with silent: true publishes no message to SNS.",
|
|
474
|
+
in: pageEvent2,
|
|
475
|
+
mapping: { silent: true },
|
|
476
|
+
out: []
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// src/sns/examples/minimal.ts
|
|
480
|
+
var minimal2 = {
|
|
481
|
+
settings: {
|
|
482
|
+
topicArn: "arn:aws:sns:eu-central-1:123456789012:walkeros-events"
|
|
483
|
+
}
|
|
484
|
+
};
|
|
428
485
|
// Annotate the CommonJS export names for ESM import in node:
|
|
429
486
|
0 && (module.exports = {
|
|
430
487
|
env,
|