diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f19326..cdad9b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.9.2] - 2024-10-28 + +- feat: stop storing the message in the datastore + ## [1.9.1] - 2024-09-04 - chore: apply linter suggestions diff --git a/bun.lockb b/bun.lockb index 8121344..e617c62 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 03e5087..effb96b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ard-eventhub", - "version": "1.9.1", + "version": "1.9.2", "description": "ARD system to distribute real-time (live) metadata for primarily radio broadcasts.", "main": "./src/ingest/index.js", "engines": { @@ -28,25 +28,25 @@ "license": "EUPL-1.2", "dependencies": { "@google-cloud/datastore": "^9.1.0", - "@google-cloud/pubsub": "^4.7.0", + "@google-cloud/pubsub": "^4.8.0", "@google-cloud/secret-manager": "^5.6.0", - "@swrlab/utils": "^2.0.1-beta", + "@swrlab/utils": "^2.0.2", "compression": "^1.7.4", - "dd-trace": "^5.22.0", - "express": "^4.19.2", + "dd-trace": "^5.24.0", + "express": "^4.21.1", "express-openapi-validator": "^5.3.4", - "firebase-admin": "^12.4.0", + "firebase-admin": "^12.7.0", "google-auth-library": "^9.14.1", "jsonwebtoken": "^9.0.2", "luxon": "^3.5.0", "slug": "^9.1.0", "swagger-ui-express": "^5.0.1", "ulid": "^2.3.0", - "winston": "^3.14.2" + "winston": "^3.15.0" }, "devDependencies": { "@biomejs/biome": "^1.8.3", - "@swrlab/style-guide": "^1.0.1", + "@swrlab/style-guide": "^1.0.2", "chai": "^4.5.0", "chai-http": "^4.4.0", "docsify-cli": "^4.4.4", diff --git a/src/ingest/events/post.js b/src/ingest/events/post.js index 9a2836f..b052385 100644 --- a/src/ingest/events/post.js +++ b/src/ingest/events/post.js @@ -7,9 +7,9 @@ // load node utils const { DateTime } = require('luxon') +const ULID = require('ulid') // load eventhub utils -const datastore = require('../../utils/datastore') const { createNewTopic, processServices } = require('../../utils/events') const logger = require('../../utils/logger') const pubsub = require('../../utils/pubsub') @@ -84,9 +84,8 @@ module.exports = async (req, res) => { message.services.map((service) => processServices(service, req)) ) - // save message to datastore - const savedMessage = await datastore.save(message, 'events') - message.id = savedMessage.id.toString() + // generate unique Id from the institution id and a random ULID + message.id = `${req.user.institutionId}-${ULID.ulid()}` // collect unknown topics from returning errors const newServices = []