@walkeros/server-source-gcp 4.8.1 → 4.8.3-next-1793115089237

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-source-gcp",
4
- "version": "4.8.1",
4
+ "version": "4.8.3-next-1793115089237",
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 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}}}}"
112
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await b(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": "()=>n"
145
+ "$code": "()=>a"
146
146
  }
147
147
  }
148
148
  }
@@ -200,7 +200,7 @@
200
200
  "name": "order complete",
201
201
  "data": {
202
202
  "id": "ORD-700",
203
- "total": 99.99,
203
+ "value": 99.99,
204
204
  "currency": "EUR"
205
205
  }
206
206
  },
@@ -215,7 +215,7 @@
215
215
  "name": "order complete",
216
216
  "data": {
217
217
  "id": "ORD-700",
218
- "total": 99.99,
218
+ "value": 99.99,
219
219
  "currency": "EUR"
220
220
  }
221
221
  }
@@ -259,7 +259,7 @@
259
259
  "exportExamples": {
260
260
  "sourceCloudFunction": {
261
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}}}}"
262
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await b(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
263
  },
264
264
  "env": {
265
265
  "push": {
@@ -292,7 +292,7 @@
292
292
  "$code": "()=>{}"
293
293
  },
294
294
  "scope": {
295
- "$code": "()=>n"
295
+ "$code": "()=>a"
296
296
  }
297
297
  }
298
298
  }
@@ -350,7 +350,7 @@
350
350
  "name": "order complete",
351
351
  "data": {
352
352
  "id": "ORD-700",
353
- "total": 99.99,
353
+ "value": 99.99,
354
354
  "currency": "EUR"
355
355
  }
356
356
  },
@@ -365,7 +365,7 @@
365
365
  "name": "order complete",
366
366
  "data": {
367
367
  "id": "ORD-700",
368
- "total": 99.99,
368
+ "value": 99.99,
369
369
  "currency": "EUR"
370
370
  }
371
371
  }
@@ -408,7 +408,7 @@
408
408
  },
409
409
  "sourcePubSubPull": {
410
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}}}"
411
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await A(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if(R(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
412
  },
413
413
  "env": {
414
414
  "moduleMockEnv": {
@@ -441,7 +441,7 @@
441
441
  "$code": "()=>{}"
442
442
  },
443
443
  "scope": {
444
- "$code": "()=>h"
444
+ "$code": "()=>v"
445
445
  }
446
446
  }
447
447
  },
@@ -475,11 +475,11 @@
475
475
  "$code": "()=>{}"
476
476
  },
477
477
  "scope": {
478
- "$code": "()=>h"
478
+ "$code": "()=>v"
479
479
  }
480
480
  },
481
481
  "PubSub": {
482
- "$code": "class{constructor(e){this.options=e}options;subscription(e,t){return new v(e,t)}async close(){}}"
482
+ "$code": "class{constructor(e){this.options=e}options;subscription(e,t){return new y(e,t)}async close(){}}"
483
483
  }
484
484
  },
485
485
  "simulation": [
@@ -489,7 +489,7 @@
489
489
  "step": {
490
490
  "decoderText": {
491
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.",
492
+ "description": "With decoder=text on the source settings, the message data is forwarded as data.payload. It has no event name, so without a before transformer that builds the event the collector rejects it and the message is acked.",
493
493
  "in": {
494
494
  "id": "msg-3",
495
495
  "dataString": "plain text payload",
@@ -537,7 +537,7 @@
537
537
  "description": "A JSON-encoded order event arrives and is acked after successful collector forwarding.",
538
538
  "in": {
539
539
  "id": "msg-2",
540
- "dataString": "{\"name\":\"order complete\",\"data\":{\"id\":\"ORD-500\",\"total\":199.99,\"currency\":\"EUR\"}}",
540
+ "dataString": "{\"name\":\"order complete\",\"data\":{\"id\":\"ORD-500\",\"value\":199.99,\"currency\":\"EUR\"}}",
541
541
  "attributes": {
542
542
  "entity": "order",
543
543
  "action": "complete"
@@ -569,7 +569,7 @@
569
569
  },
570
570
  "sourcePubSubPush": {
571
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]]}}}"
572
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await V(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(_(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
573
  },
574
574
  "env": {
575
575
  "push": {
@@ -602,7 +602,7 @@
602
602
  "$code": "()=>{}"
603
603
  },
604
604
  "scope": {
605
- "$code": "()=>I"
605
+ "$code": "()=>U"
606
606
  }
607
607
  }
608
608
  },
@@ -632,7 +632,7 @@
632
632
  "in": {
633
633
  "message": {
634
634
  "messageId": "push-2",
635
- "data": "eyJuYW1lIjoib3JkZXIgY29tcGxldGUiLCJkYXRhIjp7ImlkIjoiT1JELTUwMCIsInRvdGFsIjoxOTkuOTksImN1cnJlbmN5IjoiRVVSIn19",
635
+ "data": "eyJuYW1lIjoib3JkZXIgY29tcGxldGUiLCJkYXRhIjp7ImlkIjoiT1JELTUwMCIsInZhbHVlIjoxOTkuOTksImN1cnJlbmN5IjoiRVVSIn19",
636
636
  "attributes": {}
637
637
  },
638
638
  "subscription": "projects/test/subscriptions/events-sub"
@@ -805,7 +805,7 @@
805
805
  "text",
806
806
  "raw"
807
807
  ],
808
- "description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
808
+ "description": "Decoder for the message data field. json (default) parses JSON; text forwards the UTF-8 string as data.payload; raw forwards the bytes base64 encoded as data.payload. text and raw events need a before transformer that sets the event name."
809
809
  },
810
810
  "flowControl": {
811
811
  "type": "object",
@@ -837,7 +837,7 @@
837
837
  "nack",
838
838
  "ack"
839
839
  ],
840
- "description": "Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it."
840
+ "description": "Behavior when a message is not delivered and a redelivery could still deliver it (a retryable failure), or when decoding or forwarding throws. nack (default) redelivers the message; ack drops it."
841
841
  }
842
842
  },
843
843
  "required": [
@@ -856,7 +856,7 @@
856
856
  },
857
857
  "ackDeadlineSeconds": {
858
858
  "type": "number",
859
- "description": "Subscription ack deadline in seconds. Default: 60."
859
+ "description": "Subscription ack deadline in seconds. Unset: Pub/Sub's default (10)."
860
860
  },
861
861
  "messageRetentionDuration": {
862
862
  "type": "object",
@@ -994,7 +994,7 @@
994
994
  "properties": {
995
995
  "projectId": {
996
996
  "type": "string",
997
- "description": "Google Cloud Project ID (informational, surfaced in error messages)."
997
+ "description": "Google Cloud Project ID. Optional; the push handler does not read it."
998
998
  },
999
999
  "decoder": {
1000
1000
  "type": "string",
@@ -1003,7 +1003,7 @@
1003
1003
  "text",
1004
1004
  "raw"
1005
1005
  ],
1006
- "description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
1006
+ "description": "Decoder for the message data field. json (default) parses JSON, text forwards the UTF-8 string, raw forwards the Buffer. text and raw values carry no event name: without a before transformer that builds the event the collector rejects them and the push answers 400."
1007
1007
  },
1008
1008
  "verifyOidc": {
1009
1009
  "type": "boolean",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-source-gcp",
3
3
  "description": "Google Cloud Platform server sources for walkerOS (Cloud Functions, Pub/Sub)",
4
- "version": "4.8.1",
4
+ "version": "4.8.3-next-1793115089237",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@google-cloud/pubsub": "^5.3.0",
24
- "@walkeros/collector": "4.8.1",
25
- "@walkeros/core": "4.8.1"
24
+ "@walkeros/collector": "4.8.3-next-1793115089237",
25
+ "@walkeros/core": "4.8.3-next-1793115089237"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@google-cloud/functions-framework": "^5.0.2"