@walkeros/server-source-gcp 4.4.0 → 4.5.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-source-gcp",
4
- "version": "4.4.0",
4
+ "version": "4.5.0",
5
5
  "type": "source",
6
6
  "platform": [
7
7
  "server"
@@ -84,6 +84,18 @@
84
84
  ],
85
85
  "description": "CORS configuration: false = disabled, true = allow all origins, object = custom configuration"
86
86
  },
87
+ "maxBatchSize": {
88
+ "default": 100,
89
+ "type": "integer",
90
+ "minimum": 1,
91
+ "maximum": 9007199254740991,
92
+ "description": "Maximum number of events accepted in a single batch request"
93
+ },
94
+ "enablePixelTracking": {
95
+ "default": true,
96
+ "type": "boolean",
97
+ "description": "Serve a tracking pixel for GET requests"
98
+ },
87
99
  "timeout": {
88
100
  "type": "integer",
89
101
  "exclusiveMinimum": 0,
@@ -91,12 +103,13 @@
91
103
  "description": "Request timeout in milliseconds (max: 540000 for GCP)"
92
104
  }
93
105
  },
106
+ "required": [],
94
107
  "additionalProperties": false
95
108
  }
96
109
  },
97
110
  "examples": {
98
111
  "createTrigger": {
99
- "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await y(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 S(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}}}}"
100
113
  },
101
114
  "env": {
102
115
  "push": {
@@ -135,6 +148,46 @@
135
148
  }
136
149
  },
137
150
  "step": {
151
+ "cloudFunctionPostForwardsSource": {
152
+ "title": "POST with provenance",
153
+ "description": "A POST body carrying a source map is forwarded in full, so release and trace provenance survive the crossing.",
154
+ "trigger": {
155
+ "type": "POST"
156
+ },
157
+ "in": {
158
+ "method": "POST",
159
+ "body": {
160
+ "name": "page view",
161
+ "data": {
162
+ "title": "Home"
163
+ },
164
+ "source": {
165
+ "release": {
166
+ "web": "r1"
167
+ }
168
+ }
169
+ },
170
+ "headers": {
171
+ "content-type": "application/json"
172
+ }
173
+ },
174
+ "out": [
175
+ [
176
+ "elb",
177
+ {
178
+ "name": "page view",
179
+ "data": {
180
+ "title": "Home"
181
+ },
182
+ "source": {
183
+ "release": {
184
+ "web": "r1"
185
+ }
186
+ }
187
+ }
188
+ ]
189
+ ]
190
+ },
138
191
  "orderEvent": {
139
192
  "title": "Order POST",
140
193
  "description": "A Cloud Function HTTP POST carrying an order payload becomes a walker order complete event.",
@@ -144,7 +197,7 @@
144
197
  "in": {
145
198
  "method": "POST",
146
199
  "body": {
147
- "event": "order complete",
200
+ "name": "order complete",
148
201
  "data": {
149
202
  "id": "ORD-700",
150
203
  "total": 99.99,
@@ -178,7 +231,7 @@
178
231
  "in": {
179
232
  "method": "POST",
180
233
  "body": {
181
- "event": "page view",
234
+ "name": "page view",
182
235
  "data": {
183
236
  "title": "Home",
184
237
  "url": "https://example.com/"
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.4.0",
4
+ "version": "4.5.0",
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.4.0",
25
- "@walkeros/core": "4.4.0"
24
+ "@walkeros/collector": "4.5.0",
25
+ "@walkeros/core": "4.5.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@google-cloud/functions-framework": "^5.0.2"