@uipath/uipath-typescript 1.3.2 → 1.3.4

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 (38) hide show
  1. package/dist/assets/index.cjs +21 -8
  2. package/dist/assets/index.mjs +21 -8
  3. package/dist/attachments/index.cjs +21 -8
  4. package/dist/attachments/index.mjs +21 -8
  5. package/dist/buckets/index.cjs +21 -8
  6. package/dist/buckets/index.mjs +21 -8
  7. package/dist/cases/index.cjs +41 -13
  8. package/dist/cases/index.d.ts +15 -0
  9. package/dist/cases/index.mjs +41 -13
  10. package/dist/conversational-agent/index.cjs +39 -8
  11. package/dist/conversational-agent/index.d.ts +55 -2
  12. package/dist/conversational-agent/index.mjs +39 -8
  13. package/dist/core/index.cjs +16 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.mjs +16 -1
  16. package/dist/entities/index.cjs +55 -8
  17. package/dist/entities/index.d.ts +54 -0
  18. package/dist/entities/index.mjs +55 -8
  19. package/dist/feedback/index.cjs +1911 -0
  20. package/dist/feedback/index.d.ts +475 -0
  21. package/dist/feedback/index.mjs +1909 -0
  22. package/dist/index.cjs +451 -189
  23. package/dist/index.d.ts +388 -13
  24. package/dist/index.mjs +452 -190
  25. package/dist/index.umd.js +451 -189
  26. package/dist/jobs/index.cjs +384 -8
  27. package/dist/jobs/index.d.ts +220 -2
  28. package/dist/jobs/index.mjs +385 -9
  29. package/dist/maestro-processes/index.cjs +21 -8
  30. package/dist/maestro-processes/index.mjs +21 -8
  31. package/dist/processes/index.cjs +21 -8
  32. package/dist/processes/index.mjs +21 -8
  33. package/dist/queues/index.cjs +21 -8
  34. package/dist/queues/index.mjs +21 -8
  35. package/dist/tasks/index.cjs +41 -13
  36. package/dist/tasks/index.d.ts +25 -10
  37. package/dist/tasks/index.mjs +42 -14
  38. package/package.json +13 -2
@@ -621,6 +621,13 @@ interface RawJobGetResponse extends FolderProperties {
621
621
  /** Error details for the job, or null if the job has no errors */
622
622
  jobError: JobError | null;
623
623
  }
624
+ /**
625
+ * Options for resuming a suspended job
626
+ */
627
+ interface JobResumeOptions {
628
+ /** Input arguments to pass to the resumed job */
629
+ inputArguments?: Record<string, unknown>;
630
+ }
624
631
  /**
625
632
  * Options for getting all jobs
626
633
  */
@@ -635,6 +642,18 @@ type JobGetAllOptions = RequestOptions & PaginationOptions & {
635
642
  */
636
643
  interface JobGetByIdOptions extends BaseOptions {
637
644
  }
645
+ /**
646
+ * Options for stopping jobs
647
+ */
648
+ interface JobStopOptions {
649
+ /**
650
+ * The stop strategy to use.
651
+ * - `SoftStop` — requests graceful cancellation; the job completes its current activity before stopping
652
+ * - `Kill` — requests immediate termination of the job
653
+ * @default StopStrategy.SoftStop
654
+ */
655
+ strategy?: StopStrategy;
656
+ }
638
657
 
639
658
  /** Combined response type for job data with bound methods. */
640
659
  type JobGetResponse = RawJobGetResponse & JobMethods;
@@ -757,6 +776,85 @@ interface JobServiceModel {
757
776
  * ```
758
777
  */
759
778
  getOutput(jobKey: string, folderId: number): Promise<Record<string, unknown> | null>;
779
+ /**
780
+ * Stops one or more jobs by their UUID keys.
781
+ *
782
+ * Sends a stop request for the specified jobs to the Orchestrator. Throws if any keys cannot be resolved.
783
+ *
784
+ * @param jobKeys - Array of job UUID keys to stop (e.g., from {@link JobGetResponse}.key)
785
+ * @param folderId - The folder ID where the jobs reside (required)
786
+ * @param options - Optional {@link JobStopOptions} including stop strategy
787
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
788
+ *
789
+ * @example
790
+ * ```typescript
791
+ * // Stop a single job with default soft stop
792
+ * await jobs.stop([<jobKey>], <folderId>);
793
+ * ```
794
+ *
795
+ * @example
796
+ * ```typescript
797
+ * import { StopStrategy } from '@uipath/uipath-typescript/jobs';
798
+ *
799
+ * // Force-kill multiple jobs
800
+ * await jobs.stop(
801
+ * [<jobKey1>, <jobKey2>],
802
+ * <folderId>,
803
+ * { strategy: StopStrategy.Kill }
804
+ * );
805
+ * ```
806
+ */
807
+ stop(jobKeys: string[], folderId: number, options?: JobStopOptions): Promise<void>;
808
+ /**
809
+ * Resumes a suspended job.
810
+ *
811
+ * Sends a resume request to a job that is currently in the `Suspended` state.
812
+ * The job transitions to `Resumed` and then to `Running` as it continues execution. Optionally pass
813
+ * input arguments to provide data for the resumed workflow.
814
+ *
815
+ * @param jobKey - The unique key (GUID) of the suspended job to resume
816
+ * @param folderId - The folder ID where the job resides
817
+ * @param options - Optional parameters including input arguments
818
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
819
+ *
820
+ * @example
821
+ * ```typescript
822
+ * // Resume a suspended job
823
+ * await jobs.resume(<jobKey>, <folderId>);
824
+ * ```
825
+ *
826
+ * @example
827
+ * ```typescript
828
+ * // Resume with input arguments
829
+ * await jobs.resume(<jobKey>, <folderId>, {
830
+ * inputArguments: { approved: true }
831
+ * });
832
+ * ```
833
+ */
834
+ resume(jobKey: string, folderId: number, options?: JobResumeOptions): Promise<void>;
835
+ /**
836
+ * Restarts a job in a final state (Successful, Faulted, or Stopped).
837
+ *
838
+ * Creates a **new** job execution from a previously successful, faulted, or stopped job.
839
+ * The new job has its own unique `key`, starts in `Pending` state, and uses
840
+ * the same process and input arguments as the original job.
841
+ *
842
+ * To monitor the new job's progress, poll with {@link getById}
843
+ * using the returned job's key until the state reaches a final value.
844
+ *
845
+ * @param jobKey - The unique key (GUID) of the job to restart
846
+ * @param folderId - The folder ID where the job resides
847
+ * @returns Promise resolving to the new {@link JobGetResponse} with full job details
848
+ *
849
+ * @example
850
+ * ```typescript
851
+ * // Restart a faulted job
852
+ * const newJob = await jobs.restart(<jobKey>, <folderId>);
853
+ * console.log(newJob.state); // 'Pending'
854
+ * console.log(newJob.key); // new job key (different from original)
855
+ * ```
856
+ */
857
+ restart(jobKey: string, folderId: number): Promise<JobGetResponse>;
760
858
  }
761
859
  /**
762
860
  * Methods available on job response objects.
@@ -783,6 +881,38 @@ interface JobMethods {
783
881
  * ```
784
882
  */
785
883
  getOutput(): Promise<Record<string, unknown> | null>;
884
+ /**
885
+ * Stops this job.
886
+ *
887
+ * Sends a stop request for this job to the Orchestrator.
888
+ *
889
+ * @param options - Optional {@link JobStopOptions} including stop strategy (defaults to SoftStop)
890
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
891
+ *
892
+ * @example
893
+ * ```typescript
894
+ * const allJobs = await jobs.getAll({ folderId: <folderId> });
895
+ * const runningJob = allJobs.items.find(j => j.state === JobState.Running);
896
+ *
897
+ * if (runningJob) {
898
+ * await runningJob.stop();
899
+ * }
900
+ * ```
901
+ */
902
+ stop(options?: JobStopOptions): Promise<void>;
903
+ /**
904
+ * Resumes this suspended job.
905
+ *
906
+ * @param options - Optional parameters including input arguments
907
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
908
+ */
909
+ resume(options?: JobResumeOptions): Promise<void>;
910
+ /**
911
+ * Restarts this job, creating a new execution with a new key.
912
+ *
913
+ * @returns Promise resolving to the new {@link JobGetResponse} with full job details
914
+ */
915
+ restart(): Promise<JobGetResponse>;
786
916
  }
787
917
  /**
788
918
  * Creates a job response with bound methods.
@@ -906,6 +1036,85 @@ declare class JobService extends FolderScopedService implements JobServiceModel
906
1036
  * ```
907
1037
  */
908
1038
  getOutput(jobKey: string, folderId: number): Promise<Record<string, unknown> | null>;
1039
+ /**
1040
+ * Stops one or more jobs by their UUID keys.
1041
+ *
1042
+ * Sends a stop request for the specified jobs to the Orchestrator. Throws if any keys cannot be resolved.
1043
+ *
1044
+ * @param jobKeys - Array of job UUID keys to stop (e.g., from {@link JobGetResponse}.key)
1045
+ * @param folderId - The folder ID where the jobs reside (required)
1046
+ * @param options - Optional {@link JobStopOptions} including stop strategy
1047
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
1048
+ *
1049
+ * @example
1050
+ * ```typescript
1051
+ * // Stop a single job with default soft stop
1052
+ * await jobs.stop([<jobKey>], <folderId>);
1053
+ * ```
1054
+ *
1055
+ * @example
1056
+ * ```typescript
1057
+ * import { StopStrategy } from '@uipath/uipath-typescript/jobs';
1058
+ *
1059
+ * // Force-kill multiple jobs
1060
+ * await jobs.stop(
1061
+ * [<jobKey1>, <jobKey2>],
1062
+ * <folderId>,
1063
+ * { strategy: StopStrategy.Kill }
1064
+ * );
1065
+ * ```
1066
+ */
1067
+ stop(jobKeys: string[], folderId: number, options?: JobStopOptions): Promise<void>;
1068
+ /**
1069
+ * Resumes a suspended job.
1070
+ *
1071
+ * Sends a resume request to a job that is currently in the `Suspended` state.
1072
+ * The job transitions to `Resumed` and then to `Running` as it continues execution. Optionally pass
1073
+ * input arguments to provide data for the resumed workflow.
1074
+ *
1075
+ * @param jobKey - The unique key (GUID) of the suspended job to resume
1076
+ * @param folderId - The folder ID where the job resides
1077
+ * @param options - Optional parameters including input arguments
1078
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
1079
+ *
1080
+ * @example
1081
+ * ```typescript
1082
+ * // Resume a suspended job
1083
+ * await jobs.resume(<jobKey>, <folderId>);
1084
+ * ```
1085
+ *
1086
+ * @example
1087
+ * ```typescript
1088
+ * // Resume with input arguments
1089
+ * await jobs.resume(<jobKey>, <folderId>, {
1090
+ * inputArguments: { approved: true }
1091
+ * });
1092
+ * ```
1093
+ */
1094
+ resume(jobKey: string, folderId: number, options?: JobResumeOptions): Promise<void>;
1095
+ /**
1096
+ * Restarts a job in a final state (Successful, Faulted, or Stopped).
1097
+ *
1098
+ * Creates a **new** job execution from a previously successful, faulted, or stopped job.
1099
+ * The new job has its own unique `key`, starts in `Pending` state, and uses
1100
+ * the same process and input arguments as the original job.
1101
+ *
1102
+ * To monitor the new job's progress, poll with {@link getById}
1103
+ * using the returned job's key until the state reaches a final value.
1104
+ *
1105
+ * @param jobKey - The unique key (GUID) of the job to restart
1106
+ * @param folderId - The folder ID where the job resides
1107
+ * @returns Promise resolving to the new {@link JobGetResponse} with full job details
1108
+ *
1109
+ * @example
1110
+ * ```typescript
1111
+ * // Restart a faulted job
1112
+ * const newJob = await jobs.restart(<jobKey>, <folderId>);
1113
+ * console.log(newJob.state); // 'Pending'
1114
+ * console.log(newJob.key); // new job key (different from original)
1115
+ * ```
1116
+ */
1117
+ restart(jobKey: string, folderId: number): Promise<JobGetResponse>;
909
1118
  /**
910
1119
  * Downloads the output file content via the Attachments API.
911
1120
  * 1. Fetches blob access info from the attachment using AttachmentService
@@ -913,7 +1122,16 @@ declare class JobService extends FolderScopedService implements JobServiceModel
913
1122
  * 3. Parses and returns the JSON content
914
1123
  */
915
1124
  private downloadOutputFile;
1125
+ /**
1126
+ * Resolves job UUID keys to integer IDs via the getAll method.
1127
+ * Chunks keys into batches to avoid URL length limits.
1128
+ */
1129
+ private resolveJobKeys;
1130
+ /**
1131
+ * Calls the StopJobs OData action with resolved integer IDs.
1132
+ */
1133
+ private stopJobsByIds;
916
1134
  }
917
1135
 
918
- export { JobService, JobState, JobSubState, JobService as Jobs, ServerlessJobType, createJobWithMethods };
919
- export type { JobGetAllOptions, JobGetByIdOptions, JobGetResponse, JobMethods, JobServiceModel, ProcessMetadata, RawJobGetResponse };
1136
+ export { JobService, JobState, JobSubState, JobService as Jobs, ServerlessJobType, StopStrategy, createJobWithMethods };
1137
+ export type { JobGetAllOptions, JobGetByIdOptions, JobGetResponse, JobMethods, JobResumeOptions, JobServiceModel, JobStopOptions, ProcessMetadata, RawJobGetResponse };