@fluxo-dev/api-client-base 25.4.3 → 26.1.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/index.cjs.js CHANGED
@@ -2667,6 +2667,10 @@ let HttpClient$1 = class HttpClient {
2667
2667
  return config;
2668
2668
  }));
2669
2669
  this._axiosInstance.interceptors.response.use(response => response.data, error => {
2670
+ if (error.code === 'ERR_NETWORK') return Promise.reject({
2671
+ code: "ERR_NETWORK",
2672
+ message: "Il server non è raggiungibile."
2673
+ });
2670
2674
  if (error.response.status === 401) ;
2671
2675
  return Promise.reject({
2672
2676
  code: error.response.status,
@@ -4167,7 +4171,8 @@ class AuthService {
4167
4171
  userId,
4168
4172
  canChangePassword: info.canChangePassword,
4169
4173
  canHandle2FA: info.canHandle2FA,
4170
- canHandleAccessTokens: info.canHandleAccessTokens
4174
+ canHandleAccessTokens: info.canHandleAccessTokens,
4175
+ canDisable2FA: info.canDisable2FA
4171
4176
  }, {
4172
4177
  withCredentials: true
4173
4178
  }).then(() => {
@@ -5376,26 +5381,328 @@ class PrintingService {
5376
5381
  AddPrinter(printServerId, command) {
5377
5382
  return HttpClient$1.Instance().client.post(`print-server/${printServerId}/virtual-printers`, command);
5378
5383
  }
5384
+ UpdatePrinter(printServerId, printerId, command) {
5385
+ return HttpClient$1.Instance().client.put(`print-server/${printServerId}/virtual-printers/${printerId}`, command);
5386
+ }
5387
+ DeletePrinter(printServerId, printerId) {
5388
+ return HttpClient$1.Instance().client.delete(`print-server/${printServerId}/virtual-printers/${printerId}`);
5389
+ }
5390
+ DeletePrintServer(printServerId) {
5391
+ return HttpClient$1.Instance().client.delete(`print-server/${printServerId}`);
5392
+ }
5379
5393
  }
5380
5394
 
5381
- exports.WorkflowActionInputType = void 0;
5382
- (function (WorkflowActionInputType) {
5383
- WorkflowActionInputType[WorkflowActionInputType["none"] = 0] = "none";
5384
- WorkflowActionInputType[WorkflowActionInputType["manual"] = 1] = "manual";
5385
- WorkflowActionInputType[WorkflowActionInputType["dynamic"] = 2] = "dynamic";
5386
- WorkflowActionInputType[WorkflowActionInputType["expression"] = 3] = "expression";
5387
- })(exports.WorkflowActionInputType || (exports.WorkflowActionInputType = {}));
5395
+ exports.BlockConfigFieldType = void 0;
5396
+ (function (BlockConfigFieldType) {
5397
+ BlockConfigFieldType[BlockConfigFieldType["Text"] = 0] = "Text";
5398
+ BlockConfigFieldType[BlockConfigFieldType["TextArea"] = 1] = "TextArea";
5399
+ BlockConfigFieldType[BlockConfigFieldType["Number"] = 2] = "Number";
5400
+ BlockConfigFieldType[BlockConfigFieldType["Boolean"] = 3] = "Boolean";
5401
+ BlockConfigFieldType[BlockConfigFieldType["Select"] = 4] = "Select";
5402
+ BlockConfigFieldType[BlockConfigFieldType["Expression"] = 5] = "Expression";
5403
+ BlockConfigFieldType[BlockConfigFieldType["Secret"] = 6] = "Secret";
5404
+ BlockConfigFieldType[BlockConfigFieldType["KeyValue"] = 7] = "KeyValue";
5405
+ BlockConfigFieldType[BlockConfigFieldType["ObjectMap"] = 8] = "ObjectMap";
5406
+ BlockConfigFieldType[BlockConfigFieldType["Json"] = 9] = "Json";
5407
+ BlockConfigFieldType[BlockConfigFieldType["JsonArray"] = 10] = "JsonArray";
5408
+ BlockConfigFieldType[BlockConfigFieldType["ConnectionString"] = 11] = "ConnectionString";
5409
+ })(exports.BlockConfigFieldType || (exports.BlockConfigFieldType = {}));
5410
+ exports.DynamicPortType = void 0;
5411
+ (function (DynamicPortType) {
5412
+ DynamicPortType[DynamicPortType["Count"] = 0] = "Count";
5413
+ DynamicPortType[DynamicPortType["ArrayProperty"] = 1] = "ArrayProperty";
5414
+ })(exports.DynamicPortType || (exports.DynamicPortType = {}));
5415
+ exports.PipelineStatus = void 0;
5416
+ (function (PipelineStatus) {
5417
+ PipelineStatus[PipelineStatus["Pending"] = 0] = "Pending";
5418
+ PipelineStatus[PipelineStatus["Running"] = 1] = "Running";
5419
+ PipelineStatus[PipelineStatus["Paused"] = 2] = "Paused";
5420
+ PipelineStatus[PipelineStatus["Completed"] = 3] = "Completed";
5421
+ PipelineStatus[PipelineStatus["Failed"] = 4] = "Failed";
5422
+ PipelineStatus[PipelineStatus["Cancelled"] = 5] = "Cancelled";
5423
+ })(exports.PipelineStatus || (exports.PipelineStatus = {}));
5424
+ exports.NodeExecutionState = void 0;
5425
+ (function (NodeExecutionState) {
5426
+ NodeExecutionState[NodeExecutionState["Pending"] = 0] = "Pending";
5427
+ NodeExecutionState[NodeExecutionState["Running"] = 1] = "Running";
5428
+ NodeExecutionState[NodeExecutionState["Completed"] = 2] = "Completed";
5429
+ NodeExecutionState[NodeExecutionState["Failed"] = 3] = "Failed";
5430
+ NodeExecutionState[NodeExecutionState["Cancelled"] = 4] = "Cancelled";
5431
+ })(exports.NodeExecutionState || (exports.NodeExecutionState = {}));
5432
+
5433
+ // Enum helper per i nomi
5434
+ exports.NodeTypeEnum = void 0;
5435
+ (function (NodeTypeEnum) {
5436
+ NodeTypeEnum[NodeTypeEnum["Action"] = 0] = "Action";
5437
+ NodeTypeEnum[NodeTypeEnum["Parallel"] = 1] = "Parallel";
5438
+ NodeTypeEnum[NodeTypeEnum["Join"] = 2] = "Join";
5439
+ NodeTypeEnum[NodeTypeEnum["While"] = 3] = "While";
5440
+ NodeTypeEnum[NodeTypeEnum["ForEach"] = 4] = "ForEach";
5441
+ NodeTypeEnum[NodeTypeEnum["Schedule"] = 5] = "Schedule";
5442
+ NodeTypeEnum[NodeTypeEnum["Delay"] = 6] = "Delay";
5443
+ NodeTypeEnum[NodeTypeEnum["WaitForEvent"] = 7] = "WaitForEvent";
5444
+ NodeTypeEnum[NodeTypeEnum["Decision"] = 8] = "Decision";
5445
+ NodeTypeEnum[NodeTypeEnum["Start"] = 9] = "Start";
5446
+ NodeTypeEnum[NodeTypeEnum["End"] = 10] = "End";
5447
+ })(exports.NodeTypeEnum || (exports.NodeTypeEnum = {}));
5448
+ exports.ActionInputTypeEnum = void 0;
5449
+ (function (ActionInputTypeEnum) {
5450
+ ActionInputTypeEnum[ActionInputTypeEnum["Manual"] = 0] = "Manual";
5451
+ ActionInputTypeEnum[ActionInputTypeEnum["Expression"] = 1] = "Expression";
5452
+ ActionInputTypeEnum[ActionInputTypeEnum["StepOutput"] = 2] = "StepOutput";
5453
+ ActionInputTypeEnum[ActionInputTypeEnum["Environment"] = 3] = "Environment"; // Variabile ambiente
5454
+ })(exports.ActionInputTypeEnum || (exports.ActionInputTypeEnum = {}));
5455
+ // ============================================================================
5456
+ // Workflow Execution Types
5457
+ // ============================================================================
5458
+ exports.WorkflowStatus = void 0;
5459
+ (function (WorkflowStatus) {
5460
+ WorkflowStatus[WorkflowStatus["Runnable"] = 0] = "Runnable";
5461
+ WorkflowStatus[WorkflowStatus["Suspended"] = 1] = "Suspended";
5462
+ WorkflowStatus[WorkflowStatus["Complete"] = 2] = "Complete";
5463
+ WorkflowStatus[WorkflowStatus["Terminated"] = 3] = "Terminated"; // Terminata (con o senza errori)
5464
+ })(exports.WorkflowStatus || (exports.WorkflowStatus = {}));
5465
+ exports.PointerStatus = void 0;
5466
+ (function (PointerStatus) {
5467
+ PointerStatus[PointerStatus["Legacy"] = 0] = "Legacy";
5468
+ PointerStatus[PointerStatus["Pending"] = 1] = "Pending";
5469
+ PointerStatus[PointerStatus["Running"] = 2] = "Running";
5470
+ PointerStatus[PointerStatus["Complete"] = 3] = "Complete";
5471
+ PointerStatus[PointerStatus["Sleeping"] = 4] = "Sleeping";
5472
+ PointerStatus[PointerStatus["WaitingForEvent"] = 5] = "WaitingForEvent";
5473
+ PointerStatus[PointerStatus["Failed"] = 6] = "Failed";
5474
+ PointerStatus[PointerStatus["Compensated"] = 7] = "Compensated";
5475
+ PointerStatus[PointerStatus["Cancelled"] = 8] = "Cancelled";
5476
+ })(exports.PointerStatus || (exports.PointerStatus = {}));
5388
5477
 
5389
5478
  class WorkflowService {
5479
+ // ============================================================================
5480
+ // ETL Designer Metadata
5481
+ // ============================================================================
5482
+ getEtlBlocks() {
5483
+ return HttpClient$1.Instance().client.get('etl/blocks');
5484
+ }
5485
+ getEtlBlocksGrouped() {
5486
+ return HttpClient$1.Instance().client.get('etl/blocks-grouped');
5487
+ }
5488
+ getEtlBlock(type) {
5489
+ return HttpClient$1.Instance().client.get(`etl/blocks/${type}`);
5490
+ }
5491
+ // ============================================================================
5492
+ // Designer Metadata
5493
+ // ============================================================================
5494
+ /**
5495
+ * Ottiene tutte le azioni disponibili organizzate per categoria
5496
+ */
5390
5497
  getActionsDefinition() {
5391
5498
  return HttpClient$1.Instance().client.get('workflow/designer/actions');
5392
5499
  }
5500
+ /**
5501
+ * Ottiene tutti i trigger disponibili organizzati per categoria
5502
+ */
5393
5503
  getTriggersDefinition() {
5394
5504
  return HttpClient$1.Instance().client.get('workflow/designer/triggers');
5395
5505
  }
5506
+ // ============================================================================
5507
+ // CRUD Operations
5508
+ // ============================================================================
5509
+ /**
5510
+ * Crea un nuovo workflow
5511
+ */
5512
+ createWorkflow(request) {
5513
+ return HttpClient$1.Instance().client.post('workflow/workflows', request);
5514
+ }
5515
+ /**
5516
+ * Ottiene un workflow per ID database
5517
+ */
5518
+ getWorkflowById(id) {
5519
+ return HttpClient$1.Instance().client.get(`workflow/workflows/${id}`);
5520
+ }
5521
+ /**
5522
+ * Ottiene un workflow per WorkflowId
5523
+ */
5524
+ getWorkflowByWorkflowId(workflowId) {
5525
+ return HttpClient$1.Instance().client.get(`workflow/workflows/by-workflow-id/${workflowId}`);
5526
+ }
5527
+ /**
5528
+ * Ottiene tutti i workflow (summary)
5529
+ */
5530
+ listWorkflows() {
5531
+ return HttpClient$1.Instance().client.get('workflow/workflows');
5532
+ }
5533
+ /**
5534
+ * Aggiorna un workflow esistente
5535
+ */
5536
+ updateWorkflow(id, request) {
5537
+ return HttpClient$1.Instance().client.put(`workflow/workflows/${id}`, request);
5538
+ }
5539
+ /**
5540
+ * Elimina un workflow
5541
+ */
5542
+ deleteWorkflow(id) {
5543
+ return HttpClient$1.Instance().client.delete(`workflow/workflows/${id}`);
5544
+ }
5545
+ /**
5546
+ * Attiva un workflow
5547
+ */
5548
+ activateWorkflow(id, updatedBy) {
5549
+ return HttpClient$1.Instance().client.post(`workflow/workflows/${id}/activate`, {
5550
+ updatedBy
5551
+ });
5552
+ }
5553
+ /**
5554
+ * Disattiva un workflow
5555
+ */
5556
+ deactivateWorkflow(id, updatedBy) {
5557
+ return HttpClient$1.Instance().client.post(`workflow/workflows/${id}/deactivate`, {
5558
+ updatedBy
5559
+ });
5560
+ }
5561
+ /**
5562
+ * Avvia un workflow con un trigger specifico
5563
+ * @param workflowId - ID del workflow da avviare
5564
+ * @param triggerId - ID del trigger da utilizzare
5565
+ * @param inputs - Inputs per il trigger (opzionale)
5566
+ */
5567
+ startWorkflow(workflowId, triggerId, inputs) {
5568
+ const inputSchema = {
5569
+ inputs: []
5570
+ };
5571
+ if (inputs) Object.keys(inputs).forEach(input => {
5572
+ inputSchema.inputs.push({
5573
+ key: `${triggerId}.${input}`,
5574
+ value: inputs[input]
5575
+ });
5576
+ });
5577
+ return HttpClient$1.Instance().client.post(`workflow/workflows-start/${workflowId}`, {
5578
+ inputs: inputSchema.inputs
5579
+ });
5580
+ }
5581
+ /**
5582
+ * Clona un workflow
5583
+ */
5584
+ cloneWorkflow(id, request) {
5585
+ return HttpClient$1.Instance().client.post(`workflow/workflows/${id}/clone`, request);
5586
+ }
5587
+ // ============================================================================
5588
+ // Validation
5589
+ // ============================================================================
5590
+ /**
5591
+ * Valida uno schema ReactFlow
5592
+ */
5593
+ validateWorkflow(schema) {
5594
+ return HttpClient$1.Instance().client.post('workflow/designer/validate', schema);
5595
+ }
5596
+ // ============================================================================
5597
+ // Conversion (opzionale, per test/debug)
5598
+ // ============================================================================
5599
+ /**
5600
+ * Converte uno schema ReactFlow in WorkflowCore JSON
5601
+ */
5602
+ convertToWorkflowCore(schema) {
5603
+ return HttpClient$1.Instance().client.post('workflow/designer/convert/to-workflowcore', schema);
5604
+ }
5605
+ /**
5606
+ * Converte un WorkflowCore JSON in schema ReactFlow
5607
+ */
5608
+ convertToReactFlow(request) {
5609
+ return HttpClient$1.Instance().client.post('workflow/designer/convert/to-reactflow', request);
5610
+ }
5611
+ // ============================================================================
5612
+ // Legacy (manteniamo per compatibilità)
5613
+ // ============================================================================
5614
+ /**
5615
+ * @deprecated Use validateWorkflow instead
5616
+ */
5396
5617
  test(workflow) {
5397
5618
  return HttpClient$1.Instance().client.post('workflow/convert', workflow);
5398
5619
  }
5620
+ // ============================================================================
5621
+ // Workflow Executions
5622
+ // ============================================================================
5623
+ /**
5624
+ * Ottiene tutte le esecuzioni di un workflow specifico
5625
+ */
5626
+ getWorkflowExecutions(workflowId) {
5627
+ return HttpClient$1.Instance().client.get(`workflow/workflows/${workflowId}/executions`);
5628
+ }
5629
+ /**
5630
+ * Ottiene i dettagli completi di un'esecuzione
5631
+ */
5632
+ getExecutionDetails(instanceId) {
5633
+ return HttpClient$1.Instance().client.get(`workflow/workflows/executions/${instanceId}`);
5634
+ }
5635
+ /**
5636
+ * Ottiene solo gli step di un'esecuzione
5637
+ */
5638
+ getExecutionSteps(instanceId) {
5639
+ return HttpClient$1.Instance().client.get(`workflow/workflows/executions/${instanceId}/steps`);
5640
+ }
5641
+ /**
5642
+ * Ottiene solo gli errori di un'esecuzione
5643
+ */
5644
+ getExecutionErrors(instanceId) {
5645
+ return HttpClient$1.Instance().client.get(`workflow/workflows/executions/${instanceId}/errors`);
5646
+ }
5647
+ /**
5648
+ * Termina un'esecuzione in corso
5649
+ */
5650
+ terminateExecution(instanceId) {
5651
+ return HttpClient$1.Instance().client.post(`workflow/workflows/executions/${instanceId}/terminate`, {});
5652
+ }
5653
+ /**
5654
+ * Sospende un'esecuzione in corso
5655
+ */
5656
+ suspendExecution(instanceId) {
5657
+ return HttpClient$1.Instance().client.post(`workflow/workflows/executions/${instanceId}/suspend`, {});
5658
+ }
5659
+ /**
5660
+ * Riprende un'esecuzione sospesa
5661
+ */
5662
+ resumeExecution(instanceId) {
5663
+ return HttpClient$1.Instance().client.post(`workflow/workflows/executions/${instanceId}/resume`, {});
5664
+ }
5665
+ // ============================================================================
5666
+ // ETL Pipelines
5667
+ // ============================================================================
5668
+ saveEtlPipeline(request) {
5669
+ return HttpClient$1.Instance().client.post('etl/pipelines', request);
5670
+ }
5671
+ listEtlPipelines() {
5672
+ return HttpClient$1.Instance().client.get('etl/pipelines');
5673
+ }
5674
+ getEtlPipeline(id) {
5675
+ return HttpClient$1.Instance().client.get(`etl/pipelines/${id}`);
5676
+ }
5677
+ deleteEtlPipeline(id) {
5678
+ return HttpClient$1.Instance().client.delete(`etl/pipelines/${id}`);
5679
+ }
5680
+ executeSavedEtlPipeline(pipelineId, request) {
5681
+ return HttpClient$1.Instance().client.post(`etl/pipelines/${pipelineId}/execute`, request !== null && request !== void 0 ? request : {
5682
+ pipelineId
5683
+ });
5684
+ }
5685
+ getEtlPipelineExecutions(pipelineId) {
5686
+ return HttpClient$1.Instance().client.get(`etl/pipelines/${pipelineId}/executions`);
5687
+ }
5688
+ getEtlExecutionDetails(executionId) {
5689
+ return HttpClient$1.Instance().client.get(`etl/executions/${executionId}`);
5690
+ }
5691
+ getRunningEtlExecutions() {
5692
+ return HttpClient$1.Instance().client.get('etl/executions/running');
5693
+ }
5694
+ stopEtlExecution(executionId) {
5695
+ return HttpClient$1.Instance().client.post(`etl/executions/${executionId}/stop`, {});
5696
+ }
5697
+ validateEtlPipeline(request) {
5698
+ return HttpClient$1.Instance().client.post('etl/validate', request);
5699
+ }
5700
+ executeEtlPipeline(request) {
5701
+ return HttpClient$1.Instance().client.post('etl/execute', request);
5702
+ }
5703
+ dryRunEtlPipeline(request) {
5704
+ return HttpClient$1.Instance().client.post('etl/dry-run', request);
5705
+ }
5399
5706
  }
5400
5707
 
5401
5708
  class MailServerService {
@@ -9698,6 +10005,8 @@ class SessionHubService {
9698
10005
  this.eventHandlers = new Map();
9699
10006
  this.reconnectTimeoutId = null;
9700
10007
  this.isManualStop = false; // Flag to prevent reconnection after manual stop (e.g., logout)
10008
+ this.hasReachedMaxAttempts = false; // Flag to track if max attempts reached
10009
+ this.useAutomaticReconnect = true; // Flag to control automatic reconnection behavior
9701
10010
  this.hubUrl = `${baseUrl}/ws/session`;
9702
10011
  this.getAccessToken = getAccessToken;
9703
10012
  }
@@ -9723,27 +10032,50 @@ class SessionHubService {
9723
10032
  const deviceId = DeviceIdManager.getDeviceId();
9724
10033
  // Aggiungi device-id come query parameter all'URL
9725
10034
  const hubUrlWithDeviceId = `${this.hubUrl}?deviceId=${encodeURIComponent(deviceId)}`;
9726
- this.connection = new HubConnectionBuilder().withUrl(hubUrlWithDeviceId, {
10035
+ const builder = new HubConnectionBuilder().withUrl(hubUrlWithDeviceId, {
9727
10036
  accessTokenFactory: () => this.getAccessToken(),
9728
10037
  transport: HttpTransportType.WebSockets,
9729
10038
  withCredentials: false
9730
- }).withAutomaticReconnect({
9731
- nextRetryDelayInMilliseconds: retryContext => {
9732
- // Exponential backoff: 0, 2, 10, 30 seconds, then 30 seconds
9733
- if (retryContext.previousRetryCount === 0) return 0;
9734
- if (retryContext.previousRetryCount === 1) return 2000;
9735
- if (retryContext.previousRetryCount === 2) return 10000;
9736
- return 30000;
9737
- }
9738
- }).configureLogging(LogLevel.Information).build();
10039
+ });
10040
+ // Conditionally add automatic reconnect based on flag
10041
+ if (this.useAutomaticReconnect) {
10042
+ builder.withAutomaticReconnect({
10043
+ nextRetryDelayInMilliseconds: retryContext => {
10044
+ // Track attempts using SignalR's counter
10045
+ this.reconnectAttempts = retryContext.previousRetryCount + 1;
10046
+ // Stop after max attempts
10047
+ if (retryContext.previousRetryCount >= this.maxReconnectAttempts) {
10048
+ console.warn(`SessionHub: Max automatic reconnection attempts (${this.maxReconnectAttempts}) reached`);
10049
+ this.hasReachedMaxAttempts = true;
10050
+ this.useAutomaticReconnect = false; // Disable for next connection
10051
+ return null; // Stop automatic reconnection
10052
+ }
10053
+ // Exponential backoff: 0, 2, 10 seconds, then 5 seconds
10054
+ if (retryContext.previousRetryCount === 0) return 0;
10055
+ if (retryContext.previousRetryCount === 1) return 2000;
10056
+ if (retryContext.previousRetryCount === 2) return 10000;
10057
+ return this.reconnectDelay;
10058
+ }
10059
+ });
10060
+ }
10061
+ this.connection = builder.configureLogging(LogLevel.Information).build();
9739
10062
  this.setupConnectionHandlers();
9740
10063
  this.reattachEventHandlers();
9741
10064
  yield this.connection.start();
9742
10065
  console.info('SessionHub: Connection established successfully with device-id:', deviceId);
9743
10066
  this.reconnectAttempts = 0;
10067
+ this.hasReachedMaxAttempts = false;
10068
+ // Re-enable automatic reconnect for future disconnections
10069
+ this.useAutomaticReconnect = true;
9744
10070
  } catch (error) {
9745
10071
  console.error('SessionHub: Error starting connection', error);
9746
- this.scheduleReconnect();
10072
+ // Only schedule reconnect if in automatic mode
10073
+ if (this.useAutomaticReconnect && !this.hasReachedMaxAttempts) {
10074
+ this.scheduleReconnect();
10075
+ } else {
10076
+ // Manual mode: just set flag for UI
10077
+ this.hasReachedMaxAttempts = true;
10078
+ }
9747
10079
  }
9748
10080
  });
9749
10081
  }
@@ -9861,6 +10193,51 @@ class SessionHubService {
9861
10193
  var _a, _b;
9862
10194
  return (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.connectionId) !== null && _b !== void 0 ? _b : null;
9863
10195
  }
10196
+ /**
10197
+ * Get current reconnection attempts count
10198
+ */
10199
+ get currentReconnectAttempts() {
10200
+ return this.reconnectAttempts;
10201
+ }
10202
+ /**
10203
+ * Get max reconnection attempts limit
10204
+ */
10205
+ get maxReconnectAttemptsLimit() {
10206
+ return this.maxReconnectAttempts;
10207
+ }
10208
+ /**
10209
+ * Check if max reconnection attempts have been reached
10210
+ */
10211
+ get hasReachedMaxReconnectAttempts() {
10212
+ return this.hasReachedMaxAttempts;
10213
+ }
10214
+ /**
10215
+ * Manually retry connection - performs single connection attempt without automatic retries
10216
+ * User must click retry button again if connection fails
10217
+ */
10218
+ manualRetry() {
10219
+ return __awaiter(this, void 0, void 0, function* () {
10220
+ console.info('SessionHub: Manual retry initiated by user');
10221
+ // Reset counters and flags
10222
+ this.reconnectAttempts = 0;
10223
+ this.hasReachedMaxAttempts = false;
10224
+ this.isManualStop = false;
10225
+ this.useAutomaticReconnect = false; // Force manual mode - no automatic retries
10226
+ // Cancel any pending reconnection attempt
10227
+ if (this.reconnectTimeoutId) {
10228
+ clearTimeout(this.reconnectTimeoutId);
10229
+ this.reconnectTimeoutId = null;
10230
+ }
10231
+ // Attempt to start connection (will be without automatic reconnect)
10232
+ try {
10233
+ yield this.start();
10234
+ } catch (error) {
10235
+ console.error('SessionHub: Manual retry failed', error);
10236
+ // Set flag so UI shows retry button again
10237
+ this.hasReachedMaxAttempts = true;
10238
+ }
10239
+ });
10240
+ }
9864
10241
  /**
9865
10242
  * Setup connection lifecycle handlers
9866
10243
  */
@@ -9868,14 +10245,30 @@ class SessionHubService {
9868
10245
  if (!this.connection) return;
9869
10246
  this.connection.onclose(error => {
9870
10247
  console.warn('SessionHub: Connection closed', error);
9871
- this.scheduleReconnect();
10248
+ // Don't schedule reconnect if in manual mode - user must click retry button
10249
+ if (!this.useAutomaticReconnect) {
10250
+ console.info('SessionHub: In manual mode - waiting for user to retry');
10251
+ this.hasReachedMaxAttempts = true;
10252
+ return;
10253
+ }
10254
+ // In automatic mode, check if we've reached max attempts
10255
+ if (this.reconnectAttempts >= this.maxReconnectAttempts) {
10256
+ console.error('SessionHub: Max reconnection attempts reached');
10257
+ this.hasReachedMaxAttempts = true;
10258
+ this.useAutomaticReconnect = false;
10259
+ } else {
10260
+ // Schedule next reconnect attempt
10261
+ this.scheduleReconnect();
10262
+ }
9872
10263
  });
9873
10264
  this.connection.onreconnecting(error => {
9874
- console.warn('SessionHub: Attempting to reconnect...', error);
10265
+ console.warn(`SessionHub: Attempting to reconnect... (attempt ${this.reconnectAttempts} of ${this.maxReconnectAttempts})`, error);
9875
10266
  });
9876
10267
  this.connection.onreconnected(connectionId => {
9877
10268
  console.info(`SessionHub: Reconnected successfully. ConnectionId: ${connectionId}`);
9878
10269
  this.reconnectAttempts = 0;
10270
+ this.hasReachedMaxAttempts = false;
10271
+ this.useAutomaticReconnect = true; // Re-enable automatic reconnect
9879
10272
  });
9880
10273
  }
9881
10274
  /**
@@ -9900,6 +10293,8 @@ class SessionHubService {
9900
10293
  }
9901
10294
  if (this.reconnectAttempts >= this.maxReconnectAttempts) {
9902
10295
  console.error('SessionHub: Max reconnection attempts reached. Giving up.');
10296
+ this.hasReachedMaxAttempts = true;
10297
+ this.useAutomaticReconnect = false; // Disable automatic reconnect
9903
10298
  return;
9904
10299
  }
9905
10300
  this.reconnectAttempts++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxo-dev/api-client-base",
3
- "version": "25.4.3",
3
+ "version": "26.1.2",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "react": "^18.3.1",
@@ -8,7 +8,7 @@
8
8
  "react-router-dom": "^6.11.2",
9
9
  "react-redux": "^8.0.5",
10
10
  "@reduxjs/toolkit": "^1.9.1",
11
- "@fluxo-dev/state": "^25.4.3"
11
+ "@fluxo-dev/state": "^26.1.2"
12
12
  },
13
13
  "main": "./index.cjs.js",
14
14
  "types": "./index.cjs.d.ts"
@@ -14,6 +14,7 @@ export interface FluxoUserProfile {
14
14
  canChangePassword: boolean;
15
15
  canHandle2FA: boolean;
16
16
  canHandleAccessTokens: boolean;
17
+ canDisable2FA: boolean;
17
18
  }
18
19
  export declare class AuthService {
19
20
  private isRefreshingToken;
@@ -27,6 +27,7 @@ export type SystemSettings = {
27
27
  aclMode: FluxoACLMode;
28
28
  allowExternalUsers: boolean;
29
29
  twoFactorEnabled: boolean;
30
+ isWorkflowEnabled: boolean;
30
31
  };
31
32
  export declare enum FluxoACLMode {
32
33
  DomainRole = 1,
@@ -2,6 +2,7 @@ export * from './printer-type';
2
2
  export * from './virtual-printer';
3
3
  export * from './print-server-type';
4
4
  export * from './add-printer-command';
5
+ export * from './update-printer-command';
5
6
  export * from './printer-manufacturer';
6
7
  export * from './virtual-print-server';
7
8
  export * from './print-server-managed-type';
@@ -0,0 +1,4 @@
1
+ export interface UpdatePrinterCommand {
2
+ name: string;
3
+ description: string;
4
+ }
@@ -2,6 +2,7 @@ import { VirtualPrintServer } from "./models/virtual-print-server";
2
2
  import { AddPrinterCommand } from "./models/add-printer-command";
3
3
  import { CreatePrintServerCommand } from "./models/create-print-server-command";
4
4
  import { UpdatePrintServerCommand } from "./models/update-print-server-command";
5
+ import { UpdatePrinterCommand } from "./models/update-printer-command";
5
6
  export declare class PrintingService {
6
7
  GetPrintServerList(): Promise<VirtualPrintServer[]>;
7
8
  GetPrintServer(printServerId: number): Promise<VirtualPrintServer>;
@@ -9,4 +10,7 @@ export declare class PrintingService {
9
10
  GetPrintServerPrinters(printServerId: number): Promise<string[]>;
10
11
  CreatePrintServer(command: CreatePrintServerCommand): Promise<import("axios").AxiosResponse<any, any>>;
11
12
  AddPrinter(printServerId: number, command: AddPrinterCommand): Promise<import("axios").AxiosResponse<any, any>>;
13
+ UpdatePrinter(printServerId: number, printerId: number, command: UpdatePrinterCommand): Promise<import("axios").AxiosResponse<any, any>>;
14
+ DeletePrinter(printServerId: number, printerId: number): Promise<import("axios").AxiosResponse<any, any>>;
15
+ DeletePrintServer(printServerId: number): Promise<import("axios").AxiosResponse<any, any>>;
12
16
  }
@@ -2,4 +2,5 @@ export interface PrintReportCommand {
2
2
  reportUrl: string;
3
3
  virtualServerId: number;
4
4
  virtualPrinterId: number;
5
+ copies: number;
5
6
  }
@@ -23,4 +23,5 @@ export interface SecurityPolicyInfo {
23
23
  canChangePassword: boolean;
24
24
  canHandle2FA: boolean;
25
25
  canHandleAccessTokens: boolean;
26
+ canDisable2FA: boolean;
26
27
  }
@@ -13,6 +13,8 @@ export declare class SessionHubService {
13
13
  private eventHandlers;
14
14
  private reconnectTimeoutId;
15
15
  private isManualStop;
16
+ private hasReachedMaxAttempts;
17
+ private useAutomaticReconnect;
16
18
  constructor(baseUrl: string, getAccessToken: () => string);
17
19
  getConnectedUsers(): Promise<{
18
20
  userId: string;
@@ -75,6 +77,23 @@ export declare class SessionHubService {
75
77
  * Get the connection ID
76
78
  */
77
79
  get connectionId(): string | null;
80
+ /**
81
+ * Get current reconnection attempts count
82
+ */
83
+ get currentReconnectAttempts(): number;
84
+ /**
85
+ * Get max reconnection attempts limit
86
+ */
87
+ get maxReconnectAttemptsLimit(): number;
88
+ /**
89
+ * Check if max reconnection attempts have been reached
90
+ */
91
+ get hasReachedMaxReconnectAttempts(): boolean;
92
+ /**
93
+ * Manually retry connection - performs single connection attempt without automatic retries
94
+ * User must click retry button again if connection fails
95
+ */
96
+ manualRetry(): Promise<void>;
78
97
  /**
79
98
  * Setup connection lifecycle handlers
80
99
  */