@fireemu/linux-x64 0.14.0 → 0.16.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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @fireemu/linux-x64
2
2
 
3
3
  The [fireemu](https://www.npmjs.com/package/fireemu) daemon built for `linux-x64`
4
- (Rust target `x86_64-unknown-linux-musl`), version 0.14.0.
4
+ (Rust target `x86_64-unknown-linux-musl`), version 0.16.0.
5
5
 
6
6
  Statically linked against musl: any glibc or musl distribution, including distroless and Alpine.
7
7
 
package/bin/fireemu CHANGED
Binary file
@@ -1508,11 +1508,22 @@ async function invoke(functions, manifest, msg) {
1508
1508
  await fn({ ...msg.event, data: storageObjectInRecordedOrder(msg.event.data) });
1509
1509
  return;
1510
1510
  case "pubsub":
1511
- // A custom event reaches the handler as the CloudEvent itself, exactly as the official
1512
- // Eventarc emulator POSTs it to the functions emulator.
1513
- case "eventarc":
1514
1511
  await fn(msg.event);
1515
1512
  return;
1513
+ case "eventarc": {
1514
+ // Eventarc Standard delivers binary CloudEvents. The production JSON body parser
1515
+ // admits objects and arrays before invoking the function; the emulator sends a
1516
+ // structured envelope instead. Strict conversion omits datacontenttype for JSON.
1517
+ const contentType = msg.event.datacontenttype;
1518
+ const jsonBody = contentType === undefined ||
1519
+ (typeof contentType === "string" && /^application\/json(?:\s*;|$)/i.test(contentType.trim()));
1520
+ if (strictProfile() && jsonBody && Object.hasOwn(msg.event, "data") &&
1521
+ (msg.event.data === null || typeof msg.event.data !== "object")) {
1522
+ throw new SyntaxError("Eventarc binary JSON body must be an object or array");
1523
+ }
1524
+ await fn(msg.event);
1525
+ return;
1526
+ }
1516
1527
  case "auth":
1517
1528
  throw new Error("Auth user events are delivered to v1 auth.user() handlers only");
1518
1529
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireemu/linux-x64",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "The fireemu daemon for linux-x64",
5
5
  "homepage": "https://github.com/t-k/fireemu#readme",
6
6
  "repository": {