@walkeros/server-source-gcp 4.8.1 → 4.8.2

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.2",
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": [
@@ -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": "()=>B"
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"
@@ -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": [
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.2",
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.2",
25
+ "@walkeros/core": "4.8.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@google-cloud/functions-framework": "^5.0.2"