@ductape/sdk 0.3.0 → 0.3.1

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/dist/index.d.ts CHANGED
@@ -1404,6 +1404,7 @@ export default class Ductape implements IDuctape {
1404
1404
  env: string;
1405
1405
  eventId: string;
1406
1406
  force?: boolean;
1407
+ session?: string;
1407
1408
  }) => Promise<import("./brokers").IReplayEventResult>;
1408
1409
  /** Query tracked Events records with status/category/date filters and pagination. */
1409
1410
  getEvents: (data: Parameters<BrokersService["getEvents"]>[0]) => Promise<import("./brokers").IGetBrokerEventsResult>;
@@ -1419,6 +1420,7 @@ export default class Ductape implements IDuctape {
1419
1420
  topicTag?: string;
1420
1421
  messageIds?: string[];
1421
1422
  limit?: number;
1423
+ session?: string;
1422
1424
  }) => Promise<import("./brokers").IReprocessDLQResult>;
1423
1425
  /** Test the configured provider connection for one Events environment. */
1424
1426
  testConnection: (data: {
@@ -4387,7 +4389,7 @@ export default class Ductape implements IDuctape {
4387
4389
  refreshedAt?: number;
4388
4390
  error?: string;
4389
4391
  };
4390
- connections: "ready" | "degraded" | "warming";
4392
+ connections: "degraded" | "ready" | "warming";
4391
4393
  };
4392
4394
  warmup: {
4393
4395
  databases: {
package/dist/index.js CHANGED
@@ -1675,24 +1675,12 @@ class Ductape {
1675
1675
  */
1676
1676
  produce: async (data) => {
1677
1677
  const brokersService = await this.createNewBrokersService();
1678
- // If session is provided as a string token, convert to { tag, token } format
1679
- // Session tokens from sessions.start() are in format "tag:jwt-token"
1680
- let sessionObj;
1681
- if (data.session) {
1682
- const colonIndex = data.session.indexOf(':');
1683
- if (colonIndex > 0) {
1684
- sessionObj = {
1685
- tag: data.session.substring(0, colonIndex),
1686
- token: data.session.substring(colonIndex + 1),
1687
- };
1688
- }
1689
- }
1690
1678
  return brokersService.publish({
1691
1679
  product: data.product,
1692
1680
  env: data.env,
1693
1681
  event: data.event,
1694
1682
  message: data.message,
1695
- session: sessionObj,
1683
+ session: data.session,
1696
1684
  cache: data.cache,
1697
1685
  });
1698
1686
  },
@@ -1714,13 +1702,8 @@ class Ductape {
1714
1702
  },
1715
1703
  /** Publish once for a stable logical idempotency key. */
1716
1704
  publishIdempotent: async (data) => {
1717
- var _a, _b;
1718
1705
  const brokersService = await this.createNewBrokersService();
1719
- const colonIndex = (_b = (_a = data.session) === null || _a === void 0 ? void 0 : _a.indexOf(':')) !== null && _b !== void 0 ? _b : -1;
1720
- const session = data.session && colonIndex > 0
1721
- ? { tag: data.session.substring(0, colonIndex), token: data.session.substring(colonIndex + 1) }
1722
- : undefined;
1723
- return brokersService.publishIdempotent(Object.assign(Object.assign({}, data), { session }));
1706
+ return brokersService.publishIdempotent(data);
1724
1707
  },
1725
1708
  /** Check whether an idempotency key has already been accepted. */
1726
1709
  checkIdempotency: async (data) => {