@codex-ts/core-lib 1.1.6 → 2.0.0
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/fesm2022/codex-ts-core-lib.mjs +239 -20
- package/fesm2022/codex-ts-core-lib.mjs.map +1 -1
- package/lib/components/base-task-dashboard.component.d.ts +5 -0
- package/lib/models/base-task.model.d.ts +5 -0
- package/lib/models/workflow.model.d.ts +9 -0
- package/lib/services/base-task.service.d.ts +7 -0
- package/lib/services/http-utility.service.d.ts +3 -0
- package/lib/services/task-entity-service.interface.d.ts +3 -0
- package/lib/workflow-engine/workflow-engine-api.service.d.ts +104 -0
- package/lib/workflow-engine/workflow-engine.models.d.ts +236 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -1516,6 +1516,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
1516
1516
|
* Base component for all task dashboard components in the application.
|
|
1517
1517
|
* Provides common functionality for task management operations while
|
|
1518
1518
|
* inheriting table functionality from BaseTableComponent.
|
|
1519
|
+
*
|
|
1520
|
+
* @deprecated Depends on {@link TaskEntityService}, which targets a Java controller
|
|
1521
|
+
* (`BaseTaskController`) that no longer exists — see that interface's `@deprecated` note. Build
|
|
1522
|
+
* queue/dashboard UIs against `WorkflowEngineApiService` from `workflow-engine/` instead, which
|
|
1523
|
+
* targets `workflow-engine-lib`'s actual `/workflow/queue` endpoints.
|
|
1519
1524
|
*/
|
|
1520
1525
|
class BaseTaskDashboardComponent extends BaseTableComponent {
|
|
1521
1526
|
entityService;
|
|
@@ -2427,7 +2432,10 @@ class KeycloakAuthInterceptor {
|
|
|
2427
2432
|
});
|
|
2428
2433
|
return next.handle(authReq);
|
|
2429
2434
|
}), catchError((error) => {
|
|
2430
|
-
|
|
2435
|
+
// Only re-authenticate on 401 (missing/expired credentials). A 403 means the
|
|
2436
|
+
// user IS authenticated but lacks permission — re-login won't grant it and
|
|
2437
|
+
// would needlessly discard app state, so let the app handle 403 itself.
|
|
2438
|
+
if (error.status === 401) {
|
|
2431
2439
|
this.keycloakService.login();
|
|
2432
2440
|
}
|
|
2433
2441
|
return throwError(() => error);
|
|
@@ -2617,10 +2625,22 @@ class HttpUtilityService {
|
|
|
2617
2625
|
messageService;
|
|
2618
2626
|
loading = new BehaviorSubject(false);
|
|
2619
2627
|
loading$ = this.loading.asObservable();
|
|
2628
|
+
// Reference count of in-flight requests. A single boolean flag was buggy: when
|
|
2629
|
+
// concurrent requests overlapped, the first to finish flipped loading to false
|
|
2630
|
+
// while others were still running. Emit loading = (inFlight > 0) instead.
|
|
2631
|
+
inFlight = 0;
|
|
2620
2632
|
constructor(http, messageService) {
|
|
2621
2633
|
this.http = http;
|
|
2622
2634
|
this.messageService = messageService;
|
|
2623
2635
|
}
|
|
2636
|
+
startLoading() {
|
|
2637
|
+
this.inFlight++;
|
|
2638
|
+
this.loading.next(this.inFlight > 0);
|
|
2639
|
+
}
|
|
2640
|
+
endLoading() {
|
|
2641
|
+
this.inFlight = Math.max(0, this.inFlight - 1);
|
|
2642
|
+
this.loading.next(this.inFlight > 0);
|
|
2643
|
+
}
|
|
2624
2644
|
/**
|
|
2625
2645
|
* Perform a GET request with enhanced options
|
|
2626
2646
|
* @param url The endpoint URL
|
|
@@ -2628,7 +2648,7 @@ class HttpUtilityService {
|
|
|
2628
2648
|
* @returns An observable of the response
|
|
2629
2649
|
*/
|
|
2630
2650
|
get(url, options) {
|
|
2631
|
-
this.
|
|
2651
|
+
this.startLoading();
|
|
2632
2652
|
let request$ = this.http.get(url, {
|
|
2633
2653
|
params: options?.params,
|
|
2634
2654
|
headers: options?.headers,
|
|
@@ -2641,7 +2661,7 @@ class HttpUtilityService {
|
|
|
2641
2661
|
if (options?.timeoutMs) {
|
|
2642
2662
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2643
2663
|
}
|
|
2644
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2664
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2645
2665
|
}
|
|
2646
2666
|
/**
|
|
2647
2667
|
* Perform a POST request with enhanced options
|
|
@@ -2651,7 +2671,7 @@ class HttpUtilityService {
|
|
|
2651
2671
|
* @returns An observable of the response
|
|
2652
2672
|
*/
|
|
2653
2673
|
post(url, body, options) {
|
|
2654
|
-
this.
|
|
2674
|
+
this.startLoading();
|
|
2655
2675
|
let request$ = this.http.post(url, body, {
|
|
2656
2676
|
params: options?.params,
|
|
2657
2677
|
headers: options?.headers,
|
|
@@ -2664,7 +2684,7 @@ class HttpUtilityService {
|
|
|
2664
2684
|
if (options?.timeoutMs) {
|
|
2665
2685
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2666
2686
|
}
|
|
2667
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2687
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2668
2688
|
}
|
|
2669
2689
|
/**
|
|
2670
2690
|
* Perform a PUT request with enhanced options
|
|
@@ -2674,7 +2694,7 @@ class HttpUtilityService {
|
|
|
2674
2694
|
* @returns An observable of the response
|
|
2675
2695
|
*/
|
|
2676
2696
|
put(url, body, options) {
|
|
2677
|
-
this.
|
|
2697
|
+
this.startLoading();
|
|
2678
2698
|
let request$ = this.http.put(url, body, {
|
|
2679
2699
|
params: options?.params,
|
|
2680
2700
|
headers: options?.headers,
|
|
@@ -2687,7 +2707,7 @@ class HttpUtilityService {
|
|
|
2687
2707
|
if (options?.timeoutMs) {
|
|
2688
2708
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2689
2709
|
}
|
|
2690
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2710
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2691
2711
|
}
|
|
2692
2712
|
/**
|
|
2693
2713
|
* Perform a PATCH request with enhanced options
|
|
@@ -2697,7 +2717,7 @@ class HttpUtilityService {
|
|
|
2697
2717
|
* @returns An observable of the response
|
|
2698
2718
|
*/
|
|
2699
2719
|
patch(url, body, options) {
|
|
2700
|
-
this.
|
|
2720
|
+
this.startLoading();
|
|
2701
2721
|
let request$ = this.http.patch(url, body, {
|
|
2702
2722
|
params: options?.params,
|
|
2703
2723
|
headers: options?.headers,
|
|
@@ -2710,7 +2730,7 @@ class HttpUtilityService {
|
|
|
2710
2730
|
if (options?.timeoutMs) {
|
|
2711
2731
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2712
2732
|
}
|
|
2713
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2733
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2714
2734
|
}
|
|
2715
2735
|
/**
|
|
2716
2736
|
* Perform a DELETE request with enhanced options
|
|
@@ -2719,7 +2739,7 @@ class HttpUtilityService {
|
|
|
2719
2739
|
* @returns An observable of the response
|
|
2720
2740
|
*/
|
|
2721
2741
|
delete(url, options) {
|
|
2722
|
-
this.
|
|
2742
|
+
this.startLoading();
|
|
2723
2743
|
let request$ = this.http.delete(url, {
|
|
2724
2744
|
params: options?.params,
|
|
2725
2745
|
headers: options?.headers,
|
|
@@ -2732,7 +2752,7 @@ class HttpUtilityService {
|
|
|
2732
2752
|
if (options?.timeoutMs) {
|
|
2733
2753
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2734
2754
|
}
|
|
2735
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2755
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2736
2756
|
}
|
|
2737
2757
|
/**
|
|
2738
2758
|
* Upload a file with optional additional data
|
|
@@ -2743,7 +2763,7 @@ class HttpUtilityService {
|
|
|
2743
2763
|
* @returns An observable of the response
|
|
2744
2764
|
*/
|
|
2745
2765
|
uploadFile(url, file, additionalData, options) {
|
|
2746
|
-
this.
|
|
2766
|
+
this.startLoading();
|
|
2747
2767
|
const formData = new FormData();
|
|
2748
2768
|
formData.append('file', file, file.name);
|
|
2749
2769
|
if (additionalData) {
|
|
@@ -2786,16 +2806,16 @@ class HttpUtilityService {
|
|
|
2786
2806
|
},
|
|
2787
2807
|
error: (error) => {
|
|
2788
2808
|
observer.error(this.handleError(error));
|
|
2789
|
-
this.
|
|
2809
|
+
this.endLoading();
|
|
2790
2810
|
},
|
|
2791
2811
|
complete: () => {
|
|
2792
|
-
this.
|
|
2812
|
+
this.endLoading();
|
|
2793
2813
|
}
|
|
2794
2814
|
});
|
|
2795
2815
|
});
|
|
2796
2816
|
}
|
|
2797
2817
|
// Standard request without progress tracking
|
|
2798
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2818
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2799
2819
|
}
|
|
2800
2820
|
/**
|
|
2801
2821
|
* Execute multiple HTTP requests in parallel
|
|
@@ -2803,8 +2823,8 @@ class HttpUtilityService {
|
|
|
2803
2823
|
* @returns An observable that emits when all requests complete
|
|
2804
2824
|
*/
|
|
2805
2825
|
batchRequests(requests) {
|
|
2806
|
-
this.
|
|
2807
|
-
return forkJoin(requests).pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2826
|
+
this.startLoading();
|
|
2827
|
+
return forkJoin(requests).pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2808
2828
|
}
|
|
2809
2829
|
/**
|
|
2810
2830
|
* Download a file from the server
|
|
@@ -2813,7 +2833,7 @@ class HttpUtilityService {
|
|
|
2813
2833
|
* @param options Additional request options
|
|
2814
2834
|
*/
|
|
2815
2835
|
downloadFile(url, filename, options) {
|
|
2816
|
-
this.
|
|
2836
|
+
this.startLoading();
|
|
2817
2837
|
let request$ = this.http.get(url, {
|
|
2818
2838
|
params: options?.params,
|
|
2819
2839
|
headers: options?.headers,
|
|
@@ -2823,7 +2843,7 @@ class HttpUtilityService {
|
|
|
2823
2843
|
if (options?.timeoutMs) {
|
|
2824
2844
|
request$ = request$.pipe(timeout(options.timeoutMs));
|
|
2825
2845
|
}
|
|
2826
|
-
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.
|
|
2846
|
+
return request$.pipe(catchError$1(this.handleError.bind(this)), finalize$1(() => this.endLoading()));
|
|
2827
2847
|
}
|
|
2828
2848
|
/**
|
|
2829
2849
|
* Create parameter string from an object
|
|
@@ -2917,6 +2937,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
2917
2937
|
/**
|
|
2918
2938
|
* Base service for task-related operations that extends the BaseCrudService.
|
|
2919
2939
|
* Implements endpoints defined in Java BaseTaskController.
|
|
2940
|
+
*
|
|
2941
|
+
* @deprecated `BaseTaskController` (the Java controller this service's `sendEvent`/`PUT
|
|
2942
|
+
* /{uuid}/event/{event}` call targets) no longer exists — it was deleted along with
|
|
2943
|
+
* `microservice-starter-lib`'s Spring-State-Machine-based workflow subsystem in favor of
|
|
2944
|
+
* `workflow-engine-lib`. Calling `sendEvent` against any current backend will 404. Use
|
|
2945
|
+
* `WorkflowEngineApiService` from `workflow-engine/` instead, which targets the actual current
|
|
2946
|
+
* engine API (`claim`/`unclaim`/`start`/`complete`/`reject`/`reassign` on `/workflow/tasks`).
|
|
2920
2947
|
*/
|
|
2921
2948
|
class BaseTaskService extends BaseEntityService {
|
|
2922
2949
|
httpUtility;
|
|
@@ -4639,6 +4666,198 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
4639
4666
|
`, styles: [":host{display:block;min-height:100vh;background-color:var(--surface-ground)}\n"] }]
|
|
4640
4667
|
}] });
|
|
4641
4668
|
|
|
4669
|
+
/**
|
|
4670
|
+
* Types mirroring `workflow-engine-lib`'s REST contract (`WorkflowDtos.java`), field-for-field.
|
|
4671
|
+
*
|
|
4672
|
+
* This is a separate concept from this library's older `Workflow`/`BaseTask` models, which
|
|
4673
|
+
* targeted a different, now-removed Java controller (`microservice-starter-lib`'s
|
|
4674
|
+
* Spring-State-Machine-based `BaseWorkflowController`/`BaseTaskController`, deleted in favor of
|
|
4675
|
+
* `workflow-engine-lib`). See those models' `@deprecated` notices for the distinction.
|
|
4676
|
+
*/
|
|
4677
|
+
/** The group name whose attributes belong in the queue row rather than a detail panel. */
|
|
4678
|
+
const WORKFLOW_PRIMARY_GROUP = 'primary';
|
|
4679
|
+
|
|
4680
|
+
/**
|
|
4681
|
+
* Client for `workflow-engine-lib`'s REST API — the data-driven engine that replaced
|
|
4682
|
+
* `microservice-starter-lib`'s Spring-State-Machine-based workflow subsystem.
|
|
4683
|
+
*
|
|
4684
|
+
* Follows this library's established DI convention (see {@link BaseEntityService}): not
|
|
4685
|
+
* `providedIn: 'root'`, constructed with the backend base URL by the consuming application —
|
|
4686
|
+
* *
|
|
4687
|
+
* ```ts
|
|
4688
|
+
* providers: [{
|
|
4689
|
+
* provide: WorkflowEngineApiService,
|
|
4690
|
+
* useFactory: (http: HttpUtilityService, utils: UtilsService, msg: MessageService) =>
|
|
4691
|
+
* new WorkflowEngineApiService(http, utils, 'https://api.example.com/workflow', msg),
|
|
4692
|
+
* deps: [HttpUtilityService, UtilsService, MessageService],
|
|
4693
|
+
* }]
|
|
4694
|
+
* ```
|
|
4695
|
+
*
|
|
4696
|
+
* Every method maps one-to-one onto an engine endpoint; nothing here is business-specific.
|
|
4697
|
+
*
|
|
4698
|
+
* Deliberately not decorated with {@code @Injectable()} — like {@link BaseEntityService}, this
|
|
4699
|
+
* class is always provided via an explicit `useFactory`/`useClass` provider (see above), never
|
|
4700
|
+
* auto-constructed by Angular's injector, so its constructor isn't required to be fully
|
|
4701
|
+
* DI-resolvable (`backendBaseUrl: string` isn't a valid injection token on its own).
|
|
4702
|
+
*/
|
|
4703
|
+
class WorkflowEngineApiService {
|
|
4704
|
+
httpUtility;
|
|
4705
|
+
utilsService;
|
|
4706
|
+
backendBaseUrl;
|
|
4707
|
+
messageService;
|
|
4708
|
+
apiUrl;
|
|
4709
|
+
/**
|
|
4710
|
+
* Creates the client.
|
|
4711
|
+
*
|
|
4712
|
+
* @param httpUtility HTTP requests, loading state, standardised error handling
|
|
4713
|
+
* @param utilsService UUID validation
|
|
4714
|
+
* @param backendBaseUrl base URL of the service hosting `workflow-engine-lib`, e.g.
|
|
4715
|
+
* `https://api.example.com/workflow`
|
|
4716
|
+
* @param messageService optional, shown on client-side validation failures
|
|
4717
|
+
*/
|
|
4718
|
+
constructor(httpUtility, utilsService, backendBaseUrl, messageService) {
|
|
4719
|
+
this.httpUtility = httpUtility;
|
|
4720
|
+
this.utilsService = utilsService;
|
|
4721
|
+
this.backendBaseUrl = backendBaseUrl;
|
|
4722
|
+
this.messageService = messageService;
|
|
4723
|
+
this.apiUrl = backendBaseUrl.replace(/\/+$/, '');
|
|
4724
|
+
}
|
|
4725
|
+
requireUuid(value) {
|
|
4726
|
+
if (this.utilsService.isValidUUID(value)) {
|
|
4727
|
+
return null;
|
|
4728
|
+
}
|
|
4729
|
+
this.utilsService.showError('Invalid UUID format', this.messageService);
|
|
4730
|
+
return throwError(() => new Error('Invalid UUID format'));
|
|
4731
|
+
}
|
|
4732
|
+
// ---------------------------------------------------------------- tasks
|
|
4733
|
+
/** Finds a task by id. `GET /tasks/{id}` */
|
|
4734
|
+
getTask(id) {
|
|
4735
|
+
return this.requireUuid(id) ?? this.httpUtility.get(`${this.apiUrl}/tasks/${id}`);
|
|
4736
|
+
}
|
|
4737
|
+
/** Claims a task out of a shared queue. `POST /tasks/{id}/claim` */
|
|
4738
|
+
claimTask(id) {
|
|
4739
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/claim`, {});
|
|
4740
|
+
}
|
|
4741
|
+
/** Releases a claim, returning the task to its queue. `POST /tasks/{id}/unclaim` */
|
|
4742
|
+
unclaimTask(id) {
|
|
4743
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/unclaim`, {});
|
|
4744
|
+
}
|
|
4745
|
+
/** Marks work on a task as actively started. `POST /tasks/{id}/start` */
|
|
4746
|
+
startTask(id) {
|
|
4747
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/start`, {});
|
|
4748
|
+
}
|
|
4749
|
+
/** Completes a task and resumes its workflow. `POST /tasks/{id}/complete` */
|
|
4750
|
+
completeTask(id, request = {}) {
|
|
4751
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/complete`, request);
|
|
4752
|
+
}
|
|
4753
|
+
/** Rejects a task, resuming its workflow down a different path. `POST /tasks/{id}/reject` */
|
|
4754
|
+
rejectTask(id, request = {}) {
|
|
4755
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/reject`, request);
|
|
4756
|
+
}
|
|
4757
|
+
/** Reassigns a task to a different subject. `POST /tasks/{id}/reassign` */
|
|
4758
|
+
reassignTask(id, request) {
|
|
4759
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/tasks/${id}/reassign`, request);
|
|
4760
|
+
}
|
|
4761
|
+
// ---------------------------------------------------------------- instances
|
|
4762
|
+
/** Starts a new workflow instance. `POST /instances` */
|
|
4763
|
+
startInstance(request) {
|
|
4764
|
+
return this.httpUtility.post(`${this.apiUrl}/instances`, request);
|
|
4765
|
+
}
|
|
4766
|
+
/** Finds an instance by id. `GET /instances/{id}` */
|
|
4767
|
+
getInstance(id) {
|
|
4768
|
+
return this.requireUuid(id) ?? this.httpUtility.get(`${this.apiUrl}/instances/${id}`);
|
|
4769
|
+
}
|
|
4770
|
+
/** Finds instances by business key. `GET /instances?businessKey=...` */
|
|
4771
|
+
findInstancesByBusinessKey(businessKey) {
|
|
4772
|
+
return this.httpUtility.get(`${this.apiUrl}/instances`, {
|
|
4773
|
+
params: { businessKey },
|
|
4774
|
+
});
|
|
4775
|
+
}
|
|
4776
|
+
/** Loads an instance's audit history, oldest first. `GET /instances/{id}/history` */
|
|
4777
|
+
instanceHistory(id) {
|
|
4778
|
+
return this.requireUuid(id) ?? this.httpUtility.get(`${this.apiUrl}/instances/${id}/history`);
|
|
4779
|
+
}
|
|
4780
|
+
/** Reads an instance's current variables. `GET /instances/{id}/variables` */
|
|
4781
|
+
getInstanceVariables(id) {
|
|
4782
|
+
return this.requireUuid(id) ?? this.httpUtility.get(`${this.apiUrl}/instances/${id}/variables`);
|
|
4783
|
+
}
|
|
4784
|
+
/** Sets or replaces instance variables outside of any node execution. `PUT /instances/{id}/variables` */
|
|
4785
|
+
setInstanceVariables(id, request) {
|
|
4786
|
+
return this.requireUuid(id) ?? this.httpUtility.put(`${this.apiUrl}/instances/${id}/variables`, request);
|
|
4787
|
+
}
|
|
4788
|
+
/** Signals an external event to a waiting instance. `POST /instances/{id}/signal` */
|
|
4789
|
+
signalInstance(id, request) {
|
|
4790
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/instances/${id}/signal`, request);
|
|
4791
|
+
}
|
|
4792
|
+
/** Cancels a running instance and withdraws its open tasks. `POST /instances/{id}/cancel` */
|
|
4793
|
+
cancelInstance(id, request = {}) {
|
|
4794
|
+
return this.requireUuid(id) ?? this.httpUtility.post(`${this.apiUrl}/instances/${id}/cancel`, request);
|
|
4795
|
+
}
|
|
4796
|
+
// ---------------------------------------------------------------- definitions
|
|
4797
|
+
/** Deploys a workflow definition, creating a new immutable version. `POST /definitions` */
|
|
4798
|
+
deployDefinition(request) {
|
|
4799
|
+
return this.httpUtility.post(`${this.apiUrl}/definitions`, request);
|
|
4800
|
+
}
|
|
4801
|
+
/** Lists every workflow definition. `GET /definitions` */
|
|
4802
|
+
listDefinitions() {
|
|
4803
|
+
return this.httpUtility.get(`${this.apiUrl}/definitions`);
|
|
4804
|
+
}
|
|
4805
|
+
/** Finds a definition by key. `GET /definitions/{key}` */
|
|
4806
|
+
getDefinition(key) {
|
|
4807
|
+
return this.httpUtility.get(`${this.apiUrl}/definitions/${key}`);
|
|
4808
|
+
}
|
|
4809
|
+
/** Lists every deployed version of a definition. `GET /definitions/{key}/versions` */
|
|
4810
|
+
listVersions(key) {
|
|
4811
|
+
return this.httpUtility.get(`${this.apiUrl}/definitions/${key}/versions`);
|
|
4812
|
+
}
|
|
4813
|
+
/** Loads the active version's authored document. `GET /definitions/{key}/versions/active` */
|
|
4814
|
+
activeVersion(key) {
|
|
4815
|
+
return this.httpUtility.get(`${this.apiUrl}/definitions/${key}/versions/active`);
|
|
4816
|
+
}
|
|
4817
|
+
/** Activates a specific version. `POST /definitions/{key}/versions/{versionNumber}/activate` */
|
|
4818
|
+
activateVersion(key, versionNumber) {
|
|
4819
|
+
return this.httpUtility.post(`${this.apiUrl}/definitions/${key}/versions/${versionNumber}/activate`, {});
|
|
4820
|
+
}
|
|
4821
|
+
// ---------------------------------------------------------------- queue
|
|
4822
|
+
/** Loads one of the queue views. `GET /queue/{view}` */
|
|
4823
|
+
queue(view, page = 0, size = 20) {
|
|
4824
|
+
return this.httpUtility.get(`${this.apiUrl}/queue/${view}`, {
|
|
4825
|
+
params: { page, size },
|
|
4826
|
+
});
|
|
4827
|
+
}
|
|
4828
|
+
/** Searches the queue with structured criteria. `POST /queue/search` */
|
|
4829
|
+
searchQueue(criteria = {}, page = 0, size = 20) {
|
|
4830
|
+
return this.httpUtility.post(`${this.apiUrl}/queue/search`, criteria, {
|
|
4831
|
+
params: { page, size },
|
|
4832
|
+
});
|
|
4833
|
+
}
|
|
4834
|
+
// ---------------------------------------------------------------- business objects
|
|
4835
|
+
/** Registers a business object type, or updates one with the same code. `POST /business-objects` */
|
|
4836
|
+
registerBusinessObject(request) {
|
|
4837
|
+
return this.httpUtility.post(`${this.apiUrl}/business-objects`, request);
|
|
4838
|
+
}
|
|
4839
|
+
/** Lists every registered business object. `GET /business-objects` */
|
|
4840
|
+
listBusinessObjects() {
|
|
4841
|
+
return this.httpUtility.get(`${this.apiUrl}/business-objects`);
|
|
4842
|
+
}
|
|
4843
|
+
/** Finds one business object, including the workflows bound to it. `GET /business-objects/{code}` */
|
|
4844
|
+
getBusinessObject(code) {
|
|
4845
|
+
return this.httpUtility.get(`${this.apiUrl}/business-objects/${code}`);
|
|
4846
|
+
}
|
|
4847
|
+
/** Registers a new version of a form under a business object. `POST /business-objects/{code}/forms` */
|
|
4848
|
+
registerForm(code, request) {
|
|
4849
|
+
return this.httpUtility.post(`${this.apiUrl}/business-objects/${code}/forms`, request);
|
|
4850
|
+
}
|
|
4851
|
+
/** Lists every form registered under a business object. `GET /business-objects/{code}/forms` */
|
|
4852
|
+
listForms(code) {
|
|
4853
|
+
return this.httpUtility.get(`${this.apiUrl}/business-objects/${code}/forms`);
|
|
4854
|
+
}
|
|
4855
|
+
/** Finds the active form version a new task would render. `GET /business-objects/{code}/forms/{formKey}` */
|
|
4856
|
+
activeForm(code, formKey) {
|
|
4857
|
+
return this.httpUtility.get(`${this.apiUrl}/business-objects/${code}/forms/${formKey}`);
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
|
|
4642
4861
|
/*
|
|
4643
4862
|
* Public API Surface of core-lib
|
|
4644
4863
|
*/
|
|
@@ -4648,5 +4867,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
4648
4867
|
* Generated bundle index. Do not edit.
|
|
4649
4868
|
*/
|
|
4650
4869
|
|
|
4651
|
-
export { AppConstants, AppMessages, BaseEntityService, BaseErrorService, BaseFormComponent, BaseListPageComponent, BaseListTabbedFormComponent, BasePageComponent, BaseTabbedFormComponent, BaseTableComponent, BaseTaskDashboardComponent, BaseTaskDetailsComponent, BaseTaskService, CommonValidators, ComponentContext, CoreFormlyModule, ERROR_SERVICE, EntityRegistryService, EnumRegistryService, FORMLY_TYPES, FORMLY_WRAPPERS, FormFieldWrapper, FormService, FormlyConfigService, HttpUtilityService, IndianDatePipe, KEYCLOAK_CONFIG, KEYCLOAK_SERVICE, KeycloakAuthGuard, KeycloakErrorPageComponent, KeycloakService, NotFoundComponent, NotificationService, PrimeNGFormlyModule, ReferenceDataProviderService, TabbedFormType, TableColumnDatatype, TaskRole, UnauthorizedComponent, UtilsService, provideKeycloak };
|
|
4870
|
+
export { AppConstants, AppMessages, BaseEntityService, BaseErrorService, BaseFormComponent, BaseListPageComponent, BaseListTabbedFormComponent, BasePageComponent, BaseTabbedFormComponent, BaseTableComponent, BaseTaskDashboardComponent, BaseTaskDetailsComponent, BaseTaskService, CommonValidators, ComponentContext, CoreFormlyModule, ERROR_SERVICE, EntityRegistryService, EnumRegistryService, FORMLY_TYPES, FORMLY_WRAPPERS, FormFieldWrapper, FormService, FormlyConfigService, HttpUtilityService, IndianDatePipe, KEYCLOAK_CONFIG, KEYCLOAK_SERVICE, KeycloakAuthGuard, KeycloakErrorPageComponent, KeycloakService, NotFoundComponent, NotificationService, PrimeNGFormlyModule, ReferenceDataProviderService, TabbedFormType, TableColumnDatatype, TaskRole, UnauthorizedComponent, UtilsService, WORKFLOW_PRIMARY_GROUP, WorkflowEngineApiService, provideKeycloak };
|
|
4652
4871
|
//# sourceMappingURL=codex-ts-core-lib.mjs.map
|