@nomalism-com/api 0.52.0 → 0.52.2

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.cjs CHANGED
@@ -234,6 +234,22 @@ var ApiError = class _ApiError extends Error {
234
234
  function isApiError(error) {
235
235
  return error instanceof ApiError;
236
236
  }
237
+ var MENSAGEM_POR_ESTADO = {
238
+ 400: "Os dados enviados n\xE3o s\xE3o v\xE1lidos. Verifique-os e tente novamente.",
239
+ 401: "A sess\xE3o terminou. Inicie sess\xE3o novamente.",
240
+ 403: "N\xE3o tem permiss\xE3o para realizar esta opera\xE7\xE3o.",
241
+ 404: "O que pediu n\xE3o foi encontrado. Atualize a p\xE1gina e tente novamente.",
242
+ 409: "Esta opera\xE7\xE3o entra em conflito com dados j\xE1 existentes. Atualize a p\xE1gina e tente novamente.",
243
+ 413: "O pedido \xE9 demasiado grande. Reduza a quantidade de informa\xE7\xE3o ou o tamanho do ficheiro.",
244
+ 422: "Os dados enviados n\xE3o s\xE3o v\xE1lidos. Verifique-os e tente novamente.",
245
+ 429: "Foram feitos demasiados pedidos seguidos. Aguarde um momento e tente novamente.",
246
+ 502: "O servidor n\xE3o est\xE1 a responder neste momento. Tente novamente dentro de instantes.",
247
+ 503: "O servidor n\xE3o est\xE1 dispon\xEDvel neste momento. Tente novamente dentro de instantes.",
248
+ 504: "O servidor demorou demasiado a responder. Tente novamente dentro de instantes."
249
+ };
250
+ function messageForStatus(status) {
251
+ return MENSAGEM_POR_ESTADO[status] ?? (status >= 500 ? "O sistema teve um problema ao tratar o pedido. Tente novamente; se o problema continuar, contacte o suporte." : "N\xE3o foi poss\xEDvel concluir a opera\xE7\xE3o. Tente novamente.");
252
+ }
237
253
  function extractServerMessage(data, fallback) {
238
254
  if (typeof data === "string" && data.trim()) return data;
239
255
  if (isRecord(data)) {
@@ -255,21 +271,24 @@ function parseApiError(error) {
255
271
  const code = axiosError.code;
256
272
  if (axiosError.response) {
257
273
  const { status, data } = axiosError.response;
258
- const message = extractServerMessage(
259
- data,
260
- `Request failed with status ${status}`
261
- );
274
+ const message = extractServerMessage(data, messageForStatus(status));
262
275
  return new ApiError(
263
276
  { kind: "response", message, status, code, method, url, data },
264
277
  error
265
278
  );
266
279
  }
267
280
  if (axiosError.request) {
268
- const message = code === "ECONNABORTED" ? `Request timed out${url ? ` (${method} ${url})` : ""}` : `No response received${url ? ` from ${method} ${url}` : ""}`;
281
+ const message = code === "ECONNABORTED" ? "O servidor demorou demasiado a responder. Tente novamente dentro de instantes." : "N\xE3o foi poss\xEDvel comunicar com o servidor. Verifique a liga\xE7\xE3o \xE0 internet e tente novamente.";
269
282
  return new ApiError({ kind: "request", message, code, method, url }, error);
270
283
  }
271
284
  return new ApiError(
272
- { kind: "setup", message: axiosError.message, code, method, url },
285
+ {
286
+ kind: "setup",
287
+ message: "N\xE3o foi poss\xEDvel enviar o pedido. Atualize a p\xE1gina e tente novamente.",
288
+ code,
289
+ method,
290
+ url
291
+ },
273
292
  error
274
293
  );
275
294
  }
@@ -369,7 +388,8 @@ var Repository4 = class {
369
388
  prison,
370
389
  note,
371
390
  availableStock,
372
- token
391
+ token,
392
+ as
373
393
  }) {
374
394
  const qs = new URLSearchParams();
375
395
  qs.set("ef_name", ef_name);
@@ -382,7 +402,8 @@ var Repository4 = class {
382
402
  }
383
403
  qs.set("prison", prison.toString());
384
404
  qs.set("availableStock", availableStock.toString());
385
- qs.set("token", token);
405
+ if (token) qs.set("token", token);
406
+ if (as) qs.set("as", as);
386
407
  return `${this.route}print_label_pdf/${product_id}?${qs.toString()}`;
387
408
  }
388
409
  printBulkLabelToPdfUrl({
@@ -391,7 +412,8 @@ var Repository4 = class {
391
412
  notOk,
392
413
  clientOrders,
393
414
  saved_em_picking_ids,
394
- token
415
+ token,
416
+ as
395
417
  }) {
396
418
  const qs = new URLSearchParams();
397
419
  qs.set("groupLabel", groupLabel.toString());
@@ -399,7 +421,8 @@ var Repository4 = class {
399
421
  qs.set("notOk", notOk);
400
422
  qs.set("clientOrders", clientOrders);
401
423
  qs.set("saved_em_picking_ids", saved_em_picking_ids);
402
- qs.set("token", token);
424
+ if (token) qs.set("token", token);
425
+ if (as) qs.set("as", as);
403
426
  return `${this.route}print_bulk_label_pdf?${qs.toString()}`;
404
427
  }
405
428
  };
@@ -952,6 +975,13 @@ var Repository21 = class {
952
975
  }
953
976
  );
954
977
  }
978
+ async setPublic(data) {
979
+ const response = await this.api.post(
980
+ `${this.route}public`,
981
+ data
982
+ );
983
+ return response.data;
984
+ }
955
985
  };
956
986
 
957
987
  // src/modules/integration/emailLog.ts
@@ -1266,13 +1296,6 @@ var Repository32 = class {
1266
1296
  this.api = api;
1267
1297
  this.route = route;
1268
1298
  }
1269
- async create(body) {
1270
- const response = await this.api.post(
1271
- `${this.route}`,
1272
- body
1273
- );
1274
- return response.data;
1275
- }
1276
1299
  async findByKey(params) {
1277
1300
  const response = await this.api.get(
1278
1301
  `${this.route}by_key`,
@@ -1460,6 +1483,10 @@ var Repository36 = class {
1460
1483
  );
1461
1484
  return response.data;
1462
1485
  }
1486
+ async findToday() {
1487
+ const response = await this.api.get(`${this.route}today`);
1488
+ return response.data;
1489
+ }
1463
1490
  async findByOwner(params) {
1464
1491
  const response = await this.api.get(
1465
1492
  `${this.route}by_owner`,
@@ -1857,9 +1884,10 @@ var Repository47 = class {
1857
1884
  const response = await this.api.get(`${this.route}auth`);
1858
1885
  return response.data;
1859
1886
  }
1860
- async emails() {
1887
+ async emails(params) {
1861
1888
  const response = await this.api.get(
1862
- `${this.route}emails`
1889
+ `${this.route}emails`,
1890
+ { params }
1863
1891
  );
1864
1892
  return response.data;
1865
1893
  }
@@ -1940,6 +1968,17 @@ var Repository50 = class {
1940
1968
  );
1941
1969
  return response.data;
1942
1970
  }
1971
+ async cancelOrder(body) {
1972
+ const response = await this.api.post(
1973
+ `${this.route}orders/cancel`,
1974
+ body
1975
+ );
1976
+ return response.data;
1977
+ }
1978
+ async findOrderStatus(body) {
1979
+ const response = await this.api.post(`${this.route}orders/status`, body);
1980
+ return response.data;
1981
+ }
1943
1982
  };
1944
1983
 
1945
1984
  // src/modules/stock/priceTable.ts
@@ -2159,7 +2198,7 @@ var Repository53 = class {
2159
2198
  }
2160
2199
  printLabelToPdfUrl({ id }, { token }) {
2161
2200
  const qs = new URLSearchParams();
2162
- qs.set("token", token);
2201
+ if (token) qs.set("token", token);
2163
2202
  return `${this.route}print_label_pdf/${id}?${qs.toString()}`;
2164
2203
  }
2165
2204
  printLabelToPdfBulk({
@@ -2167,7 +2206,7 @@ var Repository53 = class {
2167
2206
  token
2168
2207
  }) {
2169
2208
  const qs = new URLSearchParams();
2170
- qs.set("token", token);
2209
+ if (token) qs.set("token", token);
2171
2210
  qs.set("ids", ids);
2172
2211
  return `${this.route}print_label_pdf/bulk?${qs.toString()}`;
2173
2212
  }
@@ -2346,15 +2385,11 @@ var Repository58 = class {
2346
2385
  getQueryExecuteUrl({
2347
2386
  query_id,
2348
2387
  output,
2349
- token,
2350
2388
  ...data
2351
2389
  }) {
2352
2390
  const qs = new URLSearchParams();
2353
2391
  qs.set("query_id", query_id);
2354
2392
  qs.set("output", output);
2355
- if (token) {
2356
- qs.set("token", token);
2357
- }
2358
2393
  Object.entries(data).forEach(([key, value]) => {
2359
2394
  if (typeof value === "undefined") return;
2360
2395
  if (value === null) return;
@@ -2381,7 +2416,9 @@ var Repository59 = class {
2381
2416
  return response.data;
2382
2417
  }
2383
2418
  async from_master_checked() {
2384
- const response = await this.api.post(`${this.route}from_master`);
2419
+ const response = await this.api.post(
2420
+ `${this.route}from_master_checked`
2421
+ );
2385
2422
  return response.data;
2386
2423
  }
2387
2424
  };
@@ -2505,14 +2542,12 @@ var Repository64 = class {
2505
2542
  getStockCsvUrl({
2506
2543
  date,
2507
2544
  version,
2508
- format,
2509
- token
2545
+ format
2510
2546
  }) {
2511
2547
  const qs = new URLSearchParams();
2512
2548
  qs.set("date", date.toISOString());
2513
2549
  qs.set("version", version);
2514
2550
  qs.set("format", format);
2515
- qs.set("token", token);
2516
2551
  return `${this.route}csv?${qs.toString()}`;
2517
2552
  }
2518
2553
  };
@@ -2817,15 +2852,13 @@ var Repository71 = class {
2817
2852
  owner_id,
2818
2853
  start_date,
2819
2854
  end_date,
2820
- output,
2821
- token
2855
+ output
2822
2856
  }) {
2823
2857
  const qs = new URLSearchParams();
2824
2858
  qs.set("owner_id", owner_id);
2825
2859
  qs.set("output", output);
2826
2860
  if (start_date) qs.set("start_date", start_date.toISOString());
2827
2861
  if (end_date) qs.set("end_date", end_date.toISOString());
2828
- qs.set("token", token);
2829
2862
  return `${this.route}export?${qs.toString()}`;
2830
2863
  }
2831
2864
  };
@@ -2917,6 +2950,9 @@ var Repository72 = class {
2917
2950
  if (data?.token) {
2918
2951
  qs.set("token", data.token);
2919
2952
  }
2953
+ if (data?.as) {
2954
+ qs.set("as", data.as);
2955
+ }
2920
2956
  return `${this.route}document_pdf/${id}?${qs.toString()}`;
2921
2957
  }
2922
2958
  async documentThermalPrint({ id }, query) {
@@ -3072,12 +3108,12 @@ var Repository76 = class {
3072
3108
  }
3073
3109
  printLabelToPdfUrl({ document_line_ids }, { token }) {
3074
3110
  const qs = new URLSearchParams();
3075
- qs.set("token", token);
3111
+ if (token) qs.set("token", token);
3076
3112
  return `${this.route}print_label_pdf/${document_line_ids}?${qs.toString()}`;
3077
3113
  }
3078
3114
  printGroupLabelToPdfUrl({ document_line_ids }, { token }) {
3079
3115
  const qs = new URLSearchParams();
3080
- qs.set("token", token);
3116
+ if (token) qs.set("token", token);
3081
3117
  return `${this.route}print_group_label_pdf/${document_line_ids}?${qs.toString()}`;
3082
3118
  }
3083
3119
  };
@@ -3336,8 +3372,8 @@ var Repository85 = class {
3336
3372
  });
3337
3373
  return response.data;
3338
3374
  }
3339
- async findAllProviderProducts() {
3340
- const response = await this.api.get(`${this.route}all_provider_products`);
3375
+ async findAllProviderProducts(params) {
3376
+ const response = await this.api.get(`${this.route}all_provider_products`, { params });
3341
3377
  return response.data;
3342
3378
  }
3343
3379
  };
@@ -3416,7 +3452,7 @@ var Repository87 = class {
3416
3452
  year
3417
3453
  }) {
3418
3454
  const qs = new URLSearchParams();
3419
- qs.set("token", token);
3455
+ if (token) qs.set("token", token);
3420
3456
  if (ids) {
3421
3457
  qs.set("ids", ids);
3422
3458
  return `${this.route}create_batch_pdf?${qs.toString()}`;
@@ -3521,15 +3557,10 @@ var Repository90 = class {
3521
3557
  constructor({ route }) {
3522
3558
  this.route = route;
3523
3559
  }
3524
- getUrl({
3525
- date_start,
3526
- date_end,
3527
- token
3528
- }) {
3560
+ getUrl({ date_start, date_end }) {
3529
3561
  const qs = new URLSearchParams();
3530
3562
  qs.set("date_start", date_start);
3531
3563
  qs.set("date_end", date_end);
3532
- qs.set("token", token);
3533
3564
  return `${this.route}download?${qs.toString()}`;
3534
3565
  }
3535
3566
  };
@@ -3622,7 +3653,7 @@ var Repository93 = class {
3622
3653
  return response.data;
3623
3654
  }
3624
3655
  async update({ id }, body) {
3625
- await this.api.post(`${this.route}${id}`, body);
3656
+ await this.api.put(`${this.route}${id}`, body);
3626
3657
  }
3627
3658
  async deleteOne({
3628
3659
  id
@@ -3643,13 +3674,6 @@ var Repository94 = class {
3643
3674
  this.api = api;
3644
3675
  this.route = route;
3645
3676
  }
3646
- async create(body) {
3647
- const response = await this.api.post(
3648
- `${this.route}`,
3649
- body
3650
- );
3651
- return response.data;
3652
- }
3653
3677
  async find() {
3654
3678
  const response = await this.api.get(`${this.route}`);
3655
3679
  return response.data;
@@ -3672,12 +3696,7 @@ var Repository94 = class {
3672
3696
  return response.data;
3673
3697
  }
3674
3698
  async update({ id }, body) {
3675
- await this.api.post(`${this.route}${id}`, body);
3676
- }
3677
- async deleteOne({
3678
- id
3679
- }) {
3680
- await this.api.delete(`${this.route}${id}`);
3699
+ await this.api.put(`${this.route}${id}`, body);
3681
3700
  }
3682
3701
  };
3683
3702
 
@@ -3724,7 +3743,7 @@ var Repository95 = class {
3724
3743
  return response.data;
3725
3744
  }
3726
3745
  async update({ id }, body) {
3727
- await this.api.post(`${this.route}${id}`, body);
3746
+ await this.api.put(`${this.route}${id}`, body);
3728
3747
  }
3729
3748
  async deleteOne({
3730
3749
  id
@@ -4452,15 +4471,6 @@ var Repository115 = class {
4452
4471
  });
4453
4472
  return response.data;
4454
4473
  }
4455
- async findForBillOfLading(data) {
4456
- const response = await this.api.get(
4457
- `${this.route}`,
4458
- {
4459
- data
4460
- }
4461
- );
4462
- return response.data;
4463
- }
4464
4474
  async findByEmail(data) {
4465
4475
  const response = await this.api.get(`${this.route}by_email`, {
4466
4476
  data
@@ -5187,6 +5197,7 @@ var Repository133 = class {
5187
5197
  // src/modules/view/webSocket.ts
5188
5198
  var CLOSE_AUTH_REJECTED = 4401;
5189
5199
  var CLOSE_AUTH_UNAVAILABLE = 4503;
5200
+ var MAX_AUTH_RETRIES = 3;
5190
5201
  var PING_INTERVAL_MS = 25e3;
5191
5202
  var MAX_BACKOFF_MS = 3e4;
5192
5203
  var BASE_BACKOFF_MS = 1e3;
@@ -5200,6 +5211,7 @@ var Service = class {
5200
5211
  }
5201
5212
  openSocket({
5202
5213
  token,
5214
+ onAuthRejected,
5203
5215
  channel,
5204
5216
  onEvent,
5205
5217
  onOpen,
@@ -5209,11 +5221,15 @@ var Service = class {
5209
5221
  }) {
5210
5222
  let ws = null;
5211
5223
  let attempts = 0;
5224
+ let authRejections = 0;
5212
5225
  let opensSoFar = 0;
5213
5226
  let pingTimer = null;
5214
5227
  let reconnectTimer = null;
5215
5228
  let closedByCaller = false;
5216
- const subprotocols = channel ? [`bearer.${token}`, `channel.${channel}`] : [`bearer.${token}`];
5229
+ const subprotocols = () => {
5230
+ const current = typeof token === "function" ? token() : token;
5231
+ return channel ? [`bearer.${current}`, `channel.${channel}`] : [`bearer.${current}`];
5232
+ };
5217
5233
  const stopPing = () => {
5218
5234
  if (pingTimer !== null) {
5219
5235
  window.clearInterval(pingTimer);
@@ -5244,7 +5260,7 @@ var Service = class {
5244
5260
  const connect = () => {
5245
5261
  if (closedByCaller) return;
5246
5262
  try {
5247
- ws = new WebSocket(this.route, subprotocols);
5263
+ ws = new WebSocket(this.route, subprotocols());
5248
5264
  } catch (err) {
5249
5265
  console.error("WebSocket constructor threw", err);
5250
5266
  scheduleReconnect();
@@ -5252,6 +5268,7 @@ var Service = class {
5252
5268
  }
5253
5269
  ws.onopen = () => {
5254
5270
  attempts = 0;
5271
+ authRejections = 0;
5255
5272
  opensSoFar += 1;
5256
5273
  startPing();
5257
5274
  if (opensSoFar === 1) {
@@ -5288,6 +5305,13 @@ var Service = class {
5288
5305
  ws = null;
5289
5306
  onClose?.();
5290
5307
  if (e.code === CLOSE_AUTH_REJECTED) {
5308
+ if (typeof token === "function" && authRejections < MAX_AUTH_RETRIES) {
5309
+ authRejections += 1;
5310
+ void Promise.resolve().then(() => onAuthRejected?.()).catch((err) => {
5311
+ console.warn("WebSocket onAuthRejected failed", err);
5312
+ }).finally(scheduleReconnect);
5313
+ return;
5314
+ }
5291
5315
  console.error("WebSocket auth rejected by server, not reconnecting");
5292
5316
  closedByCaller = true;
5293
5317
  return;
package/dist/index.js CHANGED
@@ -201,6 +201,22 @@ var ApiError = class _ApiError extends Error {
201
201
  function isApiError(error) {
202
202
  return error instanceof ApiError;
203
203
  }
204
+ var MENSAGEM_POR_ESTADO = {
205
+ 400: "Os dados enviados n\xE3o s\xE3o v\xE1lidos. Verifique-os e tente novamente.",
206
+ 401: "A sess\xE3o terminou. Inicie sess\xE3o novamente.",
207
+ 403: "N\xE3o tem permiss\xE3o para realizar esta opera\xE7\xE3o.",
208
+ 404: "O que pediu n\xE3o foi encontrado. Atualize a p\xE1gina e tente novamente.",
209
+ 409: "Esta opera\xE7\xE3o entra em conflito com dados j\xE1 existentes. Atualize a p\xE1gina e tente novamente.",
210
+ 413: "O pedido \xE9 demasiado grande. Reduza a quantidade de informa\xE7\xE3o ou o tamanho do ficheiro.",
211
+ 422: "Os dados enviados n\xE3o s\xE3o v\xE1lidos. Verifique-os e tente novamente.",
212
+ 429: "Foram feitos demasiados pedidos seguidos. Aguarde um momento e tente novamente.",
213
+ 502: "O servidor n\xE3o est\xE1 a responder neste momento. Tente novamente dentro de instantes.",
214
+ 503: "O servidor n\xE3o est\xE1 dispon\xEDvel neste momento. Tente novamente dentro de instantes.",
215
+ 504: "O servidor demorou demasiado a responder. Tente novamente dentro de instantes."
216
+ };
217
+ function messageForStatus(status) {
218
+ return MENSAGEM_POR_ESTADO[status] ?? (status >= 500 ? "O sistema teve um problema ao tratar o pedido. Tente novamente; se o problema continuar, contacte o suporte." : "N\xE3o foi poss\xEDvel concluir a opera\xE7\xE3o. Tente novamente.");
219
+ }
204
220
  function extractServerMessage(data, fallback) {
205
221
  if (typeof data === "string" && data.trim()) return data;
206
222
  if (isRecord(data)) {
@@ -222,21 +238,24 @@ function parseApiError(error) {
222
238
  const code = axiosError.code;
223
239
  if (axiosError.response) {
224
240
  const { status, data } = axiosError.response;
225
- const message = extractServerMessage(
226
- data,
227
- `Request failed with status ${status}`
228
- );
241
+ const message = extractServerMessage(data, messageForStatus(status));
229
242
  return new ApiError(
230
243
  { kind: "response", message, status, code, method, url, data },
231
244
  error
232
245
  );
233
246
  }
234
247
  if (axiosError.request) {
235
- const message = code === "ECONNABORTED" ? `Request timed out${url ? ` (${method} ${url})` : ""}` : `No response received${url ? ` from ${method} ${url}` : ""}`;
248
+ const message = code === "ECONNABORTED" ? "O servidor demorou demasiado a responder. Tente novamente dentro de instantes." : "N\xE3o foi poss\xEDvel comunicar com o servidor. Verifique a liga\xE7\xE3o \xE0 internet e tente novamente.";
236
249
  return new ApiError({ kind: "request", message, code, method, url }, error);
237
250
  }
238
251
  return new ApiError(
239
- { kind: "setup", message: axiosError.message, code, method, url },
252
+ {
253
+ kind: "setup",
254
+ message: "N\xE3o foi poss\xEDvel enviar o pedido. Atualize a p\xE1gina e tente novamente.",
255
+ code,
256
+ method,
257
+ url
258
+ },
240
259
  error
241
260
  );
242
261
  }
@@ -336,7 +355,8 @@ var Repository4 = class {
336
355
  prison,
337
356
  note,
338
357
  availableStock,
339
- token
358
+ token,
359
+ as
340
360
  }) {
341
361
  const qs = new URLSearchParams();
342
362
  qs.set("ef_name", ef_name);
@@ -349,7 +369,8 @@ var Repository4 = class {
349
369
  }
350
370
  qs.set("prison", prison.toString());
351
371
  qs.set("availableStock", availableStock.toString());
352
- qs.set("token", token);
372
+ if (token) qs.set("token", token);
373
+ if (as) qs.set("as", as);
353
374
  return `${this.route}print_label_pdf/${product_id}?${qs.toString()}`;
354
375
  }
355
376
  printBulkLabelToPdfUrl({
@@ -358,7 +379,8 @@ var Repository4 = class {
358
379
  notOk,
359
380
  clientOrders,
360
381
  saved_em_picking_ids,
361
- token
382
+ token,
383
+ as
362
384
  }) {
363
385
  const qs = new URLSearchParams();
364
386
  qs.set("groupLabel", groupLabel.toString());
@@ -366,7 +388,8 @@ var Repository4 = class {
366
388
  qs.set("notOk", notOk);
367
389
  qs.set("clientOrders", clientOrders);
368
390
  qs.set("saved_em_picking_ids", saved_em_picking_ids);
369
- qs.set("token", token);
391
+ if (token) qs.set("token", token);
392
+ if (as) qs.set("as", as);
370
393
  return `${this.route}print_bulk_label_pdf?${qs.toString()}`;
371
394
  }
372
395
  };
@@ -919,6 +942,13 @@ var Repository21 = class {
919
942
  }
920
943
  );
921
944
  }
945
+ async setPublic(data) {
946
+ const response = await this.api.post(
947
+ `${this.route}public`,
948
+ data
949
+ );
950
+ return response.data;
951
+ }
922
952
  };
923
953
 
924
954
  // src/modules/integration/emailLog.ts
@@ -1233,13 +1263,6 @@ var Repository32 = class {
1233
1263
  this.api = api;
1234
1264
  this.route = route;
1235
1265
  }
1236
- async create(body) {
1237
- const response = await this.api.post(
1238
- `${this.route}`,
1239
- body
1240
- );
1241
- return response.data;
1242
- }
1243
1266
  async findByKey(params) {
1244
1267
  const response = await this.api.get(
1245
1268
  `${this.route}by_key`,
@@ -1427,6 +1450,10 @@ var Repository36 = class {
1427
1450
  );
1428
1451
  return response.data;
1429
1452
  }
1453
+ async findToday() {
1454
+ const response = await this.api.get(`${this.route}today`);
1455
+ return response.data;
1456
+ }
1430
1457
  async findByOwner(params) {
1431
1458
  const response = await this.api.get(
1432
1459
  `${this.route}by_owner`,
@@ -1824,9 +1851,10 @@ var Repository47 = class {
1824
1851
  const response = await this.api.get(`${this.route}auth`);
1825
1852
  return response.data;
1826
1853
  }
1827
- async emails() {
1854
+ async emails(params) {
1828
1855
  const response = await this.api.get(
1829
- `${this.route}emails`
1856
+ `${this.route}emails`,
1857
+ { params }
1830
1858
  );
1831
1859
  return response.data;
1832
1860
  }
@@ -1907,6 +1935,17 @@ var Repository50 = class {
1907
1935
  );
1908
1936
  return response.data;
1909
1937
  }
1938
+ async cancelOrder(body) {
1939
+ const response = await this.api.post(
1940
+ `${this.route}orders/cancel`,
1941
+ body
1942
+ );
1943
+ return response.data;
1944
+ }
1945
+ async findOrderStatus(body) {
1946
+ const response = await this.api.post(`${this.route}orders/status`, body);
1947
+ return response.data;
1948
+ }
1910
1949
  };
1911
1950
 
1912
1951
  // src/modules/stock/priceTable.ts
@@ -2126,7 +2165,7 @@ var Repository53 = class {
2126
2165
  }
2127
2166
  printLabelToPdfUrl({ id }, { token }) {
2128
2167
  const qs = new URLSearchParams();
2129
- qs.set("token", token);
2168
+ if (token) qs.set("token", token);
2130
2169
  return `${this.route}print_label_pdf/${id}?${qs.toString()}`;
2131
2170
  }
2132
2171
  printLabelToPdfBulk({
@@ -2134,7 +2173,7 @@ var Repository53 = class {
2134
2173
  token
2135
2174
  }) {
2136
2175
  const qs = new URLSearchParams();
2137
- qs.set("token", token);
2176
+ if (token) qs.set("token", token);
2138
2177
  qs.set("ids", ids);
2139
2178
  return `${this.route}print_label_pdf/bulk?${qs.toString()}`;
2140
2179
  }
@@ -2313,15 +2352,11 @@ var Repository58 = class {
2313
2352
  getQueryExecuteUrl({
2314
2353
  query_id,
2315
2354
  output,
2316
- token,
2317
2355
  ...data
2318
2356
  }) {
2319
2357
  const qs = new URLSearchParams();
2320
2358
  qs.set("query_id", query_id);
2321
2359
  qs.set("output", output);
2322
- if (token) {
2323
- qs.set("token", token);
2324
- }
2325
2360
  Object.entries(data).forEach(([key, value]) => {
2326
2361
  if (typeof value === "undefined") return;
2327
2362
  if (value === null) return;
@@ -2348,7 +2383,9 @@ var Repository59 = class {
2348
2383
  return response.data;
2349
2384
  }
2350
2385
  async from_master_checked() {
2351
- const response = await this.api.post(`${this.route}from_master`);
2386
+ const response = await this.api.post(
2387
+ `${this.route}from_master_checked`
2388
+ );
2352
2389
  return response.data;
2353
2390
  }
2354
2391
  };
@@ -2472,14 +2509,12 @@ var Repository64 = class {
2472
2509
  getStockCsvUrl({
2473
2510
  date,
2474
2511
  version,
2475
- format,
2476
- token
2512
+ format
2477
2513
  }) {
2478
2514
  const qs = new URLSearchParams();
2479
2515
  qs.set("date", date.toISOString());
2480
2516
  qs.set("version", version);
2481
2517
  qs.set("format", format);
2482
- qs.set("token", token);
2483
2518
  return `${this.route}csv?${qs.toString()}`;
2484
2519
  }
2485
2520
  };
@@ -2784,15 +2819,13 @@ var Repository71 = class {
2784
2819
  owner_id,
2785
2820
  start_date,
2786
2821
  end_date,
2787
- output,
2788
- token
2822
+ output
2789
2823
  }) {
2790
2824
  const qs = new URLSearchParams();
2791
2825
  qs.set("owner_id", owner_id);
2792
2826
  qs.set("output", output);
2793
2827
  if (start_date) qs.set("start_date", start_date.toISOString());
2794
2828
  if (end_date) qs.set("end_date", end_date.toISOString());
2795
- qs.set("token", token);
2796
2829
  return `${this.route}export?${qs.toString()}`;
2797
2830
  }
2798
2831
  };
@@ -2884,6 +2917,9 @@ var Repository72 = class {
2884
2917
  if (data?.token) {
2885
2918
  qs.set("token", data.token);
2886
2919
  }
2920
+ if (data?.as) {
2921
+ qs.set("as", data.as);
2922
+ }
2887
2923
  return `${this.route}document_pdf/${id}?${qs.toString()}`;
2888
2924
  }
2889
2925
  async documentThermalPrint({ id }, query) {
@@ -3039,12 +3075,12 @@ var Repository76 = class {
3039
3075
  }
3040
3076
  printLabelToPdfUrl({ document_line_ids }, { token }) {
3041
3077
  const qs = new URLSearchParams();
3042
- qs.set("token", token);
3078
+ if (token) qs.set("token", token);
3043
3079
  return `${this.route}print_label_pdf/${document_line_ids}?${qs.toString()}`;
3044
3080
  }
3045
3081
  printGroupLabelToPdfUrl({ document_line_ids }, { token }) {
3046
3082
  const qs = new URLSearchParams();
3047
- qs.set("token", token);
3083
+ if (token) qs.set("token", token);
3048
3084
  return `${this.route}print_group_label_pdf/${document_line_ids}?${qs.toString()}`;
3049
3085
  }
3050
3086
  };
@@ -3303,8 +3339,8 @@ var Repository85 = class {
3303
3339
  });
3304
3340
  return response.data;
3305
3341
  }
3306
- async findAllProviderProducts() {
3307
- const response = await this.api.get(`${this.route}all_provider_products`);
3342
+ async findAllProviderProducts(params) {
3343
+ const response = await this.api.get(`${this.route}all_provider_products`, { params });
3308
3344
  return response.data;
3309
3345
  }
3310
3346
  };
@@ -3383,7 +3419,7 @@ var Repository87 = class {
3383
3419
  year
3384
3420
  }) {
3385
3421
  const qs = new URLSearchParams();
3386
- qs.set("token", token);
3422
+ if (token) qs.set("token", token);
3387
3423
  if (ids) {
3388
3424
  qs.set("ids", ids);
3389
3425
  return `${this.route}create_batch_pdf?${qs.toString()}`;
@@ -3488,15 +3524,10 @@ var Repository90 = class {
3488
3524
  constructor({ route }) {
3489
3525
  this.route = route;
3490
3526
  }
3491
- getUrl({
3492
- date_start,
3493
- date_end,
3494
- token
3495
- }) {
3527
+ getUrl({ date_start, date_end }) {
3496
3528
  const qs = new URLSearchParams();
3497
3529
  qs.set("date_start", date_start);
3498
3530
  qs.set("date_end", date_end);
3499
- qs.set("token", token);
3500
3531
  return `${this.route}download?${qs.toString()}`;
3501
3532
  }
3502
3533
  };
@@ -3589,7 +3620,7 @@ var Repository93 = class {
3589
3620
  return response.data;
3590
3621
  }
3591
3622
  async update({ id }, body) {
3592
- await this.api.post(`${this.route}${id}`, body);
3623
+ await this.api.put(`${this.route}${id}`, body);
3593
3624
  }
3594
3625
  async deleteOne({
3595
3626
  id
@@ -3610,13 +3641,6 @@ var Repository94 = class {
3610
3641
  this.api = api;
3611
3642
  this.route = route;
3612
3643
  }
3613
- async create(body) {
3614
- const response = await this.api.post(
3615
- `${this.route}`,
3616
- body
3617
- );
3618
- return response.data;
3619
- }
3620
3644
  async find() {
3621
3645
  const response = await this.api.get(`${this.route}`);
3622
3646
  return response.data;
@@ -3639,12 +3663,7 @@ var Repository94 = class {
3639
3663
  return response.data;
3640
3664
  }
3641
3665
  async update({ id }, body) {
3642
- await this.api.post(`${this.route}${id}`, body);
3643
- }
3644
- async deleteOne({
3645
- id
3646
- }) {
3647
- await this.api.delete(`${this.route}${id}`);
3666
+ await this.api.put(`${this.route}${id}`, body);
3648
3667
  }
3649
3668
  };
3650
3669
 
@@ -3691,7 +3710,7 @@ var Repository95 = class {
3691
3710
  return response.data;
3692
3711
  }
3693
3712
  async update({ id }, body) {
3694
- await this.api.post(`${this.route}${id}`, body);
3713
+ await this.api.put(`${this.route}${id}`, body);
3695
3714
  }
3696
3715
  async deleteOne({
3697
3716
  id
@@ -4419,15 +4438,6 @@ var Repository115 = class {
4419
4438
  });
4420
4439
  return response.data;
4421
4440
  }
4422
- async findForBillOfLading(data) {
4423
- const response = await this.api.get(
4424
- `${this.route}`,
4425
- {
4426
- data
4427
- }
4428
- );
4429
- return response.data;
4430
- }
4431
4441
  async findByEmail(data) {
4432
4442
  const response = await this.api.get(`${this.route}by_email`, {
4433
4443
  data
@@ -5154,6 +5164,7 @@ var Repository133 = class {
5154
5164
  // src/modules/view/webSocket.ts
5155
5165
  var CLOSE_AUTH_REJECTED = 4401;
5156
5166
  var CLOSE_AUTH_UNAVAILABLE = 4503;
5167
+ var MAX_AUTH_RETRIES = 3;
5157
5168
  var PING_INTERVAL_MS = 25e3;
5158
5169
  var MAX_BACKOFF_MS = 3e4;
5159
5170
  var BASE_BACKOFF_MS = 1e3;
@@ -5167,6 +5178,7 @@ var Service = class {
5167
5178
  }
5168
5179
  openSocket({
5169
5180
  token,
5181
+ onAuthRejected,
5170
5182
  channel,
5171
5183
  onEvent,
5172
5184
  onOpen,
@@ -5176,11 +5188,15 @@ var Service = class {
5176
5188
  }) {
5177
5189
  let ws = null;
5178
5190
  let attempts = 0;
5191
+ let authRejections = 0;
5179
5192
  let opensSoFar = 0;
5180
5193
  let pingTimer = null;
5181
5194
  let reconnectTimer = null;
5182
5195
  let closedByCaller = false;
5183
- const subprotocols = channel ? [`bearer.${token}`, `channel.${channel}`] : [`bearer.${token}`];
5196
+ const subprotocols = () => {
5197
+ const current = typeof token === "function" ? token() : token;
5198
+ return channel ? [`bearer.${current}`, `channel.${channel}`] : [`bearer.${current}`];
5199
+ };
5184
5200
  const stopPing = () => {
5185
5201
  if (pingTimer !== null) {
5186
5202
  window.clearInterval(pingTimer);
@@ -5211,7 +5227,7 @@ var Service = class {
5211
5227
  const connect = () => {
5212
5228
  if (closedByCaller) return;
5213
5229
  try {
5214
- ws = new WebSocket(this.route, subprotocols);
5230
+ ws = new WebSocket(this.route, subprotocols());
5215
5231
  } catch (err) {
5216
5232
  console.error("WebSocket constructor threw", err);
5217
5233
  scheduleReconnect();
@@ -5219,6 +5235,7 @@ var Service = class {
5219
5235
  }
5220
5236
  ws.onopen = () => {
5221
5237
  attempts = 0;
5238
+ authRejections = 0;
5222
5239
  opensSoFar += 1;
5223
5240
  startPing();
5224
5241
  if (opensSoFar === 1) {
@@ -5255,6 +5272,13 @@ var Service = class {
5255
5272
  ws = null;
5256
5273
  onClose?.();
5257
5274
  if (e.code === CLOSE_AUTH_REJECTED) {
5275
+ if (typeof token === "function" && authRejections < MAX_AUTH_RETRIES) {
5276
+ authRejections += 1;
5277
+ void Promise.resolve().then(() => onAuthRejected?.()).catch((err) => {
5278
+ console.warn("WebSocket onAuthRejected failed", err);
5279
+ }).finally(scheduleReconnect);
5280
+ return;
5281
+ }
5258
5282
  console.error("WebSocket auth rejected by server, not reconnecting");
5259
5283
  closedByCaller = true;
5260
5284
  return;
@@ -9,6 +9,6 @@ export default class Repository implements Nomalism.MaterialEntrance.IApi {
9
9
  finalizarEntradaMaterial(data: Nomalism.MaterialEntrance.IFinalizarEntradaDeMaterialRequest): Promise<Nomalism.MaterialEntrance.IFinalizarEntradaDeMaterialResponse>;
10
10
  undoEntradaMaterial(data: Nomalism.MaterialEntrance.IUndoEntradaDeMaterialRequest): Promise<void>;
11
11
  findDoneById({ id, }: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.MaterialEntrance.IFindDoneByIdResponse[]>;
12
- printLabelToPdfUrl({ product_id }: Nomalism.MaterialEntrance.IPrintLabelParamsRequest, { quantity, ef_name, pc_document_number, prison, note, availableStock, token, }: Nomalism.MaterialEntrance.IPrintLabelQueryWithTokenRequest): string;
13
- printBulkLabelToPdfUrl({ groupLabel, stockOrders, notOk, clientOrders, saved_em_picking_ids, token, }: Nomalism.MaterialEntrance.IPrintBulkLabelRequest): string;
12
+ printLabelToPdfUrl({ product_id }: Nomalism.MaterialEntrance.IPrintLabelParamsRequest, { quantity, ef_name, pc_document_number, prison, note, availableStock, token, as, }: Nomalism.MaterialEntrance.IPrintLabelQueryWithTokenRequest): string;
13
+ printBulkLabelToPdfUrl({ groupLabel, stockOrders, notOk, clientOrders, saved_em_picking_ids, token, as, }: Nomalism.MaterialEntrance.IPrintBulkLabelRequest): string;
14
14
  }
@@ -8,4 +8,5 @@ export default class Repository implements Nomalism.Multimedia.IApi {
8
8
  getUrl(multimediaId: string, { download }?: Nomalism.Multimedia.IFindByIdRequest): string;
9
9
  create(multipartFormData: unknown, headers?: RawAxiosRequestHeaders): Promise<Nomalism.Multimedia.Entity>;
10
10
  update(id: string, multipartFormData: unknown, headers?: RawAxiosRequestHeaders): Promise<void>;
11
+ setPublic(data: Nomalism.Multimedia.ISetPublicRequest): Promise<Nomalism.Multimedia.ISetPublicResponse>;
11
12
  }
@@ -4,8 +4,7 @@ export default class Repository implements Nomalism.Settings.IRepository {
4
4
  route: string;
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
- create(body: Nomalism.Settings.ICreateRequest): Promise<Nomalism.Settings.Entity>;
8
- findByKey(params: Nomalism.Settings.IFindByKeyRequest): Promise<Nomalism.Settings.Entity | null>;
9
- update(body: Nomalism.Settings.IUpdateRequest): Promise<Nomalism.Settings.Entity | null>;
10
- find(): Promise<Nomalism.Settings.Entity[]>;
7
+ findByKey(params: Nomalism.Settings.IFindByKeyRequest): Promise<Nomalism.Settings.IFindResponse | null>;
8
+ update(body: Nomalism.Settings.IUpdateRequest): Promise<Nomalism.Settings.IFindResponse | null>;
9
+ find(): Promise<Nomalism.Settings.IFindResponse[]>;
11
10
  }
@@ -8,5 +8,6 @@ export default class Repository implements Nomalism.SchedulePrintJob.IRepository
8
8
  createMany(body: Nomalism.SchedulePrintJob.ICreateManySchedulePrintJobRequest): Promise<void>;
9
9
  deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void>;
10
10
  dispatchSchedulePrintJob(body: Nomalism.SchedulePrintJob.IDispatchSchedulePrintJobRequest): Promise<Nomalism.SchedulePrintJob.IDispatchSchedulePrintJobResponse>;
11
+ findToday(): Promise<Nomalism.SchedulePrintJob.IFindTodayItem[]>;
11
12
  findByOwner(params: Nomalism.shared.IFindByOwnerIdRequest): Promise<Nomalism.SchedulePrintJob.Entity[]>;
12
13
  }
@@ -5,5 +5,5 @@ export default class Repository implements Nomalism.Gmails.IRepository {
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
7
  auth(): Promise<string>;
8
- emails(): Promise<Nomalism.Gmails.IGmailsResponse[]>;
8
+ emails(params?: Nomalism.Gmails.IFindRequest): Promise<Nomalism.Gmails.IFindResponse>;
9
9
  }
@@ -7,4 +7,6 @@ export default class Repository implements Nomalism.OnlineStore.IRepository {
7
7
  findProducts(params: Nomalism.OnlineStore.IFindProductsRequest): Promise<Nomalism.OnlineStore.IFindProductsResponse>;
8
8
  findStock(body: Nomalism.OnlineStore.IFindStockRequest): Promise<Nomalism.OnlineStore.IFindStockResponse[]>;
9
9
  createOrder(body: Nomalism.OnlineStore.ICreateOrderRequest): Promise<Nomalism.OnlineStore.ICreateOrderResponse>;
10
+ cancelOrder(body: Nomalism.OnlineStore.ICancelOrderRequest): Promise<Nomalism.OnlineStore.ICancelOrderResponse>;
11
+ findOrderStatus(body: Nomalism.OnlineStore.IFindOrderStatusRequest): Promise<Nomalism.OnlineStore.IFindOrderStatusResponse[]>;
10
12
  }
@@ -6,5 +6,5 @@ export default class Repository implements Nomalism.QueryList.IRepository {
6
6
  constructor({ api, route }: IModuleConstructor);
7
7
  find(): Promise<Nomalism.QueryList.IFindResponse[]>;
8
8
  execute(params: Nomalism.QueryList.IExecuteRequest): Promise<Nomalism.QueryList.IExecuteResponse>;
9
- getQueryExecuteUrl({ query_id, output, token, ...data }: Nomalism.QueryList.IExecuteRequest): string;
9
+ getQueryExecuteUrl({ query_id, output, ...data }: Nomalism.QueryList.IExecuteRequest): string;
10
10
  }
@@ -8,5 +8,5 @@ export default class Repository implements Nomalism.StockMovement.IRepository {
8
8
  findByOwnerId(params: Nomalism.shared.IFindByOwnerIdRequest): Promise<Nomalism.StockMovement.IFindByOwnerIdResponse[]>;
9
9
  exportCsv(params: Nomalism.StockMovement.IExportRequest): Promise<Nomalism.StockMovement.IExportCsvResponse[]>;
10
10
  findMonthlyConsumption(params: Nomalism.shared.IFindByOwnerIdRequest): Promise<Nomalism.StockMovement.IFindMonthlyConsumptionResponse[]>;
11
- getStockCsvUrl({ date, version, format, token, }: Nomalism.StockMovement.IExportRequest): string;
11
+ getStockCsvUrl({ date, version, format, }: Nomalism.StockMovement.IExportRequest): string;
12
12
  }
@@ -12,5 +12,5 @@ export default class Repository implements Nomalism.CurrentAccount.IRepository {
12
12
  findClientUnpaidDebit(params: Nomalism.shared.IFindByOwnerIdRequest): Promise<Nomalism.CurrentAccount.IDocumentResponse[]>;
13
13
  findAccountAdjustment(params: Nomalism.CurrentAccount.IAccountAdjustmentRequest): Promise<Nomalism.CurrentAccount.IAccountAdjustmentPreview>;
14
14
  createAccountAdjustment(data: Nomalism.CurrentAccount.ICreateAccountAdjustmentRequest): Promise<Nomalism.CurrentAccount.ICreateAccountAdjustmentResponse>;
15
- getExportCurrentAccountUrl({ owner_id, start_date, end_date, output, token, }: Nomalism.CurrentAccount.IExportCurrentAccountRequest): string;
15
+ getExportCurrentAccountUrl({ owner_id, start_date, end_date, output, }: Nomalism.CurrentAccount.IExportCurrentAccountRequest): string;
16
16
  }
@@ -7,7 +7,7 @@ export default class Repository implements Nomalism.DocumentHeader.IRepository {
7
7
  findOne(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.DocumentHeader.IFindOneBase | null>;
8
8
  findStartVirtual(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.DocumentHeader.IStartDocumentHeaderVirtuals | null>;
9
9
  findByBasicSearch(params: Nomalism.DocumentHeader.IBasicSearchRequest): Promise<Nomalism.shared.IPaginationResponse<Nomalism.DocumentHeader.IBasicSearchResponse>>;
10
- findByType(params: Nomalism.DocumentHeader.IFindByTypeRequest): Promise<Nomalism.DocumentHeader.IFindByTypeResponse[]>;
10
+ findByType(params: Nomalism.DocumentHeader.IFindByTypeRequest): Promise<Nomalism.shared.IPaginationResponse<Nomalism.DocumentHeader.IFindByTypeResponse>>;
11
11
  find(params: Nomalism.DocumentHeader.IFindRequest): Promise<Nomalism.DocumentHeader.IFindResponse[]>;
12
12
  create(body: Nomalism.DocumentHeader.ICreateRequest): Promise<Nomalism.DocumentHeader.ICreateResponse>;
13
13
  createFromHeader(body: Nomalism.DocumentHeader.ICreateFromHeaderRequest): Promise<void>;
@@ -5,5 +5,5 @@ export default class Repository implements Nomalism.OrderManagement.IRepository
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
7
  findProviderProducts(params: Nomalism.OrderManagement.IFindProviderProductsRequest): Promise<Nomalism.OrderManagement.IFindProviderProductsResponse[]>;
8
- findAllProviderProducts(): Promise<Nomalism.OrderManagement.IFindAllProviderProductsResponse[]>;
8
+ findAllProviderProducts(params: Nomalism.OrderManagement.IFindAllProviderProductsRequest): Promise<Nomalism.OrderManagement.IFindAllProviderProductsResponse[]>;
9
9
  }
@@ -3,5 +3,5 @@ import { IModuleConstructor } from "../../main";
3
3
  export default class Repository {
4
4
  route: string;
5
5
  constructor({ route }: IModuleConstructor);
6
- getUrl({ date_start, date_end, token, }: Nomalism.Saft.ISaftInvoiceRequest): string;
6
+ getUrl({ date_start, date_end }: Nomalism.Saft.ISaftInvoiceRequest): string;
7
7
  }
@@ -4,10 +4,8 @@ export default class Repository implements Nomalism.CLT.IRepository {
4
4
  route: string;
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
- create(body: Nomalism.CLT.ICreateRequest): Promise<Nomalism.CLT.Entity>;
8
7
  find(): Promise<Nomalism.CLT.Entity[]>;
9
8
  findMinified(params?: Nomalism.CLT.IFindMinifiedRequest): Promise<Nomalism.CLT.Entity[]>;
10
9
  findById({ id, }: Nomalism.shared.IFindByIdNumberRequest): Promise<Nomalism.CLT.Entity | null>;
11
10
  update({ id }: Nomalism.shared.IFindByIdNumberRequest, body: Nomalism.CLT.IUpdateRequest): Promise<void>;
12
- deleteOne({ id, }: Nomalism.shared.IFindByIdNumberRequest): Promise<void>;
13
11
  }
@@ -10,7 +10,6 @@ export default class Repository implements Nomalism.Persona.IRepository {
10
10
  update(selector: Nomalism.shared.IFindByIdRequest, body: Nomalism.Persona.IUpdateRequest): Promise<Nomalism.Persona.IEntityExtended | null>;
11
11
  deleteOne(params: Nomalism.Persona.IDeletePersonaRequest): Promise<Nomalism.Persona.IEntityExtended | null>;
12
12
  findByBasic(params: Nomalism.Persona.IBasicSearchRequest): Promise<Nomalism.shared.IPaginationResponse<Nomalism.Persona.IBasicSearchResponse>>;
13
- findForBillOfLading(data: Nomalism.Persona.IFindRequest): Promise<Nomalism.Persona.IFindResponse[]>;
14
13
  findByEmail(data: Nomalism.Persona.IFindByEmailRequest): Promise<Nomalism.Persona.IFindByEmailResponse[]>;
15
14
  findClientOrProvider(params: Nomalism.Persona.IFindClientOrProviderRequest): Promise<Nomalism.Persona.IFindClientOrProviderResponse[]>;
16
15
  findForGmail(params: Nomalism.Persona.IFindForGmailRequest): Promise<Nomalism.Persona.IFindForGmailResponse | null>;
@@ -6,7 +6,7 @@ export default class Repository implements Nomalism.ReasonForExemption.IReposito
6
6
  constructor({ api, route }: IModuleConstructor);
7
7
  find(params: Nomalism.ReasonForExemption.IFindRequest): Promise<Nomalism.ReasonForExemption.IFindResponse[]>;
8
8
  findPaginated(params: Nomalism.ReasonForExemption.IFindPaginatedRequest): Promise<Nomalism.shared.IPaginationResponse<Nomalism.ReasonForExemption.IFindResponse>>;
9
- findMinified(params?: Nomalism.shared.IFindMinifiedRequest): Promise<Nomalism.shared.IFindMinifiedResponse[]>;
9
+ findMinified(params?: Nomalism.ReasonForExemption.IFindMinifiedRequest): Promise<Nomalism.shared.IFindMinifiedResponse[]>;
10
10
  create(body: Nomalism.ReasonForExemption.ICreateRequest): Promise<Nomalism.ReasonForExemption.Entity>;
11
11
  update(selector: Nomalism.shared.IFindByIdRequest, body: Nomalism.ReasonForExemption.IUpdateRequest): Promise<Nomalism.ReasonForExemption.Entity | null>;
12
12
  deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.ReasonForExemption.Entity | null>;
@@ -3,5 +3,5 @@ import type { IModuleConstructor } from "../../main";
3
3
  export default class Service implements Nomalism.WebSocket.IClient {
4
4
  route: string;
5
5
  constructor({ route }: IModuleConstructor);
6
- openSocket<T extends Nomalism.WebSocket.IEvent>({ token, channel, onEvent, onOpen, onReconnect, onClose, onAuthUnverified, }: Nomalism.WebSocket.SocketOptions<T>): Nomalism.WebSocket.SocketHandle;
6
+ openSocket<T extends Nomalism.WebSocket.IEvent>({ token, onAuthRejected, channel, onEvent, onOpen, onReconnect, onClose, onAuthUnverified, }: Nomalism.WebSocket.SocketOptions<T>): Nomalism.WebSocket.SocketHandle;
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/api",
3
3
  "description": "A nomalism API package for performing HTTP requests on API endpoints",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -30,19 +30,19 @@
30
30
  "prepare": "husky"
31
31
  },
32
32
  "dependencies": {
33
- "@nomalism-com/types": "^0.52.0",
33
+ "@nomalism-com/types": "^0.52.2",
34
34
  "axios": "^1.21.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@eslint/js": "^10.0.1",
38
- "@swc/core": "^1.16.20",
39
- "@types/node": "^26.6.5",
38
+ "@swc/core": "^1.16.22",
39
+ "@types/node": "^26.6.6",
40
40
  "@typescript-eslint/eslint-plugin": "^8.62.0",
41
41
  "@typescript-eslint/parser": "^8.62.0",
42
- "eslint": "^10.13.0",
42
+ "eslint": "^10.14.0",
43
43
  "eslint-config-prettier": "^10.1.8",
44
44
  "eslint-plugin-simple-import-sort": "^14.0.0",
45
- "globals": "^17.13.0",
45
+ "globals": "^17.14.0",
46
46
  "husky": "^9.1.7",
47
47
  "lint-staged": "^17.6.0",
48
48
  "prettier": "^3.9.10",