@io-orkes/conductor-javascript 2.0.0 → 2.0.1-alpha
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/README.md +2 -2
- package/dist/index.d.mts +83 -1
- package/dist/index.d.ts +83 -1
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +141 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3577,6 +3577,146 @@ var workflow = (name, tasks) => ({
|
|
|
3577
3577
|
timeoutSeconds: 0
|
|
3578
3578
|
});
|
|
3579
3579
|
|
|
3580
|
+
// src/core/schedulerClient.ts
|
|
3581
|
+
var SchedulerClient = class {
|
|
3582
|
+
_client;
|
|
3583
|
+
constructor(client) {
|
|
3584
|
+
this._client = client;
|
|
3585
|
+
}
|
|
3586
|
+
/**
|
|
3587
|
+
* Create or update a schedule for a specified workflow with a corresponding start workflow request
|
|
3588
|
+
* @param requestBody
|
|
3589
|
+
* @returns
|
|
3590
|
+
*/
|
|
3591
|
+
saveSchedule(param) {
|
|
3592
|
+
return tryCatchReThrow(
|
|
3593
|
+
() => this._client.schedulerResource.saveSchedule(param)
|
|
3594
|
+
);
|
|
3595
|
+
}
|
|
3596
|
+
/**
|
|
3597
|
+
* Searches for existing scheduler execution based on below parameters
|
|
3598
|
+
*
|
|
3599
|
+
* @param start
|
|
3600
|
+
* @param size
|
|
3601
|
+
* @param sort
|
|
3602
|
+
* @param freeText
|
|
3603
|
+
* @param query
|
|
3604
|
+
* @returns SearchResultWorkflowScheduleExecutionModel
|
|
3605
|
+
*/
|
|
3606
|
+
search(start, size, sort = "", freeText, query) {
|
|
3607
|
+
return tryCatchReThrow(
|
|
3608
|
+
() => this._client.schedulerResource.searchV21(
|
|
3609
|
+
start,
|
|
3610
|
+
size,
|
|
3611
|
+
sort,
|
|
3612
|
+
freeText,
|
|
3613
|
+
query
|
|
3614
|
+
)
|
|
3615
|
+
);
|
|
3616
|
+
}
|
|
3617
|
+
/**
|
|
3618
|
+
* Get an existing schedule by name
|
|
3619
|
+
* @param name
|
|
3620
|
+
* @returns SaveScheduleRequest
|
|
3621
|
+
*/
|
|
3622
|
+
getSchedule(name) {
|
|
3623
|
+
return tryCatchReThrow(
|
|
3624
|
+
() => this._client.schedulerResource.getSchedule(name)
|
|
3625
|
+
);
|
|
3626
|
+
}
|
|
3627
|
+
/**
|
|
3628
|
+
* Pauses an existing schedule by name
|
|
3629
|
+
* @param name
|
|
3630
|
+
* @returns
|
|
3631
|
+
*/
|
|
3632
|
+
pauseSchedule(name) {
|
|
3633
|
+
return tryCatchReThrow(
|
|
3634
|
+
() => this._client.schedulerResource.pauseSchedule(name)
|
|
3635
|
+
);
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Resume a paused schedule by name
|
|
3639
|
+
*
|
|
3640
|
+
* @param name
|
|
3641
|
+
* @returns
|
|
3642
|
+
*/
|
|
3643
|
+
resumeSchedule(name) {
|
|
3644
|
+
return tryCatchReThrow(
|
|
3645
|
+
() => this._client.schedulerResource.resumeSchedule(name)
|
|
3646
|
+
);
|
|
3647
|
+
}
|
|
3648
|
+
/**
|
|
3649
|
+
* Deletes an existing scheduler execution by name
|
|
3650
|
+
*
|
|
3651
|
+
* @param name
|
|
3652
|
+
* @returns
|
|
3653
|
+
*/
|
|
3654
|
+
deleteSchedule(name) {
|
|
3655
|
+
return tryCatchReThrow(
|
|
3656
|
+
() => this._client.schedulerResource.deleteSchedule(name)
|
|
3657
|
+
);
|
|
3658
|
+
}
|
|
3659
|
+
/**
|
|
3660
|
+
* Get all existing workflow schedules and optionally filter by workflow name
|
|
3661
|
+
* @param workflowName
|
|
3662
|
+
* @returns Array<WorkflowSchedule>
|
|
3663
|
+
*/
|
|
3664
|
+
getAllSchedules(workflowName) {
|
|
3665
|
+
return tryCatchReThrow(
|
|
3666
|
+
() => this._client.schedulerResource.getAllSchedules(workflowName)
|
|
3667
|
+
);
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* Get list of the next x (default 3, max 5) execution times for a scheduler
|
|
3671
|
+
* @param cronExpression
|
|
3672
|
+
* @param scheduleStartTime
|
|
3673
|
+
* @param scheduleEndTime
|
|
3674
|
+
* @param limit
|
|
3675
|
+
* @returns number OK
|
|
3676
|
+
* @throws ApiError
|
|
3677
|
+
*/
|
|
3678
|
+
getNextFewSchedules(cronExpression, scheduleStartTime, scheduleEndTime, limit = 3) {
|
|
3679
|
+
return tryCatchReThrow(
|
|
3680
|
+
() => this._client.schedulerResource.getNextFewSchedules(
|
|
3681
|
+
cronExpression,
|
|
3682
|
+
scheduleStartTime,
|
|
3683
|
+
scheduleEndTime,
|
|
3684
|
+
limit
|
|
3685
|
+
)
|
|
3686
|
+
);
|
|
3687
|
+
}
|
|
3688
|
+
/**
|
|
3689
|
+
* Pause all scheduling in a single conductor server instance (for debugging only)
|
|
3690
|
+
* @returns any OK
|
|
3691
|
+
* @throws ApiError
|
|
3692
|
+
*/
|
|
3693
|
+
pauseAllSchedules() {
|
|
3694
|
+
return tryCatchReThrow(
|
|
3695
|
+
() => this._client.schedulerResource.pauseAllSchedules()
|
|
3696
|
+
);
|
|
3697
|
+
}
|
|
3698
|
+
/**
|
|
3699
|
+
* Requeue all execution records
|
|
3700
|
+
* @returns any OK
|
|
3701
|
+
* @throws ApiError
|
|
3702
|
+
*/
|
|
3703
|
+
requeueAllExecutionRecords() {
|
|
3704
|
+
return tryCatchReThrow(
|
|
3705
|
+
() => this._client.schedulerResource.requeueAllExecutionRecords()
|
|
3706
|
+
);
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* Resume all scheduling
|
|
3710
|
+
* @returns any OK
|
|
3711
|
+
* @throws ApiError
|
|
3712
|
+
*/
|
|
3713
|
+
resumeAllSchedules() {
|
|
3714
|
+
return tryCatchReThrow(
|
|
3715
|
+
() => this._client.schedulerResource.resumeAllSchedules()
|
|
3716
|
+
);
|
|
3717
|
+
}
|
|
3718
|
+
};
|
|
3719
|
+
|
|
3580
3720
|
// src/orkes/BaseOrkesConductorClient.ts
|
|
3581
3721
|
var defaultRequestHandler2 = (request3, config, options) => request3(config, options);
|
|
3582
3722
|
var REFRESH_TOKEN_IN_MILLISECONDS = 30 * 60 * 1e3;
|
|
@@ -3891,6 +4031,7 @@ export {
|
|
|
3891
4031
|
HealthCheckResourceService,
|
|
3892
4032
|
HumanExecutor,
|
|
3893
4033
|
MetadataResourceService,
|
|
4034
|
+
SchedulerClient,
|
|
3894
4035
|
SchedulerResourceService,
|
|
3895
4036
|
TaskManager,
|
|
3896
4037
|
TaskResourceService,
|