@walkeros/server-destination-redis 3.4.0 → 3.4.1-next-1776790594143
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/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 +11 -0
- package/dist/examples/index.mjs +11 -0
- package/dist/walkerOS.json +18 -7
- package/package.json +4 -4
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,r)=>{for(var s in r)t(e,s,{get:r[s],enumerable:!0})},n={};o(n,{examples:()=>f,schemas:()=>a}),module.exports=(e=n,((e,o,n,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of s(o))i.call(e,d)||d===n||t(e,d,{get:()=>o[d],enumerable:!(a=r(o,d))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};o(a,{MappingSchema:()=>v,RedisSettingsSchema:()=>m,SettingsSchema:()=>c,mapping:()=>g,settings:()=>u});var d=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),m=l.z.object({streamKey:l.z.string().min(1).describe("Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD."),url:l.z.string().describe("Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.").optional(),options:l.z.record(l.z.string(),l.z.unknown()).describe("ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.").optional(),maxLen:l.z.number().int().positive().describe("Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).").optional(),exactTrimming:l.z.boolean().describe("Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.").optional(),serialization:l.z.enum(["json","flat"]).describe("Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.").optional()}),c=l.z.object({redis:m.describe("Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })")}),p=require("@walkeros/core/dev"),v=p.z.object({streamKey:p.z.string().optional().describe("Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.")}),u=(0,d.zodToSchema)(c),g=(0,d.zodToSchema)(v),f={};o(f,{env:()=>h,step:()=>y});var h={};o(h,{push:()=>x,simulation:()=>k});var w=()=>Promise.resolve("1700000100000-0"),b=()=>Promise.resolve("OK");var x={Redis:{Client:class{constructor(e){this.xadd=w,this.quit=b}pipeline(){return function(){const e={xadd:()=>e,exec:()=>Promise.resolve([])};return e}()}on(){return this}}}},k=["call:client.xadd"],y={};o(y,{ignoredEvent:()=>S,jsonDefault:()=>j,orderComplete:()=>z,streamKeyOverride:()=>R,withExactTrim:()=>D,withMaxLen:()=>A});var E=require("@walkeros/core"),j={title:"Default stream",description:"An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.",in:(0,E.getEvent)("page view",{timestamp:1700000100}),out:[["client.xadd",["walkeros:events","*","event","json:event"]]]},z={title:"Order event",description:"An order complete event is appended to the Redis stream alongside other event types for downstream consumers.",in:(0,E.getEvent)("order complete",{timestamp:1700000101,data:{id:"ORD-400",total:99.99,currency:"EUR"}}),out:[["client.xadd",["walkeros:events","*","event","json:event"]]]},A={title:"MAXLEN trim",description:"XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.",in:(0,E.getEvent)("product view",{timestamp:1700000102,data:{id:"SKU-123",name:"Widget"}}),settings:{redis:{streamKey:"walkeros:events",maxLen:5e4}},out:[["client.xadd",["walkeros:events","MAXLEN","~",5e4,"*","event","json:event"]]]},D={title:"Exact trim",description:"XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.",in:(0,E.getEvent)("page view",{timestamp:1700000103}),settings:{redis:{streamKey:"walkeros:events",maxLen:5e3,exactTrimming:!0}},out:[["client.xadd",["walkeros:events","MAXLEN",5e3,"*","event","json:event"]]]},R={title:"Stream key override",description:"A mapping rule routes the event to a dedicated Redis stream instead of the destination default.",in:(0,E.getEvent)("order complete",{timestamp:1700000104,data:{id:"ORD-500",total:42}}),mapping:{settings:{streamKey:"walkeros:orders"}},out:[["client.xadd",["walkeros:orders","*","event","json:event"]]]},S={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/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';\n\nexport { SettingsSchema, RedisSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const RedisSettingsSchema = z.object({\n streamKey: z\n .string()\n .min(1)\n .describe(\n \"Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD.\",\n ),\n url: z\n .string()\n .describe(\n \"Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.\",\n )\n .optional(),\n options: z\n .record(z.string(), z.unknown())\n .describe(\n 'ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.',\n )\n .optional(),\n maxLen: z\n .number()\n .int()\n .positive()\n .describe(\n 'Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).',\n )\n .optional(),\n exactTrimming: z\n .boolean()\n .describe(\n 'Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.',\n )\n .optional(),\n serialization: z\n .enum(['json', 'flat'])\n .describe(\n \"Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.\",\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n redis: RedisSettingsSchema.describe(\n \"Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n streamKey: z\n .string()\n .optional()\n .describe(\n 'Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n RedisClientConstructor,\n RedisClientMock,\n RedisPipelineMock,\n XaddArg,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype XaddFn = (...args: XaddArg[]) => Promise<string | null>;\ntype QuitFn = () => Promise<string>;\n\nconst asyncXadd: XaddFn = () => Promise.resolve('1700000100000-0');\nconst asyncQuit: QuitFn = () => Promise.resolve('OK');\n\nfunction createMockPipeline(): RedisPipelineMock {\n const pipeline: RedisPipelineMock = {\n xadd: () => pipeline,\n exec: () => Promise.resolve([]),\n };\n return pipeline;\n}\n\nclass MockRedisClient implements RedisClientMock {\n constructor(_urlOrOptions: string | Record<string, unknown>) {}\n xadd: XaddFn = asyncXadd;\n pipeline(): RedisPipelineMock {\n return createMockPipeline();\n }\n quit: QuitFn = asyncQuit;\n on(): unknown {\n return this;\n }\n}\n\nconst MockRedisConstructor: RedisClientConstructor = MockRedisClient;\n\nexport const push: Env = {\n Redis: {\n Client: MockRedisConstructor,\n },\n};\n\nexport const simulation = ['call:client.xadd'];\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 RedisStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default JSON serialization -- single 'event' field with full event JSON.\n */\nexport const jsonDefault: RedisStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * Order event -- verifies different event types pass through correctly.\n */\nexport const orderComplete: RedisStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * With MAXLEN approximate trimming -- trimming args inserted before '*'.\n */\nexport const withMaxLen: RedisStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000102,\n data: { id: 'SKU-123', name: 'Widget' },\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 50000,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', '~', 50000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Exact MAXLEN trimming -- no '~' between MAXLEN and the count.\n */\nexport const withExactTrim: RedisStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 5000,\n exactTrimming: true,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', 5000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Stream key override per rule -- routes this event to a dedicated stream.\n */\nexport const streamKeyOverride: RedisStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n streamKey: 'walkeros:orders',\n },\n },\n out: [['client.xadd', ['walkeros:orders', '*', 'event', 'json:event']]],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no xadd call.\n */\nexport const ignoredEvent: RedisStepExample = {\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,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,WAAW,aACR,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,KAAK,aACF,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,aACN,OAAO,aAAE,OAAO,GAAG,aAAE,QAAQ,CAAC,EAC9B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,QAAQ,aACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,eAAe,aACZ,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,eAAe,aACZ,KAAK,CAAC,QAAQ,MAAM,CAAC,EACrB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,OAAO,oBAAoB;AAAA,IACzB;AAAA,EACF;AACF,CAAC;;;AC/CD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,WAAW,cACR,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AACJ,CAAC;;;AFDM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAYA,IAAM,YAAoB,MAAM,QAAQ,QAAQ,iBAAiB;AACjE,IAA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IACH;AAAA,MACE;AAAA,MACA,CAAC,mBAAmB,UAAU,KAAK,KAAO,KAAK,SAAS,YAAY;AAAA,IACtE;AAAA,EACF;AACF;AAKO,IAAM,gBAAkC;AAAA,EAC7C,QAAI,sBAAS,aAAa;AAAA,IACxB,WAAW;AAAA,EACb,CAAC;AAAA,EACD,UAAU;AAAA,IACR,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA,CAAC,mBAAmB,UAAU,KAAM,KAAK,SAAS,YAAY;AAAA,IAChE;AAAA,EACF;AACF;AAKO,IAAM,oBAAsC;AAAA,EACjD,QAAI,sBAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,GAAG;AAAA,EACnC,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,eAAe,CAAC,mBAAmB,KAAK,SAAS,YAAY,CAAC,CAAC;AACxE;AAKO,IAAM,eAAiC;AAAA,EAC5C,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"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.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';\n\nexport { SettingsSchema, RedisSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const RedisSettingsSchema = z.object({\n streamKey: z\n .string()\n .min(1)\n .describe(\n \"Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD.\",\n ),\n url: z\n .string()\n .describe(\n \"Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.\",\n )\n .optional(),\n options: z\n .record(z.string(), z.unknown())\n .describe(\n 'ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.',\n )\n .optional(),\n maxLen: z\n .number()\n .int()\n .positive()\n .describe(\n 'Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).',\n )\n .optional(),\n exactTrimming: z\n .boolean()\n .describe(\n 'Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.',\n )\n .optional(),\n serialization: z\n .enum(['json', 'flat'])\n .describe(\n \"Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.\",\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n redis: RedisSettingsSchema.describe(\n \"Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n streamKey: z\n .string()\n .optional()\n .describe(\n 'Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n RedisClientConstructor,\n RedisClientMock,\n RedisPipelineMock,\n XaddArg,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype XaddFn = (...args: XaddArg[]) => Promise<string | null>;\ntype QuitFn = () => Promise<string>;\n\nconst asyncXadd: XaddFn = () => Promise.resolve('1700000100000-0');\nconst asyncQuit: QuitFn = () => Promise.resolve('OK');\n\nfunction createMockPipeline(): RedisPipelineMock {\n const pipeline: RedisPipelineMock = {\n xadd: () => pipeline,\n exec: () => Promise.resolve([]),\n };\n return pipeline;\n}\n\nclass MockRedisClient implements RedisClientMock {\n constructor(_urlOrOptions: string | Record<string, unknown>) {}\n xadd: XaddFn = asyncXadd;\n pipeline(): RedisPipelineMock {\n return createMockPipeline();\n }\n quit: QuitFn = asyncQuit;\n on(): unknown {\n return this;\n }\n}\n\nconst MockRedisConstructor: RedisClientConstructor = MockRedisClient;\n\nexport const push: Env = {\n Redis: {\n Client: MockRedisConstructor,\n },\n};\n\nexport const simulation = ['call:client.xadd'];\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 RedisStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default JSON serialization -- single 'event' field with full event JSON.\n */\nexport const jsonDefault: RedisStepExample = {\n title: 'Default stream',\n description:\n 'An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * Order event -- verifies different event types pass through correctly.\n */\nexport const orderComplete: RedisStepExample = {\n title: 'Order event',\n description:\n 'An order complete event is appended to the Redis stream alongside other event types for downstream consumers.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * With MAXLEN approximate trimming -- trimming args inserted before '*'.\n */\nexport const withMaxLen: RedisStepExample = {\n title: 'MAXLEN trim',\n description:\n 'XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.',\n in: getEvent('product view', {\n timestamp: 1700000102,\n data: { id: 'SKU-123', name: 'Widget' },\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 50000,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', '~', 50000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Exact MAXLEN trimming -- no '~' between MAXLEN and the count.\n */\nexport const withExactTrim: RedisStepExample = {\n title: 'Exact trim',\n description:\n 'XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 5000,\n exactTrimming: true,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', 5000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Stream key override per rule -- routes this event to a dedicated stream.\n */\nexport const streamKeyOverride: RedisStepExample = {\n title: 'Stream key override',\n description:\n 'A mapping rule routes the event to a dedicated Redis stream instead of the destination default.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n streamKey: 'walkeros:orders',\n },\n },\n out: [['client.xadd', ['walkeros:orders', '*', 'event', 'json:event']]],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no xadd call.\n */\nexport const ignoredEvent: RedisStepExample = {\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,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,WAAW,aACR,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,KAAK,aACF,OAAO,EACP;AAAA,IACC;AAAA,EACF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A,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA,CAAC,mBAAmB,UAAU,KAAM,KAAK,SAAS,YAAY;AAAA,IAChE;AAAA,EACF;AACF;AAKO,IAAM,oBAAsC;AAAA,EACjD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,GAAG;AAAA,EACnC,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,eAAe,CAAC,mBAAmB,KAAK,SAAS,YAAY,CAAC,CAAC;AACxE;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"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,s)=>{for(var
|
|
1
|
+
var e=Object.defineProperty,t=(t,s)=>{for(var i in s)e(t,i,{get:s[i],enumerable:!0})},s={};t(s,{MappingSchema:()=>d,RedisSettingsSchema:()=>o,SettingsSchema:()=>n,mapping:()=>m,settings:()=>l});import{zodToSchema as i}from"@walkeros/core/dev";import{z as r}from"@walkeros/core/dev";var o=r.object({streamKey:r.string().min(1).describe("Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD."),url:r.string().describe("Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.").optional(),options:r.record(r.string(),r.unknown()).describe("ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.").optional(),maxLen:r.number().int().positive().describe("Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).").optional(),exactTrimming:r.boolean().describe("Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.").optional(),serialization:r.enum(["json","flat"]).describe("Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.").optional()}),n=r.object({redis:o.describe("Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })")});import{z as a}from"@walkeros/core/dev";var d=a.object({streamKey:a.string().optional().describe("Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.")}),l=i(n),m=i(d),p={};t(p,{env:()=>c,step:()=>h});var c={};t(c,{push:()=>g,simulation:()=>f});var v=()=>Promise.resolve("1700000100000-0"),u=()=>Promise.resolve("OK");var g={Redis:{Client:class{constructor(e){this.xadd=v,this.quit=u}pipeline(){return function(){const e={xadd:()=>e,exec:()=>Promise.resolve([])};return e}()}on(){return this}}}},f=["call:client.xadd"],h={};t(h,{ignoredEvent:()=>D,jsonDefault:()=>x,orderComplete:()=>k,streamKeyOverride:()=>A,withExactTrim:()=>y,withMaxLen:()=>b});import{getEvent as w}from"@walkeros/core";var x={title:"Default stream",description:"An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.",in:w("page view",{timestamp:1700000100}),out:[["client.xadd",["walkeros:events","*","event","json:event"]]]},k={title:"Order event",description:"An order complete event is appended to the Redis stream alongside other event types for downstream consumers.",in:w("order complete",{timestamp:1700000101,data:{id:"ORD-400",total:99.99,currency:"EUR"}}),out:[["client.xadd",["walkeros:events","*","event","json:event"]]]},b={title:"MAXLEN trim",description:"XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.",in:w("product view",{timestamp:1700000102,data:{id:"SKU-123",name:"Widget"}}),settings:{redis:{streamKey:"walkeros:events",maxLen:5e4}},out:[["client.xadd",["walkeros:events","MAXLEN","~",5e4,"*","event","json:event"]]]},y={title:"Exact trim",description:"XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.",in:w("page view",{timestamp:1700000103}),settings:{redis:{streamKey:"walkeros:events",maxLen:5e3,exactTrimming:!0}},out:[["client.xadd",["walkeros:events","MAXLEN",5e3,"*","event","json:event"]]]},A={title:"Stream key override",description:"A mapping rule routes the event to a dedicated Redis stream instead of the destination default.",in:w("order complete",{timestamp:1700000104,data:{id:"ORD-500",total:42}}),mapping:{settings:{streamKey:"walkeros:orders"}},out:[["client.xadd",["walkeros:orders","*","event","json:event"]]]},D={public:!1,in:w("debug noise",{timestamp:1700000105}),mapping:{ignore:!0},out:[]};export{p as examples,s 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/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';\n\nexport { SettingsSchema, RedisSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const RedisSettingsSchema = z.object({\n streamKey: z\n .string()\n .min(1)\n .describe(\n \"Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD.\",\n ),\n url: z\n .string()\n .describe(\n \"Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.\",\n )\n .optional(),\n options: z\n .record(z.string(), z.unknown())\n .describe(\n 'ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.',\n )\n .optional(),\n maxLen: z\n .number()\n .int()\n .positive()\n .describe(\n 'Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).',\n )\n .optional(),\n exactTrimming: z\n .boolean()\n .describe(\n 'Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.',\n )\n .optional(),\n serialization: z\n .enum(['json', 'flat'])\n .describe(\n \"Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.\",\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n redis: RedisSettingsSchema.describe(\n \"Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n streamKey: z\n .string()\n .optional()\n .describe(\n 'Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n RedisClientConstructor,\n RedisClientMock,\n RedisPipelineMock,\n XaddArg,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype XaddFn = (...args: XaddArg[]) => Promise<string | null>;\ntype QuitFn = () => Promise<string>;\n\nconst asyncXadd: XaddFn = () => Promise.resolve('1700000100000-0');\nconst asyncQuit: QuitFn = () => Promise.resolve('OK');\n\nfunction createMockPipeline(): RedisPipelineMock {\n const pipeline: RedisPipelineMock = {\n xadd: () => pipeline,\n exec: () => Promise.resolve([]),\n };\n return pipeline;\n}\n\nclass MockRedisClient implements RedisClientMock {\n constructor(_urlOrOptions: string | Record<string, unknown>) {}\n xadd: XaddFn = asyncXadd;\n pipeline(): RedisPipelineMock {\n return createMockPipeline();\n }\n quit: QuitFn = asyncQuit;\n on(): unknown {\n return this;\n }\n}\n\nconst MockRedisConstructor: RedisClientConstructor = MockRedisClient;\n\nexport const push: Env = {\n Redis: {\n Client: MockRedisConstructor,\n },\n};\n\nexport const simulation = ['call:client.xadd'];\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 RedisStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default JSON serialization -- single 'event' field with full event JSON.\n */\nexport const jsonDefault: RedisStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * Order event -- verifies different event types pass through correctly.\n */\nexport const orderComplete: RedisStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * With MAXLEN approximate trimming -- trimming args inserted before '*'.\n */\nexport const withMaxLen: RedisStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000102,\n data: { id: 'SKU-123', name: 'Widget' },\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 50000,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', '~', 50000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Exact MAXLEN trimming -- no '~' between MAXLEN and the count.\n */\nexport const withExactTrim: RedisStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 5000,\n exactTrimming: true,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', 5000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Stream key override per rule -- routes this event to a dedicated stream.\n */\nexport const streamKeyOverride: RedisStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n streamKey: 'walkeros:orders',\n },\n },\n out: [['client.xadd', ['walkeros:orders', '*', 'event', 'json:event']]],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no xadd call.\n */\nexport const ignoredEvent: RedisStepExample = {\n in: getEvent('debug noise',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IAAM,gBAAkC;AAAA,EAC7C,IAAI,SAAS,aAAa;AAAA,IACxB,WAAW;AAAA,EACb,CAAC;AAAA,EACD,UAAU;AAAA,IACR,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA,CAAC,mBAAmB,UAAU,KAAM,KAAK,SAAS,YAAY;AAAA,IAChE;AAAA,EACF;AACF;AAKO,IAAM,oBAAsC;AAAA,EACjD,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,GAAG;AAAA,EACnC,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,eAAe,CAAC,mBAAmB,KAAK,SAAS,YAAY,CAAC,CAAC;AACxE;AAKO,IAAM,eAAiC;AAAA,EAC5C,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,EACb,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.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';\n\nexport { SettingsSchema, RedisSettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const RedisSettingsSchema = z.object({\n streamKey: z\n .string()\n .min(1)\n .describe(\n \"Redis stream key name (like 'walkeros:events'). All events are appended to this stream via XADD.\",\n ),\n url: z\n .string()\n .describe(\n \"Redis connection URL (like 'redis://localhost:6379' or 'rediss://:password@host:6380'). Supports redis:// and rediss:// (TLS) protocols.\",\n )\n .optional(),\n options: z\n .record(z.string(), z.unknown())\n .describe(\n 'ioredis connection options. Used when url is not provided. Supports host, port, password, db, tls, and all other ioredis options.',\n )\n .optional(),\n maxLen: z\n .number()\n .int()\n .positive()\n .describe(\n 'Maximum stream length. Enables approximate MAXLEN trimming on every XADD to bound memory usage (like 50000).',\n )\n .optional(),\n exactTrimming: z\n .boolean()\n .describe(\n 'Use exact MAXLEN instead of approximate (~). Not recommended for production. Default: false.',\n )\n .optional(),\n serialization: z\n .enum(['json', 'flat'])\n .describe(\n \"Serialization mode. 'json' stores the full event as a single 'event' field (default). 'flat' stores top-level event fields as separate stream entry fields.\",\n )\n .optional(),\n});\n\nexport const SettingsSchema = z.object({\n redis: RedisSettingsSchema.describe(\n \"Redis Streams configuration (like { streamKey: 'walkeros:events', url: 'redis://localhost:6379' })\",\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n streamKey: z\n .string()\n .optional()\n .describe(\n 'Override Redis stream key for this rule. Takes precedence over settings.redis.streamKey.',\n ),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n RedisClientConstructor,\n RedisClientMock,\n RedisPipelineMock,\n XaddArg,\n} from '../types';\n\n// Narrow helper type aliases so the mock SDK is typed explicitly without `any`.\ntype XaddFn = (...args: XaddArg[]) => Promise<string | null>;\ntype QuitFn = () => Promise<string>;\n\nconst asyncXadd: XaddFn = () => Promise.resolve('1700000100000-0');\nconst asyncQuit: QuitFn = () => Promise.resolve('OK');\n\nfunction createMockPipeline(): RedisPipelineMock {\n const pipeline: RedisPipelineMock = {\n xadd: () => pipeline,\n exec: () => Promise.resolve([]),\n };\n return pipeline;\n}\n\nclass MockRedisClient implements RedisClientMock {\n constructor(_urlOrOptions: string | Record<string, unknown>) {}\n xadd: XaddFn = asyncXadd;\n pipeline(): RedisPipelineMock {\n return createMockPipeline();\n }\n quit: QuitFn = asyncQuit;\n on(): unknown {\n return this;\n }\n}\n\nconst MockRedisConstructor: RedisClientConstructor = MockRedisClient;\n\nexport const push: Env = {\n Redis: {\n Client: MockRedisConstructor,\n },\n};\n\nexport const simulation = ['call:client.xadd'];\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 RedisStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default JSON serialization -- single 'event' field with full event JSON.\n */\nexport const jsonDefault: RedisStepExample = {\n title: 'Default stream',\n description:\n 'An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.',\n in: getEvent('page view', {\n timestamp: 1700000100,\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * Order event -- verifies different event types pass through correctly.\n */\nexport const orderComplete: RedisStepExample = {\n title: 'Order event',\n description:\n 'An order complete event is appended to the Redis stream alongside other event types for downstream consumers.',\n in: getEvent('order complete', {\n timestamp: 1700000101,\n data: { id: 'ORD-400', total: 99.99, currency: 'EUR' },\n }),\n out: [['client.xadd', ['walkeros:events', '*', 'event', 'json:event']]],\n};\n\n/**\n * With MAXLEN approximate trimming -- trimming args inserted before '*'.\n */\nexport const withMaxLen: RedisStepExample = {\n title: 'MAXLEN trim',\n description:\n 'XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.',\n in: getEvent('product view', {\n timestamp: 1700000102,\n data: { id: 'SKU-123', name: 'Widget' },\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 50000,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', '~', 50000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Exact MAXLEN trimming -- no '~' between MAXLEN and the count.\n */\nexport const withExactTrim: RedisStepExample = {\n title: 'Exact trim',\n description:\n 'XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n }),\n settings: {\n redis: {\n streamKey: 'walkeros:events',\n maxLen: 5000,\n exactTrimming: true,\n },\n },\n out: [\n [\n 'client.xadd',\n ['walkeros:events', 'MAXLEN', 5000, '*', 'event', 'json:event'],\n ],\n ],\n};\n\n/**\n * Stream key override per rule -- routes this event to a dedicated stream.\n */\nexport const streamKeyOverride: RedisStepExample = {\n title: 'Stream key override',\n description:\n 'A mapping rule routes the event to a dedicated Redis stream instead of the destination default.',\n in: getEvent('order complete', {\n timestamp: 1700000104,\n data: { id: 'ORD-500', total: 42 },\n }),\n mapping: {\n settings: {\n streamKey: 'walkeros:orders',\n },\n },\n out: [['client.xadd', ['walkeros:orders', '*', 'event', 'json:event']]],\n};\n\n/**\n * Ignored event -- mapping.ignore: true produces no xadd call.\n */\nexport const ignoredEvent: RedisStepExample = {\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,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,WAAW,EACR,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,KAAK,EACF,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAC9B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,QAAQ,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ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7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,GAAG;AAAA,EACnC,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,eAAe,CAAC,mBAAmB,KAAK,SAAS,YAAY,CAAC,CAAC;AACxE;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"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -72,12 +72,16 @@ __export(step_exports, {
|
|
|
72
72
|
});
|
|
73
73
|
var import_core = require("@walkeros/core");
|
|
74
74
|
var jsonDefault = {
|
|
75
|
+
title: "Default stream",
|
|
76
|
+
description: "An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.",
|
|
75
77
|
in: (0, import_core.getEvent)("page view", {
|
|
76
78
|
timestamp: 1700000100
|
|
77
79
|
}),
|
|
78
80
|
out: [["client.xadd", ["walkeros:events", "*", "event", "json:event"]]]
|
|
79
81
|
};
|
|
80
82
|
var orderComplete = {
|
|
83
|
+
title: "Order event",
|
|
84
|
+
description: "An order complete event is appended to the Redis stream alongside other event types for downstream consumers.",
|
|
81
85
|
in: (0, import_core.getEvent)("order complete", {
|
|
82
86
|
timestamp: 1700000101,
|
|
83
87
|
data: { id: "ORD-400", total: 99.99, currency: "EUR" }
|
|
@@ -85,6 +89,8 @@ var orderComplete = {
|
|
|
85
89
|
out: [["client.xadd", ["walkeros:events", "*", "event", "json:event"]]]
|
|
86
90
|
};
|
|
87
91
|
var withMaxLen = {
|
|
92
|
+
title: "MAXLEN trim",
|
|
93
|
+
description: "XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.",
|
|
88
94
|
in: (0, import_core.getEvent)("product view", {
|
|
89
95
|
timestamp: 1700000102,
|
|
90
96
|
data: { id: "SKU-123", name: "Widget" }
|
|
@@ -103,6 +109,8 @@ var withMaxLen = {
|
|
|
103
109
|
]
|
|
104
110
|
};
|
|
105
111
|
var withExactTrim = {
|
|
112
|
+
title: "Exact trim",
|
|
113
|
+
description: "XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.",
|
|
106
114
|
in: (0, import_core.getEvent)("page view", {
|
|
107
115
|
timestamp: 1700000103
|
|
108
116
|
}),
|
|
@@ -121,6 +129,8 @@ var withExactTrim = {
|
|
|
121
129
|
]
|
|
122
130
|
};
|
|
123
131
|
var streamKeyOverride = {
|
|
132
|
+
title: "Stream key override",
|
|
133
|
+
description: "A mapping rule routes the event to a dedicated Redis stream instead of the destination default.",
|
|
124
134
|
in: (0, import_core.getEvent)("order complete", {
|
|
125
135
|
timestamp: 1700000104,
|
|
126
136
|
data: { id: "ORD-500", total: 42 }
|
|
@@ -133,6 +143,7 @@ var streamKeyOverride = {
|
|
|
133
143
|
out: [["client.xadd", ["walkeros:orders", "*", "event", "json:event"]]]
|
|
134
144
|
};
|
|
135
145
|
var ignoredEvent = {
|
|
146
|
+
public: false,
|
|
136
147
|
in: (0, import_core.getEvent)("debug noise", {
|
|
137
148
|
timestamp: 1700000105
|
|
138
149
|
}),
|
package/dist/examples/index.mjs
CHANGED
|
@@ -51,12 +51,16 @@ __export(step_exports, {
|
|
|
51
51
|
});
|
|
52
52
|
import { getEvent } from "@walkeros/core";
|
|
53
53
|
var jsonDefault = {
|
|
54
|
+
title: "Default stream",
|
|
55
|
+
description: "An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.",
|
|
54
56
|
in: getEvent("page view", {
|
|
55
57
|
timestamp: 1700000100
|
|
56
58
|
}),
|
|
57
59
|
out: [["client.xadd", ["walkeros:events", "*", "event", "json:event"]]]
|
|
58
60
|
};
|
|
59
61
|
var orderComplete = {
|
|
62
|
+
title: "Order event",
|
|
63
|
+
description: "An order complete event is appended to the Redis stream alongside other event types for downstream consumers.",
|
|
60
64
|
in: getEvent("order complete", {
|
|
61
65
|
timestamp: 1700000101,
|
|
62
66
|
data: { id: "ORD-400", total: 99.99, currency: "EUR" }
|
|
@@ -64,6 +68,8 @@ var orderComplete = {
|
|
|
64
68
|
out: [["client.xadd", ["walkeros:events", "*", "event", "json:event"]]]
|
|
65
69
|
};
|
|
66
70
|
var withMaxLen = {
|
|
71
|
+
title: "MAXLEN trim",
|
|
72
|
+
description: "XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.",
|
|
67
73
|
in: getEvent("product view", {
|
|
68
74
|
timestamp: 1700000102,
|
|
69
75
|
data: { id: "SKU-123", name: "Widget" }
|
|
@@ -82,6 +88,8 @@ var withMaxLen = {
|
|
|
82
88
|
]
|
|
83
89
|
};
|
|
84
90
|
var withExactTrim = {
|
|
91
|
+
title: "Exact trim",
|
|
92
|
+
description: "XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.",
|
|
85
93
|
in: getEvent("page view", {
|
|
86
94
|
timestamp: 1700000103
|
|
87
95
|
}),
|
|
@@ -100,6 +108,8 @@ var withExactTrim = {
|
|
|
100
108
|
]
|
|
101
109
|
};
|
|
102
110
|
var streamKeyOverride = {
|
|
111
|
+
title: "Stream key override",
|
|
112
|
+
description: "A mapping rule routes the event to a dedicated Redis stream instead of the destination default.",
|
|
103
113
|
in: getEvent("order complete", {
|
|
104
114
|
timestamp: 1700000104,
|
|
105
115
|
data: { id: "ORD-500", total: 42 }
|
|
@@ -112,6 +122,7 @@ var streamKeyOverride = {
|
|
|
112
122
|
out: [["client.xadd", ["walkeros:orders", "*", "event", "json:event"]]]
|
|
113
123
|
};
|
|
114
124
|
var ignoredEvent = {
|
|
125
|
+
public: false,
|
|
115
126
|
in: getEvent("debug noise", {
|
|
116
127
|
timestamp: 1700000105
|
|
117
128
|
}),
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-redis",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1-next-1776790594143",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"step": {
|
|
94
94
|
"ignoredEvent": {
|
|
95
|
+
"public": false,
|
|
95
96
|
"in": {
|
|
96
97
|
"name": "debug noise",
|
|
97
98
|
"data": {
|
|
@@ -148,7 +149,7 @@
|
|
|
148
149
|
"group": "gr0up",
|
|
149
150
|
"count": 1,
|
|
150
151
|
"version": {
|
|
151
|
-
"source": "3.4.
|
|
152
|
+
"source": "3.4.1-next-1776790594143",
|
|
152
153
|
"tagging": 1
|
|
153
154
|
},
|
|
154
155
|
"source": {
|
|
@@ -163,6 +164,8 @@
|
|
|
163
164
|
"out": []
|
|
164
165
|
},
|
|
165
166
|
"jsonDefault": {
|
|
167
|
+
"title": "Default stream",
|
|
168
|
+
"description": "An event is appended to the configured Redis stream via XADD with the full event JSON as a single field.",
|
|
166
169
|
"in": {
|
|
167
170
|
"name": "page view",
|
|
168
171
|
"data": {
|
|
@@ -217,7 +220,7 @@
|
|
|
217
220
|
"group": "gr0up",
|
|
218
221
|
"count": 1,
|
|
219
222
|
"version": {
|
|
220
|
-
"source": "3.4.
|
|
223
|
+
"source": "3.4.1-next-1776790594143",
|
|
221
224
|
"tagging": 1
|
|
222
225
|
},
|
|
223
226
|
"source": {
|
|
@@ -239,6 +242,8 @@
|
|
|
239
242
|
]
|
|
240
243
|
},
|
|
241
244
|
"orderComplete": {
|
|
245
|
+
"title": "Order event",
|
|
246
|
+
"description": "An order complete event is appended to the Redis stream alongside other event types for downstream consumers.",
|
|
242
247
|
"in": {
|
|
243
248
|
"name": "order complete",
|
|
244
249
|
"data": {
|
|
@@ -323,7 +328,7 @@
|
|
|
323
328
|
"group": "gr0up",
|
|
324
329
|
"count": 1,
|
|
325
330
|
"version": {
|
|
326
|
-
"source": "3.4.
|
|
331
|
+
"source": "3.4.1-next-1776790594143",
|
|
327
332
|
"tagging": 1
|
|
328
333
|
},
|
|
329
334
|
"source": {
|
|
@@ -345,6 +350,8 @@
|
|
|
345
350
|
]
|
|
346
351
|
},
|
|
347
352
|
"streamKeyOverride": {
|
|
353
|
+
"title": "Stream key override",
|
|
354
|
+
"description": "A mapping rule routes the event to a dedicated Redis stream instead of the destination default.",
|
|
348
355
|
"in": {
|
|
349
356
|
"name": "order complete",
|
|
350
357
|
"data": {
|
|
@@ -428,7 +435,7 @@
|
|
|
428
435
|
"group": "gr0up",
|
|
429
436
|
"count": 1,
|
|
430
437
|
"version": {
|
|
431
|
-
"source": "3.4.
|
|
438
|
+
"source": "3.4.1-next-1776790594143",
|
|
432
439
|
"tagging": 1
|
|
433
440
|
},
|
|
434
441
|
"source": {
|
|
@@ -455,6 +462,8 @@
|
|
|
455
462
|
]
|
|
456
463
|
},
|
|
457
464
|
"withExactTrim": {
|
|
465
|
+
"title": "Exact trim",
|
|
466
|
+
"description": "XADD uses exact MAXLEN trimming to enforce a precise Redis stream length at the cost of extra work.",
|
|
458
467
|
"in": {
|
|
459
468
|
"name": "page view",
|
|
460
469
|
"data": {
|
|
@@ -509,7 +518,7 @@
|
|
|
509
518
|
"group": "gr0up",
|
|
510
519
|
"count": 1,
|
|
511
520
|
"version": {
|
|
512
|
-
"source": "3.4.
|
|
521
|
+
"source": "3.4.1-next-1776790594143",
|
|
513
522
|
"tagging": 1
|
|
514
523
|
},
|
|
515
524
|
"source": {
|
|
@@ -540,6 +549,8 @@
|
|
|
540
549
|
]
|
|
541
550
|
},
|
|
542
551
|
"withMaxLen": {
|
|
552
|
+
"title": "MAXLEN trim",
|
|
553
|
+
"description": "XADD uses approximate MAXLEN trimming to cap the Redis stream length, discarding older entries efficiently.",
|
|
543
554
|
"in": {
|
|
544
555
|
"name": "product view",
|
|
545
556
|
"data": {
|
|
@@ -576,7 +587,7 @@
|
|
|
576
587
|
"group": "gr0up",
|
|
577
588
|
"count": 1,
|
|
578
589
|
"version": {
|
|
579
|
-
"source": "3.4.
|
|
590
|
+
"source": "3.4.1-next-1776790594143",
|
|
580
591
|
"tagging": 1
|
|
581
592
|
},
|
|
582
593
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-redis",
|
|
3
3
|
"description": "Redis Streams server destination for walkerOS (ioredis, XADD, pipeline batching)",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1-next-1776790594143",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"ioredis": "^5.10.0",
|
|
38
|
-
"@walkeros/core": "3.4.
|
|
39
|
-
"@walkeros/server-core": "3.4.
|
|
38
|
+
"@walkeros/core": "3.4.1-next-1776790594143",
|
|
39
|
+
"@walkeros/server-core": "3.4.1-next-1776790594143"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@walkeros/collector": "3.4.
|
|
42
|
+
"@walkeros/collector": "3.4.1-next-1776790594143"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|