@walkeros/server-destination-kafka 4.7.0-next-1790245733116 → 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 +25 -14
- 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.js +1 -1
- package/dist/examples/index.mjs +1 -1
- package/dist/walkerOS.json +9 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
# @walkeros/server-destination-kafka
|
|
2
2
|
|
|
3
|
-
## 4.7.0
|
|
3
|
+
## 4.7.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 74821ed: Simulate records every vendor call through one recorder, `observeEnv`
|
|
8
|
+
from `@walkeros/core`, and runs offline: BigQuery, Data Manager and the
|
|
9
|
+
Sheets, GCS and S3 stores reach the network through `env`. Client and `Env`
|
|
10
|
+
types of BigQuery, Firehose, PostHog, SQS and Pub/Sub are structural.
|
|
11
|
+
`@walkeros/cli` exports `resolveExportName` and `selectDevExamples` and drops
|
|
12
|
+
`findExample` and `compareOutput`.
|
|
13
|
+
- Updated dependencies [74821ed]
|
|
8
14
|
- Updated dependencies [06b498a]
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- Updated dependencies [
|
|
15
|
+
- Updated dependencies [74821ed]
|
|
16
|
+
- Updated dependencies [64b06de]
|
|
17
|
+
- Updated dependencies [4b4937f]
|
|
18
|
+
- Updated dependencies [74821ed]
|
|
19
|
+
- Updated dependencies [74821ed]
|
|
20
|
+
- Updated dependencies [74821ed]
|
|
11
21
|
- Updated dependencies [06b498a]
|
|
12
|
-
- Updated dependencies [
|
|
13
|
-
- Updated dependencies [
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- Updated dependencies [
|
|
17
|
-
- Updated dependencies [
|
|
18
|
-
- Updated dependencies [
|
|
19
|
-
- Updated dependencies [
|
|
20
|
-
|
|
21
|
-
- @walkeros/
|
|
22
|
+
- Updated dependencies [74821ed]
|
|
23
|
+
- Updated dependencies [74821ed]
|
|
24
|
+
- Updated dependencies [74821ed]
|
|
25
|
+
- Updated dependencies [74821ed]
|
|
26
|
+
- Updated dependencies [74821ed]
|
|
27
|
+
- Updated dependencies [e860006]
|
|
28
|
+
- Updated dependencies [74821ed]
|
|
29
|
+
- Updated dependencies [74821ed]
|
|
30
|
+
- Updated dependencies [4f89234]
|
|
31
|
+
- @walkeros/core@4.7.0
|
|
32
|
+
- @walkeros/server-core@4.7.0
|
|
22
33
|
|
|
23
34
|
## 4.6.1
|
|
24
35
|
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var a in i)t(e,a,{get:i[a],enumerable:!0})},s={};r(s,{examples:()=>S,schemas:()=>n}),module.exports=(e=s,((e,r,s,n)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of a(r))o.call(e,c)||c===s||t(e,c,{get:()=>r[c],enumerable:!(n=i(r,c))||n.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n={};r(n,{KafkaSettingsSchema:()=>m,MappingSchema:()=>b,SettingsSchema:()=>u,SetupSchema:()=>
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var a in i)t(e,a,{get:i[a],enumerable:!0})},s={};r(s,{examples:()=>S,schemas:()=>n}),module.exports=(e=s,((e,r,s,n)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of a(r))o.call(e,c)||c===s||t(e,c,{get:()=>r[c],enumerable:!(n=i(r,c))||n.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n={};r(n,{KafkaSettingsSchema:()=>m,MappingSchema:()=>b,SettingsSchema:()=>u,SetupSchema:()=>k,mapping:()=>y,settings:()=>h,setup:()=>z});var c=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),d=p.z.object({mechanism:p.z.enum(["plain","scram-sha-256","scram-sha-512","aws","oauthbearer"]).describe("SASL authentication mechanism."),username:p.z.string().optional().describe("Username for plain/scram mechanisms."),password:p.z.string().optional().describe("Password for plain/scram mechanisms."),accessKeyId:p.z.string().optional().describe("AWS access key ID for IAM auth (mechanism: aws)."),secretAccessKey:p.z.string().optional().describe("AWS secret access key for IAM auth (mechanism: aws)."),sessionToken:p.z.string().optional().describe("AWS session token for temporary credentials (mechanism: aws)."),authorizationIdentity:p.z.string().optional().describe("AWS authorization identity (mechanism: aws).")}),l=p.z.object({maxRetryTime:p.z.number().int().positive().optional().describe("Max total retry wait in ms. Default: 30000."),initialRetryTime:p.z.number().int().positive().optional().describe("First retry delay in ms. Default: 300."),retries:p.z.number().int().min(0).optional().describe("Max retry count. Default: 5.")}),m=p.z.object({brokers:p.z.array(p.z.string().min(1)).min(1).describe("Kafka broker addresses (host:port). At least one required."),clientId:p.z.string().optional().describe("Kafka client ID. Default: walkeros."),ssl:p.z.union([p.z.boolean(),p.z.record(p.z.string(),p.z.unknown())]).optional().describe("TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS."),sasl:d.optional().describe("SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc."),connectionTimeout:p.z.number().int().positive().optional().describe("Connection timeout in ms. Default: 1000."),requestTimeout:p.z.number().int().positive().optional().describe("Request timeout in ms. Default: 30000."),topic:p.z.string().min(1).describe("Target Kafka topic name."),acks:p.z.number().int().min(-1).max(1).optional().describe("Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1."),timeout:p.z.number().int().positive().optional().describe("Broker response timeout in ms. Default: 30000."),compression:p.z.enum(["none","gzip","snappy","lz4","zstd"]).optional().describe("Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages."),idempotent:p.z.boolean().optional().describe("Enable idempotent producer for exactly-once delivery. Default: false."),allowAutoTopicCreation:p.z.boolean().optional().describe("Allow auto-creation of topics on the broker. Default: false."),key:p.z.string().optional().describe("Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action."),headers:p.z.record(p.z.string(),p.z.string()).optional().describe("Static headers added to every message."),retry:l.optional().describe("Retry configuration for transient failures.")}),u=p.z.object({kafka:m.describe("Kafka connection and producer settings.")}),g=require("@walkeros/core/dev"),b=g.z.object({key:g.z.string().optional().describe("Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key."),topic:g.z.string().optional().describe("Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.")}),f=require("@walkeros/core/dev"),v=f.z.object({url:f.z.string().url().describe("Schema Registry URL."),subject:f.z.string().min(1).describe("Subject name, conventionally <topic>-value."),schemaType:f.z.enum(["AVRO","JSON","PROTOBUF"]).describe("Schema type."),schema:f.z.string().min(1).describe("The schema, stringified."),compatibility:f.z.enum(["BACKWARD","FORWARD","FULL","NONE","BACKWARD_TRANSITIVE","FORWARD_TRANSITIVE","FULL_TRANSITIVE"]).optional().describe("Subject compatibility level set after registration."),auth:f.z.object({username:f.z.string(),password:f.z.string()}).optional().describe("Optional Basic auth credentials.")}),k=f.z.object({topic:f.z.string().min(1).optional().describe("Topic name. Falls back to settings.kafka.topic if omitted."),numPartitions:f.z.number().int().positive().optional().describe("Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism."),replicationFactor:f.z.number().int().positive().optional().describe("Replication factor. Required at runtime. Must be <= broker count. No safe default."),configEntries:f.z.record(f.z.string(),f.z.string()).optional().describe('Topic-level config entries, e.g. { "retention.ms": "604800000" }.'),schemaRegistry:v.optional().describe("Optional Confluent Schema Registry binding."),validateOnly:f.z.boolean().optional().describe("Use kafkajs validateOnly mode (broker-side dry-run). Default: false.")}),h=(0,c.zodToSchema)(u),y=(0,c.zodToSchema)(b),z=(0,c.zodToSchema)(k),S={};r(S,{env:()=>w,step:()=>K});var w={};r(w,{push:()=>D,simulation:()=>O});var T=()=>Promise.resolve(),A=()=>Promise.resolve(),j=()=>Promise.resolve([]);var R=()=>({connect:T,disconnect:A,send:j});var D={Kafka:{Kafka:class{constructor(e){}producer(e){return R()}admin(){return{connect:()=>Promise.resolve(),disconnect:()=>Promise.resolve(),createTopics:()=>Promise.resolve(!0),fetchTopicMetadata:({topics:e})=>Promise.resolve({topics:(e??[]).map(e=>({name:e,partitions:[{partitionId:0,leader:0,replicas:[0],isr:[0]}]}))}),describeConfigs:({resources:e})=>Promise.resolve({resources:e.map(e=>({resourceName:e.name,configEntries:[]}))})}}},CompressionTypes:{None:0,GZIP:1,Snappy:2,LZ4:3,ZSTD:4}}},O=["call:Kafka.Kafka.producer.send"],K={};r(K,{defaultEvent:()=>I,ignoredEvent:()=>L,keyFromUser:()=>M,mappedData:()=>N,mappedEventName:()=>P,topicOverride:()=>q});var E=require("@walkeros/core"),I={title:"Default event",description:"An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.",in:(0,E.getEvent)("page view",{timestamp:1700000100}),out:[["producer.send",{topic:"walkeros-events",messages:[{key:"page_view",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000100"}],acks:-1,compression:1}]]},P={title:"Renamed event",description:"A mapping renames the event which also changes the default Kafka message key used for partitioning.",in:(0,E.getEvent)("order complete",{timestamp:1700000101}),mapping:{name:"purchase"},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"purchase",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000101"}],acks:-1,compression:1}]]},N={title:"Mapped payload",description:"A data mapping transforms the event payload before producing it as the Kafka message value.",in:(0,E.getEvent)("order complete",{timestamp:1700000102,data:{id:"ORD-400",total:99.99,currency:"EUR"}}),mapping:{name:"purchase",data:{map:{order_id:"data.id",revenue:"data.total",currency:"data.currency"}}},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"purchase",value:"json:data",headers:{"content-type":"application/json"},timestamp:"1700000102"}],acks:-1,compression:1}]]},M={title:"Key from user id",description:"A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.",in:(0,E.getEvent)("user signup",{timestamp:1700000103,user:{id:"usr-789"},data:{plan:"pro"}}),settings:{kafka:{brokers:["localhost:9092"],topic:"walkeros-events",key:"user.id"}},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"usr-789",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000103"}],acks:-1,compression:1}]]},q={title:"Topic override",description:"A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.",in:(0,E.getEvent)("order complete",{timestamp:1700000104,data:{id:"ORD-500",total:42}}),mapping:{settings:{topic:"orders-stream"}},out:[["producer.send",{topic:"orders-stream",messages:[{key:"order_complete",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000104"}],acks:-1,compression:1}]]},L={public:!1,in:(0,E.getEvent)("debug noise",{timestamp:1700000105}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, KafkaSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst SASLSchema = z.object({\n mechanism: z\n .enum(['plain', 'scram-sha-256', 'scram-sha-512', 'aws', 'oauthbearer'])\n .describe('SASL authentication mechanism.'),\n username: z\n .string()\n .optional()\n .describe('Username for plain/scram mechanisms.'),\n password: z\n .string()\n .optional()\n .describe('Password for plain/scram mechanisms.'),\n accessKeyId: z\n .string()\n .optional()\n .describe('AWS access key ID for IAM auth (mechanism: aws).'),\n secretAccessKey: z\n .string()\n .optional()\n .describe('AWS secret access key for IAM auth (mechanism: aws).'),\n sessionToken: z\n .string()\n .optional()\n .describe('AWS session token for temporary credentials (mechanism: aws).'),\n authorizationIdentity: z\n .string()\n .optional()\n .describe('AWS authorization identity (mechanism: aws).'),\n});\n\nconst RetrySchema = z.object({\n maxRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Max total retry wait in ms. Default: 30000.'),\n initialRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('First retry delay in ms. Default: 300.'),\n retries: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Max retry count. Default: 5.'),\n});\n\nexport const KafkaSettingsSchema = z.object({\n brokers: z\n .array(z.string().min(1))\n .min(1)\n .describe('Kafka broker addresses (host:port). At least one required.'),\n clientId: z\n .string()\n .optional()\n .describe('Kafka client ID. Default: walkeros.'),\n ssl: z\n .union([z.boolean(), z.record(z.string(), z.unknown())])\n .optional()\n .describe(\n 'TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS.',\n ),\n sasl: SASLSchema.optional().describe(\n 'SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc.',\n ),\n connectionTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Connection timeout in ms. Default: 1000.'),\n requestTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Request timeout in ms. Default: 30000.'),\n topic: z.string().min(1).describe('Target Kafka topic name.'),\n acks: z\n .number()\n .int()\n .min(-1)\n .max(1)\n .optional()\n .describe(\n 'Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1.',\n ),\n timeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Broker response timeout in ms. Default: 30000.'),\n compression: z\n .enum(['none', 'gzip', 'snappy', 'lz4', 'zstd'])\n .optional()\n .describe(\n 'Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages.',\n ),\n idempotent: z\n .boolean()\n .optional()\n .describe(\n 'Enable idempotent producer for exactly-once delivery. Default: false.',\n ),\n allowAutoTopicCreation: z\n .boolean()\n .optional()\n .describe('Allow auto-creation of topics on the broker. Default: false.'),\n key: z\n .string()\n .optional()\n .describe(\n 'Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action.',\n ),\n headers: z\n .record(z.string(), z.string())\n .optional()\n .describe('Static headers added to every message.'),\n retry: RetrySchema.optional().describe(\n 'Retry configuration for transient failures.',\n ),\n});\n\nexport const SettingsSchema = z.object({\n kafka: KafkaSettingsSchema.describe(\n 'Kafka connection and producer settings.',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n key: z\n .string()\n .optional()\n .describe(\n 'Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key.',\n ),\n topic: z\n .string()\n .optional()\n .describe(\n 'Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","// Zod schema for the Kafka destination's setup options.\n//\n// The runtime contract (in `setup.ts`) requires `numPartitions` and\n// `replicationFactor` and rejects the boolean form `setup: true` with an\n// actionable error. The \"no safe defaults\" rule is enforced at runtime, not\n// in this schema: configs frequently arrive from JSON where TS cannot enforce\n// required fields, and the runtime check is the single source of truth. This\n// schema therefore keeps both fields optional in shape, with the descriptions\n// noting the runtime requirement so MCP / IntelliSense surfaces the constraint\n// to authors.\nimport { z } from '@walkeros/core/dev';\n\nconst SchemaRegistrySchema = z.object({\n url: z.string().url().describe('Schema Registry URL.'),\n subject: z\n .string()\n .min(1)\n .describe('Subject name, conventionally <topic>-value.'),\n schemaType: z.enum(['AVRO', 'JSON', 'PROTOBUF']).describe('Schema type.'),\n schema: z.string().min(1).describe('The schema, stringified.'),\n compatibility: z\n .enum([\n 'BACKWARD',\n 'FORWARD',\n 'FULL',\n 'NONE',\n 'BACKWARD_TRANSITIVE',\n 'FORWARD_TRANSITIVE',\n 'FULL_TRANSITIVE',\n ])\n .optional()\n .describe('Subject compatibility level set after registration.'),\n auth: z\n .object({ username: z.string(), password: z.string() })\n .optional()\n .describe('Optional Basic auth credentials.'),\n});\n\nexport const SetupSchema = z.object({\n topic: z\n .string()\n .min(1)\n .optional()\n .describe('Topic name. Falls back to settings.kafka.topic if omitted.'),\n numPartitions: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism.',\n ),\n replicationFactor: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Replication factor. Required at runtime. Must be <= broker count. No safe default.',\n ),\n configEntries: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'Topic-level config entries, e.g. { \"retention.ms\": \"604800000\" }.',\n ),\n schemaRegistry: SchemaRegistrySchema.optional().describe(\n 'Optional Confluent Schema Registry binding.',\n ),\n validateOnly: z\n .boolean()\n .optional()\n .describe(\n 'Use kafkajs validateOnly mode (broker-side dry-run). Default: false.',\n ),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n\nexport { SchemaRegistrySchema };\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n KafkaAdminMock,\n KafkaClientConstructor,\n KafkaClientMock,\n KafkaProducerMock,\n ProducerRecord,\n ProducerConfig,\n KafkaClientConfig,\n CompressionTypesMap,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype ProducerConnect = () => Promise<void>;\ntype ProducerDisconnect = () => Promise<void>;\ntype ProducerSend = (record: ProducerRecord) => Promise<unknown>;\ntype KafkaProducerFactory = (config?: ProducerConfig) => KafkaProducerMock;\n\nconst asyncConnect: ProducerConnect = () => Promise.resolve();\nconst asyncDisconnect: ProducerDisconnect = () => Promise.resolve();\nconst asyncSend: ProducerSend = () => Promise.resolve([]);\n\nfunction createMockProducer(): KafkaProducerMock {\n return {\n connect: asyncConnect,\n disconnect: asyncDisconnect,\n send: asyncSend,\n };\n}\n\nconst mockProducerFactory: KafkaProducerFactory = () => createMockProducer();\n\nfunction createMockAdmin(): KafkaAdminMock {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => Promise.resolve(),\n createTopics: () => Promise.resolve(true),\n fetchTopicMetadata: ({ topics }) =>\n Promise.resolve({\n topics: (topics ?? []).map((name) => ({\n name,\n partitions: [{ partitionId: 0, leader: 0, replicas: [0], isr: [0] }],\n })),\n }),\n describeConfigs: ({ resources }) =>\n Promise.resolve({\n resources: resources.map((r) => ({\n resourceName: r.name,\n configEntries: [],\n })),\n }),\n };\n}\n\nclass MockKafkaClient implements KafkaClientMock {\n constructor(_config: KafkaClientConfig) {}\n producer(config?: ProducerConfig): KafkaProducerMock {\n return mockProducerFactory(config);\n }\n admin(): KafkaAdminMock {\n return createMockAdmin();\n }\n}\n\nconst MockKafkaConstructor: KafkaClientConstructor = MockKafkaClient;\n\nconst MockCompressionTypes: CompressionTypesMap = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n};\n\nexport const push: Env = {\n Kafka: {\n Kafka: MockKafkaConstructor,\n CompressionTypes: MockCompressionTypes,\n },\n};\n\nexport const simulation = ['call:producer.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KafkaStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event -- full WalkerOS.Event serialized as JSON to the configured\n * topic. Message key defaults to entity_action when no key path is set.\n */\nexport const defaultEvent: KafkaStepExample = {\n title: 'Default event',\n description:\n 'An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'page_view',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000100',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- rule.name renames the event, which also changes the\n * default message key when no key mapping is configured.\n */\nexport const mappedEventName: KafkaStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event which also changes the default Kafka message key used for partitioning.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n }),\n mapping: {\n name: 'purchase',\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000101',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped data -- data.map transforms the event payload. Value is the mapped\n * object serialized as JSON.\n */\nexport const mappedData: KafkaStepExample = {\n title: 'Mapped payload',\n description:\n 'A data mapping transforms the event payload before producing it as the Kafka message value.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n order_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:data',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000102',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Key from user -- settings.kafka.key path resolves the message key from\n * the event (here user.id).\n */\nexport const keyFromUser: KafkaStepExample = {\n title: 'Key from user id',\n description:\n 'A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.',\n in: getEvent('user signup', {\n timestamp: 1700000103,\n user: { id: 'usr-789' },\n data: { plan: 'pro' },\n }),\n settings: {\n kafka: {\n brokers: ['localhost:9092'],\n topic: 'walkeros-events',\n key: 'user.id',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'usr-789',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000103',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Topic override -- rule.settings.topic routes this rule to a different\n * topic than the destination default.\n */\nexport const topicOverride: KafkaStepExample = {\n title: 'Topic override',\n description:\n 'A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n topic: 'orders-stream',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'orders-stream',\n messages: [\n {\n key: 'order_complete',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000104',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no producer.send call.\n */\nexport const ignoredEvent: KafkaStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000105,\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAElB,IAAM,aAAa,aAAE,OAAO;AAAA,EAC1B,WAAW,aACR,KAAK,CAAC,SAAS,iBAAiB,iBAAiB,OAAO,aAAa,CAAC,EACtE,SAAS,gCAAgC;AAAA,EAC5C,UAAU,aACP,OAAO,EACP,SAAS,EACT,SAA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AA,YACP,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,YAC9C,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,EACb,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, KafkaSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst SASLSchema = z.object({\n mechanism: z\n .enum(['plain', 'scram-sha-256', 'scram-sha-512', 'aws', 'oauthbearer'])\n .describe('SASL authentication mechanism.'),\n username: z\n .string()\n .optional()\n .describe('Username for plain/scram mechanisms.'),\n password: z\n .string()\n .optional()\n .describe('Password for plain/scram mechanisms.'),\n accessKeyId: z\n .string()\n .optional()\n .describe('AWS access key ID for IAM auth (mechanism: aws).'),\n secretAccessKey: z\n .string()\n .optional()\n .describe('AWS secret access key for IAM auth (mechanism: aws).'),\n sessionToken: z\n .string()\n .optional()\n .describe('AWS session token for temporary credentials (mechanism: aws).'),\n authorizationIdentity: z\n .string()\n .optional()\n .describe('AWS authorization identity (mechanism: aws).'),\n});\n\nconst RetrySchema = z.object({\n maxRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Max total retry wait in ms. Default: 30000.'),\n initialRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('First retry delay in ms. Default: 300.'),\n retries: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Max retry count. Default: 5.'),\n});\n\nexport const KafkaSettingsSchema = z.object({\n brokers: z\n .array(z.string().min(1))\n .min(1)\n .describe('Kafka broker addresses (host:port). At least one required.'),\n clientId: z\n .string()\n .optional()\n .describe('Kafka client ID. Default: walkeros.'),\n ssl: z\n .union([z.boolean(), z.record(z.string(), z.unknown())])\n .optional()\n .describe(\n 'TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS.',\n ),\n sasl: SASLSchema.optional().describe(\n 'SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc.',\n ),\n connectionTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Connection timeout in ms. Default: 1000.'),\n requestTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Request timeout in ms. Default: 30000.'),\n topic: z.string().min(1).describe('Target Kafka topic name.'),\n acks: z\n .number()\n .int()\n .min(-1)\n .max(1)\n .optional()\n .describe(\n 'Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1.',\n ),\n timeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Broker response timeout in ms. Default: 30000.'),\n compression: z\n .enum(['none', 'gzip', 'snappy', 'lz4', 'zstd'])\n .optional()\n .describe(\n 'Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages.',\n ),\n idempotent: z\n .boolean()\n .optional()\n .describe(\n 'Enable idempotent producer for exactly-once delivery. Default: false.',\n ),\n allowAutoTopicCreation: z\n .boolean()\n .optional()\n .describe('Allow auto-creation of topics on the broker. Default: false.'),\n key: z\n .string()\n .optional()\n .describe(\n 'Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action.',\n ),\n headers: z\n .record(z.string(), z.string())\n .optional()\n .describe('Static headers added to every message.'),\n retry: RetrySchema.optional().describe(\n 'Retry configuration for transient failures.',\n ),\n});\n\nexport const SettingsSchema = z.object({\n kafka: KafkaSettingsSchema.describe(\n 'Kafka connection and producer settings.',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n key: z\n .string()\n .optional()\n .describe(\n 'Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key.',\n ),\n topic: z\n .string()\n .optional()\n .describe(\n 'Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","// Zod schema for the Kafka destination's setup options.\n//\n// The runtime contract (in `setup.ts`) requires `numPartitions` and\n// `replicationFactor` and rejects the boolean form `setup: true` with an\n// actionable error. The \"no safe defaults\" rule is enforced at runtime, not\n// in this schema: configs frequently arrive from JSON where TS cannot enforce\n// required fields, and the runtime check is the single source of truth. This\n// schema therefore keeps both fields optional in shape, with the descriptions\n// noting the runtime requirement so MCP / IntelliSense surfaces the constraint\n// to authors.\nimport { z } from '@walkeros/core/dev';\n\nconst SchemaRegistrySchema = z.object({\n url: z.string().url().describe('Schema Registry URL.'),\n subject: z\n .string()\n .min(1)\n .describe('Subject name, conventionally <topic>-value.'),\n schemaType: z.enum(['AVRO', 'JSON', 'PROTOBUF']).describe('Schema type.'),\n schema: z.string().min(1).describe('The schema, stringified.'),\n compatibility: z\n .enum([\n 'BACKWARD',\n 'FORWARD',\n 'FULL',\n 'NONE',\n 'BACKWARD_TRANSITIVE',\n 'FORWARD_TRANSITIVE',\n 'FULL_TRANSITIVE',\n ])\n .optional()\n .describe('Subject compatibility level set after registration.'),\n auth: z\n .object({ username: z.string(), password: z.string() })\n .optional()\n .describe('Optional Basic auth credentials.'),\n});\n\nexport const SetupSchema = z.object({\n topic: z\n .string()\n .min(1)\n .optional()\n .describe('Topic name. Falls back to settings.kafka.topic if omitted.'),\n numPartitions: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism.',\n ),\n replicationFactor: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Replication factor. Required at runtime. Must be <= broker count. No safe default.',\n ),\n configEntries: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'Topic-level config entries, e.g. { \"retention.ms\": \"604800000\" }.',\n ),\n schemaRegistry: SchemaRegistrySchema.optional().describe(\n 'Optional Confluent Schema Registry binding.',\n ),\n validateOnly: z\n .boolean()\n .optional()\n .describe(\n 'Use kafkajs validateOnly mode (broker-side dry-run). Default: false.',\n ),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n\nexport { SchemaRegistrySchema };\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n KafkaAdminMock,\n KafkaClientConstructor,\n KafkaClientMock,\n KafkaProducerMock,\n ProducerRecord,\n ProducerConfig,\n KafkaClientConfig,\n CompressionTypesMap,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype ProducerConnect = () => Promise<void>;\ntype ProducerDisconnect = () => Promise<void>;\ntype ProducerSend = (record: ProducerRecord) => Promise<unknown>;\ntype KafkaProducerFactory = (config?: ProducerConfig) => KafkaProducerMock;\n\nconst asyncConnect: ProducerConnect = () => Promise.resolve();\nconst asyncDisconnect: ProducerDisconnect = () => Promise.resolve();\nconst asyncSend: ProducerSend = () => Promise.resolve([]);\n\nfunction createMockProducer(): KafkaProducerMock {\n return {\n connect: asyncConnect,\n disconnect: asyncDisconnect,\n send: asyncSend,\n };\n}\n\nconst mockProducerFactory: KafkaProducerFactory = () => createMockProducer();\n\nfunction createMockAdmin(): KafkaAdminMock {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => Promise.resolve(),\n createTopics: () => Promise.resolve(true),\n fetchTopicMetadata: ({ topics }) =>\n Promise.resolve({\n topics: (topics ?? []).map((name) => ({\n name,\n partitions: [{ partitionId: 0, leader: 0, replicas: [0], isr: [0] }],\n })),\n }),\n describeConfigs: ({ resources }) =>\n Promise.resolve({\n resources: resources.map((r) => ({\n resourceName: r.name,\n configEntries: [],\n })),\n }),\n };\n}\n\nclass MockKafkaClient implements KafkaClientMock {\n constructor(_config: KafkaClientConfig) {}\n producer(config?: ProducerConfig): KafkaProducerMock {\n return mockProducerFactory(config);\n }\n admin(): KafkaAdminMock {\n return createMockAdmin();\n }\n}\n\nconst MockKafkaConstructor: KafkaClientConstructor = MockKafkaClient;\n\nconst MockCompressionTypes: CompressionTypesMap = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n};\n\nexport const push: Env = {\n Kafka: {\n Kafka: MockKafkaConstructor,\n CompressionTypes: MockCompressionTypes,\n },\n};\n\nexport const simulation = ['call:Kafka.Kafka.producer.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KafkaStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event -- full WalkerOS.Event serialized as JSON to the configured\n * topic. Message key defaults to entity_action when no key path is set.\n */\nexport const defaultEvent: KafkaStepExample = {\n title: 'Default event',\n description:\n 'An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'page_view',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000100',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- rule.name renames the event, which also changes the\n * default message key when no key mapping is configured.\n */\nexport const mappedEventName: KafkaStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event which also changes the default Kafka message key used for partitioning.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n }),\n mapping: {\n name: 'purchase',\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000101',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped data -- data.map transforms the event payload. Value is the mapped\n * object serialized as JSON.\n */\nexport const mappedData: KafkaStepExample = {\n title: 'Mapped payload',\n description:\n 'A data mapping transforms the event payload before producing it as the Kafka message value.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n order_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:data',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000102',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Key from user -- settings.kafka.key path resolves the message key from\n * the event (here user.id).\n */\nexport const keyFromUser: KafkaStepExample = {\n title: 'Key from user id',\n description:\n 'A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.',\n in: getEvent('user signup', {\n timestamp: 1700000103,\n user: { id: 'usr-789' },\n data: { plan: 'pro' },\n }),\n settings: {\n kafka: {\n brokers: ['localhost:9092'],\n topic: 'walkeros-events',\n key: 'user.id',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'usr-789',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000103',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Topic override -- rule.settings.topic routes this rule to a different\n * topic than the destination default.\n */\nexport const topicOverride: KafkaStepExample = {\n title: 'Topic override',\n description:\n 'A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n topic: 'orders-stream',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'orders-stream',\n messages: [\n {\n key: 'order_complete',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000104',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no producer.send call.\n */\nexport const ignoredEvent: KafkaStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000105,\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAElB,IAAM,aAAa,aAAE,OAAO;AAAA,EAC1B,WAAW,aACR,KAAK,CAAC,SAAS,iBAAiB,iBAAiB,OAAO,aAAa,CAAC,EACtE,SAAS,gCAAgC;AAAA,EAC5C,UAAU,aACP,OAAO,EACP,SAAS,EACT,SAAS,sCAAsC;AAAA,EAClD,UAAU,aACP,OAAO,EACP,SAAS,EACT,SAAS,sCAAsC;AAAA,EAClD,aAAa,aACV,OAAO,EACP,SAAS,EACT,SAAS,kDAAkD;AAAA,EAC9D,iBAAiB,aACd,OAAO,EACP,SAAS,EACT,SAAS,sDAAsD;AAAA,EAClE,cAAc,aACX,OAAO,EACP,SAAS,EACT,SAAS,+DAA+D;AAAA,EAC3E,uBAAuB,aACpB,OAAO,EACP,SAAS,EACT,SAAS,8CAA8C;AAC5D,CAAC;AAED,IAAM,cAAc,aAAE,OAAO;AAAA,EAC3B,cAAc,aACX,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+1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{KafkaSettingsSchema:()=>n,MappingSchema:()=>d,SettingsSchema:()=>c,SetupSchema:()=>u,mapping:()=>f,settings:()=>g,setup:()=>b});import{zodToSchema as a}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var o=s.object({mechanism:s.enum(["plain","scram-sha-256","scram-sha-512","aws","oauthbearer"]).describe("SASL authentication mechanism."),username:s.string().optional().describe("Username for plain/scram mechanisms."),password:s.string().optional().describe("Password for plain/scram mechanisms."),accessKeyId:s.string().optional().describe("AWS access key ID for IAM auth (mechanism: aws)."),secretAccessKey:s.string().optional().describe("AWS secret access key for IAM auth (mechanism: aws)."),sessionToken:s.string().optional().describe("AWS session token for temporary credentials (mechanism: aws)."),authorizationIdentity:s.string().optional().describe("AWS authorization identity (mechanism: aws).")}),r=s.object({maxRetryTime:s.number().int().positive().optional().describe("Max total retry wait in ms. Default: 30000."),initialRetryTime:s.number().int().positive().optional().describe("First retry delay in ms. Default: 300."),retries:s.number().int().min(0).optional().describe("Max retry count. Default: 5.")}),n=s.object({brokers:s.array(s.string().min(1)).min(1).describe("Kafka broker addresses (host:port). At least one required."),clientId:s.string().optional().describe("Kafka client ID. Default: walkeros."),ssl:s.union([s.boolean(),s.record(s.string(),s.unknown())]).optional().describe("TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS."),sasl:o.optional().describe("SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc."),connectionTimeout:s.number().int().positive().optional().describe("Connection timeout in ms. Default: 1000."),requestTimeout:s.number().int().positive().optional().describe("Request timeout in ms. Default: 30000."),topic:s.string().min(1).describe("Target Kafka topic name."),acks:s.number().int().min(-1).max(1).optional().describe("Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1."),timeout:s.number().int().positive().optional().describe("Broker response timeout in ms. Default: 30000."),compression:s.enum(["none","gzip","snappy","lz4","zstd"]).optional().describe("Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages."),idempotent:s.boolean().optional().describe("Enable idempotent producer for exactly-once delivery. Default: false."),allowAutoTopicCreation:s.boolean().optional().describe("Allow auto-creation of topics on the broker. Default: false."),key:s.string().optional().describe("Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action."),headers:s.record(s.string(),s.string()).optional().describe("Static headers added to every message."),retry:r.optional().describe("Retry configuration for transient failures.")}),c=s.object({kafka:n.describe("Kafka connection and producer settings.")});import{z as p}from"@walkeros/core/dev";var d=p.object({key:p.string().optional().describe("Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key."),topic:p.string().optional().describe("Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.")});import{z as m}from"@walkeros/core/dev";var l=m.object({url:m.string().url().describe("Schema Registry URL."),subject:m.string().min(1).describe("Subject name, conventionally <topic>-value."),schemaType:m.enum(["AVRO","JSON","PROTOBUF"]).describe("Schema type."),schema:m.string().min(1).describe("The schema, stringified."),compatibility:m.enum(["BACKWARD","FORWARD","FULL","NONE","BACKWARD_TRANSITIVE","FORWARD_TRANSITIVE","FULL_TRANSITIVE"]).optional().describe("Subject compatibility level set after registration."),auth:m.object({username:m.string(),password:m.string()}).optional().describe("Optional Basic auth credentials.")}),u=m.object({topic:m.string().min(1).optional().describe("Topic name. Falls back to settings.kafka.topic if omitted."),numPartitions:m.number().int().positive().optional().describe("Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism."),replicationFactor:m.number().int().positive().optional().describe("Replication factor. Required at runtime. Must be <= broker count. No safe default."),configEntries:m.record(m.string(),m.string()).optional().describe('Topic-level config entries, e.g. { "retention.ms": "604800000" }.'),schemaRegistry:l.optional().describe("Optional Confluent Schema Registry binding."),validateOnly:m.boolean().optional().describe("Use kafkajs validateOnly mode (broker-side dry-run). Default: false.")}),g=a(c),f=a(d),b=a(u),v={};t(v,{env:()=>k,step:()=>R});var k={};t(k,{push:()=>w,simulation:()=>T});var h=()=>Promise.resolve(),y=()=>Promise.resolve(),S=()=>Promise.resolve([]);var A=()=>({connect:h,disconnect:y,send:S});var w={Kafka:{Kafka:class{constructor(e){}producer(e){return A()}admin(){return{connect:()=>Promise.resolve(),disconnect:()=>Promise.resolve(),createTopics:()=>Promise.resolve(!0),fetchTopicMetadata:({topics:e})=>Promise.resolve({topics:(e??[]).map(e=>({name:e,partitions:[{partitionId:0,leader:0,replicas:[0],isr:[0]}]}))}),describeConfigs:({resources:e})=>Promise.resolve({resources:e.map(e=>({resourceName:e.name,configEntries:[]}))})}}},CompressionTypes:{None:0,GZIP:1,Snappy:2,LZ4:3,ZSTD:4}}},T=["call:producer.send"],R={};t(R,{defaultEvent:()=>j,ignoredEvent:()=>P,keyFromUser:()=>
|
|
1
|
+
var e=Object.defineProperty,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{KafkaSettingsSchema:()=>n,MappingSchema:()=>d,SettingsSchema:()=>c,SetupSchema:()=>u,mapping:()=>f,settings:()=>g,setup:()=>b});import{zodToSchema as a}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var o=s.object({mechanism:s.enum(["plain","scram-sha-256","scram-sha-512","aws","oauthbearer"]).describe("SASL authentication mechanism."),username:s.string().optional().describe("Username for plain/scram mechanisms."),password:s.string().optional().describe("Password for plain/scram mechanisms."),accessKeyId:s.string().optional().describe("AWS access key ID for IAM auth (mechanism: aws)."),secretAccessKey:s.string().optional().describe("AWS secret access key for IAM auth (mechanism: aws)."),sessionToken:s.string().optional().describe("AWS session token for temporary credentials (mechanism: aws)."),authorizationIdentity:s.string().optional().describe("AWS authorization identity (mechanism: aws).")}),r=s.object({maxRetryTime:s.number().int().positive().optional().describe("Max total retry wait in ms. Default: 30000."),initialRetryTime:s.number().int().positive().optional().describe("First retry delay in ms. Default: 300."),retries:s.number().int().min(0).optional().describe("Max retry count. Default: 5.")}),n=s.object({brokers:s.array(s.string().min(1)).min(1).describe("Kafka broker addresses (host:port). At least one required."),clientId:s.string().optional().describe("Kafka client ID. Default: walkeros."),ssl:s.union([s.boolean(),s.record(s.string(),s.unknown())]).optional().describe("TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS."),sasl:o.optional().describe("SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc."),connectionTimeout:s.number().int().positive().optional().describe("Connection timeout in ms. Default: 1000."),requestTimeout:s.number().int().positive().optional().describe("Request timeout in ms. Default: 30000."),topic:s.string().min(1).describe("Target Kafka topic name."),acks:s.number().int().min(-1).max(1).optional().describe("Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1."),timeout:s.number().int().positive().optional().describe("Broker response timeout in ms. Default: 30000."),compression:s.enum(["none","gzip","snappy","lz4","zstd"]).optional().describe("Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages."),idempotent:s.boolean().optional().describe("Enable idempotent producer for exactly-once delivery. Default: false."),allowAutoTopicCreation:s.boolean().optional().describe("Allow auto-creation of topics on the broker. Default: false."),key:s.string().optional().describe("Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action."),headers:s.record(s.string(),s.string()).optional().describe("Static headers added to every message."),retry:r.optional().describe("Retry configuration for transient failures.")}),c=s.object({kafka:n.describe("Kafka connection and producer settings.")});import{z as p}from"@walkeros/core/dev";var d=p.object({key:p.string().optional().describe("Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key."),topic:p.string().optional().describe("Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.")});import{z as m}from"@walkeros/core/dev";var l=m.object({url:m.string().url().describe("Schema Registry URL."),subject:m.string().min(1).describe("Subject name, conventionally <topic>-value."),schemaType:m.enum(["AVRO","JSON","PROTOBUF"]).describe("Schema type."),schema:m.string().min(1).describe("The schema, stringified."),compatibility:m.enum(["BACKWARD","FORWARD","FULL","NONE","BACKWARD_TRANSITIVE","FORWARD_TRANSITIVE","FULL_TRANSITIVE"]).optional().describe("Subject compatibility level set after registration."),auth:m.object({username:m.string(),password:m.string()}).optional().describe("Optional Basic auth credentials.")}),u=m.object({topic:m.string().min(1).optional().describe("Topic name. Falls back to settings.kafka.topic if omitted."),numPartitions:m.number().int().positive().optional().describe("Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism."),replicationFactor:m.number().int().positive().optional().describe("Replication factor. Required at runtime. Must be <= broker count. No safe default."),configEntries:m.record(m.string(),m.string()).optional().describe('Topic-level config entries, e.g. { "retention.ms": "604800000" }.'),schemaRegistry:l.optional().describe("Optional Confluent Schema Registry binding."),validateOnly:m.boolean().optional().describe("Use kafkajs validateOnly mode (broker-side dry-run). Default: false.")}),g=a(c),f=a(d),b=a(u),v={};t(v,{env:()=>k,step:()=>R});var k={};t(k,{push:()=>w,simulation:()=>T});var h=()=>Promise.resolve(),y=()=>Promise.resolve(),S=()=>Promise.resolve([]);var A=()=>({connect:h,disconnect:y,send:S});var w={Kafka:{Kafka:class{constructor(e){}producer(e){return A()}admin(){return{connect:()=>Promise.resolve(),disconnect:()=>Promise.resolve(),createTopics:()=>Promise.resolve(!0),fetchTopicMetadata:({topics:e})=>Promise.resolve({topics:(e??[]).map(e=>({name:e,partitions:[{partitionId:0,leader:0,replicas:[0],isr:[0]}]}))}),describeConfigs:({resources:e})=>Promise.resolve({resources:e.map(e=>({resourceName:e.name,configEntries:[]}))})}}},CompressionTypes:{None:0,GZIP:1,Snappy:2,LZ4:3,ZSTD:4}}},T=["call:Kafka.Kafka.producer.send"],R={};t(R,{defaultEvent:()=>j,ignoredEvent:()=>P,keyFromUser:()=>I,mappedData:()=>O,mappedEventName:()=>K,topicOverride:()=>N});import{getEvent as D}from"@walkeros/core";var j={title:"Default event",description:"An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.",in:D("page view",{timestamp:1700000100}),out:[["producer.send",{topic:"walkeros-events",messages:[{key:"page_view",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000100"}],acks:-1,compression:1}]]},K={title:"Renamed event",description:"A mapping renames the event which also changes the default Kafka message key used for partitioning.",in:D("order complete",{timestamp:1700000101}),mapping:{name:"purchase"},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"purchase",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000101"}],acks:-1,compression:1}]]},O={title:"Mapped payload",description:"A data mapping transforms the event payload before producing it as the Kafka message value.",in:D("order complete",{timestamp:1700000102,data:{id:"ORD-400",total:99.99,currency:"EUR"}}),mapping:{name:"purchase",data:{map:{order_id:"data.id",revenue:"data.total",currency:"data.currency"}}},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"purchase",value:"json:data",headers:{"content-type":"application/json"},timestamp:"1700000102"}],acks:-1,compression:1}]]},I={title:"Key from user id",description:"A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.",in:D("user signup",{timestamp:1700000103,user:{id:"usr-789"},data:{plan:"pro"}}),settings:{kafka:{brokers:["localhost:9092"],topic:"walkeros-events",key:"user.id"}},out:[["producer.send",{topic:"walkeros-events",messages:[{key:"usr-789",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000103"}],acks:-1,compression:1}]]},N={title:"Topic override",description:"A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.",in:D("order complete",{timestamp:1700000104,data:{id:"ORD-500",total:42}}),mapping:{settings:{topic:"orders-stream"}},out:[["producer.send",{topic:"orders-stream",messages:[{key:"order_complete",value:"json:event",headers:{"content-type":"application/json"},timestamp:"1700000104"}],acks:-1,compression:1}]]},P={public:!1,in:D("debug noise",{timestamp:1700000105}),mapping:{ignore:!0},out:[]};export{v as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, KafkaSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst SASLSchema = z.object({\n mechanism: z\n .enum(['plain', 'scram-sha-256', 'scram-sha-512', 'aws', 'oauthbearer'])\n .describe('SASL authentication mechanism.'),\n username: z\n .string()\n .optional()\n .describe('Username for plain/scram mechanisms.'),\n password: z\n .string()\n .optional()\n .describe('Password for plain/scram mechanisms.'),\n accessKeyId: z\n .string()\n .optional()\n .describe('AWS access key ID for IAM auth (mechanism: aws).'),\n secretAccessKey: z\n .string()\n .optional()\n .describe('AWS secret access key for IAM auth (mechanism: aws).'),\n sessionToken: z\n .string()\n .optional()\n .describe('AWS session token for temporary credentials (mechanism: aws).'),\n authorizationIdentity: z\n .string()\n .optional()\n .describe('AWS authorization identity (mechanism: aws).'),\n});\n\nconst RetrySchema = z.object({\n maxRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Max total retry wait in ms. Default: 30000.'),\n initialRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('First retry delay in ms. Default: 300.'),\n retries: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Max retry count. Default: 5.'),\n});\n\nexport const KafkaSettingsSchema = z.object({\n brokers: z\n .array(z.string().min(1))\n .min(1)\n .describe('Kafka broker addresses (host:port). At least one required.'),\n clientId: z\n .string()\n .optional()\n .describe('Kafka client ID. Default: walkeros.'),\n ssl: z\n .union([z.boolean(), z.record(z.string(), z.unknown())])\n .optional()\n .describe(\n 'TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS.',\n ),\n sasl: SASLSchema.optional().describe(\n 'SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc.',\n ),\n connectionTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Connection timeout in ms. Default: 1000.'),\n requestTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Request timeout in ms. Default: 30000.'),\n topic: z.string().min(1).describe('Target Kafka topic name.'),\n acks: z\n .number()\n .int()\n .min(-1)\n .max(1)\n .optional()\n .describe(\n 'Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1.',\n ),\n timeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Broker response timeout in ms. Default: 30000.'),\n compression: z\n .enum(['none', 'gzip', 'snappy', 'lz4', 'zstd'])\n .optional()\n .describe(\n 'Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages.',\n ),\n idempotent: z\n .boolean()\n .optional()\n .describe(\n 'Enable idempotent producer for exactly-once delivery. Default: false.',\n ),\n allowAutoTopicCreation: z\n .boolean()\n .optional()\n .describe('Allow auto-creation of topics on the broker. Default: false.'),\n key: z\n .string()\n .optional()\n .describe(\n 'Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action.',\n ),\n headers: z\n .record(z.string(), z.string())\n .optional()\n .describe('Static headers added to every message.'),\n retry: RetrySchema.optional().describe(\n 'Retry configuration for transient failures.',\n ),\n});\n\nexport const SettingsSchema = z.object({\n kafka: KafkaSettingsSchema.describe(\n 'Kafka connection and producer settings.',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n key: z\n .string()\n .optional()\n .describe(\n 'Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key.',\n ),\n topic: z\n .string()\n .optional()\n .describe(\n 'Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","// Zod schema for the Kafka destination's setup options.\n//\n// The runtime contract (in `setup.ts`) requires `numPartitions` and\n// `replicationFactor` and rejects the boolean form `setup: true` with an\n// actionable error. The \"no safe defaults\" rule is enforced at runtime, not\n// in this schema: configs frequently arrive from JSON where TS cannot enforce\n// required fields, and the runtime check is the single source of truth. This\n// schema therefore keeps both fields optional in shape, with the descriptions\n// noting the runtime requirement so MCP / IntelliSense surfaces the constraint\n// to authors.\nimport { z } from '@walkeros/core/dev';\n\nconst SchemaRegistrySchema = z.object({\n url: z.string().url().describe('Schema Registry URL.'),\n subject: z\n .string()\n .min(1)\n .describe('Subject name, conventionally <topic>-value.'),\n schemaType: z.enum(['AVRO', 'JSON', 'PROTOBUF']).describe('Schema type.'),\n schema: z.string().min(1).describe('The schema, stringified.'),\n compatibility: z\n .enum([\n 'BACKWARD',\n 'FORWARD',\n 'FULL',\n 'NONE',\n 'BACKWARD_TRANSITIVE',\n 'FORWARD_TRANSITIVE',\n 'FULL_TRANSITIVE',\n ])\n .optional()\n .describe('Subject compatibility level set after registration.'),\n auth: z\n .object({ username: z.string(), password: z.string() })\n .optional()\n .describe('Optional Basic auth credentials.'),\n});\n\nexport const SetupSchema = z.object({\n topic: z\n .string()\n .min(1)\n .optional()\n .describe('Topic name. Falls back to settings.kafka.topic if omitted.'),\n numPartitions: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism.',\n ),\n replicationFactor: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Replication factor. Required at runtime. Must be <= broker count. No safe default.',\n ),\n configEntries: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'Topic-level config entries, e.g. { \"retention.ms\": \"604800000\" }.',\n ),\n schemaRegistry: SchemaRegistrySchema.optional().describe(\n 'Optional Confluent Schema Registry binding.',\n ),\n validateOnly: z\n .boolean()\n .optional()\n .describe(\n 'Use kafkajs validateOnly mode (broker-side dry-run). Default: false.',\n ),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n\nexport { SchemaRegistrySchema };\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n KafkaAdminMock,\n KafkaClientConstructor,\n KafkaClientMock,\n KafkaProducerMock,\n ProducerRecord,\n ProducerConfig,\n KafkaClientConfig,\n CompressionTypesMap,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype ProducerConnect = () => Promise<void>;\ntype ProducerDisconnect = () => Promise<void>;\ntype ProducerSend = (record: ProducerRecord) => Promise<unknown>;\ntype KafkaProducerFactory = (config?: ProducerConfig) => KafkaProducerMock;\n\nconst asyncConnect: ProducerConnect = () => Promise.resolve();\nconst asyncDisconnect: ProducerDisconnect = () => Promise.resolve();\nconst asyncSend: ProducerSend = () => Promise.resolve([]);\n\nfunction createMockProducer(): KafkaProducerMock {\n return {\n connect: asyncConnect,\n disconnect: asyncDisconnect,\n send: asyncSend,\n };\n}\n\nconst mockProducerFactory: KafkaProducerFactory = () => createMockProducer();\n\nfunction createMockAdmin(): KafkaAdminMock {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => Promise.resolve(),\n createTopics: () => Promise.resolve(true),\n fetchTopicMetadata: ({ topics }) =>\n Promise.resolve({\n topics: (topics ?? []).map((name) => ({\n name,\n partitions: [{ partitionId: 0, leader: 0, replicas: [0], isr: [0] }],\n })),\n }),\n describeConfigs: ({ resources }) =>\n Promise.resolve({\n resources: resources.map((r) => ({\n resourceName: r.name,\n configEntries: [],\n })),\n }),\n };\n}\n\nclass MockKafkaClient implements KafkaClientMock {\n constructor(_config: KafkaClientConfig) {}\n producer(config?: ProducerConfig): KafkaProducerMock {\n return mockProducerFactory(config);\n }\n admin(): KafkaAdminMock {\n return createMockAdmin();\n }\n}\n\nconst MockKafkaConstructor: KafkaClientConstructor = MockKafkaClient;\n\nconst MockCompressionTypes: CompressionTypesMap = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n};\n\nexport const push: Env = {\n Kafka: {\n Kafka: MockKafkaConstructor,\n CompressionTypes: MockCompressionTypes,\n },\n};\n\nexport const simulation = ['call:producer.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KafkaStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event -- full WalkerOS.Event serialized as JSON to the configured\n * topic. Message key defaults to entity_action when no key path is set.\n */\nexport const defaultEvent: KafkaStepExample = {\n title: 'Default event',\n description:\n 'An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'page_view',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000100',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- rule.name renames the event, which also changes the\n * default message key when no key mapping is configured.\n */\nexport const mappedEventName: KafkaStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event which also changes the default Kafka message key used for partitioning.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n }),\n mapping: {\n name: 'purchase',\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000101',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped data -- data.map transforms the event payload. Value is the mapped\n * object serialized as JSON.\n */\nexport const mappedData: KafkaStepExample = {\n title: 'Mapped payload',\n description:\n 'A data mapping transforms the event payload before producing it as the Kafka message value.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n order_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:data',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000102',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Key from user -- settings.kafka.key path resolves the message key from\n * the event (here user.id).\n */\nexport const keyFromUser: KafkaStepExample = {\n title: 'Key from user id',\n description:\n 'A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.',\n in: getEvent('user signup', {\n timestamp: 1700000103,\n user: { id: 'usr-789' },\n data: { plan: 'pro' },\n }),\n settings: {\n kafka: {\n brokers: ['localhost:9092'],\n topic: 'walkeros-events',\n key: 'user.id',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'usr-789',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000103',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Topic override -- rule.settings.topic routes this rule to a different\n * topic than the destination default.\n */\nexport const topicOverride: KafkaStepExample = {\n title: 'Topic override',\n description:\n 'A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n topic: 'orders-stream',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'orders-stream',\n messages: [\n {\n key: 'order_complete',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000104',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no producer.send call.\n */\nexport const ignoredEvent: KafkaStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000105,\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAA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AkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,GAAG;AAAA,EACnC,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,UAAU;AAAA,UACR;AAAA,YACE,KAAK;AAAA,YACL,OAAO;AAAA,YACP,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,YAC9C,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,EACb,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, KafkaSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nconst SASLSchema = z.object({\n mechanism: z\n .enum(['plain', 'scram-sha-256', 'scram-sha-512', 'aws', 'oauthbearer'])\n .describe('SASL authentication mechanism.'),\n username: z\n .string()\n .optional()\n .describe('Username for plain/scram mechanisms.'),\n password: z\n .string()\n .optional()\n .describe('Password for plain/scram mechanisms.'),\n accessKeyId: z\n .string()\n .optional()\n .describe('AWS access key ID for IAM auth (mechanism: aws).'),\n secretAccessKey: z\n .string()\n .optional()\n .describe('AWS secret access key for IAM auth (mechanism: aws).'),\n sessionToken: z\n .string()\n .optional()\n .describe('AWS session token for temporary credentials (mechanism: aws).'),\n authorizationIdentity: z\n .string()\n .optional()\n .describe('AWS authorization identity (mechanism: aws).'),\n});\n\nconst RetrySchema = z.object({\n maxRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Max total retry wait in ms. Default: 30000.'),\n initialRetryTime: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('First retry delay in ms. Default: 300.'),\n retries: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Max retry count. Default: 5.'),\n});\n\nexport const KafkaSettingsSchema = z.object({\n brokers: z\n .array(z.string().min(1))\n .min(1)\n .describe('Kafka broker addresses (host:port). At least one required.'),\n clientId: z\n .string()\n .optional()\n .describe('Kafka client ID. Default: walkeros.'),\n ssl: z\n .union([z.boolean(), z.record(z.string(), z.unknown())])\n .optional()\n .describe(\n 'TLS configuration. Set true for default TLS, or provide a tls.ConnectionOptions object for mTLS.',\n ),\n sasl: SASLSchema.optional().describe(\n 'SASL authentication config. Required for Confluent Cloud, AWS MSK with IAM, etc.',\n ),\n connectionTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Connection timeout in ms. Default: 1000.'),\n requestTimeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Request timeout in ms. Default: 30000.'),\n topic: z.string().min(1).describe('Target Kafka topic name.'),\n acks: z\n .number()\n .int()\n .min(-1)\n .max(1)\n .optional()\n .describe(\n 'Acknowledgement level. -1 = all replicas, 0 = fire-and-forget, 1 = leader only. Default: -1.',\n ),\n timeout: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Broker response timeout in ms. Default: 30000.'),\n compression: z\n .enum(['none', 'gzip', 'snappy', 'lz4', 'zstd'])\n .optional()\n .describe(\n 'Message compression codec. Default: gzip. Snappy/LZ4/ZSTD require additional npm packages.',\n ),\n idempotent: z\n .boolean()\n .optional()\n .describe(\n 'Enable idempotent producer for exactly-once delivery. Default: false.',\n ),\n allowAutoTopicCreation: z\n .boolean()\n .optional()\n .describe('Allow auto-creation of topics on the broker. Default: false.'),\n key: z\n .string()\n .optional()\n .describe(\n 'Mapping value path for message key derivation (e.g. user.id, data.userId). Default: entity_action.',\n ),\n headers: z\n .record(z.string(), z.string())\n .optional()\n .describe('Static headers added to every message.'),\n retry: RetrySchema.optional().describe(\n 'Retry configuration for transient failures.',\n ),\n});\n\nexport const SettingsSchema = z.object({\n kafka: KafkaSettingsSchema.describe(\n 'Kafka connection and producer settings.',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n key: z\n .string()\n .optional()\n .describe(\n 'Override message key mapping path for this rule (e.g. data.id). Takes precedence over settings.kafka.key.',\n ),\n topic: z\n .string()\n .optional()\n .describe(\n 'Override Kafka topic for this rule. Takes precedence over settings.kafka.topic.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","// Zod schema for the Kafka destination's setup options.\n//\n// The runtime contract (in `setup.ts`) requires `numPartitions` and\n// `replicationFactor` and rejects the boolean form `setup: true` with an\n// actionable error. The \"no safe defaults\" rule is enforced at runtime, not\n// in this schema: configs frequently arrive from JSON where TS cannot enforce\n// required fields, and the runtime check is the single source of truth. This\n// schema therefore keeps both fields optional in shape, with the descriptions\n// noting the runtime requirement so MCP / IntelliSense surfaces the constraint\n// to authors.\nimport { z } from '@walkeros/core/dev';\n\nconst SchemaRegistrySchema = z.object({\n url: z.string().url().describe('Schema Registry URL.'),\n subject: z\n .string()\n .min(1)\n .describe('Subject name, conventionally <topic>-value.'),\n schemaType: z.enum(['AVRO', 'JSON', 'PROTOBUF']).describe('Schema type.'),\n schema: z.string().min(1).describe('The schema, stringified.'),\n compatibility: z\n .enum([\n 'BACKWARD',\n 'FORWARD',\n 'FULL',\n 'NONE',\n 'BACKWARD_TRANSITIVE',\n 'FORWARD_TRANSITIVE',\n 'FULL_TRANSITIVE',\n ])\n .optional()\n .describe('Subject compatibility level set after registration.'),\n auth: z\n .object({ username: z.string(), password: z.string() })\n .optional()\n .describe('Optional Basic auth credentials.'),\n});\n\nexport const SetupSchema = z.object({\n topic: z\n .string()\n .min(1)\n .optional()\n .describe('Topic name. Falls back to settings.kafka.topic if omitted.'),\n numPartitions: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Number of partitions. Required at runtime. No safe default; choose based on expected throughput and consumer parallelism.',\n ),\n replicationFactor: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Replication factor. Required at runtime. Must be <= broker count. No safe default.',\n ),\n configEntries: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'Topic-level config entries, e.g. { \"retention.ms\": \"604800000\" }.',\n ),\n schemaRegistry: SchemaRegistrySchema.optional().describe(\n 'Optional Confluent Schema Registry binding.',\n ),\n validateOnly: z\n .boolean()\n .optional()\n .describe(\n 'Use kafkajs validateOnly mode (broker-side dry-run). Default: false.',\n ),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n\nexport { SchemaRegistrySchema };\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n KafkaAdminMock,\n KafkaClientConstructor,\n KafkaClientMock,\n KafkaProducerMock,\n ProducerRecord,\n ProducerConfig,\n KafkaClientConfig,\n CompressionTypesMap,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype ProducerConnect = () => Promise<void>;\ntype ProducerDisconnect = () => Promise<void>;\ntype ProducerSend = (record: ProducerRecord) => Promise<unknown>;\ntype KafkaProducerFactory = (config?: ProducerConfig) => KafkaProducerMock;\n\nconst asyncConnect: ProducerConnect = () => Promise.resolve();\nconst asyncDisconnect: ProducerDisconnect = () => Promise.resolve();\nconst asyncSend: ProducerSend = () => Promise.resolve([]);\n\nfunction createMockProducer(): KafkaProducerMock {\n return {\n connect: asyncConnect,\n disconnect: asyncDisconnect,\n send: asyncSend,\n };\n}\n\nconst mockProducerFactory: KafkaProducerFactory = () => createMockProducer();\n\nfunction createMockAdmin(): KafkaAdminMock {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => Promise.resolve(),\n createTopics: () => Promise.resolve(true),\n fetchTopicMetadata: ({ topics }) =>\n Promise.resolve({\n topics: (topics ?? []).map((name) => ({\n name,\n partitions: [{ partitionId: 0, leader: 0, replicas: [0], isr: [0] }],\n })),\n }),\n describeConfigs: ({ resources }) =>\n Promise.resolve({\n resources: resources.map((r) => ({\n resourceName: r.name,\n configEntries: [],\n })),\n }),\n };\n}\n\nclass MockKafkaClient implements KafkaClientMock {\n constructor(_config: KafkaClientConfig) {}\n producer(config?: ProducerConfig): KafkaProducerMock {\n return mockProducerFactory(config);\n }\n admin(): KafkaAdminMock {\n return createMockAdmin();\n }\n}\n\nconst MockKafkaConstructor: KafkaClientConstructor = MockKafkaClient;\n\nconst MockCompressionTypes: CompressionTypesMap = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n};\n\nexport const push: Env = {\n Kafka: {\n Kafka: MockKafkaConstructor,\n CompressionTypes: MockCompressionTypes,\n },\n};\n\nexport const simulation = ['call:Kafka.Kafka.producer.send'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KafkaStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event -- full WalkerOS.Event serialized as JSON to the configured\n * topic. Message key defaults to entity_action when no key path is set.\n */\nexport const defaultEvent: KafkaStepExample = {\n title: 'Default event',\n description:\n 'An event is produced to the configured Kafka topic with the full JSON body and entity_action as the message key.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'page_view',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000100',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- rule.name renames the event, which also changes the\n * default message key when no key mapping is configured.\n */\nexport const mappedEventName: KafkaStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event which also changes the default Kafka message key used for partitioning.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n }),\n mapping: {\n name: 'purchase',\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000101',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Mapped data -- data.map transforms the event payload. Value is the mapped\n * object serialized as JSON.\n */\nexport const mappedData: KafkaStepExample = {\n title: 'Mapped payload',\n description:\n 'A data mapping transforms the event payload before producing it as the Kafka message value.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n order_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'purchase',\n value: 'json:data',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000102',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Key from user -- settings.kafka.key path resolves the message key from\n * the event (here user.id).\n */\nexport const keyFromUser: KafkaStepExample = {\n title: 'Key from user id',\n description:\n 'A settings.kafka.key path resolves the message key from the event, here using user.id for per-user partitioning.',\n in: getEvent('user signup', {\n timestamp: 1700000103,\n user: { id: 'usr-789' },\n data: { plan: 'pro' },\n }),\n settings: {\n kafka: {\n brokers: ['localhost:9092'],\n topic: 'walkeros-events',\n key: 'user.id',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'walkeros-events',\n messages: [\n {\n key: 'usr-789',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000103',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Topic override -- rule.settings.topic routes this rule to a different\n * topic than the destination default.\n */\nexport const topicOverride: KafkaStepExample = {\n title: 'Topic override',\n description:\n 'A mapping rule overrides the destination topic so specific events are routed to a dedicated stream.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n topic: 'orders-stream',\n },\n },\n out: [\n [\n 'producer.send',\n {\n topic: 'orders-stream',\n messages: [\n {\n key: 'order_complete',\n value: 'json:event',\n headers: { 'content-type': 'application/json' },\n timestamp: '1700000104',\n },\n ],\n acks: -1,\n compression: 1,\n },\n ],\n ],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no producer.send call.\n */\nexport const ignoredEvent: KafkaStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000105,\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAElB,IAAM,aAAa,EAAE,OAAO;AAAA,EAC1B,WAAW,EACR,KAAK,CAAC,SAAS,iBAAiB,iBAAiB,OAAO,aAAa,CAAC,EACtE,SAAS,gCAAgC;AAAA,EAC5C,UAAU,EACP,OAAO,EACP,SAAS,EACT,SAAS,sCAAsC;AAAA,EAClD,UAAU,EACP,OAAO,EACP,SAAS,EACT,SAAS,sCAAsC;AAAA,EAClD,aAAa,EACV,OAAO,EACP,SAAS,EACT,SAAS,kDAAkD;AAAA,EAC9D,iBAAiB,EACd,OAAO,EACP,SAAS,EACT,SAAS,sDAAsD;AAAA,E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AA,EAC5C,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,EACb,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z","z"]}
|
package/dist/examples/index.js
CHANGED
package/dist/examples/index.mjs
CHANGED
package/dist/walkerOS.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-kafka",
|
|
4
|
-
"version": "4.7.0
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
8
8
|
],
|
|
9
|
+
"exports": {},
|
|
9
10
|
"docs": "https://www.walkeros.io/docs/destinations/server/kafka",
|
|
10
11
|
"source": "https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/kafka/src"
|
|
11
12
|
},
|
|
@@ -334,7 +335,7 @@
|
|
|
334
335
|
}
|
|
335
336
|
},
|
|
336
337
|
"simulation": [
|
|
337
|
-
"call:producer.send"
|
|
338
|
+
"call:Kafka.Kafka.producer.send"
|
|
338
339
|
]
|
|
339
340
|
},
|
|
340
341
|
"step": {
|
|
@@ -379,7 +380,7 @@
|
|
|
379
380
|
"consent": {
|
|
380
381
|
"functional": true
|
|
381
382
|
},
|
|
382
|
-
"id": "
|
|
383
|
+
"id": "70fa8f49a167af20",
|
|
383
384
|
"trigger": "load",
|
|
384
385
|
"entity": "page",
|
|
385
386
|
"action": "view",
|
|
@@ -455,7 +456,7 @@
|
|
|
455
456
|
"consent": {
|
|
456
457
|
"functional": true
|
|
457
458
|
},
|
|
458
|
-
"id": "
|
|
459
|
+
"id": "b2d6c6edbda77153",
|
|
459
460
|
"trigger": "test",
|
|
460
461
|
"entity": "debug",
|
|
461
462
|
"action": "noise",
|
|
@@ -507,7 +508,7 @@
|
|
|
507
508
|
"consent": {
|
|
508
509
|
"functional": true
|
|
509
510
|
},
|
|
510
|
-
"id": "
|
|
511
|
+
"id": "17a86da16f862bf7",
|
|
511
512
|
"trigger": "test",
|
|
512
513
|
"entity": "user",
|
|
513
514
|
"action": "signup",
|
|
@@ -628,7 +629,7 @@
|
|
|
628
629
|
"consent": {
|
|
629
630
|
"functional": true
|
|
630
631
|
},
|
|
631
|
-
"id": "
|
|
632
|
+
"id": "c3c11cad4151eaa4",
|
|
632
633
|
"trigger": "load",
|
|
633
634
|
"entity": "order",
|
|
634
635
|
"action": "complete",
|
|
@@ -752,7 +753,7 @@
|
|
|
752
753
|
"consent": {
|
|
753
754
|
"functional": true
|
|
754
755
|
},
|
|
755
|
-
"id": "
|
|
756
|
+
"id": "19d87050f1cb509c",
|
|
756
757
|
"trigger": "load",
|
|
757
758
|
"entity": "order",
|
|
758
759
|
"action": "complete",
|
|
@@ -866,7 +867,7 @@
|
|
|
866
867
|
"consent": {
|
|
867
868
|
"functional": true
|
|
868
869
|
},
|
|
869
|
-
"id": "
|
|
870
|
+
"id": "1e9a4d4c9662b408",
|
|
870
871
|
"trigger": "load",
|
|
871
872
|
"entity": "order",
|
|
872
873
|
"action": "complete",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-kafka",
|
|
3
3
|
"description": "Apache Kafka server destination for walkerOS (kafkajs, JSON serialization, GZIP compression)",
|
|
4
|
-
"version": "4.7.0
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"kafkajs": "^2.2.4",
|
|
39
|
-
"@walkeros/core": "4.7.0
|
|
40
|
-
"@walkeros/server-core": "4.7.0
|
|
39
|
+
"@walkeros/core": "4.7.0",
|
|
40
|
+
"@walkeros/server-core": "4.7.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@walkeros/collector": "4.7.0
|
|
43
|
+
"@walkeros/collector": "4.7.0"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|