@central-ticket/queue-sdk 0.0.3 → 0.0.4

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/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CentralQ, c as CentralQCreateOptions, a as CentralQClient, Q as QueueStatus, d as CentralQOptions } from './centralq-C3ukDo0x.mjs';
1
+ import { b as CentralQ, e as CentralQCreateOptions, c as CentralQClient, m as QueueStatus, f as CentralQOptions } from './centralq-CCw_Cqam.mjs';
2
2
 
3
3
  interface UseCentralQReturn {
4
4
  /** Token JWT si el usuario fue admitido, null si no */
@@ -11,6 +11,8 @@ interface UseCentralQReturn {
11
11
  expired: boolean;
12
12
  /** true si hay un error de conexión */
13
13
  error: boolean;
14
+ /** true si la cola no acepta nuevos ingresos temporalmente */
15
+ paused: boolean;
14
16
  /** Libera el slot (llamar después de comprar) */
15
17
  leave: () => void;
16
18
  /** Instancia CentralQ subyacente (para uso avanzado) */
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CentralQ, c as CentralQCreateOptions, a as CentralQClient, Q as QueueStatus, d as CentralQOptions } from './centralq-C3ukDo0x.js';
1
+ import { b as CentralQ, e as CentralQCreateOptions, c as CentralQClient, m as QueueStatus, f as CentralQOptions } from './centralq-CCw_Cqam.js';
2
2
 
3
3
  interface UseCentralQReturn {
4
4
  /** Token JWT si el usuario fue admitido, null si no */
@@ -11,6 +11,8 @@ interface UseCentralQReturn {
11
11
  expired: boolean;
12
12
  /** true si hay un error de conexión */
13
13
  error: boolean;
14
+ /** true si la cola no acepta nuevos ingresos temporalmente */
15
+ paused: boolean;
14
16
  /** Libera el slot (llamar después de comprar) */
15
17
  leave: () => void;
16
18
  /** Instancia CentralQ subyacente (para uso avanzado) */
package/dist/react.js CHANGED
@@ -68,6 +68,11 @@ var init_queue_element = __esm({
68
68
  Por favor, no cierres esta ventana.
69
69
  </p>
70
70
  ` : ""}
71
+ ${this.status === "PAUSED" ? import_lit.html`
72
+ <h2>La fila está temporalmente cerrada</h2>
73
+ <p>Volveremos a intentar automáticamente.</p>
74
+ <div class="spinner"></div>
75
+ ` : ""}
71
76
  ${this.status === "EXPIRED" ? import_lit.html`
72
77
  <h2 style="color: #f59e0b;">Tu sesión ha expirado</h2>
73
78
  <p>El tiempo para completar la compra terminó.</p>
@@ -192,6 +197,30 @@ var QueueHttpClient = class {
192
197
  }
193
198
  return res.json();
194
199
  }
200
+ /**
201
+ * Canjea un código de bypass por un token de acceso activo.
202
+ * El worker descuenta un uso únicamente cuando el canje es exitoso.
203
+ */
204
+ async redeemBypassCode(eventId, code, userId) {
205
+ const res = await fetch(
206
+ `${this.apiUrl}/api/queue/${encodeURIComponent(eventId)}/bypass`,
207
+ {
208
+ method: "POST",
209
+ headers: this.headers,
210
+ body: JSON.stringify({ code, userId })
211
+ }
212
+ );
213
+ const body = await res.json().catch(() => ({}));
214
+ if (!res.ok) {
215
+ throw new Error(
216
+ body.message ?? `Error ${res.status} al canjear c\xF3digo bypass`
217
+ );
218
+ }
219
+ if (body.status !== "ACTIVE" || !body.token || !body.expiresAt || body.bypass !== true) {
220
+ throw new Error("Respuesta inv\xE1lida al canjear c\xF3digo bypass");
221
+ }
222
+ return body;
223
+ }
195
224
  /**
196
225
  * Envía un heartbeat para mantener vivo el slot (waiting o active).
197
226
  * El SDK lo llama cada 10s automáticamente.
@@ -261,6 +290,7 @@ var QueueHttpClient = class {
261
290
  configured: body.configured === true,
262
291
  protected: body.protected === true,
263
292
  isActive: body.isActive === true,
293
+ isPaused: body.isPaused === true,
264
294
  admissionMode: body.admissionMode ?? "PUBLIC",
265
295
  challengeRequired: body.challengeRequired === true
266
296
  };
@@ -499,6 +529,24 @@ var CentralQ = class _CentralQ {
499
529
  this.pollInterval
500
530
  );
501
531
  }
532
+ } else if (res.status === "PAUSED") {
533
+ this.updateUI("PAUSED");
534
+ this.emit("paused", {
535
+ message: res.message,
536
+ retryAfterSeconds: res.retryAfterSeconds,
537
+ userId: this.userId,
538
+ eventId: this.eventId
539
+ });
540
+ if (!this.pollingTimer) {
541
+ const retryInterval = Math.max(
542
+ this.pollInterval,
543
+ res.retryAfterSeconds * 1e3
544
+ );
545
+ this.pollingTimer = setInterval(
546
+ () => this.checkQueue(),
547
+ retryInterval
548
+ );
549
+ }
502
550
  }
503
551
  } catch {
504
552
  this.updateUI("ERROR");
@@ -518,12 +566,14 @@ function useCentralQ(options) {
518
566
  const [ahead, setAhead] = (0, import_react.useState)(null);
519
567
  const [expired, setExpired] = (0, import_react.useState)(false);
520
568
  const [error, setError] = (0, import_react.useState)(false);
569
+ const [paused, setPaused] = (0, import_react.useState)(false);
521
570
  const instanceRef = (0, import_react.useRef)(null);
522
571
  const leave = (0, import_react.useCallback)(() => {
523
572
  instanceRef.current?.leave();
524
573
  setToken(null);
525
574
  setPosition(null);
526
575
  setAhead(null);
576
+ setPaused(false);
527
577
  }, []);
528
578
  (0, import_react.useEffect)(() => {
529
579
  const queue = CentralQ.init(options);
@@ -533,17 +583,26 @@ function useCentralQ(options) {
533
583
  setAhead(null);
534
584
  setExpired(false);
535
585
  setError(false);
586
+ setPaused(false);
536
587
  });
537
588
  queue.on("position", (detail) => {
538
589
  setPosition(detail.position);
539
590
  setAhead(detail.ahead);
591
+ setPaused(false);
592
+ });
593
+ queue.on("paused", () => {
594
+ setPosition(null);
595
+ setAhead(null);
596
+ setPaused(true);
540
597
  });
541
598
  queue.on("expired", () => {
542
599
  setToken(null);
543
600
  setExpired(true);
601
+ setPaused(false);
544
602
  });
545
603
  queue.on("error", () => {
546
604
  setError(true);
605
+ setPaused(false);
547
606
  });
548
607
  instanceRef.current = queue;
549
608
  return () => {
@@ -557,6 +616,7 @@ function useCentralQ(options) {
557
616
  ahead,
558
617
  expired,
559
618
  error,
619
+ paused,
560
620
  leave,
561
621
  instance: instanceRef.current
562
622
  };
@@ -636,6 +696,16 @@ function useQueue(options) {
636
696
  }));
637
697
  setStatus("waiting");
638
698
  });
699
+ queue.on("paused", (_detail) => {
700
+ setData({
701
+ token: null,
702
+ position: null,
703
+ ahead: null,
704
+ expiresAt: null
705
+ });
706
+ setStatus("paused");
707
+ setError(null);
708
+ });
639
709
  queue.on("expired", () => {
640
710
  setData({
641
711
  token: null,
package/dist/react.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CentralQ
3
- } from "./chunk-BVCZFNM3.mjs";
4
- import "./chunk-P73Q2ZIO.mjs";
3
+ } from "./chunk-OVV3CIZZ.mjs";
4
+ import "./chunk-OR3GGW4J.mjs";
5
5
  import "./chunk-XRJFNASX.mjs";
6
6
 
7
7
  // src/react.ts
@@ -12,12 +12,14 @@ function useCentralQ(options) {
12
12
  const [ahead, setAhead] = useState(null);
13
13
  const [expired, setExpired] = useState(false);
14
14
  const [error, setError] = useState(false);
15
+ const [paused, setPaused] = useState(false);
15
16
  const instanceRef = useRef(null);
16
17
  const leave = useCallback(() => {
17
18
  instanceRef.current?.leave();
18
19
  setToken(null);
19
20
  setPosition(null);
20
21
  setAhead(null);
22
+ setPaused(false);
21
23
  }, []);
22
24
  useEffect(() => {
23
25
  const queue = CentralQ.init(options);
@@ -27,17 +29,26 @@ function useCentralQ(options) {
27
29
  setAhead(null);
28
30
  setExpired(false);
29
31
  setError(false);
32
+ setPaused(false);
30
33
  });
31
34
  queue.on("position", (detail) => {
32
35
  setPosition(detail.position);
33
36
  setAhead(detail.ahead);
37
+ setPaused(false);
38
+ });
39
+ queue.on("paused", () => {
40
+ setPosition(null);
41
+ setAhead(null);
42
+ setPaused(true);
34
43
  });
35
44
  queue.on("expired", () => {
36
45
  setToken(null);
37
46
  setExpired(true);
47
+ setPaused(false);
38
48
  });
39
49
  queue.on("error", () => {
40
50
  setError(true);
51
+ setPaused(false);
41
52
  });
42
53
  instanceRef.current = queue;
43
54
  return () => {
@@ -51,6 +62,7 @@ function useCentralQ(options) {
51
62
  ahead,
52
63
  expired,
53
64
  error,
65
+ paused,
54
66
  leave,
55
67
  instance: instanceRef.current
56
68
  };
@@ -130,6 +142,16 @@ function useQueue(options) {
130
142
  }));
131
143
  setStatus("waiting");
132
144
  });
145
+ queue.on("paused", (_detail) => {
146
+ setData({
147
+ token: null,
148
+ position: null,
149
+ ahead: null,
150
+ expiresAt: null
151
+ });
152
+ setStatus("paused");
153
+ setError(null);
154
+ });
133
155
  queue.on("expired", () => {
134
156
  setData({
135
157
  token: null,
package/dist/server.mjs CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  createCentralQServerClient,
6
6
  validateQueueTokenServer,
7
7
  verifyQueueAccessServer
8
- } from "./chunk-FAJWYFUK.mjs";
9
- import "./chunk-P73Q2ZIO.mjs";
8
+ } from "./chunk-CFWLZCAR.mjs";
9
+ import "./chunk-OR3GGW4J.mjs";
10
10
  import "./chunk-XRJFNASX.mjs";
11
11
  export {
12
12
  CentralQServerClient,
package/dist/svelte.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Readable } from 'svelte/store';
2
- import { Q as QueueStatus, C as CentralQ, c as CentralQCreateOptions, a as CentralQClient, d as CentralQOptions } from './centralq-C3ukDo0x.mjs';
2
+ import { m as QueueStatus, b as CentralQ, e as CentralQCreateOptions, c as CentralQClient, f as CentralQOptions } from './centralq-CCw_Cqam.mjs';
3
3
 
4
4
  interface CentralQStores {
5
5
  /** Store con el token JWT si el usuario fue admitido */
package/dist/svelte.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Readable } from 'svelte/store';
2
- import { Q as QueueStatus, C as CentralQ, c as CentralQCreateOptions, a as CentralQClient, d as CentralQOptions } from './centralq-C3ukDo0x.js';
2
+ import { m as QueueStatus, b as CentralQ, e as CentralQCreateOptions, c as CentralQClient, f as CentralQOptions } from './centralq-CCw_Cqam.js';
3
3
 
4
4
  interface CentralQStores {
5
5
  /** Store con el token JWT si el usuario fue admitido */
package/dist/svelte.js CHANGED
@@ -68,6 +68,11 @@ var init_queue_element = __esm({
68
68
  Por favor, no cierres esta ventana.
69
69
  </p>
70
70
  ` : ""}
71
+ ${this.status === "PAUSED" ? import_lit.html`
72
+ <h2>La fila está temporalmente cerrada</h2>
73
+ <p>Volveremos a intentar automáticamente.</p>
74
+ <div class="spinner"></div>
75
+ ` : ""}
71
76
  ${this.status === "EXPIRED" ? import_lit.html`
72
77
  <h2 style="color: #f59e0b;">Tu sesión ha expirado</h2>
73
78
  <p>El tiempo para completar la compra terminó.</p>
@@ -193,6 +198,30 @@ var QueueHttpClient = class {
193
198
  }
194
199
  return res.json();
195
200
  }
201
+ /**
202
+ * Canjea un código de bypass por un token de acceso activo.
203
+ * El worker descuenta un uso únicamente cuando el canje es exitoso.
204
+ */
205
+ async redeemBypassCode(eventId, code, userId) {
206
+ const res = await fetch(
207
+ `${this.apiUrl}/api/queue/${encodeURIComponent(eventId)}/bypass`,
208
+ {
209
+ method: "POST",
210
+ headers: this.headers,
211
+ body: JSON.stringify({ code, userId })
212
+ }
213
+ );
214
+ const body = await res.json().catch(() => ({}));
215
+ if (!res.ok) {
216
+ throw new Error(
217
+ body.message ?? `Error ${res.status} al canjear c\xF3digo bypass`
218
+ );
219
+ }
220
+ if (body.status !== "ACTIVE" || !body.token || !body.expiresAt || body.bypass !== true) {
221
+ throw new Error("Respuesta inv\xE1lida al canjear c\xF3digo bypass");
222
+ }
223
+ return body;
224
+ }
196
225
  /**
197
226
  * Envía un heartbeat para mantener vivo el slot (waiting o active).
198
227
  * El SDK lo llama cada 10s automáticamente.
@@ -262,6 +291,7 @@ var QueueHttpClient = class {
262
291
  configured: body.configured === true,
263
292
  protected: body.protected === true,
264
293
  isActive: body.isActive === true,
294
+ isPaused: body.isPaused === true,
265
295
  admissionMode: body.admissionMode ?? "PUBLIC",
266
296
  challengeRequired: body.challengeRequired === true
267
297
  };
@@ -500,6 +530,24 @@ var CentralQ = class _CentralQ {
500
530
  this.pollInterval
501
531
  );
502
532
  }
533
+ } else if (res.status === "PAUSED") {
534
+ this.updateUI("PAUSED");
535
+ this.emit("paused", {
536
+ message: res.message,
537
+ retryAfterSeconds: res.retryAfterSeconds,
538
+ userId: this.userId,
539
+ eventId: this.eventId
540
+ });
541
+ if (!this.pollingTimer) {
542
+ const retryInterval = Math.max(
543
+ this.pollInterval,
544
+ res.retryAfterSeconds * 1e3
545
+ );
546
+ this.pollingTimer = setInterval(
547
+ () => this.checkQueue(),
548
+ retryInterval
549
+ );
550
+ }
503
551
  }
504
552
  } catch {
505
553
  this.updateUI("ERROR");
@@ -533,6 +581,11 @@ function createCentralQ(options) {
533
581
  _position.set(detail.position);
534
582
  _ahead.set(detail.ahead);
535
583
  });
584
+ queue.on("paused", () => {
585
+ _position.set(null);
586
+ _ahead.set(null);
587
+ _error.set(false);
588
+ });
536
589
  queue.on("expired", () => {
537
590
  _token.set(null);
538
591
  _expired.set(true);
@@ -643,6 +696,17 @@ function useQueue(optionsInput) {
643
696
  status.set("waiting");
644
697
  isPending.set(false);
645
698
  });
699
+ queue.on("paused", (_detail) => {
700
+ data.set({
701
+ token: null,
702
+ position: null,
703
+ ahead: null,
704
+ expiresAt: null
705
+ });
706
+ status.set("paused");
707
+ error.set(null);
708
+ isPending.set(false);
709
+ });
646
710
  queue.on("expired", () => {
647
711
  data.set({
648
712
  token: null,
package/dist/svelte.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CentralQ
3
- } from "./chunk-BVCZFNM3.mjs";
4
- import "./chunk-P73Q2ZIO.mjs";
3
+ } from "./chunk-OVV3CIZZ.mjs";
4
+ import "./chunk-OR3GGW4J.mjs";
5
5
  import "./chunk-XRJFNASX.mjs";
6
6
 
7
7
  // src/svelte.ts
@@ -27,6 +27,11 @@ function createCentralQ(options) {
27
27
  _position.set(detail.position);
28
28
  _ahead.set(detail.ahead);
29
29
  });
30
+ queue.on("paused", () => {
31
+ _position.set(null);
32
+ _ahead.set(null);
33
+ _error.set(false);
34
+ });
30
35
  queue.on("expired", () => {
31
36
  _token.set(null);
32
37
  _expired.set(true);
@@ -137,6 +142,17 @@ function useQueue(optionsInput) {
137
142
  status.set("waiting");
138
143
  isPending.set(false);
139
144
  });
145
+ queue.on("paused", (_detail) => {
146
+ data.set({
147
+ token: null,
148
+ position: null,
149
+ ahead: null,
150
+ expiresAt: null
151
+ });
152
+ status.set("paused");
153
+ error.set(null);
154
+ isPending.set(false);
155
+ });
140
156
  queue.on("expired", () => {
141
157
  data.set({
142
158
  token: null,
package/dist/vue.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { c as CentralQCreateOptions, a as CentralQClient, Q as QueueStatus, C as CentralQ } from './centralq-C3ukDo0x.mjs';
2
+ import { e as CentralQCreateOptions, c as CentralQClient, m as QueueStatus, b as CentralQ } from './centralq-CCw_Cqam.mjs';
3
3
 
4
4
  interface QueueData {
5
5
  token: string | null;
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { c as CentralQCreateOptions, a as CentralQClient, Q as QueueStatus, C as CentralQ } from './centralq-C3ukDo0x.js';
2
+ import { e as CentralQCreateOptions, c as CentralQClient, m as QueueStatus, b as CentralQ } from './centralq-CCw_Cqam.js';
3
3
 
4
4
  interface QueueData {
5
5
  token: string | null;
package/dist/vue.js CHANGED
@@ -71,6 +71,15 @@ function useQueue(optionsInput) {
71
71
  status.value = "waiting";
72
72
  isPending.value = false;
73
73
  });
74
+ queue.on("paused", (_detail) => {
75
+ token.value = null;
76
+ position.value = null;
77
+ ahead.value = null;
78
+ expiresAt.value = null;
79
+ status.value = "paused";
80
+ isPending.value = false;
81
+ error.value = null;
82
+ });
74
83
  queue.on("expired", () => {
75
84
  token.value = null;
76
85
  position.value = null;
package/dist/vue.mjs CHANGED
@@ -56,6 +56,15 @@ function useQueue(optionsInput) {
56
56
  status.value = "waiting";
57
57
  isPending.value = false;
58
58
  });
59
+ queue.on("paused", (_detail) => {
60
+ token.value = null;
61
+ position.value = null;
62
+ ahead.value = null;
63
+ expiresAt.value = null;
64
+ status.value = "paused";
65
+ isPending.value = false;
66
+ error.value = null;
67
+ });
59
68
  queue.on("expired", () => {
60
69
  token.value = null;
61
70
  position.value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@central-ticket/queue-sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "keywords": [
5
5
  "virtual-queue",
6
6
  "waiting-room",
@@ -53,7 +53,7 @@
53
53
  "access": "public"
54
54
  },
55
55
  "scripts": {
56
- "build": "tsup src/index.ts src/react.ts src/svelte.ts src/vue.ts src/server.ts --format cjs,esm --dts",
56
+ "build": "tsup src/index.ts src/react.ts src/svelte.ts src/vue.ts src/server.ts --format cjs,esm --dts --clean",
57
57
  "dev": "tsup src/index.ts src/react.ts src/svelte.ts src/vue.ts src/server.ts --format cjs,esm --dts --watch",
58
58
  "check-types": "tsc --noEmit",
59
59
  "test": "vitest run",
@@ -1,133 +0,0 @@
1
- interface CentralQOptions {
2
- /** URL del queue worker. */
3
- apiUrl?: string;
4
- /** Publishable API key (ctq_pub_xxx) */
5
- apiKey: string;
6
- /** ID del evento/recurso a proteger */
7
- eventId: string;
8
- /** ID de usuario externo. Si no se provee, se autogenera y persiste en sessionStorage */
9
- userId?: string;
10
- /** Init token corto emitido por backend (recomendado para producción) */
11
- queueInitToken?: string;
12
- /** Intervalo de polling en ms (default: 10000) */
13
- pollInterval?: number;
14
- /** Contenedor donde montar el overlay. Default: document.body */
15
- container?: HTMLElement;
16
- }
17
- interface CentralQClientOptions {
18
- /** URL del queue worker */
19
- apiUrl?: string;
20
- /** Publishable API key (ctq_pub_xxx) */
21
- apiKey: string;
22
- /** ID de usuario externo por defecto para todas las colas creadas por el client */
23
- userId?: string;
24
- /** Init token corto por defecto para colas creadas por el client */
25
- queueInitToken?: string;
26
- /** Intervalo de polling por defecto en ms */
27
- pollInterval?: number;
28
- /** Contenedor por defecto donde montar el overlay */
29
- container?: HTMLElement;
30
- }
31
- interface CentralQCreateOptions {
32
- /** ID del evento/recurso a proteger */
33
- eventId: string;
34
- /** Override opcional del userId por cola */
35
- userId?: string;
36
- /** Override opcional del queue init token por cola */
37
- queueInitToken?: string;
38
- /** Override opcional del poll interval por cola */
39
- pollInterval?: number;
40
- /** Override opcional del contenedor por cola */
41
- container?: HTMLElement;
42
- /** Override opcional del apiUrl por cola */
43
- apiUrl?: string;
44
- /** Override opcional del apiKey por cola */
45
- apiKey?: string;
46
- }
47
- interface PassedDetail {
48
- token: string;
49
- expiresAt: number;
50
- userId: string;
51
- eventId: string;
52
- }
53
- interface PositionDetail {
54
- position: number;
55
- ahead: number;
56
- userId: string;
57
- eventId: string;
58
- }
59
- interface ExpiredDetail {
60
- userId: string;
61
- eventId: string;
62
- }
63
- interface ErrorDetail {
64
- userId: string;
65
- eventId: string;
66
- }
67
- type EventMap = {
68
- passed: PassedDetail;
69
- expired: ExpiredDetail;
70
- position: PositionDetail;
71
- error: ErrorDetail;
72
- };
73
- type EventName = keyof EventMap;
74
- type Listener<T> = (detail: T) => void;
75
- type QueueStatus = "idle" | "joining" | "waiting" | "passed" | "expired" | "error";
76
- declare class CentralQ {
77
- private client;
78
- private element;
79
- private userId;
80
- private eventId;
81
- private pollInterval;
82
- private container;
83
- private pollingTimer?;
84
- private heartbeatTimer?;
85
- private expiryTimer?;
86
- private destroyed;
87
- private listeners;
88
- private constructor();
89
- /**
90
- * Inicializa CentralQ y comienza el flujo de cola automáticamente.
91
- * Monta el overlay de UI y empieza a hacer polling.
92
- */
93
- static init(options: CentralQOptions): CentralQ;
94
- /** Suscribirse a un evento del ciclo de vida de la cola */
95
- on<K extends EventName>(event: K, listener: Listener<EventMap[K]>): this;
96
- /** Desuscribirse de un evento */
97
- off<K extends EventName>(event: K, listener: Listener<EventMap[K]>): this;
98
- private emit;
99
- /**
100
- * Libera el slot del usuario inmediatamente.
101
- * Llamar cuando el usuario completa la compra.
102
- */
103
- leave(): void;
104
- /**
105
- * Destruye la instancia: para todos los timers, desmonta el overlay,
106
- * y libera el slot en el servidor.
107
- */
108
- destroy(): void;
109
- /** Retorna el userId resuelto (externo o autogenerado) */
110
- getUserId(): string;
111
- private resolveUserId;
112
- private mount;
113
- private unmount;
114
- private updateUI;
115
- private stopTimers;
116
- private startHeartbeat;
117
- private scheduleExpiry;
118
- private handleExpired;
119
- private checkQueue;
120
- }
121
- declare class CentralQClient {
122
- private defaults;
123
- constructor(defaults: CentralQClientOptions);
124
- issueQueueInitToken(eventId: string, userId?: string): Promise<{
125
- userId: string;
126
- queueInitToken: string;
127
- expiresAt: number;
128
- }>;
129
- createQueue(options: CentralQCreateOptions): CentralQ;
130
- }
131
- declare function createCentralQClient(options: CentralQClientOptions): CentralQClient;
132
-
133
- export { CentralQ as C, type ErrorDetail as E, type PassedDetail as P, type QueueStatus as Q, CentralQClient as a, type CentralQClientOptions as b, type CentralQCreateOptions as c, type CentralQOptions as d, type ExpiredDetail as e, type PositionDetail as f, createCentralQClient as g };