@walkeros/server-source-gcp 4.7.0-next-1790722899482 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @walkeros/server-source-gcp
2
2
 
3
- ## 4.7.0-next-1790722899482
3
+ ## 4.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 64b06de: Packages with several exports, such as the GCP and AWS sources and
8
+ destinations, now publish a settings schema per export. `walkeros validate`
9
+ and MCP `package_get` use the schema of the export a step imports. Pub/Sub,
10
+ BigQuery, SNS and SQS steps pinned to this release or later are checked
11
+ instead of skipped; older pins still report a skip.
4
12
 
5
13
  ### Patch Changes
6
14
 
@@ -15,9 +23,14 @@
15
23
  issues as `elb` calls; `--page-url` sets the web page. Express flows need no
16
24
  port. Packages with several exports use per-export examples and mocks, and a
17
25
  destination without a mock env is refused instead of calling the vendor.
26
+ - Updated dependencies [786a860]
18
27
  - Updated dependencies [74821ed]
19
28
  - Updated dependencies [06b498a]
29
+ - Updated dependencies [7e5e3de]
30
+ - Updated dependencies [b9668bf]
20
31
  - Updated dependencies [74821ed]
32
+ - Updated dependencies [64b06de]
33
+ - Updated dependencies [4b4937f]
21
34
  - Updated dependencies [74821ed]
22
35
  - Updated dependencies [74821ed]
23
36
  - Updated dependencies [74821ed]
@@ -27,10 +40,12 @@
27
40
  - Updated dependencies [74821ed]
28
41
  - Updated dependencies [74821ed]
29
42
  - Updated dependencies [74821ed]
43
+ - Updated dependencies [e860006]
30
44
  - Updated dependencies [74821ed]
31
45
  - Updated dependencies [74821ed]
32
- - @walkeros/collector@4.7.0-next-1790722899482
33
- - @walkeros/core@4.7.0-next-1790722899482
46
+ - Updated dependencies [4f89234]
47
+ - @walkeros/collector@4.7.0
48
+ - @walkeros/core@4.7.0
34
49
 
35
50
  ## 4.6.1
36
51
 
package/dist/dev.d.mts CHANGED
@@ -155,84 +155,6 @@ declare namespace cloudFunctionExamplesNs {
155
155
  export { createTrigger$2 as createTrigger, env$2 as env, step$2 as step };
156
156
  }
157
157
 
158
- /**
159
- * GCP Pub/Sub pull source settings schema.
160
- *
161
- * Required: projectId, subscription. All other fields optional with sensible
162
- * defaults applied at runtime by `getConfig`.
163
- */
164
- declare const SettingsSchema$1: z.ZodObject<{
165
- client: z.ZodOptional<z.ZodAny>;
166
- projectId: z.ZodString;
167
- subscription: z.ZodString;
168
- topic: z.ZodOptional<z.ZodString>;
169
- credentials: z.ZodOptional<z.ZodAny>;
170
- apiEndpoint: z.ZodOptional<z.ZodString>;
171
- decoder: z.ZodOptional<z.ZodEnum<{
172
- json: "json";
173
- text: "text";
174
- raw: "raw";
175
- }>>;
176
- flowControl: z.ZodOptional<z.ZodObject<{
177
- maxMessages: z.ZodOptional<z.ZodNumber>;
178
- maxBytes: z.ZodOptional<z.ZodNumber>;
179
- }, z.core.$strip>>;
180
- ackDeadline: z.ZodOptional<z.ZodNumber>;
181
- shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
182
- onPushError: z.ZodOptional<z.ZodEnum<{
183
- nack: "nack";
184
- ack: "ack";
185
- }>>;
186
- }, z.core.$strip>;
187
- type Settings$1 = z.infer<typeof SettingsSchema$1>;
188
-
189
- /**
190
- * GCP Pub/Sub pull source setup schema.
191
- *
192
- * Provisioning options for `walkeros setup source.<id>`. Idempotent
193
- * subscription creation, plus optional topic and dead-letter topic
194
- * auto-create. Triggered only by the explicit CLI command.
195
- */
196
- declare const SetupSchema: z.ZodObject<{
197
- createTopic: z.ZodOptional<z.ZodBoolean>;
198
- ackDeadlineSeconds: z.ZodOptional<z.ZodNumber>;
199
- messageRetentionDuration: z.ZodOptional<z.ZodObject<{
200
- seconds: z.ZodNumber;
201
- }, z.core.$strip>>;
202
- filter: z.ZodOptional<z.ZodString>;
203
- deadLetterPolicy: z.ZodOptional<z.ZodObject<{
204
- deadLetterTopic: z.ZodString;
205
- maxDeliveryAttempts: z.ZodNumber;
206
- createDeadLetterTopic: z.ZodOptional<z.ZodBoolean>;
207
- }, z.core.$strip>>;
208
- retryPolicy: z.ZodOptional<z.ZodObject<{
209
- minimumBackoff: z.ZodObject<{
210
- seconds: z.ZodNumber;
211
- }, z.core.$strip>;
212
- maximumBackoff: z.ZodObject<{
213
- seconds: z.ZodNumber;
214
- }, z.core.$strip>;
215
- }, z.core.$strip>>;
216
- enableMessageOrdering: z.ZodOptional<z.ZodBoolean>;
217
- labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
218
- expirationPolicy: z.ZodOptional<z.ZodObject<{
219
- ttl: z.ZodOptional<z.ZodNullable<z.ZodObject<{
220
- seconds: z.ZodNumber;
221
- }, z.core.$strip>>>;
222
- }, z.core.$strip>>;
223
- }, z.core.$strip>;
224
- type Setup = z.infer<typeof SetupSchema>;
225
-
226
- declare const settings$1: _walkeros_core_dev.JSONSchema;
227
- declare const setup: _walkeros_core_dev.JSONSchema;
228
-
229
- type index$1_Setup = Setup;
230
- declare const index$1_SetupSchema: typeof SetupSchema;
231
- declare const index$1_setup: typeof setup;
232
- declare namespace index$1 {
233
- export { type Settings$1 as Settings, SettingsSchema$1 as SettingsSchema, type index$1_Setup as Setup, index$1_SetupSchema as SetupSchema, settings$1 as settings, index$1_setup as setup };
234
- }
235
-
236
158
  declare module '@walkeros/core' {
237
159
  interface SourceMap {
238
160
  'pubsub-pull': {
@@ -334,34 +256,6 @@ declare namespace pubsubPullExamplesNs {
334
256
  export { type Content$1 as Content, type Result$1 as Result, createTrigger$1 as createTrigger, env$1 as env, step$1 as step };
335
257
  }
336
258
 
337
- /**
338
- * GCP Pub/Sub push source settings schema.
339
- *
340
- * No required fields. The push source is a request-handler; configuration
341
- * tunables live here, but operators wire `source.push` into their own
342
- * express/lambda runtime.
343
- */
344
- declare const SettingsSchema: z.ZodObject<{
345
- projectId: z.ZodOptional<z.ZodString>;
346
- decoder: z.ZodOptional<z.ZodEnum<{
347
- json: "json";
348
- text: "text";
349
- raw: "raw";
350
- }>>;
351
- verifyOidc: z.ZodOptional<z.ZodBoolean>;
352
- audience: z.ZodOptional<z.ZodString>;
353
- }, z.core.$strip>;
354
- type Settings = z.infer<typeof SettingsSchema>;
355
-
356
- declare const settings: _walkeros_core_dev.JSONSchema;
357
-
358
- type index_Settings = Settings;
359
- declare const index_SettingsSchema: typeof SettingsSchema;
360
- declare const index_settings: typeof settings;
361
- declare namespace index {
362
- export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
363
- }
364
-
365
259
  declare module '@walkeros/core' {
366
260
  interface SourceMap {
367
261
  'pubsub-push': {
@@ -439,11 +333,130 @@ declare namespace pubsubPushExamplesNs {
439
333
  export { type pubsubPushExamplesNs_Content as Content, type pubsubPushExamplesNs_Result as Result, pubsubPushExamplesNs_createTrigger as createTrigger, pubsubPushExamplesNs_env as env, pubsubPushExamplesNs_step as step };
440
334
  }
441
335
 
336
+ /**
337
+ * GCP Pub/Sub pull source settings schema.
338
+ *
339
+ * Required: projectId, subscription. All other fields optional with sensible
340
+ * defaults applied at runtime by `getConfig`.
341
+ */
342
+ declare const SettingsSchema$1: z.ZodObject<{
343
+ client: z.ZodOptional<z.ZodAny>;
344
+ projectId: z.ZodString;
345
+ subscription: z.ZodString;
346
+ topic: z.ZodOptional<z.ZodString>;
347
+ credentials: z.ZodOptional<z.ZodAny>;
348
+ apiEndpoint: z.ZodOptional<z.ZodString>;
349
+ decoder: z.ZodOptional<z.ZodEnum<{
350
+ json: "json";
351
+ text: "text";
352
+ raw: "raw";
353
+ }>>;
354
+ flowControl: z.ZodOptional<z.ZodObject<{
355
+ maxMessages: z.ZodOptional<z.ZodNumber>;
356
+ maxBytes: z.ZodOptional<z.ZodNumber>;
357
+ }, z.core.$strip>>;
358
+ ackDeadline: z.ZodOptional<z.ZodNumber>;
359
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
360
+ onPushError: z.ZodOptional<z.ZodEnum<{
361
+ nack: "nack";
362
+ ack: "ack";
363
+ }>>;
364
+ }, z.core.$strip>;
365
+ type Settings$1 = z.infer<typeof SettingsSchema$1>;
366
+
367
+ /**
368
+ * GCP Pub/Sub pull source setup schema.
369
+ *
370
+ * Provisioning options for `walkeros setup source.<id>`. Idempotent
371
+ * subscription creation, plus optional topic and dead-letter topic
372
+ * auto-create. Triggered only by the explicit CLI command.
373
+ */
374
+ declare const SetupSchema: z.ZodObject<{
375
+ createTopic: z.ZodOptional<z.ZodBoolean>;
376
+ ackDeadlineSeconds: z.ZodOptional<z.ZodNumber>;
377
+ messageRetentionDuration: z.ZodOptional<z.ZodObject<{
378
+ seconds: z.ZodNumber;
379
+ }, z.core.$strip>>;
380
+ filter: z.ZodOptional<z.ZodString>;
381
+ deadLetterPolicy: z.ZodOptional<z.ZodObject<{
382
+ deadLetterTopic: z.ZodString;
383
+ maxDeliveryAttempts: z.ZodNumber;
384
+ createDeadLetterTopic: z.ZodOptional<z.ZodBoolean>;
385
+ }, z.core.$strip>>;
386
+ retryPolicy: z.ZodOptional<z.ZodObject<{
387
+ minimumBackoff: z.ZodObject<{
388
+ seconds: z.ZodNumber;
389
+ }, z.core.$strip>;
390
+ maximumBackoff: z.ZodObject<{
391
+ seconds: z.ZodNumber;
392
+ }, z.core.$strip>;
393
+ }, z.core.$strip>>;
394
+ enableMessageOrdering: z.ZodOptional<z.ZodBoolean>;
395
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
396
+ expirationPolicy: z.ZodOptional<z.ZodObject<{
397
+ ttl: z.ZodOptional<z.ZodNullable<z.ZodObject<{
398
+ seconds: z.ZodNumber;
399
+ }, z.core.$strip>>>;
400
+ }, z.core.$strip>>;
401
+ }, z.core.$strip>;
402
+ type Setup = z.infer<typeof SetupSchema>;
403
+
404
+ declare const settings$1: _walkeros_core_dev.JSONSchema;
405
+ declare const setup: _walkeros_core_dev.JSONSchema;
406
+
407
+ type index$1_Setup = Setup;
408
+ declare const index$1_SetupSchema: typeof SetupSchema;
409
+ declare const index$1_setup: typeof setup;
410
+ declare namespace index$1 {
411
+ export { type Settings$1 as Settings, SettingsSchema$1 as SettingsSchema, type index$1_Setup as Setup, index$1_SetupSchema as SetupSchema, settings$1 as settings, index$1_setup as setup };
412
+ }
413
+
414
+ /**
415
+ * GCP Pub/Sub push source settings schema.
416
+ *
417
+ * No required fields. The push source is a request-handler; configuration
418
+ * tunables live here, but operators wire `source.push` into their own
419
+ * express/lambda runtime.
420
+ */
421
+ declare const SettingsSchema: z.ZodObject<{
422
+ projectId: z.ZodOptional<z.ZodString>;
423
+ decoder: z.ZodOptional<z.ZodEnum<{
424
+ json: "json";
425
+ text: "text";
426
+ raw: "raw";
427
+ }>>;
428
+ verifyOidc: z.ZodOptional<z.ZodBoolean>;
429
+ audience: z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strip>;
431
+ type Settings = z.infer<typeof SettingsSchema>;
432
+
433
+ declare const settings: _walkeros_core_dev.JSONSchema;
434
+
435
+ type index_Settings = Settings;
436
+ declare const index_SettingsSchema: typeof SettingsSchema;
437
+ declare const index_settings: typeof settings;
438
+ declare namespace index {
439
+ export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
440
+ }
441
+
442
442
  /** Dev examples per export, keyed by the export names in package.json. */
443
443
  declare const exportExamples: {
444
444
  sourceCloudFunction: typeof cloudFunctionExamplesNs;
445
445
  sourcePubSubPull: typeof pubsubPullExamplesNs;
446
446
  sourcePubSubPush: typeof pubsubPushExamplesNs;
447
447
  };
448
+ /** Schemas per export, keyed by the export names in package.json. */
449
+ declare const exportSchemas: {
450
+ sourceCloudFunction: {
451
+ settings: _walkeros_core_dev.JSONSchema;
452
+ };
453
+ sourcePubSubPull: {
454
+ settings: _walkeros_core_dev.JSONSchema;
455
+ setup: _walkeros_core_dev.JSONSchema;
456
+ };
457
+ sourcePubSubPush: {
458
+ settings: _walkeros_core_dev.JSONSchema;
459
+ };
460
+ };
448
461
 
449
- export { cloudFunctionExamplesNs as examples, exportExamples, pubsubPullExamplesNs as pubsubPullExamples, index$1 as pubsubPullSchemas, pubsubPushExamplesNs as pubsubPushExamples, index as pubsubPushSchemas, index$2 as schemas };
462
+ export { cloudFunctionExamplesNs as examples, exportExamples, exportSchemas, pubsubPullExamplesNs as pubsubPullExamples, index$1 as pubsubPullSchemas, pubsubPushExamplesNs as pubsubPushExamples, index as pubsubPushSchemas, index$2 as schemas };
package/dist/dev.d.ts CHANGED
@@ -155,84 +155,6 @@ declare namespace cloudFunctionExamplesNs {
155
155
  export { createTrigger$2 as createTrigger, env$2 as env, step$2 as step };
156
156
  }
157
157
 
158
- /**
159
- * GCP Pub/Sub pull source settings schema.
160
- *
161
- * Required: projectId, subscription. All other fields optional with sensible
162
- * defaults applied at runtime by `getConfig`.
163
- */
164
- declare const SettingsSchema$1: z.ZodObject<{
165
- client: z.ZodOptional<z.ZodAny>;
166
- projectId: z.ZodString;
167
- subscription: z.ZodString;
168
- topic: z.ZodOptional<z.ZodString>;
169
- credentials: z.ZodOptional<z.ZodAny>;
170
- apiEndpoint: z.ZodOptional<z.ZodString>;
171
- decoder: z.ZodOptional<z.ZodEnum<{
172
- json: "json";
173
- text: "text";
174
- raw: "raw";
175
- }>>;
176
- flowControl: z.ZodOptional<z.ZodObject<{
177
- maxMessages: z.ZodOptional<z.ZodNumber>;
178
- maxBytes: z.ZodOptional<z.ZodNumber>;
179
- }, z.core.$strip>>;
180
- ackDeadline: z.ZodOptional<z.ZodNumber>;
181
- shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
182
- onPushError: z.ZodOptional<z.ZodEnum<{
183
- nack: "nack";
184
- ack: "ack";
185
- }>>;
186
- }, z.core.$strip>;
187
- type Settings$1 = z.infer<typeof SettingsSchema$1>;
188
-
189
- /**
190
- * GCP Pub/Sub pull source setup schema.
191
- *
192
- * Provisioning options for `walkeros setup source.<id>`. Idempotent
193
- * subscription creation, plus optional topic and dead-letter topic
194
- * auto-create. Triggered only by the explicit CLI command.
195
- */
196
- declare const SetupSchema: z.ZodObject<{
197
- createTopic: z.ZodOptional<z.ZodBoolean>;
198
- ackDeadlineSeconds: z.ZodOptional<z.ZodNumber>;
199
- messageRetentionDuration: z.ZodOptional<z.ZodObject<{
200
- seconds: z.ZodNumber;
201
- }, z.core.$strip>>;
202
- filter: z.ZodOptional<z.ZodString>;
203
- deadLetterPolicy: z.ZodOptional<z.ZodObject<{
204
- deadLetterTopic: z.ZodString;
205
- maxDeliveryAttempts: z.ZodNumber;
206
- createDeadLetterTopic: z.ZodOptional<z.ZodBoolean>;
207
- }, z.core.$strip>>;
208
- retryPolicy: z.ZodOptional<z.ZodObject<{
209
- minimumBackoff: z.ZodObject<{
210
- seconds: z.ZodNumber;
211
- }, z.core.$strip>;
212
- maximumBackoff: z.ZodObject<{
213
- seconds: z.ZodNumber;
214
- }, z.core.$strip>;
215
- }, z.core.$strip>>;
216
- enableMessageOrdering: z.ZodOptional<z.ZodBoolean>;
217
- labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
218
- expirationPolicy: z.ZodOptional<z.ZodObject<{
219
- ttl: z.ZodOptional<z.ZodNullable<z.ZodObject<{
220
- seconds: z.ZodNumber;
221
- }, z.core.$strip>>>;
222
- }, z.core.$strip>>;
223
- }, z.core.$strip>;
224
- type Setup = z.infer<typeof SetupSchema>;
225
-
226
- declare const settings$1: _walkeros_core_dev.JSONSchema;
227
- declare const setup: _walkeros_core_dev.JSONSchema;
228
-
229
- type index$1_Setup = Setup;
230
- declare const index$1_SetupSchema: typeof SetupSchema;
231
- declare const index$1_setup: typeof setup;
232
- declare namespace index$1 {
233
- export { type Settings$1 as Settings, SettingsSchema$1 as SettingsSchema, type index$1_Setup as Setup, index$1_SetupSchema as SetupSchema, settings$1 as settings, index$1_setup as setup };
234
- }
235
-
236
158
  declare module '@walkeros/core' {
237
159
  interface SourceMap {
238
160
  'pubsub-pull': {
@@ -334,34 +256,6 @@ declare namespace pubsubPullExamplesNs {
334
256
  export { type Content$1 as Content, type Result$1 as Result, createTrigger$1 as createTrigger, env$1 as env, step$1 as step };
335
257
  }
336
258
 
337
- /**
338
- * GCP Pub/Sub push source settings schema.
339
- *
340
- * No required fields. The push source is a request-handler; configuration
341
- * tunables live here, but operators wire `source.push` into their own
342
- * express/lambda runtime.
343
- */
344
- declare const SettingsSchema: z.ZodObject<{
345
- projectId: z.ZodOptional<z.ZodString>;
346
- decoder: z.ZodOptional<z.ZodEnum<{
347
- json: "json";
348
- text: "text";
349
- raw: "raw";
350
- }>>;
351
- verifyOidc: z.ZodOptional<z.ZodBoolean>;
352
- audience: z.ZodOptional<z.ZodString>;
353
- }, z.core.$strip>;
354
- type Settings = z.infer<typeof SettingsSchema>;
355
-
356
- declare const settings: _walkeros_core_dev.JSONSchema;
357
-
358
- type index_Settings = Settings;
359
- declare const index_SettingsSchema: typeof SettingsSchema;
360
- declare const index_settings: typeof settings;
361
- declare namespace index {
362
- export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
363
- }
364
-
365
259
  declare module '@walkeros/core' {
366
260
  interface SourceMap {
367
261
  'pubsub-push': {
@@ -439,11 +333,130 @@ declare namespace pubsubPushExamplesNs {
439
333
  export { type pubsubPushExamplesNs_Content as Content, type pubsubPushExamplesNs_Result as Result, pubsubPushExamplesNs_createTrigger as createTrigger, pubsubPushExamplesNs_env as env, pubsubPushExamplesNs_step as step };
440
334
  }
441
335
 
336
+ /**
337
+ * GCP Pub/Sub pull source settings schema.
338
+ *
339
+ * Required: projectId, subscription. All other fields optional with sensible
340
+ * defaults applied at runtime by `getConfig`.
341
+ */
342
+ declare const SettingsSchema$1: z.ZodObject<{
343
+ client: z.ZodOptional<z.ZodAny>;
344
+ projectId: z.ZodString;
345
+ subscription: z.ZodString;
346
+ topic: z.ZodOptional<z.ZodString>;
347
+ credentials: z.ZodOptional<z.ZodAny>;
348
+ apiEndpoint: z.ZodOptional<z.ZodString>;
349
+ decoder: z.ZodOptional<z.ZodEnum<{
350
+ json: "json";
351
+ text: "text";
352
+ raw: "raw";
353
+ }>>;
354
+ flowControl: z.ZodOptional<z.ZodObject<{
355
+ maxMessages: z.ZodOptional<z.ZodNumber>;
356
+ maxBytes: z.ZodOptional<z.ZodNumber>;
357
+ }, z.core.$strip>>;
358
+ ackDeadline: z.ZodOptional<z.ZodNumber>;
359
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
360
+ onPushError: z.ZodOptional<z.ZodEnum<{
361
+ nack: "nack";
362
+ ack: "ack";
363
+ }>>;
364
+ }, z.core.$strip>;
365
+ type Settings$1 = z.infer<typeof SettingsSchema$1>;
366
+
367
+ /**
368
+ * GCP Pub/Sub pull source setup schema.
369
+ *
370
+ * Provisioning options for `walkeros setup source.<id>`. Idempotent
371
+ * subscription creation, plus optional topic and dead-letter topic
372
+ * auto-create. Triggered only by the explicit CLI command.
373
+ */
374
+ declare const SetupSchema: z.ZodObject<{
375
+ createTopic: z.ZodOptional<z.ZodBoolean>;
376
+ ackDeadlineSeconds: z.ZodOptional<z.ZodNumber>;
377
+ messageRetentionDuration: z.ZodOptional<z.ZodObject<{
378
+ seconds: z.ZodNumber;
379
+ }, z.core.$strip>>;
380
+ filter: z.ZodOptional<z.ZodString>;
381
+ deadLetterPolicy: z.ZodOptional<z.ZodObject<{
382
+ deadLetterTopic: z.ZodString;
383
+ maxDeliveryAttempts: z.ZodNumber;
384
+ createDeadLetterTopic: z.ZodOptional<z.ZodBoolean>;
385
+ }, z.core.$strip>>;
386
+ retryPolicy: z.ZodOptional<z.ZodObject<{
387
+ minimumBackoff: z.ZodObject<{
388
+ seconds: z.ZodNumber;
389
+ }, z.core.$strip>;
390
+ maximumBackoff: z.ZodObject<{
391
+ seconds: z.ZodNumber;
392
+ }, z.core.$strip>;
393
+ }, z.core.$strip>>;
394
+ enableMessageOrdering: z.ZodOptional<z.ZodBoolean>;
395
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
396
+ expirationPolicy: z.ZodOptional<z.ZodObject<{
397
+ ttl: z.ZodOptional<z.ZodNullable<z.ZodObject<{
398
+ seconds: z.ZodNumber;
399
+ }, z.core.$strip>>>;
400
+ }, z.core.$strip>>;
401
+ }, z.core.$strip>;
402
+ type Setup = z.infer<typeof SetupSchema>;
403
+
404
+ declare const settings$1: _walkeros_core_dev.JSONSchema;
405
+ declare const setup: _walkeros_core_dev.JSONSchema;
406
+
407
+ type index$1_Setup = Setup;
408
+ declare const index$1_SetupSchema: typeof SetupSchema;
409
+ declare const index$1_setup: typeof setup;
410
+ declare namespace index$1 {
411
+ export { type Settings$1 as Settings, SettingsSchema$1 as SettingsSchema, type index$1_Setup as Setup, index$1_SetupSchema as SetupSchema, settings$1 as settings, index$1_setup as setup };
412
+ }
413
+
414
+ /**
415
+ * GCP Pub/Sub push source settings schema.
416
+ *
417
+ * No required fields. The push source is a request-handler; configuration
418
+ * tunables live here, but operators wire `source.push` into their own
419
+ * express/lambda runtime.
420
+ */
421
+ declare const SettingsSchema: z.ZodObject<{
422
+ projectId: z.ZodOptional<z.ZodString>;
423
+ decoder: z.ZodOptional<z.ZodEnum<{
424
+ json: "json";
425
+ text: "text";
426
+ raw: "raw";
427
+ }>>;
428
+ verifyOidc: z.ZodOptional<z.ZodBoolean>;
429
+ audience: z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strip>;
431
+ type Settings = z.infer<typeof SettingsSchema>;
432
+
433
+ declare const settings: _walkeros_core_dev.JSONSchema;
434
+
435
+ type index_Settings = Settings;
436
+ declare const index_SettingsSchema: typeof SettingsSchema;
437
+ declare const index_settings: typeof settings;
438
+ declare namespace index {
439
+ export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
440
+ }
441
+
442
442
  /** Dev examples per export, keyed by the export names in package.json. */
443
443
  declare const exportExamples: {
444
444
  sourceCloudFunction: typeof cloudFunctionExamplesNs;
445
445
  sourcePubSubPull: typeof pubsubPullExamplesNs;
446
446
  sourcePubSubPush: typeof pubsubPushExamplesNs;
447
447
  };
448
+ /** Schemas per export, keyed by the export names in package.json. */
449
+ declare const exportSchemas: {
450
+ sourceCloudFunction: {
451
+ settings: _walkeros_core_dev.JSONSchema;
452
+ };
453
+ sourcePubSubPull: {
454
+ settings: _walkeros_core_dev.JSONSchema;
455
+ setup: _walkeros_core_dev.JSONSchema;
456
+ };
457
+ sourcePubSubPush: {
458
+ settings: _walkeros_core_dev.JSONSchema;
459
+ };
460
+ };
448
461
 
449
- export { cloudFunctionExamplesNs as examples, exportExamples, pubsubPullExamplesNs as pubsubPullExamples, index$1 as pubsubPullSchemas, pubsubPushExamplesNs as pubsubPushExamples, index as pubsubPushSchemas, index$2 as schemas };
462
+ export { cloudFunctionExamplesNs as examples, exportExamples, exportSchemas, pubsubPullExamplesNs as pubsubPullExamples, index$1 as pubsubPullSchemas, pubsubPushExamplesNs as pubsubPushExamples, index as pubsubPushSchemas, index$2 as schemas };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(e,o)=>{for(var r in o)t(e,r,{get:o[r],enumerable:!0})},n={};i(n,{examples:()=>f,exportExamples:()=>Se,pubsubPullExamples:()=>J,pubsubPullSchemas:()=>x,pubsubPushExamples:()=>ne,pubsubPushSchemas:()=>te,schemas:()=>a}),module.exports=(e=n,((e,i,n,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of r(i))s.call(e,c)||c===n||t(e,c,{get:()=>i[c],enumerable:!(a=o(i,c))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};i(a,{CorsOptionsSchema:()=>b,CorsOrigin:()=>p,HttpMethod:()=>u,SettingsSchema:()=>m,settings:()=>g});var c=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),d=require("@walkeros/core/dev"),u=d.z.enum(["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"]),p=d.z.union([d.z.string(),d.z.array(d.z.string()),d.z.literal("*")]),b=d.z.object({origin:p.describe("Allowed origins (* for all, URL string, or array of URLs)").optional(),methods:d.z.array(u).describe("Allowed HTTP methods").optional(),headers:d.z.array(d.z.string()).describe("Allowed request headers").optional(),credentials:d.z.boolean().describe("Allow credentials (cookies, authorization headers)").optional(),maxAge:d.z.number().int().positive().describe("Preflight cache duration in seconds").optional()}),m=l.z.object({cors:l.z.union([l.z.boolean(),b]).describe("CORS configuration: false = disabled, true = allow all origins, object = custom configuration").optional(),maxBatchSize:l.z.number().int().min(1).describe("Maximum number of events accepted in a single batch request").default(100),enablePixelTracking:l.z.boolean().describe("Serve a tracking pixel for GET requests").default(!0),timeout:l.z.number().int().positive().max(54e4).describe("Request timeout in milliseconds (max: 540000 for GCP)").optional()}),g=(0,c.zodToSchema)(m),f={};i(f,{createTrigger:()=>T,env:()=>h,step:()=>z});var h={};i(h,{push:()=>S});var w=()=>()=>Promise.resolve({ok:!0}),y=()=>{},v={error:y,warn:y,info:y,debug:y,throw:e=>{throw"string"==typeof e?new Error(e):e},json:y,scope:()=>v},S={get push(){return w()},get command(){return w()},get elb(){return w()},logger:v},z={};i(z,{cloudFunctionPostForwardsSource:()=>k,orderEvent:()=>O,postEvent:()=>P});var P={title:"POST event",description:"A GCP Cloud Function HTTP POST with a JSON body becomes a single walker elb event.",trigger:{type:"POST"},in:{method:"POST",body:{name:"page view",data:{title:"Home",url:"https://example.com/"}},headers:{"content-type":"application/json"}},out:[["elb",{name:"page view",data:{title:"Home",url:"https://example.com/"}}]]},O={title:"Order POST",description:"A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.",trigger:{type:"POST"},in:{method:"POST",body:{name:"order complete",data:{id:"ORD-700",total:99.99,currency:"EUR"}},headers:{"content-type":"application/json"}},out:[["elb",{name:"order complete",data:{id:"ORD-700",total:99.99,currency:"EUR"}}]]},k={title:"POST with provenance",description:"A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.",trigger:{type:"POST"},in:{method:"POST",body:{name:"page view",data:{title:"Home"},source:{release:{web:"r1"}}},headers:{"content-type":"application/json"}},out:[["elb",{name:"page view",data:{title:"Home"},source:{release:{web:"r1"}}}]]},j=require("@walkeros/collector");var T=async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await(0,j.startFlow)(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if("cloudfunction"===t.type)return t}(t.collector);if(!r)throw new Error("CloudFunction source not found in collector — ensure it is configured in sources");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{"content-type":"application/json"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}},x={};i(x,{SettingsSchema:()=>C,SetupSchema:()=>q,settings:()=>R,setup:()=>M});var D=require("@walkeros/core/dev"),E=require("@walkeros/core/dev"),C=E.z.object({client:E.z.any().describe("Pre-configured Google Cloud Pub/Sub client (like new PubSub({ projectId })). Bypasses credentials resolution when supplied.").optional(),projectId:E.z.string().min(1).describe("Google Cloud Project ID (like my-gcp-project)."),subscription:E.z.string().min(1).describe("Pub/Sub subscription short name (like events-sub). The full resource name projects/<projectId>/subscriptions/<subscription> is built by the SDK."),topic:E.z.string().describe("Pub/Sub topic short name. Required when setup.createTopic is true; otherwise informational.").optional(),credentials:E.z.any().describe("Service account credentials as a JSON string or an object with client_email and private_key. Default: Application Default Credentials (ADC). (deprecated: use config.credentials)").optional(),apiEndpoint:E.z.string().describe("Override Pub/Sub API endpoint. Useful for the local emulator (like localhost:8085).").optional(),decoder:E.z.enum(["json","text","raw"]).describe("Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.").optional(),flowControl:E.z.object({maxMessages:E.z.number().describe("Maximum in-flight messages. Default: 100.").optional(),maxBytes:E.z.number().describe("Maximum in-flight bytes. Default: 10485760 (10 MB).").optional()}).describe("Subscriber flow control. Tightens the SDK defaults.").optional(),ackDeadline:E.z.number().describe("Subscriber ack deadline in seconds. Default: 60.").optional(),shutdownTimeoutMs:E.z.number().describe("Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes the subscriber.").optional(),onPushError:E.z.enum(["nack","ack"]).describe("Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it.").optional()}),A=require("@walkeros/core/dev"),q=A.z.object({createTopic:A.z.boolean().describe("Create the topic if it does not exist. Requires settings.topic. Default: false (require pre-existing topic).").optional(),ackDeadlineSeconds:A.z.number().describe("Subscription ack deadline in seconds. Default: 60.").optional(),messageRetentionDuration:A.z.object({seconds:A.z.number().describe("Retention window in seconds. Default: project default.")}).describe("Subscription-level retention configuration.").optional(),filter:A.z.string().describe("Subscription filter expression. Only messages matching this filter are delivered.").optional(),deadLetterPolicy:A.z.object({deadLetterTopic:A.z.string().describe("Dead-letter topic short name."),maxDeliveryAttempts:A.z.number().describe("Maximum delivery attempts before forwarding to the dead-letter topic."),createDeadLetterTopic:A.z.boolean().describe("Auto-create the dead-letter topic if it does not exist. Default: false.").optional()}).describe("Dead-letter policy. Strongly recommended for production.").optional(),retryPolicy:A.z.object({minimumBackoff:A.z.object({seconds:A.z.number().describe("Minimum backoff in seconds.")}),maximumBackoff:A.z.object({seconds:A.z.number().describe("Maximum backoff in seconds.")})}).describe("Subscription retry policy.").optional(),enableMessageOrdering:A.z.boolean().describe("Enable message ordering on the subscription. Default: false.").optional(),labels:A.z.record(A.z.string(),A.z.string()).describe("Subscription labels for organization and billing.").optional(),expirationPolicy:A.z.object({ttl:A.z.object({seconds:A.z.number().describe("TTL in seconds. null means never expire.")}).nullable().optional()}).describe("Subscription expiration policy.").optional()}),R=(0,D.zodToSchema)(C),M=(0,D.zodToSchema)(q),J={};i(J,{createTrigger:()=>ee,env:()=>N,step:()=>K});var N={};i(N,{moduleMockEnv:()=>G,push:()=>L,simulation:()=>_});var I=()=>{},B={error:I,warn:I,info:I,debug:I,throw:e=>{throw"string"==typeof e?new Error(e):e},json:I,scope:()=>B},F=()=>()=>Promise.resolve({ok:!0}),U=class{constructor(e,t){this.name=e,this.options=t}name;options;on(e,t){return this}async close(){}};function H(){return{get push(){return F()},get command(){return F()},get elb(){return F()},logger:B}}var L=Object.assign(H(),{PubSub:class{constructor(e){this.options=e}options;subscription(e,t){return new U(e,t)}async close(){}}}),G=H(),_=["call:PubSub.subscription"],K={};i(K,{decoderText:()=>Q,malformedJson:()=>X,malformedJsonAck:()=>Y,orderComplete:()=>W,pageView:()=>V});var V={title:"Page view",description:"A JSON-encoded page view event arrives on the subscription, decodes successfully, and is acked.",in:{id:"msg-1",dataString:JSON.stringify({name:"page view",data:{title:"Documentation",url:"https://example.com/docs"}}),attributes:{}},out:[["message.ack","msg-1"]]},W={title:"Order complete",description:"A JSON-encoded order event arrives and is acked after successful collector forwarding.",in:{id:"msg-2",dataString:JSON.stringify({name:"order complete",data:{id:"ORD-500",total:199.99,currency:"EUR"}}),attributes:{entity:"order",action:"complete"}},out:[["message.ack","msg-2"]]},Q={title:"Text decoder",description:"With decoder=text on the source settings, the message data is forwarded to the collector as a UTF-8 string and acked.",in:{id:"msg-3",dataString:"plain text payload",attributes:{}},out:[["message.ack","msg-3"]]},X={title:"Malformed JSON nack",description:"A non-JSON body with the default json decoder fails to decode; the message is nacked for redelivery.",in:{id:"msg-4",dataString:"not-json{",attributes:{}},out:[["message.nack","msg-4"]]},Y={title:"Malformed JSON ack-and-drop",description:"With onPushError=ack on the source settings, a malformed JSON message is acked-and-dropped instead of redelivered.",in:{id:"msg-5",dataString:"not-json{",attributes:{}},out:[["message.ack","msg-5"]]},Z=require("@walkeros/collector");function $(e){if("object"!=typeof e||null===e)return!1;const t=e;return"pubsub-pull"===t.type&&"function"==typeof t.push}var ee=async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await(0,Z.startFlow)(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if($(t))return t}(t.collector);if(!r)throw new Error("pubsub-pull source not registered in collector — ensure it is configured in sources");const s={id:o.id,data:Buffer.from(o.dataString,"utf8"),attributes:o.attributes,orderingKey:o.orderingKey},i=await r.push(s),n=[];return i&&"object"==typeof i&&(i.acked&&n.push(["message.ack",o.id]),i.nacked&&n.push(["message.nack",o.id])),n}}},te={};i(te,{SettingsSchema:()=>se,settings:()=>ie});var oe=require("@walkeros/core/dev"),re=require("@walkeros/core/dev"),se=re.z.object({projectId:re.z.string().describe("Google Cloud Project ID (informational, surfaced in error messages).").optional(),decoder:re.z.enum(["json","text","raw"]).describe("Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.").optional(),verifyOidc:re.z.boolean().describe("Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false.").optional(),audience:re.z.string().describe("OIDC audience (your endpoint URL or a custom audience). Required when verifyOidc is true.").optional()}),ie=(0,oe.zodToSchema)(se),ne={};i(ne,{createTrigger:()=>ve,env:()=>ae,step:()=>be});var ae={};i(ae,{push:()=>ue,simulation:()=>pe});var ce=()=>{},le={error:ce,warn:ce,info:ce,debug:ce,throw:e=>{throw"string"==typeof e?new Error(e):e},json:ce,scope:()=>le},de=()=>()=>Promise.resolve({ok:!0}),ue={get push(){return de()},get command(){return de()},get elb(){return de()},logger:le},pe=[],be={};i(be,{malformedEnvelope:()=>he,orderEnvelope:()=>fe,validEnvelope:()=>ge});function me(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64")}var ge={title:"Valid push envelope",description:"A well-formed Pub/Sub push envelope decodes the base64 data, parses JSON, and forwards the event to the collector with a 200 response.",in:{message:{messageId:"push-1",data:me({name:"page view",data:{title:"Documentation",url:"https://example.com/docs"}}),attributes:{source:"analytics"}},subscription:"projects/test/subscriptions/events-sub"},out:[["response",200,{success:!0,id:"push-1"}]]},fe={title:"Order envelope",description:"A push envelope carrying an order event is decoded and forwarded to the collector.",in:{message:{messageId:"push-2",data:me({name:"order complete",data:{id:"ORD-500",total:199.99,currency:"EUR"}}),attributes:{}},subscription:"projects/test/subscriptions/events-sub"},out:[["response",200,{success:!0,id:"push-2"}]]},he={title:"Malformed envelope",description:"A POST body lacking message.messageId returns 400 Bad Request without forwarding to the collector.",in:{not_a:"pubsub envelope"},out:[["response",400,{success:!1,error:"Malformed Pub/Sub envelope (missing message.messageId)."}]]},we=require("@walkeros/collector");function ye(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.type&&"pubsub-push"===t.type&&"function"==typeof t.push}var ve=async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await(0,we.startFlow)(e);t={collector:o.collector,elb:o.elb}}const s=("object"==typeof r&&null!==r?r:{}).headers??{},i=function(e){for(const t of Object.values(e.sources??{}))if(ye(t))return t}(t.collector);if(!i)throw new Error("pubsub-push source not registered");const n={},a=function(e,t){return{method:"POST",body:e,headers:t,get:e=>t[e.toLowerCase()]??t[e]}}(o,s),c=function(e){const t={status:o=>(e.statusCode=o,t),json:o=>(e.body=o,t),send:o=>(e.body=o,t),set:()=>t};return t}(n);await i.push(a,c);return[["response",n.statusCode??0,n.body??null]]}}},Se={sourceCloudFunction:f,sourcePubSubPull:J,sourcePubSubPush:ne};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(e,o)=>{for(var r in o)t(e,r,{get:o[r],enumerable:!0})},n={};i(n,{examples:()=>a,exportExamples:()=>Se,exportSchemas:()=>ze,pubsubPullExamples:()=>y,pubsubPullSchemas:()=>ce,pubsubPushExamples:()=>I,pubsubPushSchemas:()=>fe,schemas:()=>$}),module.exports=(e=n,((e,i,n,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of r(i))s.call(e,c)||c===n||t(e,c,{get:()=>i[c],enumerable:!(a=o(i,c))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};i(a,{createTrigger:()=>w,env:()=>c,step:()=>b});var c={};i(c,{push:()=>p});var l=()=>()=>Promise.resolve({ok:!0}),u=()=>{},d={error:u,warn:u,info:u,debug:u,throw:e=>{throw"string"==typeof e?new Error(e):e},json:u,scope:()=>d},p={get push(){return l()},get command(){return l()},get elb(){return l()},logger:d},b={};i(b,{cloudFunctionPostForwardsSource:()=>f,orderEvent:()=>g,postEvent:()=>m});var m={title:"POST event",description:"A GCP Cloud Function HTTP POST with a JSON body becomes a single walker elb event.",trigger:{type:"POST"},in:{method:"POST",body:{name:"page view",data:{title:"Home",url:"https://example.com/"}},headers:{"content-type":"application/json"}},out:[["elb",{name:"page view",data:{title:"Home",url:"https://example.com/"}}]]},g={title:"Order POST",description:"A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.",trigger:{type:"POST"},in:{method:"POST",body:{name:"order complete",data:{id:"ORD-700",total:99.99,currency:"EUR"}},headers:{"content-type":"application/json"}},out:[["elb",{name:"order complete",data:{id:"ORD-700",total:99.99,currency:"EUR"}}]]},f={title:"POST with provenance",description:"A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.",trigger:{type:"POST"},in:{method:"POST",body:{name:"page view",data:{title:"Home"},source:{release:{web:"r1"}}},headers:{"content-type":"application/json"}},out:[["elb",{name:"page view",data:{title:"Home"},source:{release:{web:"r1"}}}]]},h=require("@walkeros/collector");var w=async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await(0,h.startFlow)(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if("cloudfunction"===t.type)return t}(t.collector);if(!r)throw new Error("CloudFunction source not found in collector — ensure it is configured in sources");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{"content-type":"application/json"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}},y={};i(y,{createTrigger:()=>N,env:()=>v,step:()=>D});var v={};i(v,{moduleMockEnv:()=>T,push:()=>j,simulation:()=>x});var S=()=>{},z={error:S,warn:S,info:S,debug:S,throw:e=>{throw"string"==typeof e?new Error(e):e},json:S,scope:()=>z},P=()=>()=>Promise.resolve({ok:!0}),O=class{constructor(e,t){this.name=e,this.options=t}name;options;on(e,t){return this}async close(){}};function k(){return{get push(){return P()},get command(){return P()},get elb(){return P()},logger:z}}var j=Object.assign(k(),{PubSub:class{constructor(e){this.options=e}options;subscription(e,t){return new O(e,t)}async close(){}}}),T=k(),x=["call:PubSub.subscription"],D={};i(D,{decoderText:()=>A,malformedJson:()=>q,malformedJsonAck:()=>R,orderComplete:()=>C,pageView:()=>E});var E={title:"Page view",description:"A JSON-encoded page view event arrives on the subscription, decodes successfully, and is acked.",in:{id:"msg-1",dataString:JSON.stringify({name:"page view",data:{title:"Documentation",url:"https://example.com/docs"}}),attributes:{}},out:[["message.ack","msg-1"]]},C={title:"Order complete",description:"A JSON-encoded order event arrives and is acked after successful collector forwarding.",in:{id:"msg-2",dataString:JSON.stringify({name:"order complete",data:{id:"ORD-500",total:199.99,currency:"EUR"}}),attributes:{entity:"order",action:"complete"}},out:[["message.ack","msg-2"]]},A={title:"Text decoder",description:"With decoder=text on the source settings, the message data is forwarded to the collector as a UTF-8 string and acked.",in:{id:"msg-3",dataString:"plain text payload",attributes:{}},out:[["message.ack","msg-3"]]},q={title:"Malformed JSON nack",description:"A non-JSON body with the default json decoder fails to decode; the message is nacked for redelivery.",in:{id:"msg-4",dataString:"not-json{",attributes:{}},out:[["message.nack","msg-4"]]},R={title:"Malformed JSON ack-and-drop",description:"With onPushError=ack on the source settings, a malformed JSON message is acked-and-dropped instead of redelivered.",in:{id:"msg-5",dataString:"not-json{",attributes:{}},out:[["message.ack","msg-5"]]},M=require("@walkeros/collector");function J(e){if("object"!=typeof e||null===e)return!1;const t=e;return"pubsub-pull"===t.type&&"function"==typeof t.push}var N=async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await(0,M.startFlow)(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if(J(t))return t}(t.collector);if(!r)throw new Error("pubsub-pull source not registered in collector — ensure it is configured in sources");const s={id:o.id,data:Buffer.from(o.dataString,"utf8"),attributes:o.attributes,orderingKey:o.orderingKey},i=await r.push(s),n=[];return i&&"object"==typeof i&&(i.acked&&n.push(["message.ack",o.id]),i.nacked&&n.push(["message.nack",o.id])),n}}},I={};i(I,{createTrigger:()=>Z,env:()=>F,step:()=>_});var F={};i(F,{push:()=>L,simulation:()=>G});var B=()=>{},U={error:B,warn:B,info:B,debug:B,throw:e=>{throw"string"==typeof e?new Error(e):e},json:B,scope:()=>U},H=()=>()=>Promise.resolve({ok:!0}),L={get push(){return H()},get command(){return H()},get elb(){return H()},logger:U},G=[],_={};i(_,{malformedEnvelope:()=>Q,orderEnvelope:()=>W,validEnvelope:()=>V});function K(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64")}var V={title:"Valid push envelope",description:"A well-formed Pub/Sub push envelope decodes the base64 data, parses JSON, and forwards the event to the collector with a 200 response.",in:{message:{messageId:"push-1",data:K({name:"page view",data:{title:"Documentation",url:"https://example.com/docs"}}),attributes:{source:"analytics"}},subscription:"projects/test/subscriptions/events-sub"},out:[["response",200,{success:!0,id:"push-1"}]]},W={title:"Order envelope",description:"A push envelope carrying an order event is decoded and forwarded to the collector.",in:{message:{messageId:"push-2",data:K({name:"order complete",data:{id:"ORD-500",total:199.99,currency:"EUR"}}),attributes:{}},subscription:"projects/test/subscriptions/events-sub"},out:[["response",200,{success:!0,id:"push-2"}]]},Q={title:"Malformed envelope",description:"A POST body lacking message.messageId returns 400 Bad Request without forwarding to the collector.",in:{not_a:"pubsub envelope"},out:[["response",400,{success:!1,error:"Malformed Pub/Sub envelope (missing message.messageId)."}]]},X=require("@walkeros/collector");function Y(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.type&&"pubsub-push"===t.type&&"function"==typeof t.push}var Z=async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await(0,X.startFlow)(e);t={collector:o.collector,elb:o.elb}}const s=("object"==typeof r&&null!==r?r:{}).headers??{},i=function(e){for(const t of Object.values(e.sources??{}))if(Y(t))return t}(t.collector);if(!i)throw new Error("pubsub-push source not registered");const n={},a=function(e,t){return{method:"POST",body:e,headers:t,get:e=>t[e.toLowerCase()]??t[e]}}(o,s),c=function(e){const t={status:o=>(e.statusCode=o,t),json:o=>(e.body=o,t),send:o=>(e.body=o,t),set:()=>t};return t}(n);await i.push(a,c);return[["response",n.statusCode??0,n.body??null]]}}},$={};i($,{CorsOptionsSchema:()=>ie,CorsOrigin:()=>se,HttpMethod:()=>re,SettingsSchema:()=>ne,settings:()=>ae});var ee=require("@walkeros/core/dev"),te=require("@walkeros/core/dev"),oe=require("@walkeros/core/dev"),re=oe.z.enum(["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"]),se=oe.z.union([oe.z.string(),oe.z.array(oe.z.string()),oe.z.literal("*")]),ie=oe.z.object({origin:se.describe("Allowed origins (* for all, URL string, or array of URLs)").optional(),methods:oe.z.array(re).describe("Allowed HTTP methods").optional(),headers:oe.z.array(oe.z.string()).describe("Allowed request headers").optional(),credentials:oe.z.boolean().describe("Allow credentials (cookies, authorization headers)").optional(),maxAge:oe.z.number().int().positive().describe("Preflight cache duration in seconds").optional()}),ne=te.z.object({cors:te.z.union([te.z.boolean(),ie]).describe("CORS configuration: false = disabled, true = allow all origins, object = custom configuration").optional(),maxBatchSize:te.z.number().int().min(1).describe("Maximum number of events accepted in a single batch request").default(100),enablePixelTracking:te.z.boolean().describe("Serve a tracking pixel for GET requests").default(!0),timeout:te.z.number().int().positive().max(54e4).describe("Request timeout in milliseconds (max: 540000 for GCP)").optional()}),ae=(0,ee.zodToSchema)(ne),ce={};i(ce,{SettingsSchema:()=>de,SetupSchema:()=>be,settings:()=>me,setup:()=>ge});var le=require("@walkeros/core/dev"),ue=require("@walkeros/core/dev"),de=ue.z.object({client:ue.z.any().describe("Pre-configured Google Cloud Pub/Sub client (like new PubSub({ projectId })). Bypasses credentials resolution when supplied.").optional(),projectId:ue.z.string().min(1).describe("Google Cloud Project ID (like my-gcp-project)."),subscription:ue.z.string().min(1).describe("Pub/Sub subscription short name (like events-sub). The full resource name projects/<projectId>/subscriptions/<subscription> is built by the SDK."),topic:ue.z.string().describe("Pub/Sub topic short name. Required when setup.createTopic is true; otherwise informational.").optional(),credentials:ue.z.any().describe("Service account credentials as a JSON string or an object with client_email and private_key. Default: Application Default Credentials (ADC). (deprecated: use config.credentials)").optional(),apiEndpoint:ue.z.string().describe("Override Pub/Sub API endpoint. Useful for the local emulator (like localhost:8085).").optional(),decoder:ue.z.enum(["json","text","raw"]).describe("Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.").optional(),flowControl:ue.z.object({maxMessages:ue.z.number().describe("Maximum in-flight messages. Default: 100.").optional(),maxBytes:ue.z.number().describe("Maximum in-flight bytes. Default: 10485760 (10 MB).").optional()}).describe("Subscriber flow control. Tightens the SDK defaults.").optional(),ackDeadline:ue.z.number().describe("Subscriber ack deadline in seconds. Default: 60.").optional(),shutdownTimeoutMs:ue.z.number().describe("Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes the subscriber.").optional(),onPushError:ue.z.enum(["nack","ack"]).describe("Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it.").optional()}),pe=require("@walkeros/core/dev"),be=pe.z.object({createTopic:pe.z.boolean().describe("Create the topic if it does not exist. Requires settings.topic. Default: false (require pre-existing topic).").optional(),ackDeadlineSeconds:pe.z.number().describe("Subscription ack deadline in seconds. Default: 60.").optional(),messageRetentionDuration:pe.z.object({seconds:pe.z.number().describe("Retention window in seconds. Default: project default.")}).describe("Subscription-level retention configuration.").optional(),filter:pe.z.string().describe("Subscription filter expression. Only messages matching this filter are delivered.").optional(),deadLetterPolicy:pe.z.object({deadLetterTopic:pe.z.string().describe("Dead-letter topic short name."),maxDeliveryAttempts:pe.z.number().describe("Maximum delivery attempts before forwarding to the dead-letter topic."),createDeadLetterTopic:pe.z.boolean().describe("Auto-create the dead-letter topic if it does not exist. Default: false.").optional()}).describe("Dead-letter policy. Strongly recommended for production.").optional(),retryPolicy:pe.z.object({minimumBackoff:pe.z.object({seconds:pe.z.number().describe("Minimum backoff in seconds.")}),maximumBackoff:pe.z.object({seconds:pe.z.number().describe("Maximum backoff in seconds.")})}).describe("Subscription retry policy.").optional(),enableMessageOrdering:pe.z.boolean().describe("Enable message ordering on the subscription. Default: false.").optional(),labels:pe.z.record(pe.z.string(),pe.z.string()).describe("Subscription labels for organization and billing.").optional(),expirationPolicy:pe.z.object({ttl:pe.z.object({seconds:pe.z.number().describe("TTL in seconds. null means never expire.")}).nullable().optional()}).describe("Subscription expiration policy.").optional()}),me=(0,le.zodToSchema)(de),ge=(0,le.zodToSchema)(be),fe={};i(fe,{SettingsSchema:()=>ye,settings:()=>ve});var he=require("@walkeros/core/dev"),we=require("@walkeros/core/dev"),ye=we.z.object({projectId:we.z.string().describe("Google Cloud Project ID (informational, surfaced in error messages).").optional(),decoder:we.z.enum(["json","text","raw"]).describe("Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer.").optional(),verifyOidc:we.z.boolean().describe("Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false.").optional(),audience:we.z.string().describe("OIDC audience (your endpoint URL or a custom audience). Required when verifyOidc is true.").optional()}),ve=(0,he.zodToSchema)(ye),Se={sourceCloudFunction:a,sourcePubSubPull:y,sourcePubSubPush:I},ze={sourceCloudFunction:{settings:ae},sourcePubSubPull:{settings:me,setup:ge},sourcePubSubPush:{settings:ve}};//# sourceMappingURL=dev.js.map