@5minds/processcube_engine_client 6.0.0-alpha.5 → 6.0.0-alpha.7

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.
Files changed (86) hide show
  1. package/dist/Client.d.ts +4 -5
  2. package/dist/ClientCredentialsIdentityAccessor.d.ts +14 -0
  3. package/dist/ClientFactory.d.ts +16 -17
  4. package/dist/Clients/ApplicationInfoHttpClient.d.ts +5 -4
  5. package/dist/Clients/BaseClient.d.ts +10 -8
  6. package/dist/Clients/CorrelationHttpClient.d.ts +4 -3
  7. package/dist/Clients/CronjobHttpClient.d.ts +5 -4
  8. package/dist/Clients/DataObjectInstanceHttpClient.d.ts +3 -2
  9. package/dist/Clients/EventHttpClient.d.ts +13 -12
  10. package/dist/Clients/ExternalTaskApiHttpClient.d.ts +7 -6
  11. package/dist/Clients/ExternalTaskHttpClient.d.ts +4 -3
  12. package/dist/Clients/FlowNodeInstanceHttpClient.d.ts +8 -7
  13. package/dist/Clients/Lib/SocketIoManager.d.ts +15 -28
  14. package/dist/Clients/ManualTaskHttpClient.d.ts +7 -6
  15. package/dist/Clients/NotificationHttpClient.d.ts +52 -51
  16. package/dist/Clients/ProcessDefinitionHttpClient.d.ts +11 -10
  17. package/dist/Clients/ProcessDefinitionHttpClientNode.d.ts +2 -2
  18. package/dist/Clients/ProcessInstanceHttpClient.d.ts +10 -9
  19. package/dist/Clients/ProcessModelHttpClient.d.ts +11 -10
  20. package/dist/Clients/UntypedTaskHttpClient.d.ts +7 -6
  21. package/dist/Clients/UserTaskHttpClient.d.ts +11 -10
  22. package/dist/Clients/index.d.ts +0 -1
  23. package/dist/ExternalTaskExecution.d.ts +1 -0
  24. package/dist/ExternalTaskWorker.d.ts +8 -1
  25. package/dist/IdentityAccessor.d.ts +50 -0
  26. package/dist/Retry.d.ts +1 -0
  27. package/dist/Types/IExternalTaskWorker.d.ts +3 -2
  28. package/dist/commonjs/Client.js +22 -27
  29. package/dist/commonjs/Client.js.map +1 -1
  30. package/dist/commonjs/ClientCredentialsIdentityAccessor.js +94 -0
  31. package/dist/commonjs/ClientCredentialsIdentityAccessor.js.map +1 -0
  32. package/dist/commonjs/ClientFactory.js +23 -29
  33. package/dist/commonjs/ClientFactory.js.map +1 -1
  34. package/dist/commonjs/Clients/ApplicationInfoHttpClient.js +5 -5
  35. package/dist/commonjs/Clients/ApplicationInfoHttpClient.js.map +1 -1
  36. package/dist/commonjs/Clients/BaseClient.js +23 -15
  37. package/dist/commonjs/Clients/BaseClient.js.map +1 -1
  38. package/dist/commonjs/Clients/CorrelationHttpClient.js +2 -2
  39. package/dist/commonjs/Clients/CorrelationHttpClient.js.map +1 -1
  40. package/dist/commonjs/Clients/CronjobHttpClient.js +3 -3
  41. package/dist/commonjs/Clients/CronjobHttpClient.js.map +1 -1
  42. package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js +1 -1
  43. package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js.map +1 -1
  44. package/dist/commonjs/Clients/EventHttpClient.js +4 -4
  45. package/dist/commonjs/Clients/EventHttpClient.js.map +1 -1
  46. package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js +5 -5
  47. package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js.map +1 -1
  48. package/dist/commonjs/Clients/ExternalTaskHttpClient.js +7 -5
  49. package/dist/commonjs/Clients/ExternalTaskHttpClient.js.map +1 -1
  50. package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js +6 -6
  51. package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js.map +1 -1
  52. package/dist/commonjs/Clients/Lib/SocketIoManager.js +132 -60
  53. package/dist/commonjs/Clients/Lib/SocketIoManager.js.map +1 -1
  54. package/dist/commonjs/Clients/ManualTaskHttpClient.js +2 -2
  55. package/dist/commonjs/Clients/ManualTaskHttpClient.js.map +1 -1
  56. package/dist/commonjs/Clients/NotificationHttpClient.js +3 -3
  57. package/dist/commonjs/Clients/NotificationHttpClient.js.map +1 -1
  58. package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js +8 -8
  59. package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js.map +1 -1
  60. package/dist/commonjs/Clients/ProcessDefinitionHttpClientNode.js.map +1 -1
  61. package/dist/commonjs/Clients/ProcessInstanceHttpClient.js +9 -9
  62. package/dist/commonjs/Clients/ProcessInstanceHttpClient.js.map +1 -1
  63. package/dist/commonjs/Clients/ProcessModelHttpClient.js +9 -9
  64. package/dist/commonjs/Clients/ProcessModelHttpClient.js.map +1 -1
  65. package/dist/commonjs/Clients/UntypedTaskHttpClient.js +2 -2
  66. package/dist/commonjs/Clients/UntypedTaskHttpClient.js.map +1 -1
  67. package/dist/commonjs/Clients/UserTaskHttpClient.js +4 -4
  68. package/dist/commonjs/Clients/UserTaskHttpClient.js.map +1 -1
  69. package/dist/commonjs/Clients/index.js +0 -1
  70. package/dist/commonjs/Clients/index.js.map +1 -1
  71. package/dist/commonjs/ExternalTaskExecution.js +7 -3
  72. package/dist/commonjs/ExternalTaskExecution.js.map +1 -1
  73. package/dist/commonjs/ExternalTaskWorker.js +21 -11
  74. package/dist/commonjs/ExternalTaskWorker.js.map +1 -1
  75. package/dist/commonjs/IdentityAccessor.js +235 -0
  76. package/dist/commonjs/IdentityAccessor.js.map +1 -0
  77. package/dist/commonjs/Retry.js +30 -0
  78. package/dist/commonjs/Retry.js.map +1 -0
  79. package/dist/commonjs/index.js +5 -1
  80. package/dist/commonjs/index.js.map +1 -1
  81. package/dist/index.d.ts +2 -0
  82. package/package.json +12 -6
  83. package/tsconfig.tests.json +20 -0
  84. package/dist/Clients/AnonymousSessionHttpClient.d.ts +0 -26
  85. package/dist/commonjs/Clients/AnonymousSessionHttpClient.js +0 -48
  86. package/dist/commonjs/Clients/AnonymousSessionHttpClient.js.map +0 -1
package/dist/Client.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { Identity } from '@5minds/processcube_engine_sdk';
2
1
  import * as Clients from './Clients/index';
2
+ import { IdentityLike } from './IdentityAccessor';
3
3
  export declare class EngineClient {
4
4
  private readonly engineUrl;
5
- private readonly identity;
6
- private readonly anonymousSessionClient;
5
+ private readonly identityAccessor;
7
6
  private readonly applicationInfoClient;
8
7
  private readonly correlationClient;
9
8
  private readonly cronjobClient;
@@ -18,13 +17,13 @@ export declare class EngineClient {
18
17
  private readonly processInstanceClient;
19
18
  private readonly processModelClient;
20
19
  private readonly userTaskClient;
21
- constructor(engineUrl: string, identity?: Identity);
20
+ private readonly socketIoManager;
21
+ constructor(engineUrl: string, identity?: IdentityLike);
22
22
  dispose(): void;
23
23
  /**
24
24
  * Gets the url of the engine that this client is communicating with.
25
25
  */
26
26
  getEngineUrl(): string;
27
- get anonymousSession(): Clients.AnonymousSessionHttpClient;
28
27
  get applicationInfo(): Clients.ApplicationInfoHttpClient;
29
28
  get correlations(): Clients.CorrelationHttpClient;
30
29
  get cronjobs(): Clients.CronjobHttpClient;
@@ -0,0 +1,14 @@
1
+ import { Identity } from '@5minds/processcube_engine_sdk';
2
+ import { ClientCredentialsConfig, IdentityAccessor } from './index';
3
+ export declare class ClientCredentialsIdentityAccessor extends IdentityAccessor {
4
+ private config;
5
+ constructor(clientCredentialsConfig: ClientCredentialsConfig);
6
+ getFreshIdentity(clientCredentialsConfig: ClientCredentialsConfig): Promise<Identity>;
7
+ protected getBaseMinRefreshTimeInMs(): number;
8
+ private getNewToken;
9
+ private getOpenIdClient;
10
+ private getAuthorityUrl;
11
+ private getAuthorityUrlFromEngineUrl;
12
+ private ensureEndsWithoutSlash;
13
+ private hash;
14
+ }
@@ -1,20 +1,19 @@
1
- import { Identity } from '@5minds/processcube_engine_sdk';
2
1
  import { SocketIoManager } from './Clients/Lib/SocketIoManager';
3
- import { AnonymousSessionHttpClient, ApplicationInfoHttpClient, CorrelationHttpClient, CronjobHttpClient, DataObjectInstanceHttpClient, EventHttpClient, ExternalTaskClient, FlowNodeInstanceHttpClient, ManualTaskHttpClient, NotificationHttpClient, ProcessDefinitionHttpClient, ProcessInstanceHttpClient, ProcessModelHttpClient, UntypedTaskHttpClient, UserTaskHttpClient } from './Clients/index';
2
+ import { ApplicationInfoHttpClient, CorrelationHttpClient, CronjobHttpClient, DataObjectInstanceHttpClient, EventHttpClient, ExternalTaskClient, FlowNodeInstanceHttpClient, ManualTaskHttpClient, NotificationHttpClient, ProcessDefinitionHttpClient, ProcessInstanceHttpClient, ProcessModelHttpClient, UntypedTaskHttpClient, UserTaskHttpClient } from './Clients/index';
3
+ import { IdentityLike } from './IdentityAccessor';
4
4
  export declare const ClientFactory: {
5
- createAnonymousSessionClient: (engineUrl: string, identity?: Identity) => AnonymousSessionHttpClient;
6
- createApplicationInfoClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ApplicationInfoHttpClient;
7
- createCorrelationClient: (engineUrl: string, identity?: Identity) => CorrelationHttpClient;
8
- createCronJobClient: (engineUrl: string, identity?: Identity) => CronjobHttpClient;
9
- createDataObjectInstanceClient: (engineUrl: string, identity?: Identity) => DataObjectInstanceHttpClient;
10
- createUntypedTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => UntypedTaskHttpClient;
11
- createEventClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => EventHttpClient;
12
- createExternalTaskClient: (engineUrl: string, identity?: Identity) => ExternalTaskClient;
13
- createFlowNodeInstanceClient: (engineUrl: string, identity?: Identity) => FlowNodeInstanceHttpClient;
14
- createManualTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ManualTaskHttpClient;
15
- createNotificationClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => NotificationHttpClient;
16
- createProcessDefinitionClient: (engineUrl: string, identity?: Identity) => ProcessDefinitionHttpClient;
17
- createProcessInstanceClient: (engineUrl: string, identity?: Identity) => ProcessInstanceHttpClient;
18
- createProcessModelClient: (engineUrl: string, identity?: Identity) => ProcessModelHttpClient;
19
- createUserTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => UserTaskHttpClient;
5
+ createApplicationInfoClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => ApplicationInfoHttpClient;
6
+ createCorrelationClient: (engineUrl: string, identity?: IdentityLike) => CorrelationHttpClient;
7
+ createCronJobClient: (engineUrl: string, identity?: IdentityLike) => CronjobHttpClient;
8
+ createDataObjectInstanceClient: (engineUrl: string, identity?: IdentityLike) => DataObjectInstanceHttpClient;
9
+ createUntypedTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => UntypedTaskHttpClient;
10
+ createEventClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => EventHttpClient;
11
+ createExternalTaskClient: (engineUrl: string, identity?: IdentityLike) => ExternalTaskClient;
12
+ createFlowNodeInstanceClient: (engineUrl: string, identity?: IdentityLike) => FlowNodeInstanceHttpClient;
13
+ createManualTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => ManualTaskHttpClient;
14
+ createNotificationClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => NotificationHttpClient;
15
+ createProcessDefinitionClient: (engineUrl: string, identity?: IdentityLike) => ProcessDefinitionHttpClient;
16
+ createProcessInstanceClient: (engineUrl: string, identity?: IdentityLike) => ProcessInstanceHttpClient;
17
+ createProcessModelClient: (engineUrl: string, identity?: IdentityLike) => ProcessModelHttpClient;
18
+ createUserTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => UserTaskHttpClient;
20
19
  };
@@ -1,10 +1,11 @@
1
- import { DataModels, IApplicationInfoExtensionAdapter, Identity, Subscription } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IApplicationInfoExtensionAdapter, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { Messages as ClientMessages } from '../Types/index';
3
4
  import { BaseClient } from './BaseClient';
4
5
  export declare class ApplicationInfoHttpClient extends BaseClient implements IApplicationInfoExtensionAdapter {
5
6
  getApplicationInfo(): Promise<DataModels.ApplicationInfo>;
6
7
  getAuthorityAddress(): Promise<string>;
7
- onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
8
- onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
9
- onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
8
+ onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
9
+ onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
10
+ onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
10
11
  }
@@ -1,25 +1,27 @@
1
- import { Identity, Subscription } from '@5minds/processcube_engine_sdk';
1
+ import { Subscription } from '@5minds/processcube_engine_sdk';
2
2
  import { HttpClient, IRequestOptions } from '../HttpClient';
3
+ import { IdentityAccessor, IdentityLike } from '../IdentityAccessor';
3
4
  import { SocketIoManager } from './Lib/SocketIoManager';
4
5
  export declare class BaseClient {
5
- identity: Identity;
6
+ identityAccessor: IdentityAccessor;
6
7
  protected httpClient: HttpClient;
7
8
  protected readonly socketIoManager: SocketIoManager;
8
9
  private readonly baseUrl;
9
10
  private readonly engineUrl;
10
- constructor(engineUrl: string, identity: Identity, socketIoManager?: SocketIoManager);
11
+ constructor(engineUrl: string, identity: IdentityLike, socketIoManager?: SocketIoManager);
11
12
  get connected(): boolean;
12
13
  /**
13
14
  * Gets the url of the engine that this client is communicating with.
14
15
  */
15
16
  getEngineUrl(): string;
16
- isSocketConnected(identity?: Identity): boolean;
17
- disconnectSocket(identity: Identity): void;
17
+ isSocketConnected(identityAccessor?: IdentityLike): boolean;
18
+ disconnectSocket(identityAccessor?: IdentityLike): void;
18
19
  dispose(): void;
19
20
  protected buildUrl<TQuery, TSort>(url: string, offset?: number, limit?: number, query?: TQuery, sortSettings?: TSort): string;
20
- protected createRequestAuthHeaders(identity: Identity): IRequestOptions;
21
- protected createSocketIoSubscription(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: Identity): Subscription;
22
- protected removeSocketIoSubscription(subscription: Subscription, identity?: Identity): void;
21
+ protected createRequestAuthHeaders(identityAccessor?: IdentityLike): Promise<IRequestOptions>;
22
+ protected createSocketIoSubscription(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: IdentityLike): Promise<Subscription>;
23
+ protected createSocketIoSubscriptionSync(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: IdentityLike): Subscription;
24
+ protected removeSocketIoSubscription(subscription: Subscription, identity?: IdentityLike): void;
23
25
  protected addParameterToUrl<TValue>(url: string, parameterName: string, parameterValue: TValue): string;
24
26
  private encodeQueryAndAddParametersToUrl;
25
27
  private encodeValue;
@@ -1,15 +1,16 @@
1
- import { DataModels, ICorrelationExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, ICorrelationExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class CorrelationHttpClient extends BaseClient implements ICorrelationExtensionAdapter {
4
5
  getAll(options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  includeProcessInstances?: boolean;
7
8
  offset?: number;
8
9
  limit?: number;
9
10
  sortSettings?: DataModels.Correlation.CorrelationSortSettings;
10
11
  }): Promise<DataModels.Correlation.CorrelationList>;
11
12
  getById(correlationId: string, options?: {
12
- identity?: Identity;
13
+ identity?: IdentityLike;
13
14
  includeProcessInstances?: boolean;
14
15
  }): Promise<DataModels.Correlation.Correlation>;
15
16
  }
@@ -1,12 +1,13 @@
1
- import { CronjobQuery, CronjobSortSettings, DeployedCronjobList, ICronjobExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { CronjobQuery, CronjobSortSettings, DeployedCronjobList, ICronjobExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class CronjobHttpClient extends BaseClient implements ICronjobExtensionAdapter {
4
5
  query(query: CronjobQuery, options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  offset?: number;
7
8
  limit?: number;
8
9
  sortSettings?: CronjobSortSettings;
9
10
  }): Promise<DeployedCronjobList>;
10
- enableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
11
- disableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
11
+ enableCronjob(processModelId: string, flowNodeId: string, identity?: IdentityLike): Promise<void>;
12
+ disableCronjob(processModelId: string, flowNodeId: string, identity?: IdentityLike): Promise<void>;
12
13
  }
@@ -1,8 +1,9 @@
1
- import { DataModels, IDataObjectInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IDataObjectInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class DataObjectInstanceHttpClient extends BaseClient implements IDataObjectInstanceExtensionAdapter {
4
5
  query(query: DataModels.DataObjects.DataObjectInstanceQuery, options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  offset?: number;
7
8
  limit?: number;
8
9
  sortSettings?: DataModels.DataObjects.DataObjectSortSettings;
@@ -1,9 +1,10 @@
1
1
  import { DataModels, IEventExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type EventList = DataModels.FlowNodeInstances.EventList;
4
5
  export declare class EventHttpClient extends BaseClient implements IEventExtensionAdapter {
5
6
  query(query: DataModels.FlowNodeInstances.EventQuery, options?: {
6
- identity?: Identity;
7
+ identity?: IdentityLike;
7
8
  offset?: number;
8
9
  limit?: number;
9
10
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
@@ -11,51 +12,51 @@ export declare class EventHttpClient extends BaseClient implements IEventExtensi
11
12
  triggerMessageEvent<TPayload>(messageName: string, options?: {
12
13
  processInstanceId?: string;
13
14
  payload?: TPayload;
14
- identity?: Identity;
15
+ identity?: IdentityLike;
15
16
  }): Promise<void>;
16
17
  triggerSignalEvent<TPayload>(signalName: string, options?: {
17
18
  processInstanceId?: string;
18
19
  payload?: TPayload;
19
- identity?: Identity;
20
+ identity?: IdentityLike;
20
21
  }): Promise<void>;
21
22
  triggerTimerEvent(flowNodeInstanceId: string, options?: {
22
23
  identity?: Identity;
23
24
  }): Promise<void>;
24
25
  onBoundaryEventTriggered(callback: Messages.CallbackTypes.OnBoundaryEventTriggeredCallback, options?: {
25
26
  subscribeOnce?: boolean;
26
- identity?: Identity;
27
+ identity?: IdentityLike;
27
28
  }): Promise<Subscription>;
28
29
  onBoundaryEventFinished(callback: Messages.CallbackTypes.OnBoundaryEventFinishedCallback, options?: {
29
30
  subscribeOnce?: boolean;
30
- identity?: Identity;
31
+ identity?: IdentityLike;
31
32
  }): Promise<Subscription>;
32
33
  onIntermediateThrowEventTriggered(callback: Messages.CallbackTypes.OnIntermediateThrowEventTriggeredCallback, options?: {
33
34
  subscribeOnce?: boolean;
34
- identity?: Identity;
35
+ identity?: IdentityLike;
35
36
  }): Promise<Subscription>;
36
37
  onIntermediateCatchEventReached(callback: Messages.CallbackTypes.OnIntermediateCatchEventReachedCallback, options?: {
37
38
  subscribeOnce?: boolean;
38
- identity?: Identity;
39
+ identity?: IdentityLike;
39
40
  }): Promise<Subscription>;
40
41
  onIntermediateCatchEventFinished(callback: Messages.CallbackTypes.OnIntermediateCatchEventFinishedCallback, options?: {
41
42
  subscribeOnce?: boolean;
42
- identity?: Identity;
43
+ identity?: IdentityLike;
43
44
  }): Promise<Subscription>;
44
45
  onMessageTriggered(callback: Messages.CallbackTypes.OnMessageTriggeredCallback, options?: {
45
46
  subscribeOnce?: boolean;
46
- identity?: Identity;
47
+ identity?: IdentityLike;
47
48
  }): Promise<Subscription>;
48
49
  onSignalTriggered(callback: Messages.CallbackTypes.OnSignalTriggeredCallback, options?: {
49
50
  subscribeOnce?: boolean;
50
- identity?: Identity;
51
+ identity?: IdentityLike;
51
52
  }): Promise<Subscription>;
52
53
  onStartEventFinished(callback: Messages.CallbackTypes.OnStartEventFinishedCallback, options?: {
53
54
  subscribeOnce?: boolean;
54
- identity?: Identity;
55
+ identity?: IdentityLike;
55
56
  }): Promise<Subscription>;
56
57
  onEndEventFinished(callback: Messages.CallbackTypes.OnEndEventFinishedCallback, options?: {
57
58
  subscribeOnce?: boolean;
58
- identity?: Identity;
59
+ identity?: IdentityLike;
59
60
  }): Promise<Subscription>;
60
61
  removeSubscription(subscription: Subscription, identity?: Identity): void;
61
62
  }
@@ -1,11 +1,12 @@
1
- import { DataModels, IExternalTaskExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IExternalTaskExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type ExternalTask<TPayload> = DataModels.ExternalTasks.ExternalTask<TPayload>;
4
5
  export declare class ExternalTaskApiClient extends BaseClient implements IExternalTaskExtensionAdapter {
5
- getAllDeployedTopics(identity?: Identity): Promise<Array<string>>;
6
- fetchAndLockExternalTasks<TPayload>(workerId: string, topicNames: string | Array<string>, maxTasks: number, longPollingTimeout: number, lockDuration: number, payloadFilter?: RegExp, identity?: Identity, abortSignal?: AbortSignal): Promise<Array<ExternalTask<TPayload>>>;
7
- extendLock(workerId: string, externalTaskId: string, additionalDuration: number, identity?: Identity, abortSignal?: AbortSignal): Promise<void>;
8
- handleError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskError, identity?: Identity, abortSignal?: AbortSignal): Promise<void>;
9
- finishExternalTask<TResultType>(workerId: string, externalTaskId: string, result: TResultType, identity?: Identity, abortSignal?: AbortSignal): Promise<void>;
6
+ getAllDeployedTopics(identity?: IdentityLike): Promise<Array<string>>;
7
+ fetchAndLockExternalTasks<TPayload>(workerId: string, topicNames: string | Array<string>, maxTasks: number, longPollingTimeout: number, lockDuration: number, payloadFilter?: RegExp, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<Array<ExternalTask<TPayload>>>;
8
+ extendLock(workerId: string, externalTaskId: string, additionalDuration: number, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>;
9
+ handleError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskError, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>;
10
+ finishExternalTask<TResultType>(workerId: string, externalTaskId: string, result: TResultType, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>;
10
11
  }
11
12
  export {};
@@ -1,13 +1,14 @@
1
- import { Identity } from '@5minds/processcube_engine_sdk';
2
1
  import { ExternalTaskWorker } from '../ExternalTaskWorker';
2
+ import { IdentityAccessor } from '../IdentityAccessor';
3
3
  import { HandleExternalTaskAction, IExternalTaskWorkerConfig } from '../Types/index';
4
4
  export declare class ExternalTaskClient {
5
5
  private engineUrl;
6
- private identity;
7
- constructor(engineUrl: string, identity: Identity);
6
+ private identityAccessor;
7
+ constructor(engineUrl: string, identity?: IdentityAccessor);
8
8
  /**
9
9
  * Gets the url of the engine that this client is communicating with.
10
10
  */
11
11
  getEngineUrl(): string;
12
+ dispose(): void;
12
13
  subscribeToExternalTaskTopic<TExternalTaskPayload, TResultPayload extends object>(topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig): Promise<ExternalTaskWorker<TExternalTaskPayload, TResultPayload>>;
13
14
  }
@@ -1,23 +1,24 @@
1
- import { DataModels, IFlowNodeInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IFlowNodeInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class FlowNodeInstanceHttpClient extends BaseClient implements IFlowNodeInstanceExtensionAdapter {
4
5
  query(query: DataModels.FlowNodeInstances.GenericFlowNodeInstanceQuery, options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  offset?: number;
7
8
  limit?: number;
8
9
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
9
10
  }): Promise<DataModels.FlowNodeInstances.FlowNodeInstanceList>;
10
- finishUntypedTask(taskInstanceId: string, identity?: Identity): Promise<void>;
11
- finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>;
12
- finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: Identity): Promise<void>;
11
+ finishUntypedTask(taskInstanceId: string, identity?: IdentityLike): Promise<void>;
12
+ finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>;
13
+ finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>;
13
14
  triggerMessageEvent<TPayload>(messageName: string, options?: {
14
15
  processInstanceId?: string;
15
16
  payload?: TPayload;
16
- identity?: Identity;
17
+ identity?: IdentityLike;
17
18
  }): Promise<void>;
18
19
  triggerSignalEvent<TPayload>(signalName: string, options?: {
19
20
  processInstanceId?: string;
20
21
  payload?: TPayload;
21
- identity?: Identity;
22
+ identity?: IdentityLike;
22
23
  }): Promise<void>;
23
24
  }
@@ -1,36 +1,23 @@
1
1
  import { Socket } from 'socket.io-client';
2
- import { Identity, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { Subscription } from '@5minds/processcube_engine_sdk';
3
+ import { IdentityAccessor } from '../../IdentityAccessor';
3
4
  export declare class SocketIoManager {
4
5
  private readonly engineUrl;
6
+ private logger;
5
7
  private socketCollection;
6
- private subscriptionCollection;
7
8
  constructor(engineUrl: string);
8
- /**
9
- * Disconnects the socket associated with the given identity.
10
- *
11
- * @param identity The identity to disconnect.
12
- */
13
- disconnectSocket(identity: Identity): void;
14
- /**
15
- * Disposes all sockets.
16
- */
9
+ disconnectSocket(accessor: IdentityAccessor): void;
17
10
  dispose(): void;
18
- /**
19
- * Creates a new socket.io subscription for the given eventName.
20
- *
21
- * @param identity The identity for which to create the subscription.
22
- * @param eventName The event to subscribe to.
23
- * @param callback The callback to execute when the event gets triggered.
24
- * @param subscribeOnce If true, the subscription will be disposed after the event was received once.
25
- */
26
- createSocketIoSubscription(identity: Identity, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription;
27
- /**
28
- * Removes the given subscription from the socket associated with the given identity.
29
- *
30
- * @param identity The identity for which to remove a subscription.
31
- * @param subscription The subscription to remove.
32
- */
33
- removeSocketIoSubscription(identity: Identity, subscription: Subscription): void;
34
- getSocketForIdentity(identity: Identity): Socket;
11
+ createSocketIoSubscriptionSync(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription;
12
+ createSocketIoSubscription(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Promise<Subscription>;
13
+ removeSocketIoSubscription(accessor: IdentityAccessor, subscription: Subscription): void;
14
+ getSocketForIdentity(accessor: IdentityAccessor): Socket;
15
+ private createSocketForIdentitySync;
35
16
  private createSocketForIdentity;
17
+ private buildSocketWithContext;
18
+ private getSocketContext;
19
+ private ensureSocketContextIsinitialized;
20
+ private addNewSubscriptionToSocketContext;
21
+ private getRecreateWhenIdentityIsRefreshedFunction;
22
+ private applySubscriptionsToSocket;
36
23
  }
@@ -1,22 +1,23 @@
1
- import { DataModels, IManualTaskExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IManualTaskExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type ManualTaskList = DataModels.FlowNodeInstances.ManualTaskList;
4
5
  export declare class ManualTaskHttpClient extends BaseClient implements IManualTaskExtensionAdapter {
5
6
  query(query: DataModels.FlowNodeInstances.ManualTaskQuery, options?: {
6
- identity?: Identity;
7
+ identity?: IdentityLike;
7
8
  offset?: number;
8
9
  limit?: number;
9
10
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
10
11
  }): Promise<ManualTaskList>;
11
- finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>;
12
+ finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>;
12
13
  onManualTaskWaiting(callback: Messages.CallbackTypes.OnManualTaskWaitingCallback, options?: {
13
14
  subscribeOnce?: boolean;
14
- identity?: Identity;
15
+ identity?: IdentityLike;
15
16
  }): Promise<Subscription>;
16
17
  onManualTaskFinished(callback: Messages.CallbackTypes.OnManualTaskFinishedCallback, options?: {
17
18
  subscribeOnce?: boolean;
18
- identity?: Identity;
19
+ identity?: IdentityLike;
19
20
  }): Promise<Subscription>;
20
- removeSubscription(subscription: Subscription, identity?: Identity): void;
21
+ removeSubscription(subscription: Subscription, identity?: IdentityLike): void;
21
22
  }
22
23
  export {};