@kortex-app/api 0.0.1-next.202511101646-afc43f26284 → 0.0.1-next.202511131258-3f92ba93f
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/package.json +2 -1
- package/src/extension-api.d.ts +69 -1
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortex-app/api",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.202511131258-3f92ba93f",
|
|
4
4
|
"description": "API for Kortex extensions",
|
|
5
5
|
"repository": "https://github.com/kortex-hub/kortex",
|
|
6
6
|
"publishConfig": {
|
|
7
|
+
"provenance": true,
|
|
7
8
|
"access": "public"
|
|
8
9
|
},
|
|
9
10
|
"license": "Apache-2.0",
|
package/src/extension-api.d.ts
CHANGED
|
@@ -431,6 +431,12 @@ declare module '@kortex-app/api' {
|
|
|
431
431
|
flowId: string;
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
+
export interface FlowExecuteParams {
|
|
435
|
+
flowId: string;
|
|
436
|
+
logger: Logger;
|
|
437
|
+
params?: Record<string, string>;
|
|
438
|
+
}
|
|
439
|
+
|
|
434
440
|
export interface FlowGenerateCommandLineResult {
|
|
435
441
|
command: string;
|
|
436
442
|
args: string[];
|
|
@@ -497,7 +503,7 @@ declare module '@kortex-app/api' {
|
|
|
497
503
|
/**
|
|
498
504
|
* @experimental expect change
|
|
499
505
|
*/
|
|
500
|
-
execute(
|
|
506
|
+
execute(options: FlowExecuteParams): Promise<void>;
|
|
501
507
|
};
|
|
502
508
|
}
|
|
503
509
|
|
|
@@ -802,6 +808,62 @@ declare module '@kortex-app/api' {
|
|
|
802
808
|
logo?: string | { light: string; dark: string };
|
|
803
809
|
}
|
|
804
810
|
|
|
811
|
+
// details of a scheduled task execution (from getExecution)
|
|
812
|
+
export interface ProviderScheduleExecution {
|
|
813
|
+
id: string;
|
|
814
|
+
lastExecution: Date;
|
|
815
|
+
output: string;
|
|
816
|
+
duration: number;
|
|
817
|
+
exitCode?: number;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// item representing a scheduled task (from listing)
|
|
821
|
+
export interface ProviderScheduleItem {
|
|
822
|
+
id: string;
|
|
823
|
+
metadata: Record<string, string>;
|
|
824
|
+
cronExpression: string;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// command to execute for the scheduled task
|
|
828
|
+
export interface ProviderSchedulerCommand {
|
|
829
|
+
command: string;
|
|
830
|
+
env: Record<string, string>;
|
|
831
|
+
args: string[];
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// options to schedule a task
|
|
835
|
+
export interface ProviderSchedulerOptions {
|
|
836
|
+
command: ProviderSchedulerCommand;
|
|
837
|
+
cronExpression: string;
|
|
838
|
+
metadata: Record<string, string>;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// result of scheduling a task
|
|
842
|
+
export interface ProviderScheduleResult {
|
|
843
|
+
id: string;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export interface ProviderSchedulerListOptions {
|
|
847
|
+
metadataKeys?: string[];
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// allow to schedule tasks, including listing, canceling and getting execution details
|
|
851
|
+
export interface ProviderScheduler {
|
|
852
|
+
name: string;
|
|
853
|
+
|
|
854
|
+
// schedule a task and return a schedule id
|
|
855
|
+
schedule(options: ProviderSchedulerOptions): Promise<ProviderScheduleResult>;
|
|
856
|
+
|
|
857
|
+
// cancel a scheduled task by id
|
|
858
|
+
cancel(id: string): Promise<void>;
|
|
859
|
+
|
|
860
|
+
// list scheduled tasks
|
|
861
|
+
list(options: ProviderSchedulerListOptions): Promise<ProviderScheduleItem[]>;
|
|
862
|
+
|
|
863
|
+
// get execution details for a scheduled task
|
|
864
|
+
getExecution(id: string): Promise<ProviderScheduleExecution | undefined>;
|
|
865
|
+
}
|
|
866
|
+
|
|
805
867
|
export interface Provider {
|
|
806
868
|
setContainerProviderConnectionFactory(
|
|
807
869
|
containerProviderConnectionFactory: ContainerProviderConnectionFactory,
|
|
@@ -841,6 +903,8 @@ declare module '@kortex-app/api' {
|
|
|
841
903
|
|
|
842
904
|
registerCleanup(cleanup: ProviderCleanup): Disposable;
|
|
843
905
|
|
|
906
|
+
registerScheduler(scheduler: ProviderScheduler): Disposable;
|
|
907
|
+
|
|
844
908
|
dispose(): void;
|
|
845
909
|
readonly name: string;
|
|
846
910
|
readonly id: string;
|
|
@@ -1166,6 +1230,10 @@ declare module '@kortex-app/api' {
|
|
|
1166
1230
|
readonly label: string;
|
|
1167
1231
|
}
|
|
1168
1232
|
|
|
1233
|
+
export interface SchedulerOptions {
|
|
1234
|
+
name: string;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1169
1237
|
export namespace provider {
|
|
1170
1238
|
export function createProvider(provider: ProviderOptions): Provider;
|
|
1171
1239
|
export const onDidUpdateProvider: Event<ProviderEvent>;
|