@walkeros/server-source-gcp 4.0.0 → 4.0.1-next-1778183328892
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/README.md +216 -2
- package/dist/dev.d.mts +290 -33
- package/dist/dev.d.ts +290 -33
- 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/index.d.mts +292 -42
- package/dist/index.d.ts +292 -42
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +6 -4
- package/package.json +16 -5
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cloudfunction/schemas/index.ts","../src/cloudfunction/schemas/settings.ts","../src/cloudfunction/schemas/primitives.ts","../src/cloudfunction/examples/index.ts","../src/cloudfunction/examples/env.ts","../src/cloudfunction/examples/step.ts","../src/cloudfunction/examples/trigger.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * GCP CloudFunction source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .optional(),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(540000) // GCP Cloud Functions max timeout: 9 minutes\n .describe('Request timeout in milliseconds (max: 540000 for GCP)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for GCP Cloud Function source\n *\n * These environments provide standardized mock structures for testing\n * HTTP request handling without requiring actual cloud function deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing cloud function source\n *\n * Use this for testing HTTP event ingestion and request/response handling\n * without requiring a real GCP Cloud Function environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const postEvent: Flow.StepExample = {\n title: 'POST event',\n description:\n 'A GCP Cloud Function HTTP POST with a JSON body becomes a single walker elb event.',\n trigger: { type: 'POST' },\n in: {\n method: 'POST',\n body: {\n event: 'page view',\n data: { title: 'Home', url: 'https://example.com/' },\n },\n headers: { 'content-type': 'application/json' },\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home', url: 'https://example.com/' },\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order POST',\n description:\n 'A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.',\n trigger: { type: 'POST' },\n in: {\n method: 'POST',\n body: {\n event: 'order complete',\n data: { id: 'ORD-700', total: 99.99, currency: 'EUR' },\n },\n headers: { 'content-type': 'application/json' },\n },\n out: [\n [\n 'elb',\n {\n name: 'order complete',\n data: { id: 'ORD-700', total: 99.99, currency: 'EUR' },\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport type { CloudFunctionSource, Request, Response } from '../types';\nimport { startFlow } from '@walkeros/collector';\n\nexport interface Content {\n method: string;\n body: Record<string, unknown>;\n headers?: Record<string, string>;\n}\n\nexport interface Result {\n status: number;\n body: unknown;\n}\n\n/**\n * Find the cloudfunction source instance from collector.sources.\n */\nfunction findGcpSource(\n collector: Collector.Instance,\n): CloudFunctionSource | undefined {\n for (const source of Object.values(collector.sources || {})) {\n if ((source as { type?: string }).type === 'cloudfunction')\n return source as unknown as CloudFunctionSource;\n }\n return undefined;\n}\n\n/**\n * GCP CloudFunction source createTrigger.\n *\n * Boots a real collector via startFlow, then synthesizes mock req/res\n * (matching the GCP Functions Framework pattern) and calls source.push(req, res).\n * This is the realistic approach for GCP Cloud Functions - the Functions Framework\n * synthesizes these objects in production too.\n */\nconst createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n // Lazy startFlow\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findGcpSource(flow.collector);\n if (!source)\n throw new Error(\n 'CloudFunction source not found in collector — ensure it is configured in sources',\n );\n\n // Adapt body: step examples use `name`, source expects `event`\n const body = { ...content.body };\n if (body.name && !body.event) {\n body.event = body.name;\n delete body.name;\n }\n\n const headers = content.headers || {\n 'content-type': 'application/json',\n };\n\n // Synthesize mock req matching GCP Functions Framework pattern\n const req = {\n method: content.method,\n body,\n headers,\n get: (h: string) => headers[h.toLowerCase()],\n } as Request;\n\n // Synthesize mock res that captures status and response body\n let statusCode = 200;\n let responseBody: unknown;\n const res = {\n status: (code: number) => {\n statusCode = code;\n return res;\n },\n json: (data: unknown) => {\n responseBody = data;\n return res;\n },\n send: (data: unknown) => {\n responseBody = data;\n return res;\n },\n set: () => res,\n } as unknown as Response;\n\n // GCP source awaits env.push() — no detached promises\n await source.push(req, res);\n\n return { status: statusCode, body: responseBody };\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\nexport { createTrigger };\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAKX,IAAM,aAAa,EAAE,KAAK;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AASM,IAAM,aAAa,EAAE,MAAM;AAAA,EAChC,EAAE,OAAO;AAAA,EACT,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EAClB,EAAE,QAAQ,GAAG;AACf,CAAC;AAMM,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACx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,QAAI,CAAC,MAAM;AACT,YAAM,SAAS,MAAM,UAAU,MAAM;AACrC,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AAAA,IACxD;AAEA,UAAM,SAAS,cAAc,KAAK,SAAS;AAC3C,QAAI,CAAC;AACH,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAGF,UAAM,OAAO,EAAE,GAAG,QAAQ,KAAK;AAC/B,QAAI,KAAK,QAAQ,CAAC,KAAK,OAAO;AAC5B,WAAK,QAAQ,KAAK;AAClB,aAAO,KAAK;AAAA,IACd;AAEA,UAAM,UAAU,QAAQ,WAAW;AAAA,MACjC,gBAAgB;AAAA,IAClB;AAGA,UAAM,MAAM;AAAA,MACV,QAAQ,QAAQ;AAAA,MAChB;AAAA,MACA;AAAA,MACA,KAAK,CAAC,MAAc,QAAQ,EAAE,YAAY,CAAC;AAAA,IAC7C;AAGA,QAAI,aAAa;AACjB,QAAI;AACJ,UAAM,MAAM;AAAA,MACV,QAAQ,CAAC,SAAiB;AACxB,qBAAa;AACb,eAAO;AAAA,MACT;AAAA,MACA,MAAM,CAAC,SAAkB;AACvB,uBAAe;AACf,eAAO;AAAA,MACT;AAAA,MACA,MAAM,CAAC,SAAkB;AACvB,uBAAe;AACf,eAAO;AAAA,MACT;AAAA,MACA,KAAK,MAAM;AAAA,IACb;AAGA,UAAM,OAAO,KAAK,KAAK,GAAG;AAE1B,WAAO,EAAE,QAAQ,YAAY,MAAM,aAAa;AAAA,EAClD;AAEF,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;","names":["z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/cloudfunction/schemas/index.ts","../src/cloudfunction/schemas/settings.ts","../src/cloudfunction/schemas/primitives.ts","../src/cloudfunction/examples/index.ts","../src/cloudfunction/examples/env.ts","../src/cloudfunction/examples/step.ts","../src/cloudfunction/examples/trigger.ts","../src/pubsub/pull/schemas/index.ts","../src/pubsub/pull/schemas/settings.ts","../src/pubsub/pull/schemas/setup.ts","../src/pubsub/pull/examples/index.ts","../src/pubsub/pull/examples/env.ts","../src/pubsub/pull/examples/step.ts","../src/pubsub/pull/examples/trigger.ts","../src/pubsub/push/schemas/index.ts","../src/pubsub/push/schemas/settings.ts","../src/pubsub/push/examples/index.ts","../src/pubsub/push/examples/env.ts","../src/pubsub/push/examples/step.ts","../src/pubsub/push/examples/trigger.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * GCP CloudFunction source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .optional(),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(540000) // GCP Cloud Functions max timeout: 9 minutes\n .describe('Request timeout in milliseconds (max: 540000 for GCP)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for GCP Cloud Function source\n *\n * These environments provide standardized mock structures for testing\n * HTTP request handling without requiring actual cloud function deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing cloud function source\n *\n * Use this for testing HTTP event ingestion and request/response handling\n * without requiring a real GCP Cloud Function environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const postEvent: Flow.StepExample = {\n title: 'POST event',\n description:\n 'A GCP Cloud Function HTTP POST with a JSON body becomes a single walker elb event.',\n trigger: { type: 'POST' },\n in: {\n method: 'POST',\n body: {\n event: 'page view',\n data: { title: 'Home', url: 'https://example.com/' },\n },\n headers: { 'content-type': 'application/json' },\n },\n out: [\n [\n 'elb',\n {\n name: 'page view',\n data: { title: 'Home', url: 'https://example.com/' },\n },\n ],\n ],\n};\n\nexport const orderEvent: Flow.StepExample = {\n title: 'Order POST',\n description:\n 'A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.',\n trigger: { type: 'POST' },\n in: {\n method: 'POST',\n body: {\n event: 'order complete',\n data: { id: 'ORD-700', total: 99.99, currency: 'EUR' },\n },\n headers: { 'content-type': 'application/json' },\n },\n out: [\n [\n 'elb',\n {\n name: 'order complete',\n data: { id: 'ORD-700', total: 99.99, currency: 'EUR' },\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport type { CloudFunctionSource, Request, Response } from '../types';\nimport { startFlow } from '@walkeros/collector';\n\nexport interface Content {\n method: string;\n body: Record<string, unknown>;\n headers?: Record<string, string>;\n}\n\nexport interface Result {\n status: number;\n body: unknown;\n}\n\n/**\n * Find the cloudfunction source instance from collector.sources.\n */\nfunction findGcpSource(\n collector: Collector.Instance,\n): CloudFunctionSource | undefined {\n for (const source of Object.values(collector.sources || {})) {\n if ((source as { type?: string }).type === 'cloudfunction')\n return source as unknown as CloudFunctionSource;\n }\n return undefined;\n}\n\n/**\n * GCP CloudFunction source createTrigger.\n *\n * Boots a real collector via startFlow, then synthesizes mock req/res\n * (matching the GCP Functions Framework pattern) and calls source.push(req, res).\n * This is the realistic approach for GCP Cloud Functions - the Functions Framework\n * synthesizes these objects in production too.\n */\nconst createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n // Lazy startFlow\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findGcpSource(flow.collector);\n if (!source)\n throw new Error(\n 'CloudFunction source not found in collector — ensure it is configured in sources',\n );\n\n // Adapt body: step examples use `name`, source expects `event`\n const body = { ...content.body };\n if (body.name && !body.event) {\n body.event = body.name;\n delete body.name;\n }\n\n const headers = content.headers || {\n 'content-type': 'application/json',\n };\n\n // Synthesize mock req matching GCP Functions Framework pattern\n const req = {\n method: content.method,\n body,\n headers,\n get: (h: string) => headers[h.toLowerCase()],\n } as Request;\n\n // Synthesize mock res that captures status and response body\n let statusCode = 200;\n let responseBody: unknown;\n const res = {\n status: (code: number) => {\n statusCode = code;\n return res;\n },\n json: (data: unknown) => {\n responseBody = data;\n return res;\n },\n send: (data: unknown) => {\n responseBody = data;\n return res;\n },\n set: () => res,\n } as unknown as Response;\n\n // GCP source awaits env.push() — no detached promises\n await source.push(req, res);\n\n return { status: statusCode, body: responseBody };\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\nexport { createTrigger };\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * GCP Pub/Sub pull source settings schema.\n *\n * Required: projectId, subscription. All other fields optional with sensible\n * defaults applied at runtime by `getConfig`.\n */\nexport const SettingsSchema = z.object({\n client: z\n .any()\n .describe(\n 'Pre-configured Google Cloud Pub/Sub client (like new PubSub({ projectId })). Bypasses credentials resolution when supplied.',\n )\n .optional(),\n projectId: z\n .string()\n .min(1)\n .describe('Google Cloud Project ID (like my-gcp-project).'),\n subscription: z\n .string()\n .min(1)\n .describe(\n 'Pub/Sub subscription short name (like events-sub). The full resource name projects/<projectId>/subscriptions/<subscription> is built by the SDK.',\n ),\n topic: z\n .string()\n .describe(\n 'Pub/Sub topic short name. Required when setup.createTopic is true; otherwise informational.',\n )\n .optional(),\n credentials: z\n .any()\n .describe(\n 'Service account credentials as a JSON string or an object with client_email and private_key. Default: Application Default Credentials (ADC).',\n )\n .optional(),\n apiEndpoint: z\n .string()\n .describe(\n 'Override Pub/Sub API endpoint. Useful for the local emulator (like localhost:8085).',\n )\n .optional(),\n decoder: z\n .enum(['json', 'text', 'raw'])\n .describe(\n 'Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.',\n )\n .optional(),\n flowControl: z\n .object({\n maxMessages: z\n .number()\n .describe('Maximum in-flight messages. Default: 100.')\n .optional(),\n maxBytes: z\n .number()\n .describe('Maximum in-flight bytes. Default: 10485760 (10 MB).')\n .optional(),\n })\n .describe('Subscriber flow control. Tightens the SDK defaults.')\n .optional(),\n ackDeadline: z\n .number()\n .describe('Subscriber ack deadline in seconds. Default: 60.')\n .optional(),\n shutdownTimeoutMs: z\n .number()\n .describe(\n 'Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes the subscriber.',\n )\n .optional(),\n onPushError: z\n .enum(['nack', 'ack'])\n .describe(\n 'Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * GCP Pub/Sub pull source setup schema.\n *\n * Provisioning options for `walkeros setup source.<id>`. Idempotent\n * subscription creation, plus optional topic and dead-letter topic\n * auto-create. Triggered only by the explicit CLI command.\n */\nexport const SetupSchema = z.object({\n createTopic: z\n .boolean()\n .describe(\n 'Create the topic if it does not exist. Requires settings.topic. Default: false (require pre-existing topic).',\n )\n .optional(),\n ackDeadlineSeconds: z\n .number()\n .describe('Subscription ack deadline in seconds. Default: 60.')\n .optional(),\n messageRetentionDuration: z\n .object({\n seconds: z\n .number()\n .describe('Retention window in seconds. Default: project default.'),\n })\n .describe('Subscription-level retention configuration.')\n .optional(),\n filter: z\n .string()\n .describe(\n 'Subscription filter expression. Only messages matching this filter are delivered.',\n )\n .optional(),\n deadLetterPolicy: z\n .object({\n deadLetterTopic: z.string().describe('Dead-letter topic short name.'),\n maxDeliveryAttempts: z\n .number()\n .describe(\n 'Maximum delivery attempts before forwarding to the dead-letter topic.',\n ),\n createDeadLetterTopic: z\n .boolean()\n .describe(\n 'Auto-create the dead-letter topic if it does not exist. Default: false.',\n )\n .optional(),\n })\n .describe('Dead-letter policy. Strongly recommended for production.')\n .optional(),\n retryPolicy: z\n .object({\n minimumBackoff: z.object({\n seconds: z.number().describe('Minimum backoff in seconds.'),\n }),\n maximumBackoff: z.object({\n seconds: z.number().describe('Maximum backoff in seconds.'),\n }),\n })\n .describe('Subscription retry policy.')\n .optional(),\n enableMessageOrdering: z\n .boolean()\n .describe('Enable message ordering on the subscription. Default: false.')\n .optional(),\n labels: z\n .record(z.string(), z.string())\n .describe('Subscription labels for organization and billing.')\n .optional(),\n expirationPolicy: z\n .object({\n ttl: z\n .object({\n seconds: z\n .number()\n .describe('TTL in seconds. null means never expire.'),\n })\n .nullable()\n .optional(),\n })\n .describe('Subscription expiration policy.')\n .optional(),\n});\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\nexport type { Content, Result } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment for the Pub/Sub pull source.\n *\n * Tests substitute the real SDK via `jest.mock('@google-cloud/pubsub')`,\n * which is the recommended pattern: imports of `@google-cloud/pubsub` get\n * replaced module-wide, no env-injection plumbing required at the call site.\n *\n * The `simulation` list documents which globals the source touches during a\n * simulated run, used by the simulator to know what to stub.\n */\n\nconst noopFn = (): void => undefined;\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\nconst createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\n return fn;\n};\n\n/**\n * Standard mock environment for the pull source.\n *\n * `PubSub` is intentionally absent: the canonical pattern is module-level\n * `jest.mock('@google-cloud/pubsub')`, not env-injection.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n\nexport const simulation = ['PubSub'];\n","import type { Flow } from '@walkeros/core';\n\n/**\n * Pub/Sub pull step examples.\n *\n * Each example's `in` is a partial MessageLike (id, data Buffer, attributes,\n * publishTime). The trigger synthesizes the missing fields and invokes the\n * registered message handler. `out` is the array of recorded mock calls\n * produced by the handler. Recording shape is `[method, ...args]`.\n *\n * The `__triggerMessage` helper records each message's terminal state under\n * `message.ack` or `message.nack` so step examples can assert on that.\n */\n\nconst eventPayload = {\n name: 'page view',\n data: { title: 'Documentation', url: 'https://example.com/docs' },\n};\n\nconst orderPayload = {\n name: 'order complete',\n data: { id: 'ORD-500', total: 199.99, currency: 'EUR' },\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A JSON-encoded page view event arrives on the subscription, decodes successfully, and is acked.',\n in: {\n id: 'msg-1',\n dataString: JSON.stringify(eventPayload),\n attributes: {},\n },\n out: [['message.ack', 'msg-1']],\n};\n\nexport const orderComplete: Flow.StepExample = {\n title: 'Order complete',\n description:\n 'A JSON-encoded order event arrives and is acked after successful collector forwarding.',\n in: {\n id: 'msg-2',\n dataString: JSON.stringify(orderPayload),\n attributes: { entity: 'order', action: 'complete' },\n },\n out: [['message.ack', 'msg-2']],\n};\n\nexport const decoderText: Flow.StepExample = {\n title: 'Text decoder',\n description:\n 'With decoder=text on the source settings, the message data is forwarded to the collector as a UTF-8 string and acked.',\n in: {\n id: 'msg-3',\n dataString: 'plain text payload',\n attributes: {},\n },\n out: [['message.ack', 'msg-3']],\n};\n\nexport const malformedJson: Flow.StepExample = {\n title: 'Malformed JSON nack',\n description:\n 'A non-JSON body with the default json decoder fails to decode; the message is nacked for redelivery.',\n in: {\n id: 'msg-4',\n dataString: 'not-json{',\n attributes: {},\n },\n out: [['message.nack', 'msg-4']],\n};\n\nexport const malformedJsonAck: Flow.StepExample = {\n title: 'Malformed JSON ack-and-drop',\n description:\n 'With onPushError=ack on the source settings, a malformed JSON message is acked-and-dropped instead of redelivered.',\n in: {\n id: 'msg-5',\n dataString: 'not-json{',\n attributes: {},\n },\n out: [['message.ack', 'msg-5']],\n};\n","import type { Collector, Trigger } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport type { SyntheticMessage, SyntheticPushResult } from '../types';\n\n/**\n * Content shape for the pull-source trigger.\n *\n * The trigger synthesizes a message from this partial input and dispatches\n * it through the source's `push()` (the same pipeline the SDK subscriber\n * callback uses). `dataString` is the user-friendly way to provide the\n * message body; the trigger encodes it to a Buffer.\n */\nexport interface Content {\n id: string;\n dataString: string;\n attributes?: Record<string, string>;\n orderingKey?: string;\n}\n\n/**\n * Result shape for the pull-source trigger.\n *\n * Returns the recorded ack/nack as `[method, id]` entries, mirroring the\n * destination's `[method, ...args]` recording shape used elsewhere.\n */\nexport type Result = Array<[string, ...unknown[]]>;\n\ninterface PubSubPullSourceLike {\n type: string;\n push: (content?: SyntheticMessage) => Promise<SyntheticPushResult | void>;\n}\n\nfunction isPubSubPullSource(value: unknown): value is PubSubPullSourceLike {\n if (typeof value !== 'object' || value === null) return false;\n const candidate: { type?: unknown; push?: unknown } = value;\n return (\n candidate.type === 'pubsub-pull' && typeof candidate.push === 'function'\n );\n}\n\nfunction findSource(\n collector: Collector.Instance,\n): PubSubPullSourceLike | undefined {\n for (const source of Object.values(collector.sources ?? {})) {\n if (isPubSubPullSource(source)) return source;\n }\n return undefined;\n}\n\n/**\n * Pub/Sub pull source createTrigger.\n *\n * Boots the collector via startFlow, finds the registered pubsub-pull source,\n * and invokes its `push()` with a synthesized message. The source dispatches\n * the synthetic message through the same handler the SDK subscriber callback\n * uses, exercising the full decode / forward / ack-nack pipeline without\n * touching real Pub/Sub.\n *\n * Matches the convention used by other source triggers (express, lambda,\n * cloudfunction): find the source by type from the collector and call its\n * public `push()` interface.\n */\nexport const createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n () =>\n async (content: Content): Promise<Result> => {\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const source = findSource(flow.collector);\n if (!source)\n throw new Error(\n 'pubsub-pull source not registered in collector — ensure it is configured in sources',\n );\n\n const synthetic: SyntheticMessage = {\n id: content.id,\n data: Buffer.from(content.dataString, 'utf8'),\n attributes: content.attributes,\n orderingKey: content.orderingKey,\n };\n\n const result = await source.push(synthetic);\n const recorded: Result = [];\n if (result && typeof result === 'object') {\n if (result.acked) recorded.push(['message.ack', content.id]);\n if (result.nacked) recorded.push(['message.nack', content.id]);\n }\n return recorded;\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\nexport { SettingsSchema, type Settings } from './settings';\n\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * GCP Pub/Sub push source settings schema.\n *\n * No required fields. The push source is a request-handler; configuration\n * tunables live here, but operators wire `source.push` into their own\n * express/lambda runtime.\n */\nexport const SettingsSchema = z.object({\n projectId: z\n .string()\n .describe(\n 'Google Cloud Project ID (informational, surfaced in error messages).',\n )\n .optional(),\n decoder: z\n .enum(['json', 'text', 'raw'])\n .describe(\n 'Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.',\n )\n .optional(),\n verifyOidc: z\n .boolean()\n .describe(\n 'Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false.',\n )\n .optional(),\n audience: z\n .string()\n .describe(\n 'OIDC audience (your endpoint URL or a custom audience). Required when verifyOidc is true.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\nexport type { Content, Result } from './trigger';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment for the Pub/Sub push source.\n *\n * Provides a no-op env compatible with `Source.Env` plus an optional\n * verifyOidcToken stub for tests that exercise OIDC verification.\n */\n\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n warn: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noopFn,\n scope: () => noopLogger,\n};\n\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() => Promise.resolve({ ok: true })) as Elb.Fn;\n return fn;\n};\n\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n\nexport const simulation: string[] = [];\n","import type { Flow } from '@walkeros/core';\n\n/**\n * Pub/Sub push step examples.\n *\n * Each example's `in` is a partial Pub/Sub push envelope (with `message.data`\n * pre-encoded as base64). The trigger constructs an HTTP-like Request from\n * `in` and invokes the source handler. `out` is the recorded HTTP response\n * shape (statusCode + JSON body).\n */\n\nconst eventPayload = {\n name: 'page view',\n data: { title: 'Documentation', url: 'https://example.com/docs' },\n};\n\nconst orderPayload = {\n name: 'order complete',\n data: { id: 'ORD-500', total: 199.99, currency: 'EUR' },\n};\n\nfunction encodeData(value: unknown): string {\n return Buffer.from(JSON.stringify(value), 'utf8').toString('base64');\n}\n\nexport const validEnvelope: Flow.StepExample = {\n title: 'Valid push envelope',\n description:\n 'A well-formed Pub/Sub push envelope decodes the base64 data, parses JSON, and forwards the event to the collector with a 200 response.',\n in: {\n message: {\n messageId: 'push-1',\n data: encodeData(eventPayload),\n attributes: { source: 'analytics' },\n },\n subscription: 'projects/test/subscriptions/events-sub',\n },\n out: [['response', 200, { success: true, id: 'push-1' }]],\n};\n\nexport const orderEnvelope: Flow.StepExample = {\n title: 'Order envelope',\n description:\n 'A push envelope carrying an order event is decoded and forwarded to the collector.',\n in: {\n message: {\n messageId: 'push-2',\n data: encodeData(orderPayload),\n attributes: {},\n },\n subscription: 'projects/test/subscriptions/events-sub',\n },\n out: [['response', 200, { success: true, id: 'push-2' }]],\n};\n\nexport const malformedEnvelope: Flow.StepExample = {\n title: 'Malformed envelope',\n description:\n 'A POST body lacking message.messageId returns 400 Bad Request without forwarding to the collector.',\n in: {\n not_a: 'pubsub envelope',\n },\n out: [\n [\n 'response',\n 400,\n {\n success: false,\n error: 'Malformed Pub/Sub envelope (missing message.messageId).',\n },\n ],\n ],\n};\n","import type { Collector, Trigger } from '@walkeros/core';\nimport type { Request, Response } from '../types';\nimport { startFlow } from '@walkeros/collector';\n\n/** Content for the push trigger: a Pub/Sub envelope or any POST body. */\nexport type Content = Record<string, unknown>;\n\n/** Result: the recorded HTTP response (`status` + `json` body). */\nexport type Result = Array<[string, ...unknown[]]>;\n\ninterface RecordedResponse {\n statusCode?: number;\n body?: unknown;\n}\n\nfunction buildResponse(state: RecordedResponse): Response {\n const res: Response = {\n status(code: number) {\n state.statusCode = code;\n return res;\n },\n json(body: unknown) {\n state.body = body;\n return res;\n },\n send(body?: unknown) {\n state.body = body;\n return res;\n },\n set() {\n return res;\n },\n };\n return res;\n}\n\nfunction buildRequest(\n content: Content,\n headers: Record<string, string>,\n): Request {\n return {\n method: 'POST',\n body: content,\n headers,\n get(name: string) {\n const value = headers[name.toLowerCase()] ?? headers[name];\n return value;\n },\n };\n}\n\ninterface TriggerOptions {\n headers?: Record<string, string>;\n}\n\ninterface PushCapableSource {\n type: string;\n push: (req: Request, res: Response) => Promise<void>;\n}\n\nfunction isPushCapableSource(value: unknown): value is PushCapableSource {\n if (typeof value !== 'object' || value === null) return false;\n const candidate: { type?: unknown; push?: unknown } = value;\n return (\n typeof candidate.type === 'string' &&\n candidate.type === 'pubsub-push' &&\n typeof candidate.push === 'function'\n );\n}\n\nfunction findPushSource(\n collector: Collector.Instance,\n): PushCapableSource | undefined {\n for (const source of Object.values(collector.sources ?? {})) {\n if (isPushCapableSource(source)) return source;\n }\n return undefined;\n}\n\n/**\n * Pub/Sub push source createTrigger.\n *\n * Boots the collector via startFlow, builds a fake Request/Response pair\n * from the trigger Content, and invokes the source's HTTP handler. Returns\n * the recorded response as a Result entry.\n */\nexport const createTrigger: Trigger.CreateFn<Content, Result> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<Content, Result> =\n (_type, options) =>\n async (content: Content): Promise<Result> => {\n if (!flow) {\n const result = await startFlow(config);\n flow = { collector: result.collector, elb: result.elb };\n }\n\n const triggerOptions: TriggerOptions =\n typeof options === 'object' && options !== null\n ? (options as TriggerOptions)\n : {};\n const headers = triggerOptions.headers ?? {};\n\n const source = findPushSource(flow.collector);\n if (!source) throw new Error('pubsub-push source not registered');\n\n const state: RecordedResponse = {};\n const req = buildRequest(content, headers);\n const res = buildResponse(state);\n\n await source.push(req, res);\n\n const recorded: Result = [\n ['response', state.statusCode ?? 0, state.body ?? null],\n ];\n return recorded;\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAKX,IAAM,aAAa,EAAE,KAAK;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AASM,IAAM,aAAa,EAAE,MAAM;AAAA,EAChC,EAAE,OAAO;AAAA,EACT,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EAClB,EAAE,QAAQ,GAAG;AACf,CAAC;AAMM,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,QAAQ,WAAW;AAAA,IACjB;AAAA,EACF,EAAE,SAAS;AAAA,EAEX,SAAS,EAAE,MAAM,UAAU,EAAE,SAAS,sBAAsB,EAAE,SAAS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tD,SACE,OAAO,UAAU,SAAS,YAC1B,UAAU,SAAS,iBACnB,OAAO,UAAU,SAAS;AAE9B;AAEA,SAAS,eACP,WAC+B;AAC/B,aAAW,UAAU,OAAO,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG;AAC3D,QAAI,oBAAoB,MAAM,EAAG,QAAO;AAAA,EAC1C;AACA,SAAO;AACT;AASO,IAAMC,iBAAmD,OAC9D,WACG;AACH,MAAI;AAEJ,QAAM,UACJ,CAAC,OAAO,YACR,OAAO,YAAsC;AAC3C,QAAI,CAAC,MAAM;AACT,YAAM,SAAS,MAAMD,WAAU,MAAM;AACrC,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AAAA,IACxD;AAEA,UAAM,iBACJ,OAAO,YAAY,YAAY,YAAY,OACtC,UACD,CAAC;AACP,UAAM,UAAU,eAAe,WAAW,CAAC;AAE3C,UAAM,SAAS,eAAe,KAAK,SAAS;AAC5C,QAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,mCAAmC;AAEhE,UAAM,QAA0B,CAAC;AACjC,UAAM,MAAM,aAAa,SAAS,OAAO;AACzC,UAAM,MAAM,cAAc,KAAK;AAE/B,UAAM,OAAO,KAAK,KAAK,GAAG;AAE1B,UAAM,WAAmB;AAAA,MACvB,CAAC,YAAY,MAAM,cAAc,GAAG,MAAM,QAAQ,IAAI;AAAA,IACxD;AACA,WAAO;AAAA,EACT;AAEF,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;","names":["z","z","schemas_exports","SettingsSchema","settings","zodToSchema","z","SettingsSchema","z","settings","zodToSchema","SettingsSchema","examples_exports","createTrigger","env_exports","step_exports","env_exports","push","noopFn","noopLogger","createMockElbFn","step_exports","startFlow","createTrigger","result","schemas_exports","SettingsSchema","settings","zodToSchema","z","SettingsSchema","settings","zodToSchema","SettingsSchema","examples_exports","createTrigger","env_exports","step_exports","env_exports","push","simulation","noopFn","noopLogger","createMockElbFn","step_exports","eventPayload","orderPayload","startFlow","createTrigger"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Source, WalkerOS, Flow, Trigger } from '@walkeros/core';
|
|
1
|
+
import { Source, WalkerOS, Flow, Trigger, SetupFn as SetupFn$1 } from '@walkeros/core';
|
|
2
2
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
3
3
|
import { z } from '@walkeros/core/dev';
|
|
4
|
+
import { PubSub, Subscription } from '@google-cloud/pubsub';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* HTTP methods enum
|
|
@@ -64,7 +65,7 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
64
65
|
}, z.core.$strip>]>>;
|
|
65
66
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
66
67
|
}, z.core.$strip>;
|
|
67
|
-
type Settings$
|
|
68
|
+
type Settings$3 = z.infer<typeof SettingsSchema>;
|
|
68
69
|
|
|
69
70
|
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
70
71
|
|
|
@@ -74,7 +75,7 @@ declare const index$1_HttpMethod: typeof HttpMethod;
|
|
|
74
75
|
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
75
76
|
declare const index$1_settings: typeof settings;
|
|
76
77
|
declare namespace index$1 {
|
|
77
|
-
export { type CorsOptions$1 as CorsOptions, index$1_CorsOptionsSchema as CorsOptionsSchema, index$1_CorsOrigin as CorsOrigin, index$1_HttpMethod as HttpMethod, type Settings$
|
|
78
|
+
export { type CorsOptions$1 as CorsOptions, index$1_CorsOptionsSchema as CorsOptionsSchema, index$1_CorsOrigin as CorsOrigin, index$1_HttpMethod as HttpMethod, type Settings$3 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
declare module '@walkeros/core' {
|
|
@@ -85,34 +86,34 @@ declare module '@walkeros/core' {
|
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
interface Request {
|
|
89
|
+
interface Request$1 {
|
|
89
90
|
method: string;
|
|
90
91
|
body?: unknown;
|
|
91
92
|
headers: Record<string, string | string[]>;
|
|
92
93
|
get(name: string): string | undefined;
|
|
93
94
|
}
|
|
94
|
-
interface Response {
|
|
95
|
-
status(code: number): Response;
|
|
96
|
-
json(body: unknown): Response;
|
|
97
|
-
send(body?: unknown): Response;
|
|
98
|
-
set(key: string, value: string): Response;
|
|
95
|
+
interface Response$1 {
|
|
96
|
+
status(code: number): Response$1;
|
|
97
|
+
json(body: unknown): Response$1;
|
|
98
|
+
send(body?: unknown): Response$1;
|
|
99
|
+
set(key: string, value: string): Response$1;
|
|
99
100
|
}
|
|
100
|
-
type Settings = z.infer<typeof SettingsSchema>;
|
|
101
|
+
type Settings$2 = z.infer<typeof SettingsSchema>;
|
|
101
102
|
type CorsOptions = z.infer<typeof CorsOptionsSchema>;
|
|
102
|
-
type InitSettings = Partial<Settings>;
|
|
103
|
-
interface Mapping {
|
|
103
|
+
type InitSettings$2 = Partial<Settings$2>;
|
|
104
|
+
interface Mapping$2 {
|
|
104
105
|
}
|
|
105
|
-
type Push = (req: Request, res: Response) => Promise<void>;
|
|
106
|
-
interface Env extends Source.Env {
|
|
107
|
-
req?: Request;
|
|
108
|
-
res?: Response;
|
|
106
|
+
type Push$2 = (req: Request$1, res: Response$1) => Promise<void>;
|
|
107
|
+
interface Env$2 extends Source.Env {
|
|
108
|
+
req?: Request$1;
|
|
109
|
+
res?: Response$1;
|
|
109
110
|
}
|
|
110
|
-
type Types = Source.Types<Settings, Mapping, Push, Env, InitSettings>;
|
|
111
|
-
interface CloudFunctionSource extends Omit<Source.Instance<Types>, 'push'> {
|
|
112
|
-
push: Push;
|
|
111
|
+
type Types$2 = Source.Types<Settings$2, Mapping$2, Push$2, Env$2, InitSettings$2>;
|
|
112
|
+
interface CloudFunctionSource extends Omit<Source.Instance<Types$2>, 'push'> {
|
|
113
|
+
push: Push$2;
|
|
113
114
|
}
|
|
114
|
-
type Config = Source.Config<Types>;
|
|
115
|
-
type PartialConfig = Source.PartialConfig<Types>;
|
|
115
|
+
type Config$2 = Source.Config<Types$2>;
|
|
116
|
+
type PartialConfig$2 = Source.PartialConfig<Types$2>;
|
|
116
117
|
interface EventRequest {
|
|
117
118
|
event: string;
|
|
118
119
|
data?: WalkerOS.AnyObject;
|
|
@@ -129,24 +130,14 @@ interface EventResponse {
|
|
|
129
130
|
type RequestBody = EventRequest;
|
|
130
131
|
type ResponseBody = EventResponse;
|
|
131
132
|
|
|
132
|
-
type
|
|
133
|
-
type
|
|
134
|
-
type
|
|
135
|
-
type
|
|
136
|
-
type
|
|
137
|
-
type
|
|
138
|
-
|
|
139
|
-
type
|
|
140
|
-
type types_PartialConfig = PartialConfig;
|
|
141
|
-
type types_Push = Push;
|
|
142
|
-
type types_Request = Request;
|
|
143
|
-
type types_RequestBody = RequestBody;
|
|
144
|
-
type types_Response = Response;
|
|
145
|
-
type types_ResponseBody = ResponseBody;
|
|
146
|
-
type types_Settings = Settings;
|
|
147
|
-
type types_Types = Types;
|
|
148
|
-
declare namespace types {
|
|
149
|
-
export type { types_CloudFunctionSource as CloudFunctionSource, types_Config as Config, types_CorsOptions as CorsOptions, types_Env as Env, types_EventRequest as EventRequest, types_EventResponse as EventResponse, types_InitSettings as InitSettings, types_Mapping as Mapping, types_PartialConfig as PartialConfig, types_Push as Push, types_Request as Request, types_RequestBody as RequestBody, types_Response as Response, types_ResponseBody as ResponseBody, types_Settings as Settings, types_Types as Types };
|
|
133
|
+
type types$2_CloudFunctionSource = CloudFunctionSource;
|
|
134
|
+
type types$2_CorsOptions = CorsOptions;
|
|
135
|
+
type types$2_EventRequest = EventRequest;
|
|
136
|
+
type types$2_EventResponse = EventResponse;
|
|
137
|
+
type types$2_RequestBody = RequestBody;
|
|
138
|
+
type types$2_ResponseBody = ResponseBody;
|
|
139
|
+
declare namespace types$2 {
|
|
140
|
+
export type { types$2_CloudFunctionSource as CloudFunctionSource, Config$2 as Config, types$2_CorsOptions as CorsOptions, Env$2 as Env, types$2_EventRequest as EventRequest, types$2_EventResponse as EventResponse, InitSettings$2 as InitSettings, Mapping$2 as Mapping, PartialConfig$2 as PartialConfig, Push$2 as Push, Request$1 as Request, types$2_RequestBody as RequestBody, Response$1 as Response, types$2_ResponseBody as ResponseBody, Settings$2 as Settings, Types$2 as Types };
|
|
150
141
|
}
|
|
151
142
|
|
|
152
143
|
/**
|
|
@@ -155,7 +146,7 @@ declare namespace types {
|
|
|
155
146
|
* Use this for testing HTTP event ingestion and request/response handling
|
|
156
147
|
* without requiring a real GCP Cloud Function environment.
|
|
157
148
|
*/
|
|
158
|
-
declare const push: Env;
|
|
149
|
+
declare const push: Env$2;
|
|
159
150
|
|
|
160
151
|
declare const env_push: typeof push;
|
|
161
152
|
declare namespace env {
|
|
@@ -197,6 +188,265 @@ declare namespace index {
|
|
|
197
188
|
export { index_createTrigger as createTrigger, index_env as env, index_step as step };
|
|
198
189
|
}
|
|
199
190
|
|
|
200
|
-
declare const sourceCloudFunction: Source.Init<Types>;
|
|
191
|
+
declare const sourceCloudFunction: Source.Init<Types$2>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Shared types for the Pub/Sub source (pull and push).
|
|
195
|
+
*
|
|
196
|
+
* The source uses real `@google-cloud/pubsub` SDK types directly (`PubSub`,
|
|
197
|
+
* `Subscription`, `Topic`, `Message`, `SubscriptionMetadata`, etc.) rather
|
|
198
|
+
* than hand-rolled narrow surrogates. This keeps the runtime contract
|
|
199
|
+
* honest: if the SDK changes a signature, the source surfaces the break
|
|
200
|
+
* at compile time instead of papering over it with a permissive interface.
|
|
201
|
+
*
|
|
202
|
+
* Only domain types that have no SDK equivalent live here.
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* Service account credentials. Mirrors the destination shape in
|
|
206
|
+
* `@walkeros/server-destination-gcp`.
|
|
207
|
+
*/
|
|
208
|
+
interface ServiceAccountCredentials {
|
|
209
|
+
client_email: string;
|
|
210
|
+
private_key: string;
|
|
211
|
+
project_id?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Decoder mode for the message data payload.
|
|
215
|
+
*
|
|
216
|
+
* - `json`: JSON.parse(data.toString('utf8')). Default.
|
|
217
|
+
* - `text`: data.toString('utf8'). The text becomes the event payload.
|
|
218
|
+
* - `raw`: the raw Buffer is forwarded as-is.
|
|
219
|
+
*/
|
|
220
|
+
type Decoder = 'json' | 'text' | 'raw';
|
|
221
|
+
|
|
222
|
+
declare module '@walkeros/core' {
|
|
223
|
+
interface SourceMap {
|
|
224
|
+
'pubsub-pull': {
|
|
225
|
+
type: 'pubsub-pull';
|
|
226
|
+
platform: 'server';
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
interface Settings$1 {
|
|
231
|
+
client: PubSub;
|
|
232
|
+
projectId: string;
|
|
233
|
+
subscription: string;
|
|
234
|
+
topic?: string;
|
|
235
|
+
credentials?: string | ServiceAccountCredentials;
|
|
236
|
+
apiEndpoint?: string;
|
|
237
|
+
decoder?: Decoder;
|
|
238
|
+
flowControl?: {
|
|
239
|
+
maxMessages?: number;
|
|
240
|
+
maxBytes?: number;
|
|
241
|
+
};
|
|
242
|
+
ackDeadline?: number;
|
|
243
|
+
shutdownTimeoutMs?: number;
|
|
244
|
+
onPushError?: 'nack' | 'ack';
|
|
245
|
+
subscriptionHandle?: Subscription;
|
|
246
|
+
}
|
|
247
|
+
interface InitSettings$1 {
|
|
248
|
+
projectId: string;
|
|
249
|
+
subscription: string;
|
|
250
|
+
topic?: string;
|
|
251
|
+
client?: PubSub;
|
|
252
|
+
credentials?: string | ServiceAccountCredentials;
|
|
253
|
+
apiEndpoint?: string;
|
|
254
|
+
decoder?: Decoder;
|
|
255
|
+
flowControl?: {
|
|
256
|
+
maxMessages?: number;
|
|
257
|
+
maxBytes?: number;
|
|
258
|
+
};
|
|
259
|
+
ackDeadline?: number;
|
|
260
|
+
shutdownTimeoutMs?: number;
|
|
261
|
+
onPushError?: 'nack' | 'ack';
|
|
262
|
+
}
|
|
263
|
+
interface Mapping$1 {
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Synthetic message input. Used by tests / triggers to dispatch a message
|
|
267
|
+
* through the same handler the SDK subscriber callback uses, without
|
|
268
|
+
* involving real Pub/Sub infrastructure.
|
|
269
|
+
*
|
|
270
|
+
* In production, `push()` is invoked without arguments and is a no-op:
|
|
271
|
+
* Pub/Sub is event-driven, the SDK's subscription emitter is the canonical
|
|
272
|
+
* delivery path. Tests pass a synthetic input to dispatch directly.
|
|
273
|
+
*/
|
|
274
|
+
interface SyntheticMessage {
|
|
275
|
+
id: string;
|
|
276
|
+
data: Buffer;
|
|
277
|
+
attributes?: Record<string, string>;
|
|
278
|
+
orderingKey?: string;
|
|
279
|
+
}
|
|
280
|
+
interface SyntheticPushResult {
|
|
281
|
+
acked: boolean;
|
|
282
|
+
nacked: boolean;
|
|
283
|
+
}
|
|
284
|
+
type Push$1 = (content?: SyntheticMessage) => Promise<SyntheticPushResult | void>;
|
|
285
|
+
interface Env$1 extends Source.Env {
|
|
286
|
+
PubSub?: typeof PubSub;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Provisioning options for `walkeros setup source.<id>`.
|
|
290
|
+
*
|
|
291
|
+
* Triggered only by the explicit CLI command. Idempotent. Never auto-run.
|
|
292
|
+
*/
|
|
293
|
+
interface Setup {
|
|
294
|
+
/** Optional: create the topic if it does not exist. Default: false (require pre-existing topic). */
|
|
295
|
+
createTopic?: boolean;
|
|
296
|
+
/** Subscription ack deadline in seconds. Default: 60. */
|
|
297
|
+
ackDeadlineSeconds?: number;
|
|
298
|
+
/** Subscription message retention. Default: undefined (project default). */
|
|
299
|
+
messageRetentionDuration?: {
|
|
300
|
+
seconds: number;
|
|
301
|
+
};
|
|
302
|
+
/** Filter expression. Optional. */
|
|
303
|
+
filter?: string;
|
|
304
|
+
/** Dead-letter policy. Optional but strongly recommended. */
|
|
305
|
+
deadLetterPolicy?: {
|
|
306
|
+
deadLetterTopic: string;
|
|
307
|
+
maxDeliveryAttempts: number;
|
|
308
|
+
/** Auto-create the dead-letter topic if it does not exist. Default: false. */
|
|
309
|
+
createDeadLetterTopic?: boolean;
|
|
310
|
+
};
|
|
311
|
+
/** Retry policy. Optional. */
|
|
312
|
+
retryPolicy?: {
|
|
313
|
+
minimumBackoff: {
|
|
314
|
+
seconds: number;
|
|
315
|
+
};
|
|
316
|
+
maximumBackoff: {
|
|
317
|
+
seconds: number;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
/** Enable message ordering on the subscription. Default: false. */
|
|
321
|
+
enableMessageOrdering?: boolean;
|
|
322
|
+
/** Subscription labels. Optional. */
|
|
323
|
+
labels?: Record<string, string>;
|
|
324
|
+
/** Subscription expiration policy. `null` means never expire. */
|
|
325
|
+
expirationPolicy?: {
|
|
326
|
+
ttl?: {
|
|
327
|
+
seconds: number;
|
|
328
|
+
} | null;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
type Types$1 = Source.Types<Settings$1, Mapping$1, Push$1, Env$1, InitSettings$1, Setup>;
|
|
332
|
+
type Config$1 = Source.Config<Types$1>;
|
|
333
|
+
type PartialConfig$1 = Source.PartialConfig<Types$1>;
|
|
334
|
+
type SetupFn = SetupFn$1<Config$1, Env$1>;
|
|
335
|
+
|
|
336
|
+
type types$1_Decoder = Decoder;
|
|
337
|
+
declare const types$1_PubSub: typeof PubSub;
|
|
338
|
+
type types$1_ServiceAccountCredentials = ServiceAccountCredentials;
|
|
339
|
+
type types$1_Setup = Setup;
|
|
340
|
+
type types$1_SetupFn = SetupFn;
|
|
341
|
+
declare const types$1_Subscription: typeof Subscription;
|
|
342
|
+
type types$1_SyntheticMessage = SyntheticMessage;
|
|
343
|
+
type types$1_SyntheticPushResult = SyntheticPushResult;
|
|
344
|
+
declare namespace types$1 {
|
|
345
|
+
export { type Config$1 as Config, type types$1_Decoder as Decoder, type Env$1 as Env, type InitSettings$1 as InitSettings, type Mapping$1 as Mapping, type PartialConfig$1 as PartialConfig, types$1_PubSub as PubSub, type Push$1 as Push, type types$1_ServiceAccountCredentials as ServiceAccountCredentials, type Settings$1 as Settings, type types$1_Setup as Setup, type types$1_SetupFn as SetupFn, types$1_Subscription as Subscription, type types$1_SyntheticMessage as SyntheticMessage, type types$1_SyntheticPushResult as SyntheticPushResult, type Types$1 as Types };
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Google Cloud Pub/Sub pull source.
|
|
350
|
+
*
|
|
351
|
+
* Long-running streaming subscriber. `init()` opens the subscription stream
|
|
352
|
+
* and forwards each message to the collector via `env.push`. The source's
|
|
353
|
+
* `push` accepts an optional synthetic message (used by tests / triggers)
|
|
354
|
+
* and dispatches it through the same pipeline; called without arguments
|
|
355
|
+
* (production) it is a no-op since Pub/Sub is event-driven.
|
|
356
|
+
*
|
|
357
|
+
* `destroy()` closes the subscriber gracefully, honoring `shutdownTimeoutMs`.
|
|
358
|
+
*/
|
|
359
|
+
declare const sourcePubSubPull: Source.Init<Types$1>;
|
|
360
|
+
|
|
361
|
+
declare module '@walkeros/core' {
|
|
362
|
+
interface SourceMap {
|
|
363
|
+
'pubsub-push': {
|
|
364
|
+
type: 'pubsub-push';
|
|
365
|
+
platform: 'server';
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Minimal request shape for the push handler. Mirrors the cloudfunction
|
|
371
|
+
* source so operators can wire `sourcePubSubPush` into express, lambda,
|
|
372
|
+
* or any framework that delivers a similar contract.
|
|
373
|
+
*/
|
|
374
|
+
interface Request {
|
|
375
|
+
method: string;
|
|
376
|
+
body?: unknown;
|
|
377
|
+
headers: Record<string, string | string[]>;
|
|
378
|
+
get(name: string): string | undefined;
|
|
379
|
+
}
|
|
380
|
+
interface Response {
|
|
381
|
+
status(code: number): Response;
|
|
382
|
+
json(body: unknown): Response;
|
|
383
|
+
send(body?: unknown): Response;
|
|
384
|
+
set(key: string, value: string): Response;
|
|
385
|
+
}
|
|
386
|
+
interface Settings {
|
|
387
|
+
/** GCP project id. Optional; informational, used in error messages. */
|
|
388
|
+
projectId?: string;
|
|
389
|
+
/** Decoder for the message data field. Default: 'json'. */
|
|
390
|
+
decoder?: Decoder;
|
|
391
|
+
/** Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false. */
|
|
392
|
+
verifyOidc?: boolean;
|
|
393
|
+
/** OIDC audience (your endpoint URL or a custom audience). Required if verifyOidc is true. */
|
|
394
|
+
audience?: string;
|
|
395
|
+
}
|
|
396
|
+
type InitSettings = Partial<Settings>;
|
|
397
|
+
interface Mapping {
|
|
398
|
+
}
|
|
399
|
+
type Push = (req: Request, res: Response) => Promise<void>;
|
|
400
|
+
interface Env extends Source.Env {
|
|
401
|
+
req?: Request;
|
|
402
|
+
res?: Response;
|
|
403
|
+
/** Optional override for OIDC verification. Tests can inject a stub. */
|
|
404
|
+
verifyOidcToken?: (token: string, audience: string) => Promise<{
|
|
405
|
+
sub?: string;
|
|
406
|
+
email?: string;
|
|
407
|
+
}>;
|
|
408
|
+
}
|
|
409
|
+
type Types = Source.Types<Settings, Mapping, Push, Env, InitSettings>;
|
|
410
|
+
type Config = Source.Config<Types>;
|
|
411
|
+
type PartialConfig = Source.PartialConfig<Types>;
|
|
412
|
+
/**
|
|
413
|
+
* Pub/Sub push envelope shape. Pub/Sub POSTs each message in this format
|
|
414
|
+
* to the configured push endpoint. `data` is base64-encoded.
|
|
415
|
+
*/
|
|
416
|
+
interface PushEnvelope {
|
|
417
|
+
message: {
|
|
418
|
+
data?: string;
|
|
419
|
+
attributes?: Record<string, string>;
|
|
420
|
+
messageId: string;
|
|
421
|
+
publishTime?: string;
|
|
422
|
+
orderingKey?: string;
|
|
423
|
+
};
|
|
424
|
+
subscription: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type types_Config = Config;
|
|
428
|
+
type types_Env = Env;
|
|
429
|
+
type types_InitSettings = InitSettings;
|
|
430
|
+
type types_Mapping = Mapping;
|
|
431
|
+
type types_PartialConfig = PartialConfig;
|
|
432
|
+
type types_Push = Push;
|
|
433
|
+
type types_PushEnvelope = PushEnvelope;
|
|
434
|
+
type types_Request = Request;
|
|
435
|
+
type types_Response = Response;
|
|
436
|
+
type types_Settings = Settings;
|
|
437
|
+
type types_Types = Types;
|
|
438
|
+
declare namespace types {
|
|
439
|
+
export type { types_Config as Config, types_Env as Env, types_InitSettings as InitSettings, types_Mapping as Mapping, types_PartialConfig as PartialConfig, types_Push as Push, types_PushEnvelope as PushEnvelope, types_Request as Request, types_Response as Response, types_Settings as Settings, types_Types as Types };
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Google Cloud Pub/Sub push source.
|
|
444
|
+
*
|
|
445
|
+
* HTTP request handler. Pub/Sub POSTs each message envelope to the operator's
|
|
446
|
+
* endpoint; this source decodes the envelope, base64-decodes the data field,
|
|
447
|
+
* runs the configured decoder, and forwards the decoded value to the
|
|
448
|
+
* collector via env.push.
|
|
449
|
+
*/
|
|
450
|
+
declare const sourcePubSubPush: Source.Init<Types>;
|
|
201
451
|
|
|
202
|
-
export { types as SourceCloudFunction, index as examples, index$1 as schemas, sourceCloudFunction };
|
|
452
|
+
export { types$2 as SourceCloudFunction, types$1 as SourcePubSubPull, types as SourcePubSubPush, index as examples, index$1 as schemas, sourceCloudFunction, sourcePubSubPull, sourcePubSubPush };
|