@newhomestar/sdk 0.7.11 → 0.7.13

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.
Files changed (2) hide show
  1. package/dist/events.js +7 -7
  2. package/package.json +1 -1
package/dist/events.js CHANGED
@@ -54,7 +54,7 @@ async function _relayRow(db, row, eventsUrl, serviceToken) {
54
54
  ...row.payload,
55
55
  idempotency_key: row.idempotencyKey,
56
56
  };
57
- const res = await fetch(`${eventsUrl}/queue`, {
57
+ const res = await fetch(`${eventsUrl}/events/queue`, {
58
58
  method: 'POST',
59
59
  headers: {
60
60
  'Authorization': `Bearer ${serviceToken}`,
@@ -317,7 +317,7 @@ export async function logEvent(payload) {
317
317
  const eventsUrl = _getEnvOrThrow('NOVA_EVENTS_SERVICE_URL', 'logEvent');
318
318
  const serviceToken = _getEnvOrThrow('NOVA_SERVICE_TOKEN', 'logEvent');
319
319
  const serviceSlug = process.env.NOVA_SERVICE_SLUG;
320
- const res = await fetch(`${eventsUrl}`, {
320
+ const res = await fetch(`${eventsUrl}/events`, {
321
321
  method: 'POST',
322
322
  headers: {
323
323
  'Authorization': `Bearer ${serviceToken}`,
@@ -349,7 +349,7 @@ export async function queueEvent(payload) {
349
349
  const eventsUrl = _getEnvOrThrow('NOVA_EVENTS_SERVICE_URL', 'queueEvent');
350
350
  const serviceToken = _getEnvOrThrow('NOVA_SERVICE_TOKEN', 'queueEvent');
351
351
  const serviceSlug = process.env.NOVA_SERVICE_SLUG;
352
- const res = await fetch(`${eventsUrl}/queue`, {
352
+ const res = await fetch(`${eventsUrl}/events/queue`, {
353
353
  method: 'POST',
354
354
  headers: {
355
355
  'Authorization': `Bearer ${serviceToken}`,
@@ -565,7 +565,7 @@ export async function withInboundEvent(db, msg, handler) {
565
565
  // Safe because: if ACK fails, PGMQ re-delivers, UNIQUE(msg_id) blocks
566
566
  // re-processing, and we just ACK again on the duplicate delivery.
567
567
  try {
568
- const ackRes = await fetch(`${eventsUrl}/queue/ack`, {
568
+ const ackRes = await fetch(`${eventsUrl}/events/queue/ack`, {
569
569
  method: 'POST',
570
570
  headers: {
571
571
  'Authorization': `Bearer ${serviceToken}`,
@@ -676,7 +676,7 @@ export function startInboundConsumer(db, options) {
676
676
  /** Send a NACK to extend the visibility timeout with exponential backoff */
677
677
  async function _nack(msgId, readCt) {
678
678
  try {
679
- await fetch(`${eventsUrl}/queue/nack`, {
679
+ await fetch(`${eventsUrl}/events/queue/nack`, {
680
680
  method: 'POST',
681
681
  headers: {
682
682
  'Authorization': `Bearer ${serviceToken}`,
@@ -710,7 +710,7 @@ export function startInboundConsumer(db, options) {
710
710
  // No handler registered and no default — skip + ACK to unblock queue
711
711
  console.log(`[nova/events] No handler for event type "${eventType}" (msg_id=${msgId}) — ACK and skip`);
712
712
  try {
713
- await fetch(`${eventsUrl}/queue/ack`, {
713
+ await fetch(`${eventsUrl}/events/queue/ack`, {
714
714
  method: 'POST',
715
715
  headers: { 'Authorization': `Bearer ${serviceToken}`, 'Content-Type': 'application/json' },
716
716
  body: JSON.stringify({ queue_name: queueName, msg_id: msgId }),
@@ -802,7 +802,7 @@ export function startInboundConsumer(db, options) {
802
802
  console.log(`[nova/events] SSE consumer starting — url=${eventsUrl} ` +
803
803
  `token=${tokenSuffix} queue=${queueName} vt=${vt}s headersTimeout=120s`);
804
804
  while (!abort.signal.aborted) {
805
- const streamUrl = `${eventsUrl}/queue/stream?queue=${encodeURIComponent(queueName)}&vt=${vt}`;
805
+ const streamUrl = `${eventsUrl}/events/queue/stream?queue=${encodeURIComponent(queueName)}&vt=${vt}`;
806
806
  const connectStart = Date.now();
807
807
  try {
808
808
  console.log(`[nova/events] Connecting to SSE stream (attempt ${reconnectAttempt + 1}): ${streamUrl}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newhomestar/sdk",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
4
4
  "description": "Type-safe SDK for building Nova pipelines (workers & functions)",
5
5
  "homepage": "https://github.com/newhomestar/nova-node-sdk#readme",
6
6
  "bugs": {