@walkeros/server-source-gcp 4.7.0-next-1790245733116 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -16
- package/dist/dev.d.mts +170 -129
- package/dist/dev.d.ts +170 -129
- 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 +42 -6
- package/dist/index.d.ts +42 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +765 -3
- package/package.json +3 -3
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-source-gcp",
|
|
4
|
-
"version": "4.7.0
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"type": "source",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"examples": {
|
|
111
111
|
"createTrigger": {
|
|
112
|
-
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await
|
|
112
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await p(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}}}}"
|
|
113
113
|
},
|
|
114
114
|
"env": {
|
|
115
115
|
"push": {
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"$code": "()=>{}"
|
|
143
143
|
},
|
|
144
144
|
"scope": {
|
|
145
|
-
"$code": "()=>
|
|
145
|
+
"$code": "()=>n"
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -255,5 +255,767 @@
|
|
|
255
255
|
]
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
},
|
|
259
|
+
"exportExamples": {
|
|
260
|
+
"sourceCloudFunction": {
|
|
261
|
+
"createTrigger": {
|
|
262
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await p(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}}}}"
|
|
263
|
+
},
|
|
264
|
+
"env": {
|
|
265
|
+
"push": {
|
|
266
|
+
"push": {
|
|
267
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
268
|
+
},
|
|
269
|
+
"command": {
|
|
270
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
271
|
+
},
|
|
272
|
+
"elb": {
|
|
273
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
274
|
+
},
|
|
275
|
+
"logger": {
|
|
276
|
+
"error": {
|
|
277
|
+
"$code": "()=>{}"
|
|
278
|
+
},
|
|
279
|
+
"warn": {
|
|
280
|
+
"$code": "()=>{}"
|
|
281
|
+
},
|
|
282
|
+
"info": {
|
|
283
|
+
"$code": "()=>{}"
|
|
284
|
+
},
|
|
285
|
+
"debug": {
|
|
286
|
+
"$code": "()=>{}"
|
|
287
|
+
},
|
|
288
|
+
"throw": {
|
|
289
|
+
"$code": "e=>{throw\"string\"==typeof e?new Error(e):e}"
|
|
290
|
+
},
|
|
291
|
+
"json": {
|
|
292
|
+
"$code": "()=>{}"
|
|
293
|
+
},
|
|
294
|
+
"scope": {
|
|
295
|
+
"$code": "()=>n"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"step": {
|
|
301
|
+
"cloudFunctionPostForwardsSource": {
|
|
302
|
+
"title": "POST with provenance",
|
|
303
|
+
"description": "A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.",
|
|
304
|
+
"trigger": {
|
|
305
|
+
"type": "POST"
|
|
306
|
+
},
|
|
307
|
+
"in": {
|
|
308
|
+
"method": "POST",
|
|
309
|
+
"body": {
|
|
310
|
+
"name": "page view",
|
|
311
|
+
"data": {
|
|
312
|
+
"title": "Home"
|
|
313
|
+
},
|
|
314
|
+
"source": {
|
|
315
|
+
"release": {
|
|
316
|
+
"web": "r1"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"headers": {
|
|
321
|
+
"content-type": "application/json"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"out": [
|
|
325
|
+
[
|
|
326
|
+
"elb",
|
|
327
|
+
{
|
|
328
|
+
"name": "page view",
|
|
329
|
+
"data": {
|
|
330
|
+
"title": "Home"
|
|
331
|
+
},
|
|
332
|
+
"source": {
|
|
333
|
+
"release": {
|
|
334
|
+
"web": "r1"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
"orderEvent": {
|
|
342
|
+
"title": "Order POST",
|
|
343
|
+
"description": "A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.",
|
|
344
|
+
"trigger": {
|
|
345
|
+
"type": "POST"
|
|
346
|
+
},
|
|
347
|
+
"in": {
|
|
348
|
+
"method": "POST",
|
|
349
|
+
"body": {
|
|
350
|
+
"name": "order complete",
|
|
351
|
+
"data": {
|
|
352
|
+
"id": "ORD-700",
|
|
353
|
+
"total": 99.99,
|
|
354
|
+
"currency": "EUR"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"headers": {
|
|
358
|
+
"content-type": "application/json"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"out": [
|
|
362
|
+
[
|
|
363
|
+
"elb",
|
|
364
|
+
{
|
|
365
|
+
"name": "order complete",
|
|
366
|
+
"data": {
|
|
367
|
+
"id": "ORD-700",
|
|
368
|
+
"total": 99.99,
|
|
369
|
+
"currency": "EUR"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"postEvent": {
|
|
376
|
+
"title": "POST event",
|
|
377
|
+
"description": "A GCP Cloud Function HTTP POST with a JSON body becomes a single walker elb event.",
|
|
378
|
+
"trigger": {
|
|
379
|
+
"type": "POST"
|
|
380
|
+
},
|
|
381
|
+
"in": {
|
|
382
|
+
"method": "POST",
|
|
383
|
+
"body": {
|
|
384
|
+
"name": "page view",
|
|
385
|
+
"data": {
|
|
386
|
+
"title": "Home",
|
|
387
|
+
"url": "https://example.com/"
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"headers": {
|
|
391
|
+
"content-type": "application/json"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"out": [
|
|
395
|
+
[
|
|
396
|
+
"elb",
|
|
397
|
+
{
|
|
398
|
+
"name": "page view",
|
|
399
|
+
"data": {
|
|
400
|
+
"title": "Home",
|
|
401
|
+
"url": "https://example.com/"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"sourcePubSubPull": {
|
|
410
|
+
"createTrigger": {
|
|
411
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await C(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if(A(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}}}"
|
|
412
|
+
},
|
|
413
|
+
"env": {
|
|
414
|
+
"moduleMockEnv": {
|
|
415
|
+
"push": {
|
|
416
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
417
|
+
},
|
|
418
|
+
"command": {
|
|
419
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
420
|
+
},
|
|
421
|
+
"elb": {
|
|
422
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
423
|
+
},
|
|
424
|
+
"logger": {
|
|
425
|
+
"error": {
|
|
426
|
+
"$code": "()=>{}"
|
|
427
|
+
},
|
|
428
|
+
"warn": {
|
|
429
|
+
"$code": "()=>{}"
|
|
430
|
+
},
|
|
431
|
+
"info": {
|
|
432
|
+
"$code": "()=>{}"
|
|
433
|
+
},
|
|
434
|
+
"debug": {
|
|
435
|
+
"$code": "()=>{}"
|
|
436
|
+
},
|
|
437
|
+
"throw": {
|
|
438
|
+
"$code": "e=>{throw\"string\"==typeof e?new Error(e):e}"
|
|
439
|
+
},
|
|
440
|
+
"json": {
|
|
441
|
+
"$code": "()=>{}"
|
|
442
|
+
},
|
|
443
|
+
"scope": {
|
|
444
|
+
"$code": "()=>h"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"push": {
|
|
449
|
+
"push": {
|
|
450
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
451
|
+
},
|
|
452
|
+
"command": {
|
|
453
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
454
|
+
},
|
|
455
|
+
"elb": {
|
|
456
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
457
|
+
},
|
|
458
|
+
"logger": {
|
|
459
|
+
"error": {
|
|
460
|
+
"$code": "()=>{}"
|
|
461
|
+
},
|
|
462
|
+
"warn": {
|
|
463
|
+
"$code": "()=>{}"
|
|
464
|
+
},
|
|
465
|
+
"info": {
|
|
466
|
+
"$code": "()=>{}"
|
|
467
|
+
},
|
|
468
|
+
"debug": {
|
|
469
|
+
"$code": "()=>{}"
|
|
470
|
+
},
|
|
471
|
+
"throw": {
|
|
472
|
+
"$code": "e=>{throw\"string\"==typeof e?new Error(e):e}"
|
|
473
|
+
},
|
|
474
|
+
"json": {
|
|
475
|
+
"$code": "()=>{}"
|
|
476
|
+
},
|
|
477
|
+
"scope": {
|
|
478
|
+
"$code": "()=>h"
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"PubSub": {
|
|
482
|
+
"$code": "class{constructor(e){this.options=e}options;subscription(e,t){return new v(e,t)}async close(){}}"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"simulation": [
|
|
486
|
+
"call:PubSub.subscription"
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
"step": {
|
|
490
|
+
"decoderText": {
|
|
491
|
+
"title": "Text decoder",
|
|
492
|
+
"description": "With decoder=text on the source settings, the message data is forwarded to the collector as a UTF-8 string and acked.",
|
|
493
|
+
"in": {
|
|
494
|
+
"id": "msg-3",
|
|
495
|
+
"dataString": "plain text payload",
|
|
496
|
+
"attributes": {}
|
|
497
|
+
},
|
|
498
|
+
"out": [
|
|
499
|
+
[
|
|
500
|
+
"message.ack",
|
|
501
|
+
"msg-3"
|
|
502
|
+
]
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
"malformedJson": {
|
|
506
|
+
"title": "Malformed JSON nack",
|
|
507
|
+
"description": "A non-JSON body with the default json decoder fails to decode; the message is nacked for redelivery.",
|
|
508
|
+
"in": {
|
|
509
|
+
"id": "msg-4",
|
|
510
|
+
"dataString": "not-json{",
|
|
511
|
+
"attributes": {}
|
|
512
|
+
},
|
|
513
|
+
"out": [
|
|
514
|
+
[
|
|
515
|
+
"message.nack",
|
|
516
|
+
"msg-4"
|
|
517
|
+
]
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
"malformedJsonAck": {
|
|
521
|
+
"title": "Malformed JSON ack-and-drop",
|
|
522
|
+
"description": "With onPushError=ack on the source settings, a malformed JSON message is acked-and-dropped instead of redelivered.",
|
|
523
|
+
"in": {
|
|
524
|
+
"id": "msg-5",
|
|
525
|
+
"dataString": "not-json{",
|
|
526
|
+
"attributes": {}
|
|
527
|
+
},
|
|
528
|
+
"out": [
|
|
529
|
+
[
|
|
530
|
+
"message.ack",
|
|
531
|
+
"msg-5"
|
|
532
|
+
]
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
"orderComplete": {
|
|
536
|
+
"title": "Order complete",
|
|
537
|
+
"description": "A JSON-encoded order event arrives and is acked after successful collector forwarding.",
|
|
538
|
+
"in": {
|
|
539
|
+
"id": "msg-2",
|
|
540
|
+
"dataString": "{\"name\":\"order complete\",\"data\":{\"id\":\"ORD-500\",\"total\":199.99,\"currency\":\"EUR\"}}",
|
|
541
|
+
"attributes": {
|
|
542
|
+
"entity": "order",
|
|
543
|
+
"action": "complete"
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
"out": [
|
|
547
|
+
[
|
|
548
|
+
"message.ack",
|
|
549
|
+
"msg-2"
|
|
550
|
+
]
|
|
551
|
+
]
|
|
552
|
+
},
|
|
553
|
+
"pageView": {
|
|
554
|
+
"title": "Page view",
|
|
555
|
+
"description": "A JSON-encoded page view event arrives on the subscription, decodes successfully, and is acked.",
|
|
556
|
+
"in": {
|
|
557
|
+
"id": "msg-1",
|
|
558
|
+
"dataString": "{\"name\":\"page view\",\"data\":{\"title\":\"Documentation\",\"url\":\"https://example.com/docs\"}}",
|
|
559
|
+
"attributes": {}
|
|
560
|
+
},
|
|
561
|
+
"out": [
|
|
562
|
+
[
|
|
563
|
+
"message.ack",
|
|
564
|
+
"msg-1"
|
|
565
|
+
]
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"sourcePubSubPush": {
|
|
571
|
+
"createTrigger": {
|
|
572
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await K(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(V(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]]}}}"
|
|
573
|
+
},
|
|
574
|
+
"env": {
|
|
575
|
+
"push": {
|
|
576
|
+
"push": {
|
|
577
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
578
|
+
},
|
|
579
|
+
"command": {
|
|
580
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
581
|
+
},
|
|
582
|
+
"elb": {
|
|
583
|
+
"$code": "()=>Promise.resolve({ok:!0})"
|
|
584
|
+
},
|
|
585
|
+
"logger": {
|
|
586
|
+
"error": {
|
|
587
|
+
"$code": "()=>{}"
|
|
588
|
+
},
|
|
589
|
+
"warn": {
|
|
590
|
+
"$code": "()=>{}"
|
|
591
|
+
},
|
|
592
|
+
"info": {
|
|
593
|
+
"$code": "()=>{}"
|
|
594
|
+
},
|
|
595
|
+
"debug": {
|
|
596
|
+
"$code": "()=>{}"
|
|
597
|
+
},
|
|
598
|
+
"throw": {
|
|
599
|
+
"$code": "e=>{throw\"string\"==typeof e?new Error(e):e}"
|
|
600
|
+
},
|
|
601
|
+
"json": {
|
|
602
|
+
"$code": "()=>{}"
|
|
603
|
+
},
|
|
604
|
+
"scope": {
|
|
605
|
+
"$code": "()=>I"
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
"simulation": []
|
|
610
|
+
},
|
|
611
|
+
"step": {
|
|
612
|
+
"malformedEnvelope": {
|
|
613
|
+
"title": "Malformed envelope",
|
|
614
|
+
"description": "A POST body lacking message.messageId returns 400 Bad Request without forwarding to the collector.",
|
|
615
|
+
"in": {
|
|
616
|
+
"not_a": "pubsub envelope"
|
|
617
|
+
},
|
|
618
|
+
"out": [
|
|
619
|
+
[
|
|
620
|
+
"response",
|
|
621
|
+
400,
|
|
622
|
+
{
|
|
623
|
+
"success": false,
|
|
624
|
+
"error": "Malformed Pub/Sub envelope (missing message.messageId)."
|
|
625
|
+
}
|
|
626
|
+
]
|
|
627
|
+
]
|
|
628
|
+
},
|
|
629
|
+
"orderEnvelope": {
|
|
630
|
+
"title": "Order envelope",
|
|
631
|
+
"description": "A push envelope carrying an order event is decoded and forwarded to the collector.",
|
|
632
|
+
"in": {
|
|
633
|
+
"message": {
|
|
634
|
+
"messageId": "push-2",
|
|
635
|
+
"data": "eyJuYW1lIjoib3JkZXIgY29tcGxldGUiLCJkYXRhIjp7ImlkIjoiT1JELTUwMCIsInRvdGFsIjoxOTkuOTksImN1cnJlbmN5IjoiRVVSIn19",
|
|
636
|
+
"attributes": {}
|
|
637
|
+
},
|
|
638
|
+
"subscription": "projects/test/subscriptions/events-sub"
|
|
639
|
+
},
|
|
640
|
+
"out": [
|
|
641
|
+
[
|
|
642
|
+
"response",
|
|
643
|
+
200,
|
|
644
|
+
{
|
|
645
|
+
"success": true,
|
|
646
|
+
"id": "push-2"
|
|
647
|
+
}
|
|
648
|
+
]
|
|
649
|
+
]
|
|
650
|
+
},
|
|
651
|
+
"validEnvelope": {
|
|
652
|
+
"title": "Valid push envelope",
|
|
653
|
+
"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.",
|
|
654
|
+
"in": {
|
|
655
|
+
"message": {
|
|
656
|
+
"messageId": "push-1",
|
|
657
|
+
"data": "eyJuYW1lIjoicGFnZSB2aWV3IiwiZGF0YSI6eyJ0aXRsZSI6IkRvY3VtZW50YXRpb24iLCJ1cmwiOiJodHRwczovL2V4YW1wbGUuY29tL2RvY3MifX0=",
|
|
658
|
+
"attributes": {
|
|
659
|
+
"source": "analytics"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
"subscription": "projects/test/subscriptions/events-sub"
|
|
663
|
+
},
|
|
664
|
+
"out": [
|
|
665
|
+
[
|
|
666
|
+
"response",
|
|
667
|
+
200,
|
|
668
|
+
{
|
|
669
|
+
"success": true,
|
|
670
|
+
"id": "push-1"
|
|
671
|
+
}
|
|
672
|
+
]
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
"exportSchemas": {
|
|
679
|
+
"sourceCloudFunction": {
|
|
680
|
+
"settings": {
|
|
681
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
682
|
+
"type": "object",
|
|
683
|
+
"properties": {
|
|
684
|
+
"cors": {
|
|
685
|
+
"anyOf": [
|
|
686
|
+
{
|
|
687
|
+
"type": "boolean"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"type": "object",
|
|
691
|
+
"properties": {
|
|
692
|
+
"origin": {
|
|
693
|
+
"anyOf": [
|
|
694
|
+
{
|
|
695
|
+
"type": "string"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"type": "array",
|
|
699
|
+
"items": {
|
|
700
|
+
"type": "string"
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"type": "string",
|
|
705
|
+
"const": "*"
|
|
706
|
+
}
|
|
707
|
+
],
|
|
708
|
+
"description": "Allowed origins (* for all, URL string, or array of URLs)"
|
|
709
|
+
},
|
|
710
|
+
"methods": {
|
|
711
|
+
"type": "array",
|
|
712
|
+
"items": {
|
|
713
|
+
"type": "string",
|
|
714
|
+
"enum": [
|
|
715
|
+
"GET",
|
|
716
|
+
"POST",
|
|
717
|
+
"PUT",
|
|
718
|
+
"PATCH",
|
|
719
|
+
"DELETE",
|
|
720
|
+
"OPTIONS",
|
|
721
|
+
"HEAD"
|
|
722
|
+
]
|
|
723
|
+
},
|
|
724
|
+
"description": "Allowed HTTP methods"
|
|
725
|
+
},
|
|
726
|
+
"headers": {
|
|
727
|
+
"type": "array",
|
|
728
|
+
"items": {
|
|
729
|
+
"type": "string"
|
|
730
|
+
},
|
|
731
|
+
"description": "Allowed request headers"
|
|
732
|
+
},
|
|
733
|
+
"credentials": {
|
|
734
|
+
"type": "boolean",
|
|
735
|
+
"description": "Allow credentials (cookies, authorization headers)"
|
|
736
|
+
},
|
|
737
|
+
"maxAge": {
|
|
738
|
+
"type": "integer",
|
|
739
|
+
"exclusiveMinimum": 0,
|
|
740
|
+
"maximum": 9007199254740991,
|
|
741
|
+
"description": "Preflight cache duration in seconds"
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
"additionalProperties": false
|
|
745
|
+
}
|
|
746
|
+
],
|
|
747
|
+
"description": "CORS configuration: false = disabled, true = allow all origins, object = custom configuration"
|
|
748
|
+
},
|
|
749
|
+
"maxBatchSize": {
|
|
750
|
+
"default": 100,
|
|
751
|
+
"type": "integer",
|
|
752
|
+
"minimum": 1,
|
|
753
|
+
"maximum": 9007199254740991,
|
|
754
|
+
"description": "Maximum number of events accepted in a single batch request"
|
|
755
|
+
},
|
|
756
|
+
"enablePixelTracking": {
|
|
757
|
+
"default": true,
|
|
758
|
+
"type": "boolean",
|
|
759
|
+
"description": "Serve a tracking pixel for GET requests"
|
|
760
|
+
},
|
|
761
|
+
"timeout": {
|
|
762
|
+
"type": "integer",
|
|
763
|
+
"exclusiveMinimum": 0,
|
|
764
|
+
"maximum": 540000,
|
|
765
|
+
"description": "Request timeout in milliseconds (max: 540000 for GCP)"
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
"required": [],
|
|
769
|
+
"additionalProperties": false
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
"sourcePubSubPull": {
|
|
773
|
+
"settings": {
|
|
774
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
775
|
+
"type": "object",
|
|
776
|
+
"properties": {
|
|
777
|
+
"client": {
|
|
778
|
+
"description": "Pre-configured Google Cloud Pub/Sub client (like new PubSub({ projectId })). Bypasses credentials resolution when supplied."
|
|
779
|
+
},
|
|
780
|
+
"projectId": {
|
|
781
|
+
"type": "string",
|
|
782
|
+
"minLength": 1,
|
|
783
|
+
"description": "Google Cloud Project ID (like my-gcp-project)."
|
|
784
|
+
},
|
|
785
|
+
"subscription": {
|
|
786
|
+
"type": "string",
|
|
787
|
+
"minLength": 1,
|
|
788
|
+
"description": "Pub/Sub subscription short name (like events-sub). The full resource name projects/<projectId>/subscriptions/<subscription> is built by the SDK."
|
|
789
|
+
},
|
|
790
|
+
"topic": {
|
|
791
|
+
"type": "string",
|
|
792
|
+
"description": "Pub/Sub topic short name. Required when setup.createTopic is true; otherwise informational."
|
|
793
|
+
},
|
|
794
|
+
"credentials": {
|
|
795
|
+
"description": "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)"
|
|
796
|
+
},
|
|
797
|
+
"apiEndpoint": {
|
|
798
|
+
"type": "string",
|
|
799
|
+
"description": "Override Pub/Sub API endpoint. Useful for the local emulator (like localhost:8085)."
|
|
800
|
+
},
|
|
801
|
+
"decoder": {
|
|
802
|
+
"type": "string",
|
|
803
|
+
"enum": [
|
|
804
|
+
"json",
|
|
805
|
+
"text",
|
|
806
|
+
"raw"
|
|
807
|
+
],
|
|
808
|
+
"description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
|
|
809
|
+
},
|
|
810
|
+
"flowControl": {
|
|
811
|
+
"type": "object",
|
|
812
|
+
"properties": {
|
|
813
|
+
"maxMessages": {
|
|
814
|
+
"type": "number",
|
|
815
|
+
"description": "Maximum in-flight messages. Default: 100."
|
|
816
|
+
},
|
|
817
|
+
"maxBytes": {
|
|
818
|
+
"type": "number",
|
|
819
|
+
"description": "Maximum in-flight bytes. Default: 10485760 (10 MB)."
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"additionalProperties": false,
|
|
823
|
+
"description": "Subscriber flow control. Tightens the SDK defaults.",
|
|
824
|
+
"title": "flowControl"
|
|
825
|
+
},
|
|
826
|
+
"ackDeadline": {
|
|
827
|
+
"type": "number",
|
|
828
|
+
"description": "Subscriber ack deadline in seconds. Default: 60."
|
|
829
|
+
},
|
|
830
|
+
"shutdownTimeoutMs": {
|
|
831
|
+
"type": "number",
|
|
832
|
+
"description": "Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes the subscriber."
|
|
833
|
+
},
|
|
834
|
+
"onPushError": {
|
|
835
|
+
"type": "string",
|
|
836
|
+
"enum": [
|
|
837
|
+
"nack",
|
|
838
|
+
"ack"
|
|
839
|
+
],
|
|
840
|
+
"description": "Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it."
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
"required": [
|
|
844
|
+
"projectId",
|
|
845
|
+
"subscription"
|
|
846
|
+
],
|
|
847
|
+
"additionalProperties": false
|
|
848
|
+
},
|
|
849
|
+
"setup": {
|
|
850
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
851
|
+
"type": "object",
|
|
852
|
+
"properties": {
|
|
853
|
+
"createTopic": {
|
|
854
|
+
"type": "boolean",
|
|
855
|
+
"description": "Create the topic if it does not exist. Requires settings.topic. Default: false (require pre-existing topic)."
|
|
856
|
+
},
|
|
857
|
+
"ackDeadlineSeconds": {
|
|
858
|
+
"type": "number",
|
|
859
|
+
"description": "Subscription ack deadline in seconds. Default: 60."
|
|
860
|
+
},
|
|
861
|
+
"messageRetentionDuration": {
|
|
862
|
+
"type": "object",
|
|
863
|
+
"properties": {
|
|
864
|
+
"seconds": {
|
|
865
|
+
"type": "number",
|
|
866
|
+
"description": "Retention window in seconds. Default: project default."
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
"required": [
|
|
870
|
+
"seconds"
|
|
871
|
+
],
|
|
872
|
+
"additionalProperties": false,
|
|
873
|
+
"description": "Subscription-level retention configuration.",
|
|
874
|
+
"title": "messageRetentionDuration"
|
|
875
|
+
},
|
|
876
|
+
"filter": {
|
|
877
|
+
"type": "string",
|
|
878
|
+
"description": "Subscription filter expression. Only messages matching this filter are delivered."
|
|
879
|
+
},
|
|
880
|
+
"deadLetterPolicy": {
|
|
881
|
+
"type": "object",
|
|
882
|
+
"properties": {
|
|
883
|
+
"deadLetterTopic": {
|
|
884
|
+
"type": "string",
|
|
885
|
+
"description": "Dead-letter topic short name."
|
|
886
|
+
},
|
|
887
|
+
"maxDeliveryAttempts": {
|
|
888
|
+
"type": "number",
|
|
889
|
+
"description": "Maximum delivery attempts before forwarding to the dead-letter topic."
|
|
890
|
+
},
|
|
891
|
+
"createDeadLetterTopic": {
|
|
892
|
+
"type": "boolean",
|
|
893
|
+
"description": "Auto-create the dead-letter topic if it does not exist. Default: false."
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
"required": [
|
|
897
|
+
"deadLetterTopic",
|
|
898
|
+
"maxDeliveryAttempts"
|
|
899
|
+
],
|
|
900
|
+
"additionalProperties": false,
|
|
901
|
+
"description": "Dead-letter policy. Strongly recommended for production.",
|
|
902
|
+
"title": "deadLetterPolicy"
|
|
903
|
+
},
|
|
904
|
+
"retryPolicy": {
|
|
905
|
+
"type": "object",
|
|
906
|
+
"properties": {
|
|
907
|
+
"minimumBackoff": {
|
|
908
|
+
"type": "object",
|
|
909
|
+
"properties": {
|
|
910
|
+
"seconds": {
|
|
911
|
+
"type": "number",
|
|
912
|
+
"description": "Minimum backoff in seconds."
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
"required": [
|
|
916
|
+
"seconds"
|
|
917
|
+
],
|
|
918
|
+
"additionalProperties": false,
|
|
919
|
+
"title": "minimumBackoff"
|
|
920
|
+
},
|
|
921
|
+
"maximumBackoff": {
|
|
922
|
+
"type": "object",
|
|
923
|
+
"properties": {
|
|
924
|
+
"seconds": {
|
|
925
|
+
"type": "number",
|
|
926
|
+
"description": "Maximum backoff in seconds."
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
"required": [
|
|
930
|
+
"seconds"
|
|
931
|
+
],
|
|
932
|
+
"additionalProperties": false,
|
|
933
|
+
"title": "maximumBackoff"
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
"required": [
|
|
937
|
+
"minimumBackoff",
|
|
938
|
+
"maximumBackoff"
|
|
939
|
+
],
|
|
940
|
+
"additionalProperties": false,
|
|
941
|
+
"description": "Subscription retry policy.",
|
|
942
|
+
"title": "retryPolicy"
|
|
943
|
+
},
|
|
944
|
+
"enableMessageOrdering": {
|
|
945
|
+
"type": "boolean",
|
|
946
|
+
"description": "Enable message ordering on the subscription. Default: false."
|
|
947
|
+
},
|
|
948
|
+
"labels": {
|
|
949
|
+
"type": "object",
|
|
950
|
+
"propertyNames": {
|
|
951
|
+
"type": "string"
|
|
952
|
+
},
|
|
953
|
+
"additionalProperties": {
|
|
954
|
+
"type": "string"
|
|
955
|
+
},
|
|
956
|
+
"description": "Subscription labels for organization and billing."
|
|
957
|
+
},
|
|
958
|
+
"expirationPolicy": {
|
|
959
|
+
"type": "object",
|
|
960
|
+
"properties": {
|
|
961
|
+
"ttl": {
|
|
962
|
+
"anyOf": [
|
|
963
|
+
{
|
|
964
|
+
"type": "object",
|
|
965
|
+
"properties": {
|
|
966
|
+
"seconds": {
|
|
967
|
+
"type": "number",
|
|
968
|
+
"description": "TTL in seconds. null means never expire."
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
"required": [
|
|
972
|
+
"seconds"
|
|
973
|
+
],
|
|
974
|
+
"additionalProperties": false
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"type": "null"
|
|
978
|
+
}
|
|
979
|
+
]
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
"additionalProperties": false,
|
|
983
|
+
"description": "Subscription expiration policy.",
|
|
984
|
+
"title": "expirationPolicy"
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
"additionalProperties": false
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
"sourcePubSubPush": {
|
|
991
|
+
"settings": {
|
|
992
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
993
|
+
"type": "object",
|
|
994
|
+
"properties": {
|
|
995
|
+
"projectId": {
|
|
996
|
+
"type": "string",
|
|
997
|
+
"description": "Google Cloud Project ID (informational, surfaced in error messages)."
|
|
998
|
+
},
|
|
999
|
+
"decoder": {
|
|
1000
|
+
"type": "string",
|
|
1001
|
+
"enum": [
|
|
1002
|
+
"json",
|
|
1003
|
+
"text",
|
|
1004
|
+
"raw"
|
|
1005
|
+
],
|
|
1006
|
+
"description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
|
|
1007
|
+
},
|
|
1008
|
+
"verifyOidc": {
|
|
1009
|
+
"type": "boolean",
|
|
1010
|
+
"description": "Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false."
|
|
1011
|
+
},
|
|
1012
|
+
"audience": {
|
|
1013
|
+
"type": "string",
|
|
1014
|
+
"description": "OIDC audience (your endpoint URL or a custom audience). Required when verifyOidc is true."
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"additionalProperties": false
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
258
1020
|
}
|
|
259
1021
|
}
|