@smplkit/sdk 3.0.11 → 3.0.12

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.cts CHANGED
@@ -77,7 +77,7 @@ declare class EventsClient {
77
77
  * reject those with a 403 (the buffer logs and drops permanent
78
78
  * failures, so a misuse will silently disappear from the queue).
79
79
  */
80
- create(input: CreateEventInput): void;
80
+ record(input: CreateEventInput): void;
81
81
  list(params?: ListEventsParams): Promise<ListEventsPage>;
82
82
  get(eventId: string): Promise<AuditEvent>;
83
83
  /** Block until the in-memory buffer is drained or `timeoutMs` elapses. */
package/dist/index.d.ts CHANGED
@@ -77,7 +77,7 @@ declare class EventsClient {
77
77
  * reject those with a 403 (the buffer logs and drops permanent
78
78
  * failures, so a misuse will silently disappear from the queue).
79
79
  */
80
- create(input: CreateEventInput): void;
80
+ record(input: CreateEventInput): void;
81
81
  list(params?: ListEventsParams): Promise<ListEventsPage>;
82
82
  get(eventId: string): Promise<AuditEvent>;
83
83
  /** Block until the in-memory buffer is drained or `timeoutMs` elapses. */
package/dist/index.js CHANGED
@@ -16659,10 +16659,10 @@ var AuditEventBuffer = class {
16659
16659
  void this._drainOnce();
16660
16660
  }
16661
16661
  }
16662
- /** Block (cooperatively) until the buffer is empty or `timeoutMs` elapses. */
16662
+ /** Block (cooperatively) until the buffer is idle or `timeoutMs` elapses. */
16663
16663
  async flush(timeoutMs = 5e3) {
16664
16664
  const deadline = Date.now() + timeoutMs;
16665
- while (this._queue.length > 0) {
16665
+ while (this._queue.length > 0 || this._draining) {
16666
16666
  if (Date.now() >= deadline) {
16667
16667
  console.warn(`[smplkit.audit] flush timed out after ${timeoutMs}ms`);
16668
16668
  return;
@@ -16807,7 +16807,7 @@ var EventsClient = class {
16807
16807
  * reject those with a 403 (the buffer logs and drops permanent
16808
16808
  * failures, so a misuse will silently disappear from the queue).
16809
16809
  */
16810
- create(input) {
16810
+ record(input) {
16811
16811
  const body = {
16812
16812
  data: { type: "event", attributes: _attributesFromInput(input) }
16813
16813
  };