@epam/ai-dial-chat-hooks 1.2.0-dev.89 → 1.2.0-dev.93
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/index.d.ts +176 -0
- package/index.js +82 -77
- package/package.json +15 -15
- package/scheduled-task/scheduled-task-description.js +77 -0
- package/scheduled-task/scheduled-task-preparation.js +24 -0
- package/scheduled-task/scheduled-tasks-api-client.js +19 -0
- package/scheduled-task/use-scheduled-task-runs.js +82 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +178 -0
- package/scheduled-tasks.js +7 -2
package/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { ConversationTransferJob } from '@epam/ai-dial-chat-shared';
|
|
|
27
27
|
import { ConversationTransferWarningCode } from '@epam/ai-dial-chat-shared';
|
|
28
28
|
import { CopyFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
29
29
|
import { CopyItemDto } from '@epam/ai-dial-chat-api-client';
|
|
30
|
+
import { CreatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
30
31
|
import { CreateFolderDto } from '@epam/ai-dial-chat-api-client';
|
|
31
32
|
import { CreateFolderResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
32
33
|
import { CreateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
@@ -81,6 +82,9 @@ import type { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
|
81
82
|
import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
82
83
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
83
84
|
import { ListPublicFilesRequest } from '@epam/ai-dial-chat-api-client';
|
|
85
|
+
import { ListScheduledTaskRunsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
86
|
+
import { ListScheduledTasksResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
87
|
+
import { ListScheduledTasksSortEnum } from '@epam/ai-dial-chat-api-client';
|
|
84
88
|
import { ListSharedFilesRequest } from '@epam/ai-dial-chat-api-client';
|
|
85
89
|
import { LocaleTextEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
86
90
|
import { McpAppToolSummaryDto } from '@epam/ai-dial-chat-api-client';
|
|
@@ -120,6 +124,10 @@ import { RevokeAccessItemDto } from '@epam/ai-dial-chat-api-client';
|
|
|
120
124
|
import { RevokeAccessResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
121
125
|
import { ScheduledTaskCreateFormValues } from '@epam/ai-dial-scheduled-tasks';
|
|
122
126
|
import { ScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
127
|
+
import { ScheduledTaskRunDto } from '@epam/ai-dial-chat-api-client';
|
|
128
|
+
import { ScheduledTaskValidationErrors } from '../../libs/scheduled-tasks/validation';
|
|
129
|
+
import { ScheduledTaskValidationOptions } from '../../libs/scheduled-tasks/validation';
|
|
130
|
+
import { ScheduleTriggerDto } from '@epam/ai-dial-chat-api-client';
|
|
123
131
|
import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
|
|
124
132
|
import { SetStateAction } from 'react';
|
|
125
133
|
import { ShareApi } from '@epam/ai-dial-chat-api-client';
|
|
@@ -147,6 +155,7 @@ import { ToolsetsApi } from '@epam/ai-dial-chat-api-client';
|
|
|
147
155
|
import { TranscriptionApi } from '@epam/ai-dial-chat-api-client';
|
|
148
156
|
import { UnpublishCatalogEntityDto } from '@epam/ai-dial-chat-api-client';
|
|
149
157
|
import { UnpublishResultDto } from '@epam/ai-dial-chat-api-client';
|
|
158
|
+
import { UpdatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
150
159
|
import { UpdateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
151
160
|
import { UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
152
161
|
import { UploadedAttachmentResult } from '@epam/ai-dial-chat-shared';
|
|
@@ -1004,6 +1013,12 @@ export declare const createMessagePair: (content: string, customContent?: Messag
|
|
|
1004
1013
|
*/
|
|
1005
1014
|
export declare const createPublishApiClient: (publishApi: PublishApi) => PublishApiClient;
|
|
1006
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* Composes scheduler operations over an already configured generated client.
|
|
1018
|
+
* Authentication, base URL, CSRF, and retries remain host responsibilities.
|
|
1019
|
+
*/
|
|
1020
|
+
export declare const createScheduledTasksApiClient: (client: ScheduledTasksConfiguredClient) => ScheduledTasksApiClient;
|
|
1021
|
+
|
|
1007
1022
|
/**
|
|
1008
1023
|
* Builds a generated-client `Middleware` that throws on 401, and on a
|
|
1009
1024
|
* classified invalid-CSRF 403 refreshes the token and retries the original
|
|
@@ -1170,6 +1185,14 @@ export declare const deriveConversationRowActionState: (item: Pick<ConversationL
|
|
|
1170
1185
|
*/
|
|
1171
1186
|
export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => CatalogItem[];
|
|
1172
1187
|
|
|
1188
|
+
/**
|
|
1189
|
+
* Describes the complete trigger without requiring unrelated task metadata.
|
|
1190
|
+
* Unsupported constraints remain Custom, with the full source expression.
|
|
1191
|
+
* Calendar-month shifts crossing month boundaries or days 29–31 remain
|
|
1192
|
+
* Custom because a shifted monthly day is not equivalent around short months.
|
|
1193
|
+
*/
|
|
1194
|
+
export declare const describeScheduledTaskTrigger: (trigger: ScheduleTriggerDto, { timeZone, referenceDate, }?: ScheduledTaskTriggerDescriptionOptions) => ScheduledTaskTriggerDescription;
|
|
1195
|
+
|
|
1173
1196
|
/** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
|
|
1174
1197
|
export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
|
|
1175
1198
|
|
|
@@ -2893,6 +2916,15 @@ export declare const prepareMoveRenameItems: (copiedItems: DialCopiedItem[], buc
|
|
|
2893
2916
|
preparedMoveItems: PreparedCopyMoveItem<MoveItemDto>[];
|
|
2894
2917
|
};
|
|
2895
2918
|
|
|
2919
|
+
/**
|
|
2920
|
+
* Validates form values before creating a request body. Hosts translate the
|
|
2921
|
+
* returned field codes and must not issue a write when `ok` is false.
|
|
2922
|
+
*/
|
|
2923
|
+
export declare const prepareScheduledTaskCreateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<CreateScheduledTaskBodyDto>;
|
|
2924
|
+
|
|
2925
|
+
/** Validates form values before preparing an update request body. */
|
|
2926
|
+
export declare const prepareScheduledTaskUpdateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<UpdateScheduledTaskBodyDto>;
|
|
2927
|
+
|
|
2896
2928
|
/** Maximum body length accepted by `CreatePromptDto.content`. */
|
|
2897
2929
|
export declare const PROMPT_CONTENT_MAX_LENGTH = 50000;
|
|
2898
2930
|
|
|
@@ -3306,6 +3338,106 @@ export declare type ScheduledTaskDtoMappingResult = {
|
|
|
3306
3338
|
reason: UnsupportedTriggerReason;
|
|
3307
3339
|
};
|
|
3308
3340
|
|
|
3341
|
+
/** A checked request preparation result that never serializes invalid values. */
|
|
3342
|
+
export declare type ScheduledTaskPreparationResult<TBody> = {
|
|
3343
|
+
ok: true;
|
|
3344
|
+
body: TBody;
|
|
3345
|
+
} | {
|
|
3346
|
+
ok: false;
|
|
3347
|
+
errors: ScheduledTaskValidationErrors;
|
|
3348
|
+
};
|
|
3349
|
+
|
|
3350
|
+
export declare interface ScheduledTaskRunsListRequest {
|
|
3351
|
+
scheduleId: string;
|
|
3352
|
+
limit?: number;
|
|
3353
|
+
offset?: number;
|
|
3354
|
+
signal?: AbortSignal;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
export declare interface ScheduledTasksApiClient {
|
|
3358
|
+
listScheduledTasks: (request?: ScheduledTasksListRequest) => Promise<ListScheduledTasksResponseDto>;
|
|
3359
|
+
listScheduledTaskRuns: (request: ScheduledTaskRunsListRequest) => Promise<ListScheduledTaskRunsResponseDto>;
|
|
3360
|
+
createScheduledTask: (body: CreateScheduledTaskBodyDto) => Promise<CreatedScheduledTaskDto>;
|
|
3361
|
+
getScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
3362
|
+
updateScheduledTask: (scheduleId: string, body: UpdateScheduledTaskBodyDto) => Promise<UpdatedScheduledTaskDto>;
|
|
3363
|
+
pauseScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
3364
|
+
resumeScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
3365
|
+
deleteScheduledTask: (scheduleId: string) => Promise<void>;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
/** Narrow configured generated-client surface required by scheduler hooks. */
|
|
3369
|
+
export declare interface ScheduledTasksConfiguredClient {
|
|
3370
|
+
listScheduledTasks: (request: {
|
|
3371
|
+
limit?: number;
|
|
3372
|
+
offset?: number;
|
|
3373
|
+
search?: string;
|
|
3374
|
+
sort?: ListScheduledTasksSortEnum;
|
|
3375
|
+
}, options?: RequestInit) => Promise<ListScheduledTasksResponseDto>;
|
|
3376
|
+
listScheduledTaskRuns: (request: {
|
|
3377
|
+
scheduleId: string;
|
|
3378
|
+
limit?: number;
|
|
3379
|
+
offset?: number;
|
|
3380
|
+
}, options?: RequestInit) => Promise<ListScheduledTaskRunsResponseDto>;
|
|
3381
|
+
createScheduledTask: (request: {
|
|
3382
|
+
createScheduledTaskBodyDto: CreateScheduledTaskBodyDto;
|
|
3383
|
+
}) => Promise<CreatedScheduledTaskDto>;
|
|
3384
|
+
getScheduledTask: (request: {
|
|
3385
|
+
scheduleId: string;
|
|
3386
|
+
}) => Promise<ScheduledTaskDto>;
|
|
3387
|
+
updateScheduledTask: (request: {
|
|
3388
|
+
scheduleId: string;
|
|
3389
|
+
updateScheduledTaskBodyDto: UpdateScheduledTaskBodyDto;
|
|
3390
|
+
}) => Promise<UpdatedScheduledTaskDto>;
|
|
3391
|
+
pauseScheduledTask: (request: {
|
|
3392
|
+
scheduleId: string;
|
|
3393
|
+
}) => Promise<ScheduledTaskDto>;
|
|
3394
|
+
resumeScheduledTask: (request: {
|
|
3395
|
+
scheduleId: string;
|
|
3396
|
+
}) => Promise<ScheduledTaskDto>;
|
|
3397
|
+
deleteScheduledTask: (request: {
|
|
3398
|
+
scheduleId: string;
|
|
3399
|
+
}) => Promise<void>;
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
/** App-agnostic request options accepted by the scheduler facade. */
|
|
3403
|
+
export declare interface ScheduledTasksListRequest {
|
|
3404
|
+
limit?: number;
|
|
3405
|
+
offset?: number;
|
|
3406
|
+
search?: string;
|
|
3407
|
+
sort?: ListScheduledTasksSortEnum;
|
|
3408
|
+
signal?: AbortSignal;
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
export declare interface ScheduledTaskTriggerDescription {
|
|
3412
|
+
kind: ScheduledTaskTriggerDescriptionKind;
|
|
3413
|
+
time?: string;
|
|
3414
|
+
dayOfWeek?: string;
|
|
3415
|
+
dayOfMonth?: string;
|
|
3416
|
+
intervalMinutes?: number;
|
|
3417
|
+
date?: Date;
|
|
3418
|
+
expression?: string;
|
|
3419
|
+
sourceTimezone: 'utc';
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
/** Display categories are independent of task editability. */
|
|
3423
|
+
export declare enum ScheduledTaskTriggerDescriptionKind {
|
|
3424
|
+
OneTime = "oneTime",
|
|
3425
|
+
Hourly = "hourly",
|
|
3426
|
+
EveryNMinutes = "everyNMinutes",
|
|
3427
|
+
Daily = "daily",
|
|
3428
|
+
Weekly = "weekly",
|
|
3429
|
+
Monthly = "monthly",
|
|
3430
|
+
Custom = "custom",
|
|
3431
|
+
Invalid = "invalid"
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
export declare interface ScheduledTaskTriggerDescriptionOptions {
|
|
3435
|
+
/** Display timezone; defaults to UTC for backwards compatibility. */
|
|
3436
|
+
timeZone?: string;
|
|
3437
|
+
/** Date whose timezone offset is used. Defaults to now (the existing UTC-storage policy). */
|
|
3438
|
+
referenceDate?: Date;
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3309
3441
|
/** Serializes a prompt export envelope into a pretty-printed JSON blob. */
|
|
3310
3442
|
export declare const serializePromptExport: (envelope: PromptExportFormat) => Blob;
|
|
3311
3443
|
|
|
@@ -5566,6 +5698,50 @@ export declare interface UsePublishFoldersResult {
|
|
|
5566
5698
|
hasPublishWriteAccess: (folderPath: string[]) => boolean;
|
|
5567
5699
|
}
|
|
5568
5700
|
|
|
5701
|
+
/** Shared, cancellation-safe pagination for one schedule's run history. */
|
|
5702
|
+
export declare const useScheduledTaskRuns: (client: ScheduledTasksApiClient, { scheduleId, enabled, pageSize }: UseScheduledTaskRunsOptions) => {
|
|
5703
|
+
items: ScheduledTaskRunDto[];
|
|
5704
|
+
isLoading: boolean;
|
|
5705
|
+
isLoadingMore: boolean;
|
|
5706
|
+
initialError: Error | null;
|
|
5707
|
+
loadMoreError: Error | null;
|
|
5708
|
+
hasMore: boolean;
|
|
5709
|
+
loadMore: () => void;
|
|
5710
|
+
retryLoadMore: () => void;
|
|
5711
|
+
refetch: () => void;
|
|
5712
|
+
};
|
|
5713
|
+
|
|
5714
|
+
export declare interface UseScheduledTaskRunsOptions {
|
|
5715
|
+
scheduleId: string;
|
|
5716
|
+
enabled?: boolean;
|
|
5717
|
+
pageSize?: number;
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
/** Shared scheduler-list lifecycle with generation-scoped stale-response guards. */
|
|
5721
|
+
export declare const useScheduledTasks: (client: ScheduledTasksApiClient, { enabled, pageSize, debounceMs, initialSearch, initialSort, }?: UseScheduledTasksOptions) => {
|
|
5722
|
+
items: ScheduledTaskDto[];
|
|
5723
|
+
searchQuery: string;
|
|
5724
|
+
setSearchQuery: Dispatch<SetStateAction<string>>;
|
|
5725
|
+
sortKey: "firstToRun" | "lastToRun" | "newest" | "nameAZ";
|
|
5726
|
+
setSortKey: Dispatch<SetStateAction<"firstToRun" | "lastToRun" | "newest" | "nameAZ">>;
|
|
5727
|
+
isLoading: boolean;
|
|
5728
|
+
isLoadingMore: boolean;
|
|
5729
|
+
initialError: Error | null;
|
|
5730
|
+
loadMoreError: Error | null;
|
|
5731
|
+
hasMore: boolean;
|
|
5732
|
+
loadMore: () => void;
|
|
5733
|
+
retryLoadMore: () => void;
|
|
5734
|
+
refetch: () => void;
|
|
5735
|
+
};
|
|
5736
|
+
|
|
5737
|
+
export declare interface UseScheduledTasksOptions {
|
|
5738
|
+
enabled?: boolean;
|
|
5739
|
+
pageSize?: number;
|
|
5740
|
+
debounceMs?: number;
|
|
5741
|
+
initialSearch?: string;
|
|
5742
|
+
initialSort?: ListScheduledTasksSortEnum;
|
|
5743
|
+
}
|
|
5744
|
+
|
|
5569
5745
|
/**
|
|
5570
5746
|
* Resolves and manages share-link data for a DIAL Core resource.
|
|
5571
5747
|
*
|
package/index.js
CHANGED
|
@@ -62,80 +62,85 @@ import { buildPromptExportEnvelope as sn, buildPromptExportFileName as cn, seria
|
|
|
62
62
|
import { PROMPT_CONTENT_MAX_LENGTH as un, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as dn, PROMPT_DESCRIPTION_MAX_LENGTH as fn, PROMPT_NAME_MAX_LENGTH as pn, PromptFieldError as mn, buildPromptPath as hn, getRemainingCharacters as gn, validatePromptContent as _n, validatePromptDescription as vn, validatePromptName as yn } from "./prompt/prompt.js";
|
|
63
63
|
import { usePromptsState as bn } from "./prompt/usePromptsState/usePromptsState.js";
|
|
64
64
|
import { UnsupportedTriggerReason as xn } from "./scheduled-task/scheduled-task-mapping.js";
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
export { x as AttachmentValidationErrorReason, er as AudioTranscriptionError, tr as AudioTranscriptionErrorReason, R as AuthenticationType, Or as COLUMNS_WITHOUT_AUTHOR, kr as COLUMNS_WITH_AUTHOR, Ar as CORE_PERMISSION_MAP, et as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, jr as DATE_OPTIONS, zt as DEFAULT_GENERATION_CONFLICT_MESSAGE, rr as DEFAULT_MAX_ARCHIVE_BYTES, Fr as DialFileManagerActionProfile, Ir as DialFileManagerVariant, wr as DialFilesApiUploadMode, Ri as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, jt as FavoriteEntityType, Tr as FileManagerNotificationReason, Er as FileNameValidationErrorReason, Dr as FileOperationKind, Bt as GenerationConflictError, ua as McpAppResourceFetchError, ze as McpResourceKind, ot as OAuthResourceKind, Mr as PATH_SEPARATOR_REGEXP, un as PROMPT_CONTENT_MAX_LENGTH, dn as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, fn as PROMPT_DESCRIPTION_MAX_LENGTH, pn as PROMPT_NAME_MAX_LENGTH, Te as PUBLIC_SKILL_BUCKET, mn as PromptFieldError, ae as PromptSource, Nr as RESERVED_MARKER_NAME, Vn as RecipientsCountStatus, ue as SKILL_FILE_UPLOAD_MAX_BYTES, Ee as SKILL_LISTING_MAX_PAGES, De as SKILL_LISTING_PAGE_SIZE, de as SKILL_MANIFEST_FILE, Oe as SKILL_MANIFEST_MAX_BYTES, fe as SKILL_UPLOAD_MAX_FILES, pe as SKILL_UPLOAD_MAX_TOTAL_BYTES, In as SkillArchiveImportErrorKind, Ln as SkillArchiveImportStatus, Rn as SkillArchiveSelectionRejectionReason, kn as SkillEditorLoadState, Nn as SkillPreviewErrorKind, ke as SkillSource, st as TOOLSET_REDIRECT_STATE_KEY, ct as ToolsetAuthStatus, lt as ToolsetAuthTypes, ut as ToolsetCredentialsLevel, Et as ToolsetLoginOutcomeType, dt as ToolsetOAuthCallbackQuery, ft as ToolsetOAuthChannelControlType, pt as ToolsetOAuthFailureReason, mt as ToolsetOAuthInitiationResultType, ht as ToolsetOAuthResultType, Pr as UPLOAD_CONCURRENCY, xn as UnsupportedTriggerReason, gt as WithLogin, Mi as annotationToDisplayAttachment, mi as annotationToOoxmlCanvasContent, hi as annotationToPdfCanvasContent, Sn as apSchedulerDayToJsDay, W as appendLocaleCode, yr as applyChunkToMessages, Ni as attachmentDtoToDisplayAttachment, Pi as attachmentDtosToDisplayAttachments, ar as attachmentToDto, or as attachmentsToDtos, G as buildAdditionalLocaleOptions, Pt as buildAnnouncementSignature, Be as buildApplicationMcpUrl, N as buildChatCompletionsUrl, Ve as buildConnectApi, P as buildDeploymentConnectApi, ea as buildExternalServiceScopeId, ni as buildFromCache, sn as buildPromptExportEnvelope, cn as buildPromptExportFileName, se as buildPromptOverview, hn as buildPromptPath, F as buildResponsesUrl, Rr as buildSharedItemVirtualPath, je as buildSkillContentTree, me as buildSkillFilesPayload, he as buildSkillManifest, ge as buildSkillManifestForSubmit, _e as buildSkillManifestFromFrontmatter, Me as buildSkillOverview, xt as buildToolsetAuthorizeUrl, He as buildToolsetMcpUrl, zn as classifySkillArchiveImportError, gi as clearAttachmentCache, K as composeLocalePayload, Vt as createChatStreamApi, i as createCsrfMiddleware, qt as createDeploymentChangedMessage, di as createFilesApiClient, da as createMcpAppsApiClient, sr as createMessagePair, j as createPublishApiClient, a as createUnauthorizedMiddleware, fi as createUploadFileWithProgress, V as decodeToolsetId, q as decomposeLocalizedFields, Lr as deriveActionProfile, Ye as deriveAvailableTabIds, Un as deriveConversationRowActionState, Xe as deriveFavoriteItems, zr as dialCorePathToRelative, Fi as dialFileToAttachment, Ii as dialFilesToAttachments, Li as dialFolderPathToAttachment, m as downloadAttachment, _t as emitToolsetLoginSuccess, I as encodeDeploymentId, H as encodeToolsetId, ri as fetchByTab, ii as fetchForSearch, Ze as filterCatalogItemsBySelector, Qe as filterHiddenOwnedItems, L as findDeploymentByIdOrReference, Br as findDialFileByPath, ai as findFirstSuccessfulCopyMoveItem, Vr as findFolderByVirtualPath, Ut as formatAppVersion, X as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Hr as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Xi as getBrowserTimezone, hr as getConversationPath, qn as getConversationSource, ta as getExternalServiceFallbackName, Jt as getLastDeploymentId, Yt as getLastUserMessageToolConfiguration, Gt as getModelIdFromConversationId, Zr as getParentFolderPath, We as getPublicCatalogEntityFolderPath, en as getQuickAppConversationStarters, gn as getRemainingCharacters, fr as getStarterConversationText, pr as getStarterDisplayText, rn as getStarterPopulateText, mr as getStarterSubmitText, an as getStartersFromSchema, Kt as getTimeOfDayGreeting, yt as getToolsetOAuthChannelName, St as getToolsetRedirectUri, ki as getUrlFileName, Ur as getVirtualPathName, cr as hasActiveToolConfig, Ft as hasAnnouncementContent, _i as hasAttachmentTextSource, Wr as hasDialFileWritePermission, Gr as hasForbiddenNameSymbols, It as hasStructuredAnnouncement, o as includesIgnoreCase, Ct as initiateOAuthLogin, lr as isAnswerIncomplete, xr as isAwaitingGenerationResume, r as isConversationNotFoundError, Kr as isCopyMoveDuplicateAllowed, Ji as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, Ai as isExternalSourcePreviewable, ur as isMessageChanged, Xt as isMessageStreaming, ce as isOrganisationPromptItem, Ge as isPublicCatalogEntityId, U as isPublicToolsetId, Yi as isQuickAppSchema, qr as isShareActionsAllowed, Zi as isValidAbsoluteUrl, Qi as isValidFeaturesData, ve as isValidSkillRelativePath, Cn as jsDayToApSchedulerDay, oi as mapCorePermissions, Q as mapDeploymentDetailsDtoToEntityDetails, z as mapDeploymentLimitsDtoToCatalogLimits, B as mapDeploymentLimitsToInput, te as mapDeploymentToCatalogItem, ne as mapDeploymentToolsetCredentials, $ as mapEntityDetailsToCatalogDetails, si as mapFileMetadataToDialFile, wn as mapFormValuesToCreateBody, Tn as mapFormValuesToUpdateBody, le as mapPromptToCatalogItem, Ke as mapPublishConversationResultDto, qe as mapPublishHistoryEntryDto, En as mapScheduledTaskDtoToFormValues, ci as mapSearchItem, Ne as mapSkillToCatalogItem, tn as mapStages, ee as mapToolsetCredentials, re as mapToolsetToCatalogItem, li as mergeCreatedFolderIntoCache, br as mergeStages, Zt as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, ye as nameFromPath, wt as navigateToolsetOAuthPopup, Qt as normalizeResponseFormat, be as normalizeSkillName, Jr as normalizeVirtualPath, pi as openAnnotationAttachment, Tt as openToolsetOAuthPopup, Z as padTwoDigits, na as parseExternalServiceUrl, $i as parseFeaturesData, Yr as parseNewFolderVirtualPath, oe as parsePromptResourceUrl, xe as parseSkillManifest, rt as parseSkillManifestDocument, Ae as parseSkillResourceUrl, ei as prepareCopyItems, zi as prepareDownloadDestination, ti as prepareMoveRenameItems, Pe as readSkillFileBytes, Fe as readSkillFilePreviewBytes, Ie as readSkillManifest, $e as reconcileFilterTopics, vi as referenceAttachmentToPdfCanvasContent, tt as resolveCatalogPrimaryAction, yi as resolveCodeCanvasContent, ie as resolveDeploymentFolder, Qr as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, ji as resolveExternalSourceContentType, bi as resolveGroupedVisualizerCanvasContent, xi as resolveHtmlCanvasContent, Si as resolveImageCanvasContent, Ci as resolveJsonCanvasContent, J as resolveLocalizedText, wi as resolveMarkdownCanvasContent, Ue as resolveMcpResourceKind, Ti as resolveOoxmlCanvasContent, Xr as resolveOwnerCoords, Ei as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Le as resolveSkillFileDownloadPath, Re as resolveSkillManifestFileId, Di as resolveTextCanvasContent, Oi as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Lt as sanitizeAnnouncementHtml, Rt as sanitizeAnnouncementMessageHtml, Xn as sanitizeFileName, Wt as sanitizeFooterHtml, ln as serializePromptExport, dr as shouldRerunGenerationOnEdit, Ht as shouldWatchForDisplayNameUpdate, Se as skillFileBytesToBlob, On as skillFileToAttachment, Zn as splitFileNameExtension, Ce as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, vt as subscribeToolsetLoginSuccess, Y as toBaseLocale, $t as toOverlayMessages, Je as toPublishEntityType, M as toPublishRuleDto, nn as toStage, Qn as trimFileNameToByteLimit, we as unpackSkillArchive, ui as updateEntry, Wn as useActiveConversationSync, kt as useApplicationCredentials, Gn as useAsyncConfirmDialog, g as useAttachmentAction, $n as useAttachmentUpload, S as useAttachmentValidation, nt as useCatalogEditNavigation, at as useCatalogItemDetails, Ot as useCatalogToolsetCredentials, ra as useChatSettingsFormConfig, ir as useConversationExport, gr as useConversationHandlers, _r as useConversationImport, Kn as useConversationLookupMaps, Jn as useConversationPanelItems, vr as useConversationScroll, Cr as useConversationSources, Sr as useConversationStream, Bi as useDialFileListing, Gi as useDialFileManager, Ki as useDialFileManagerTabConfig, Vi as useDialFileMetadata, Hi as useDialFileMutations, Ui as useDialFileSharing, Wi as useDialFileUploadBatch, Mt as useFavoriteEntitiesState, qi as useFileAttachmentPicker, ga as useGridEditingScroll, Yn as useImportFilePicker, ma as useMcpAppHostAdapter, pa as useMcpAppHostContext, fa as useMcpAppTools, on as useOAuthCallbackCompletion, ha as useOpenMcpAppCanvas, ia as usePageFileDrag, oa as usePanelMaxWidth, bn as usePromptsState, Nt as usePublishFolders, sa as useShareLink, Hn as useShareRecipientsCount, Bn as useSkillArchiveImport, At as useSkillDetailsPanelData, An as useSkillEditorLoad, jn as useSkillEditorSubmit, Mn as useSkillFileActions, Pn as useSkillFilePreview, it as useSkillItemDetails, Fn as useSkillsState, ca as useToolsMenu, Dt as useToolsetLogin, nr as useTranscribeAudio, la as useUsageData, aa as useViewportWidth, _n as validatePromptContent, vn as validatePromptDescription, yn as validatePromptName, Dn as validateSkillFileBatch, $r as virtualPathToApiPath, bt as waitForToolsetOAuthResult };
|
|
65
|
+
import { ScheduledTaskTriggerDescriptionKind as Sn, describeScheduledTaskTrigger as Cn } from "./scheduled-task/scheduled-task-description.js";
|
|
66
|
+
import { apSchedulerDayToJsDay as wn, jsDayToApSchedulerDay as Tn } from "./shared/cron-weekday.js";
|
|
67
|
+
import { mapFormValuesToCreateBody as En, mapFormValuesToUpdateBody as Dn, mapScheduledTaskDtoToFormValues as On } from "./scheduled-task/scheduled-task-trigger.js";
|
|
68
|
+
import { prepareScheduledTaskCreateBody as kn, prepareScheduledTaskUpdateBody as An } from "./scheduled-task/scheduled-task-preparation.js";
|
|
69
|
+
import { createScheduledTasksApiClient as jn } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
70
|
+
import { useScheduledTasks as Mn } from "./scheduled-task/use-scheduled-tasks.js";
|
|
71
|
+
import { useScheduledTaskRuns as Nn } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
72
|
+
import { validateSkillFileBatch as Pn } from "./skill/skill-file-batch-validation.js";
|
|
73
|
+
import { skillFileToAttachment as Fn } from "./skill/skill-file-preview.js";
|
|
74
|
+
import { SkillEditorLoadState as In, useSkillEditorLoad as Ln } from "./skill/useSkillEditorLoad.js";
|
|
75
|
+
import { useSkillEditorSubmit as Rn } from "./skill/useSkillEditorSubmit.js";
|
|
76
|
+
import { useSkillFileActions as zn } from "./skill/useSkillFileActions.js";
|
|
77
|
+
import { SkillPreviewErrorKind as Bn, useSkillFilePreview as Vn } from "./skill/useSkillFilePreview.js";
|
|
78
|
+
import { useSkillsState as Hn } from "./skill/useSkillsState/useSkillsState.js";
|
|
79
|
+
import { SkillArchiveImportErrorKind as Un, SkillArchiveImportStatus as Wn, SkillArchiveSelectionRejectionReason as Gn, classifySkillArchiveImportError as Kn, useSkillArchiveImport as qn } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
|
|
80
|
+
import { RecipientsCountStatus as Jn, useShareRecipientsCount as Yn } from "./useShareRecipientsCount/useShareRecipientsCount.js";
|
|
81
|
+
import { deriveConversationRowActionState as Xn } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
82
|
+
import { useActiveConversationSync as Zn } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
83
|
+
import { useAsyncConfirmDialog as Qn } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
84
|
+
import { useConversationLookupMaps as $n } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
85
|
+
import { getConversationSource as er, useConversationPanelItems as tr } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
86
|
+
import { useImportFilePicker as nr } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
87
|
+
import { sanitizeFileName as rr, splitFileNameExtension as ir, trimFileNameToByteLimit as ar } from "./files/file-name.js";
|
|
88
|
+
import { useAttachmentUpload as or } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
89
|
+
import { AudioTranscriptionError as sr, AudioTranscriptionErrorReason as cr } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
90
|
+
import { useTranscribeAudio as lr } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
91
|
+
import { DEFAULT_MAX_ARCHIVE_BYTES as ur, useConversationExport as dr } from "./conversation/useConversationExport/useConversationExport.js";
|
|
92
|
+
import { attachmentToDto as fr, attachmentsToDtos as pr } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
93
|
+
import { createMessagePair as mr } from "./conversation/useConversationHandlers/message-factory.js";
|
|
94
|
+
import { hasActiveToolConfig as hr, isAnswerIncomplete as gr, isMessageChanged as _r, shouldRerunGenerationOnEdit as vr } from "./conversation/useConversationHandlers/message-utils.js";
|
|
95
|
+
import { getStarterConversationText as yr, getStarterDisplayText as br, getStarterSubmitText as xr } from "./conversation/useConversationHandlers/starter-option.js";
|
|
96
|
+
import { getConversationPath as Sr } from "./conversation/useConversationStream/conversation-path.js";
|
|
97
|
+
import { useConversationHandlers as Cr } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
98
|
+
import { useConversationImport as wr } from "./conversation/useConversationImport/useConversationImport.js";
|
|
99
|
+
import { useConversationScroll as Tr } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
100
|
+
import { applyChunkToMessages as Er, mergeStages as Dr } from "./conversation/useConversationStream/apply-chunk.js";
|
|
101
|
+
import { isAwaitingGenerationResume as Or } from "./conversation/useConversationStream/generation-resume.js";
|
|
102
|
+
import { useConversationStream as kr } from "./conversation/useConversationStream/useConversationStream.js";
|
|
103
|
+
import { useConversationSources as Ar } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
|
104
|
+
import { DialFilesApiUploadMode as jr } from "./files/dial-files-api.js";
|
|
105
|
+
import { FileManagerNotificationReason as Mr, FileNameValidationErrorReason as Nr, FileOperationKind as Pr } from "./files/dial-file-manager.types.js";
|
|
106
|
+
import { COLUMNS_WITHOUT_AUTHOR as Fr, COLUMNS_WITH_AUTHOR as Ir, CORE_PERMISSION_MAP as Lr, DATE_OPTIONS as Rr, PATH_SEPARATOR_REGEXP as zr, RESERVED_MARKER_NAME as Br, UPLOAD_CONCURRENCY as Vr } from "./files/dial-file-manager.model.js";
|
|
107
|
+
import { DialFileManagerActionProfile as Hr, DialFileManagerVariant as Ur, deriveActionProfile as Wr } from "./files/file-manager-variant.js";
|
|
108
|
+
import { buildSharedItemVirtualPath as Gr, dialCorePathToRelative as Kr, findDialFileByPath as qr, findFolderByVirtualPath as Jr, formatOperationFolderName as Yr, getVirtualPathName as Xr, hasDialFileWritePermission as Zr, hasForbiddenNameSymbols as Qr, isCopyMoveDuplicateAllowed as $r, isShareActionsAllowed as ei, normalizeVirtualPath as ti, parseNewFolderVirtualPath as ni, resolveOwnerCoords as ri } from "./files/dial-file-manager-path.util.js";
|
|
109
|
+
import { getParentFolderPath as ii, resolveDialFileApiPath as ai, virtualPathToApiPath as oi } from "./files/resolve-dial-file-api-path.js";
|
|
110
|
+
import { prepareCopyItems as si, prepareMoveRenameItems as ci } from "./files/dial-file-manager-copy-move.util.js";
|
|
111
|
+
import { buildFromCache as li, fetchByTab as ui, fetchForSearch as di, findFirstSuccessfulCopyMoveItem as fi, mapCorePermissions as pi, mapFileMetadataToDialFile as mi, mapSearchItem as hi, mergeCreatedFolderIntoCache as gi, updateEntry as _i } from "./files/dial-file-manager-mapping.util.js";
|
|
112
|
+
import { createFilesApiClient as vi } from "./files/create-files-api.js";
|
|
113
|
+
import { createUploadFileWithProgress as yi } from "./files/create-upload-file-with-progress.js";
|
|
114
|
+
import { openAnnotationAttachment as bi } from "./files/annotation.js";
|
|
115
|
+
import { annotationToOoxmlCanvasContent as xi, annotationToPdfCanvasContent as Si, clearAttachmentCache as Ci, hasAttachmentTextSource as wi, referenceAttachmentToPdfCanvasContent as Ti, resolveCodeCanvasContent as Ei, resolveGroupedVisualizerCanvasContent as Di, resolveHtmlCanvasContent as Oi, resolveImageCanvasContent as ki, resolveJsonCanvasContent as Ai, resolveMarkdownCanvasContent as ji, resolveOoxmlCanvasContent as Mi, resolvePdfCanvasContent as Ni, resolveTextCanvasContent as Pi, resolveVisualizerCanvasContent as Fi } from "./files/attachment-canvas.js";
|
|
116
|
+
import { getUrlFileName as Ii, isExternalSourcePreviewable as Li, resolveExternalSourceContentType as Ri } from "./files/source-content.js";
|
|
117
|
+
import { annotationToDisplayAttachment as zi, attachmentDtoToDisplayAttachment as Bi, attachmentDtosToDisplayAttachments as Vi } from "./files/attachment-dto-to-display.js";
|
|
118
|
+
import { dialFileToAttachment as Hi, dialFilesToAttachments as Ui, dialFolderPathToAttachment as Wi } from "./files/dial-file-to-attachment.js";
|
|
119
|
+
import { DownloadDestinationType as Gi } from "./files/download-destination.js";
|
|
120
|
+
import { prepareDownloadDestination as Ki } from "./files/prepare-download-destination.js";
|
|
121
|
+
import { useDialFileListing as qi } from "./files/useDialFileListing/useDialFileListing.js";
|
|
122
|
+
import { useDialFileMetadata as Ji } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
123
|
+
import { useDialFileMutations as Yi } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
124
|
+
import { useDialFileSharing as Xi } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
125
|
+
import { useDialFileUploadBatch as Zi } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
126
|
+
import { useDialFileManager as Qi } from "./files/useDialFileManager/useDialFileManager.js";
|
|
127
|
+
import { useDialFileManagerTabConfig as $i } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
128
|
+
import { useFileAttachmentPicker as ea } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
129
|
+
import { isCustomAppSchema as ta, isQuickAppSchema as na } from "./shared/application-schema.js";
|
|
130
|
+
import { getBrowserTimezone as ra } from "./shared/browser-timezone.js";
|
|
131
|
+
import { isValidAbsoluteUrl as ia, isValidFeaturesData as aa, parseFeaturesData as oa } from "./shared/custom-apps.js";
|
|
132
|
+
import { buildExternalServiceScopeId as sa, getExternalServiceFallbackName as ca, parseExternalServiceUrl as la } from "./shared/external-services.js";
|
|
133
|
+
import { useChatSettingsFormConfig as ua } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
134
|
+
import { usePageFileDrag as da } from "./usePageFileDrag/usePageFileDrag.js";
|
|
135
|
+
import { useViewportWidth as fa } from "./useViewportWidth/useViewportWidth.js";
|
|
136
|
+
import { usePanelMaxWidth as pa } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
137
|
+
import { useShareLink as ma } from "./useShareLink/useShareLink.js";
|
|
138
|
+
import { useToolsMenu as ha } from "./useToolsMenu/useToolsMenu.js";
|
|
139
|
+
import { useUsageData as ga } from "./usage/useUsageData/useUsageData.js";
|
|
140
|
+
import { McpAppResourceFetchError as _a, createMcpAppsApiClient as va } from "./mcp-apps/mcp-apps-api-client.js";
|
|
141
|
+
import { useMcpAppTools as ya } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
142
|
+
import { useMcpAppHostContext as ba } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
143
|
+
import { useMcpAppHostAdapter as xa } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
144
|
+
import { useOpenMcpAppCanvas as Sa } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
145
|
+
import { useGridEditingScroll as Ca } from "@epam/ai-dial-chat-shared";
|
|
146
|
+
export { x as AttachmentValidationErrorReason, sr as AudioTranscriptionError, cr as AudioTranscriptionErrorReason, R as AuthenticationType, Fr as COLUMNS_WITHOUT_AUTHOR, Ir as COLUMNS_WITH_AUTHOR, Lr as CORE_PERMISSION_MAP, et as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, Rr as DATE_OPTIONS, zt as DEFAULT_GENERATION_CONFLICT_MESSAGE, ur as DEFAULT_MAX_ARCHIVE_BYTES, Hr as DialFileManagerActionProfile, Ur as DialFileManagerVariant, jr as DialFilesApiUploadMode, Gi as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, jt as FavoriteEntityType, Mr as FileManagerNotificationReason, Nr as FileNameValidationErrorReason, Pr as FileOperationKind, Bt as GenerationConflictError, _a as McpAppResourceFetchError, ze as McpResourceKind, ot as OAuthResourceKind, zr as PATH_SEPARATOR_REGEXP, un as PROMPT_CONTENT_MAX_LENGTH, dn as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, fn as PROMPT_DESCRIPTION_MAX_LENGTH, pn as PROMPT_NAME_MAX_LENGTH, Te as PUBLIC_SKILL_BUCKET, mn as PromptFieldError, ae as PromptSource, Br as RESERVED_MARKER_NAME, Jn as RecipientsCountStatus, ue as SKILL_FILE_UPLOAD_MAX_BYTES, Ee as SKILL_LISTING_MAX_PAGES, De as SKILL_LISTING_PAGE_SIZE, de as SKILL_MANIFEST_FILE, Oe as SKILL_MANIFEST_MAX_BYTES, fe as SKILL_UPLOAD_MAX_FILES, pe as SKILL_UPLOAD_MAX_TOTAL_BYTES, Sn as ScheduledTaskTriggerDescriptionKind, Un as SkillArchiveImportErrorKind, Wn as SkillArchiveImportStatus, Gn as SkillArchiveSelectionRejectionReason, In as SkillEditorLoadState, Bn as SkillPreviewErrorKind, ke as SkillSource, st as TOOLSET_REDIRECT_STATE_KEY, ct as ToolsetAuthStatus, lt as ToolsetAuthTypes, ut as ToolsetCredentialsLevel, Et as ToolsetLoginOutcomeType, dt as ToolsetOAuthCallbackQuery, ft as ToolsetOAuthChannelControlType, pt as ToolsetOAuthFailureReason, mt as ToolsetOAuthInitiationResultType, ht as ToolsetOAuthResultType, Vr as UPLOAD_CONCURRENCY, xn as UnsupportedTriggerReason, gt as WithLogin, zi as annotationToDisplayAttachment, xi as annotationToOoxmlCanvasContent, Si as annotationToPdfCanvasContent, wn as apSchedulerDayToJsDay, W as appendLocaleCode, Er as applyChunkToMessages, Bi as attachmentDtoToDisplayAttachment, Vi as attachmentDtosToDisplayAttachments, fr as attachmentToDto, pr as attachmentsToDtos, G as buildAdditionalLocaleOptions, Pt as buildAnnouncementSignature, Be as buildApplicationMcpUrl, N as buildChatCompletionsUrl, Ve as buildConnectApi, P as buildDeploymentConnectApi, sa as buildExternalServiceScopeId, li as buildFromCache, sn as buildPromptExportEnvelope, cn as buildPromptExportFileName, se as buildPromptOverview, hn as buildPromptPath, F as buildResponsesUrl, Gr as buildSharedItemVirtualPath, je as buildSkillContentTree, me as buildSkillFilesPayload, he as buildSkillManifest, ge as buildSkillManifestForSubmit, _e as buildSkillManifestFromFrontmatter, Me as buildSkillOverview, xt as buildToolsetAuthorizeUrl, He as buildToolsetMcpUrl, Kn as classifySkillArchiveImportError, Ci as clearAttachmentCache, K as composeLocalePayload, Vt as createChatStreamApi, i as createCsrfMiddleware, qt as createDeploymentChangedMessage, vi as createFilesApiClient, va as createMcpAppsApiClient, mr as createMessagePair, j as createPublishApiClient, jn as createScheduledTasksApiClient, a as createUnauthorizedMiddleware, yi as createUploadFileWithProgress, V as decodeToolsetId, q as decomposeLocalizedFields, Wr as deriveActionProfile, Ye as deriveAvailableTabIds, Xn as deriveConversationRowActionState, Xe as deriveFavoriteItems, Cn as describeScheduledTaskTrigger, Kr as dialCorePathToRelative, Hi as dialFileToAttachment, Ui as dialFilesToAttachments, Wi as dialFolderPathToAttachment, m as downloadAttachment, _t as emitToolsetLoginSuccess, I as encodeDeploymentId, H as encodeToolsetId, ui as fetchByTab, di as fetchForSearch, Ze as filterCatalogItemsBySelector, Qe as filterHiddenOwnedItems, L as findDeploymentByIdOrReference, qr as findDialFileByPath, fi as findFirstSuccessfulCopyMoveItem, Jr as findFolderByVirtualPath, Ut as formatAppVersion, X as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Yr as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, ra as getBrowserTimezone, Sr as getConversationPath, er as getConversationSource, ca as getExternalServiceFallbackName, Jt as getLastDeploymentId, Yt as getLastUserMessageToolConfiguration, Gt as getModelIdFromConversationId, ii as getParentFolderPath, We as getPublicCatalogEntityFolderPath, en as getQuickAppConversationStarters, gn as getRemainingCharacters, yr as getStarterConversationText, br as getStarterDisplayText, rn as getStarterPopulateText, xr as getStarterSubmitText, an as getStartersFromSchema, Kt as getTimeOfDayGreeting, yt as getToolsetOAuthChannelName, St as getToolsetRedirectUri, Ii as getUrlFileName, Xr as getVirtualPathName, hr as hasActiveToolConfig, Ft as hasAnnouncementContent, wi as hasAttachmentTextSource, Zr as hasDialFileWritePermission, Qr as hasForbiddenNameSymbols, It as hasStructuredAnnouncement, o as includesIgnoreCase, Ct as initiateOAuthLogin, gr as isAnswerIncomplete, Or as isAwaitingGenerationResume, r as isConversationNotFoundError, $r as isCopyMoveDuplicateAllowed, ta as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, Li as isExternalSourcePreviewable, _r as isMessageChanged, Xt as isMessageStreaming, ce as isOrganisationPromptItem, Ge as isPublicCatalogEntityId, U as isPublicToolsetId, na as isQuickAppSchema, ei as isShareActionsAllowed, ia as isValidAbsoluteUrl, aa as isValidFeaturesData, ve as isValidSkillRelativePath, Tn as jsDayToApSchedulerDay, pi as mapCorePermissions, Q as mapDeploymentDetailsDtoToEntityDetails, z as mapDeploymentLimitsDtoToCatalogLimits, B as mapDeploymentLimitsToInput, te as mapDeploymentToCatalogItem, ne as mapDeploymentToolsetCredentials, $ as mapEntityDetailsToCatalogDetails, mi as mapFileMetadataToDialFile, En as mapFormValuesToCreateBody, Dn as mapFormValuesToUpdateBody, le as mapPromptToCatalogItem, Ke as mapPublishConversationResultDto, qe as mapPublishHistoryEntryDto, On as mapScheduledTaskDtoToFormValues, hi as mapSearchItem, Ne as mapSkillToCatalogItem, tn as mapStages, ee as mapToolsetCredentials, re as mapToolsetToCatalogItem, gi as mergeCreatedFolderIntoCache, Dr as mergeStages, Zt as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, ye as nameFromPath, wt as navigateToolsetOAuthPopup, Qt as normalizeResponseFormat, be as normalizeSkillName, ti as normalizeVirtualPath, bi as openAnnotationAttachment, Tt as openToolsetOAuthPopup, Z as padTwoDigits, la as parseExternalServiceUrl, oa as parseFeaturesData, ni as parseNewFolderVirtualPath, oe as parsePromptResourceUrl, xe as parseSkillManifest, rt as parseSkillManifestDocument, Ae as parseSkillResourceUrl, si as prepareCopyItems, Ki as prepareDownloadDestination, ci as prepareMoveRenameItems, kn as prepareScheduledTaskCreateBody, An as prepareScheduledTaskUpdateBody, Pe as readSkillFileBytes, Fe as readSkillFilePreviewBytes, Ie as readSkillManifest, $e as reconcileFilterTopics, Ti as referenceAttachmentToPdfCanvasContent, tt as resolveCatalogPrimaryAction, Ei as resolveCodeCanvasContent, ie as resolveDeploymentFolder, ai as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, Ri as resolveExternalSourceContentType, Di as resolveGroupedVisualizerCanvasContent, Oi as resolveHtmlCanvasContent, ki as resolveImageCanvasContent, Ai as resolveJsonCanvasContent, J as resolveLocalizedText, ji as resolveMarkdownCanvasContent, Ue as resolveMcpResourceKind, Mi as resolveOoxmlCanvasContent, ri as resolveOwnerCoords, Ni as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Le as resolveSkillFileDownloadPath, Re as resolveSkillManifestFileId, Pi as resolveTextCanvasContent, Fi as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Lt as sanitizeAnnouncementHtml, Rt as sanitizeAnnouncementMessageHtml, rr as sanitizeFileName, Wt as sanitizeFooterHtml, ln as serializePromptExport, vr as shouldRerunGenerationOnEdit, Ht as shouldWatchForDisplayNameUpdate, Se as skillFileBytesToBlob, Fn as skillFileToAttachment, ir as splitFileNameExtension, Ce as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, vt as subscribeToolsetLoginSuccess, Y as toBaseLocale, $t as toOverlayMessages, Je as toPublishEntityType, M as toPublishRuleDto, nn as toStage, ar as trimFileNameToByteLimit, we as unpackSkillArchive, _i as updateEntry, Zn as useActiveConversationSync, kt as useApplicationCredentials, Qn as useAsyncConfirmDialog, g as useAttachmentAction, or as useAttachmentUpload, S as useAttachmentValidation, nt as useCatalogEditNavigation, at as useCatalogItemDetails, Ot as useCatalogToolsetCredentials, ua as useChatSettingsFormConfig, dr as useConversationExport, Cr as useConversationHandlers, wr as useConversationImport, $n as useConversationLookupMaps, tr as useConversationPanelItems, Tr as useConversationScroll, Ar as useConversationSources, kr as useConversationStream, qi as useDialFileListing, Qi as useDialFileManager, $i as useDialFileManagerTabConfig, Ji as useDialFileMetadata, Yi as useDialFileMutations, Xi as useDialFileSharing, Zi as useDialFileUploadBatch, Mt as useFavoriteEntitiesState, ea as useFileAttachmentPicker, Ca as useGridEditingScroll, nr as useImportFilePicker, xa as useMcpAppHostAdapter, ba as useMcpAppHostContext, ya as useMcpAppTools, on as useOAuthCallbackCompletion, Sa as useOpenMcpAppCanvas, da as usePageFileDrag, pa as usePanelMaxWidth, bn as usePromptsState, Nt as usePublishFolders, Nn as useScheduledTaskRuns, Mn as useScheduledTasks, ma as useShareLink, Yn as useShareRecipientsCount, qn as useSkillArchiveImport, At as useSkillDetailsPanelData, Ln as useSkillEditorLoad, Rn as useSkillEditorSubmit, zn as useSkillFileActions, Vn as useSkillFilePreview, it as useSkillItemDetails, Hn as useSkillsState, ha as useToolsMenu, Dt as useToolsetLogin, lr as useTranscribeAudio, ga as useUsageData, fa as useViewportWidth, _n as validatePromptContent, vn as validatePromptDescription, yn as validatePromptName, Pn as validateSkillFileBatch, oi as virtualPathToApiPath, bt as waitForToolsetOAuthResult };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.93",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@epam/ai-dial-chat-api-client": "1.2.0-dev.
|
|
109
|
+
"@epam/ai-dial-chat-api-client": "1.2.0-dev.93",
|
|
110
110
|
"dompurify": "3.4.15",
|
|
111
111
|
"fflate": "^0.8.3",
|
|
112
112
|
"lru-cache": "^10.4.3",
|
|
@@ -115,20 +115,20 @@
|
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"react": "^19.2.8",
|
|
118
|
-
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.
|
|
119
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
120
|
-
"@epam/ai-dial-builder-form": "1.2.0-dev.
|
|
121
|
-
"@epam/ai-dial-catalog": "1.2.0-dev.
|
|
122
|
-
"@epam/ai-dial-chat-overlay": "1.2.0-dev.
|
|
123
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
124
|
-
"@epam/ai-dial-mcp-apps": "1.2.0-dev.
|
|
125
|
-
"@epam/ai-dial-publish-panel": "1.2.0-dev.
|
|
126
|
-
"@epam/ai-dial-quotations": "1.2.0-dev.
|
|
118
|
+
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.93",
|
|
119
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.93",
|
|
120
|
+
"@epam/ai-dial-builder-form": "1.2.0-dev.93",
|
|
121
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.93",
|
|
122
|
+
"@epam/ai-dial-chat-overlay": "1.2.0-dev.93",
|
|
123
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.93",
|
|
124
|
+
"@epam/ai-dial-mcp-apps": "1.2.0-dev.93",
|
|
125
|
+
"@epam/ai-dial-publish-panel": "1.2.0-dev.93",
|
|
126
|
+
"@epam/ai-dial-quotations": "1.2.0-dev.93",
|
|
127
127
|
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.4",
|
|
128
|
-
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.
|
|
129
|
-
"@epam/ai-dial-share": "1.2.0-dev.
|
|
130
|
-
"@epam/ai-dial-skill-editor": "1.2.0-dev.
|
|
131
|
-
"@epam/ai-dial-source-panel": "1.2.0-dev.
|
|
128
|
+
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.93",
|
|
129
|
+
"@epam/ai-dial-share": "1.2.0-dev.93",
|
|
130
|
+
"@epam/ai-dial-skill-editor": "1.2.0-dev.93",
|
|
131
|
+
"@epam/ai-dial-source-panel": "1.2.0-dev.93",
|
|
132
132
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.12",
|
|
133
133
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
134
134
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region src/scheduled-task/scheduled-task-description.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.OneTime = "oneTime", e.Hourly = "hourly", e.EveryNMinutes = "everyNMinutes", e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e.Custom = "custom", e.Invalid = "invalid", e;
|
|
4
|
+
}({}), t = (e, { timeZone: t = "UTC", referenceDate: n = /* @__PURE__ */ new Date() } = {}) => {
|
|
5
|
+
let r = (e, t = {}) => ({
|
|
6
|
+
kind: e,
|
|
7
|
+
sourceTimezone: "utc",
|
|
8
|
+
...t
|
|
9
|
+
});
|
|
10
|
+
if (e.date && e.cron) return r("invalid");
|
|
11
|
+
if (e.date) {
|
|
12
|
+
let t = new Date(e.date);
|
|
13
|
+
return Number.isNaN(t.getTime()) ? r("invalid") : r("oneTime", { date: t });
|
|
14
|
+
}
|
|
15
|
+
let i = e.cron?.fields;
|
|
16
|
+
if (!i || Object.keys(i).length === 0) return r("invalid");
|
|
17
|
+
let a = () => r("custom", { expression: JSON.stringify(i) }), o = {
|
|
18
|
+
hour: [0, 23],
|
|
19
|
+
minute: [0, 59],
|
|
20
|
+
day: [1, 31],
|
|
21
|
+
day_of_week: [0, 6],
|
|
22
|
+
month: [1, 12],
|
|
23
|
+
second: [0, 59]
|
|
24
|
+
};
|
|
25
|
+
for (let [e, t] of Object.entries(i)) {
|
|
26
|
+
if (t == null) continue;
|
|
27
|
+
if (!t.trim()) return r("invalid");
|
|
28
|
+
let n = o[e];
|
|
29
|
+
if (n && /^-?\d+$/.test(t) && (Number(t) < n[0] || Number(t) > n[1])) return r("invalid");
|
|
30
|
+
if (e === "second" && t !== "0" || ![
|
|
31
|
+
"hour",
|
|
32
|
+
"minute",
|
|
33
|
+
"day",
|
|
34
|
+
"day_of_week"
|
|
35
|
+
].includes(e) && t !== "*" && !(e === "second" && t === "0")) return a();
|
|
36
|
+
}
|
|
37
|
+
let s = i.hour, c = i.minute, l = i.day === "*" ? void 0 : i.day, u = i.day_of_week === "*" ? void 0 : i.day_of_week, d = u ? [
|
|
38
|
+
"monday",
|
|
39
|
+
"tuesday",
|
|
40
|
+
"wednesday",
|
|
41
|
+
"thursday",
|
|
42
|
+
"friday",
|
|
43
|
+
"saturday",
|
|
44
|
+
"sunday"
|
|
45
|
+
].findIndex((e) => e === u.toLowerCase() || e.slice(0, 3) === u.toLowerCase()) : -1, f = d >= 0 ? String(d) : u;
|
|
46
|
+
if (l && f || l && !/^\d+$/.test(l) || f && !/^\d+$/.test(f)) return a();
|
|
47
|
+
let p = s == null || s === "*", m = c?.match(/^\*\/(\d+)$/);
|
|
48
|
+
if (p && m && !l && !f) {
|
|
49
|
+
let e = Number(m[1]);
|
|
50
|
+
return e > 0 && e <= 59 ? r("everyNMinutes", { intervalMinutes: e }) : r("invalid");
|
|
51
|
+
}
|
|
52
|
+
if (!c || !/^\d+$/.test(c) || !p && !/^\d+$/.test(s) || p && (l || f)) return a();
|
|
53
|
+
let h = new Date(n);
|
|
54
|
+
if (Number.isNaN(h.getTime())) return r("invalid");
|
|
55
|
+
if (h.setUTCHours(p ? 0 : Number(s), Number(c), 0, 0), f) {
|
|
56
|
+
let e = (Number(f) + 1) % 7;
|
|
57
|
+
h.setUTCDate(h.getUTCDate() + (e - h.getUTCDay() + 7) % 7);
|
|
58
|
+
}
|
|
59
|
+
let g = new Intl.DateTimeFormat("en-GB", {
|
|
60
|
+
timeZone: t,
|
|
61
|
+
hourCycle: "h23",
|
|
62
|
+
year: "numeric",
|
|
63
|
+
month: "2-digit",
|
|
64
|
+
day: "2-digit",
|
|
65
|
+
hour: "2-digit",
|
|
66
|
+
minute: "2-digit"
|
|
67
|
+
}).formatToParts(h), _ = (e) => g.find((t) => t.type === e)?.value ?? "", v = new Date(Date.UTC(Number(_("year")), Number(_("month")) - 1, Number(_("day")))), y = Date.UTC(h.getUTCFullYear(), h.getUTCMonth(), h.getUTCDate()), b = Math.round((v.getTime() - y) / 864e5), x = _("hour") + ":" + _("minute");
|
|
68
|
+
return p ? r("hourly", { time: _("minute") }) : f ? r("weekly", {
|
|
69
|
+
time: x,
|
|
70
|
+
dayOfWeek: String((Number(f) + b + 7) % 7)
|
|
71
|
+
}) : l ? b === 0 || Number(l) <= 28 && Number(l) + b >= 1 && Number(l) + b <= 28 ? r("monthly", {
|
|
72
|
+
time: x,
|
|
73
|
+
dayOfMonth: String(Number(l) + b)
|
|
74
|
+
}) : a() : r("daily", { time: x });
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { e as ScheduledTaskTriggerDescriptionKind, t as describeScheduledTaskTrigger };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { mapFormValuesToCreateBody as e, mapFormValuesToUpdateBody as t } from "./scheduled-task-trigger.js";
|
|
2
|
+
import { validateScheduledTaskFormValues as n } from "@epam/ai-dial-scheduled-tasks/validation";
|
|
3
|
+
//#region src/scheduled-task/scheduled-task-preparation.ts
|
|
4
|
+
var r = (t, r) => {
|
|
5
|
+
let i = n(t, r);
|
|
6
|
+
return Object.keys(i).length > 0 ? {
|
|
7
|
+
ok: !1,
|
|
8
|
+
errors: i
|
|
9
|
+
} : {
|
|
10
|
+
ok: !0,
|
|
11
|
+
body: e(t)
|
|
12
|
+
};
|
|
13
|
+
}, i = (e, r) => {
|
|
14
|
+
let i = n(e, r);
|
|
15
|
+
return Object.keys(i).length > 0 ? {
|
|
16
|
+
ok: !1,
|
|
17
|
+
errors: i
|
|
18
|
+
} : {
|
|
19
|
+
ok: !0,
|
|
20
|
+
body: t(e)
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as prepareScheduledTaskCreateBody, i as prepareScheduledTaskUpdateBody };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/scheduled-task/scheduled-tasks-api-client.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
if (!Array.isArray(e.items)) throw TypeError("Scheduled tasks API returned a malformed page response");
|
|
4
|
+
return e;
|
|
5
|
+
}, t = (t) => ({
|
|
6
|
+
listScheduledTasks: async ({ signal: n, ...r } = {}) => e(await t.listScheduledTasks(r, n ? { signal: n } : void 0)),
|
|
7
|
+
listScheduledTaskRuns: async ({ signal: n, ...r }) => e(await t.listScheduledTaskRuns(r, n ? { signal: n } : void 0)),
|
|
8
|
+
createScheduledTask: (e) => t.createScheduledTask({ createScheduledTaskBodyDto: e }),
|
|
9
|
+
getScheduledTask: (e) => t.getScheduledTask({ scheduleId: e }),
|
|
10
|
+
updateScheduledTask: (e, n) => t.updateScheduledTask({
|
|
11
|
+
scheduleId: e,
|
|
12
|
+
updateScheduledTaskBodyDto: n
|
|
13
|
+
}),
|
|
14
|
+
pauseScheduledTask: (e) => t.pauseScheduledTask({ scheduleId: e }),
|
|
15
|
+
resumeScheduledTask: (e) => t.resumeScheduledTask({ scheduleId: e }),
|
|
16
|
+
deleteScheduledTask: (e) => t.deleteScheduledTask({ scheduleId: e })
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as createScheduledTasksApiClient };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
//#region src/scheduled-task/use-scheduled-task-runs.ts
|
|
3
|
+
var i = (i, { scheduleId: a, enabled: o = !0, pageSize: s = 10 }) => {
|
|
4
|
+
let [c, l] = r([]), [u, d] = r(o), [f, p] = r(!1), [m, h] = r(null), [g, _] = r(null), [v, y] = r(!1), [b, x] = r(0), S = n(0), C = n(0), w = n(!1), T = n(null);
|
|
5
|
+
t(() => {
|
|
6
|
+
let e = ++S.current, t = new AbortController();
|
|
7
|
+
T.current?.abort(), T.current = null, w.current = !1, p(!1), h(null), _(null), l([]), y(!1), C.current = 0;
|
|
8
|
+
let n = () => {
|
|
9
|
+
++S.current, t.abort(), T.current?.abort(), T.current = null;
|
|
10
|
+
};
|
|
11
|
+
return !o || !a ? (d(!1), l([]), y(!1), n) : ((async () => {
|
|
12
|
+
d(!0);
|
|
13
|
+
try {
|
|
14
|
+
let n = await i.listScheduledTaskRuns({
|
|
15
|
+
scheduleId: a,
|
|
16
|
+
limit: s,
|
|
17
|
+
offset: 0,
|
|
18
|
+
signal: t.signal
|
|
19
|
+
});
|
|
20
|
+
if (S.current !== e) return;
|
|
21
|
+
l(n.items), C.current = n.items.length, y(n.next != null || (n.count == null ? n.items.length === s : n.items.length < n.count));
|
|
22
|
+
} catch (t) {
|
|
23
|
+
S.current === e && h(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load scheduled task runs"));
|
|
24
|
+
} finally {
|
|
25
|
+
S.current === e && d(!1);
|
|
26
|
+
}
|
|
27
|
+
})(), n);
|
|
28
|
+
}, [
|
|
29
|
+
i,
|
|
30
|
+
o,
|
|
31
|
+
s,
|
|
32
|
+
b,
|
|
33
|
+
a
|
|
34
|
+
]);
|
|
35
|
+
let E = e(() => {
|
|
36
|
+
if (!o || !a || !v || u || w.current) return;
|
|
37
|
+
w.current = !0;
|
|
38
|
+
let e = new AbortController();
|
|
39
|
+
T.current = e;
|
|
40
|
+
let t = S.current, n = C.current;
|
|
41
|
+
(async () => {
|
|
42
|
+
p(!0), _(null);
|
|
43
|
+
try {
|
|
44
|
+
let r = await i.listScheduledTaskRuns({
|
|
45
|
+
scheduleId: a,
|
|
46
|
+
limit: s,
|
|
47
|
+
offset: n,
|
|
48
|
+
signal: e.signal
|
|
49
|
+
});
|
|
50
|
+
if (S.current !== t) return;
|
|
51
|
+
l((e) => {
|
|
52
|
+
let t = new Set(e.map(({ id: e }) => e));
|
|
53
|
+
return [...e, ...r.items.filter(({ id: e }) => t.has(e) ? !1 : (t.add(e), !0))];
|
|
54
|
+
}), C.current = n + r.items.length, y(r.next != null || (r.count == null ? r.items.length === s : n + r.items.length < r.count));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
S.current === t && _(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load more scheduled task runs"));
|
|
57
|
+
} finally {
|
|
58
|
+
S.current === t && (p(!1), w.current = !1, T.current = null);
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
}, [
|
|
62
|
+
i,
|
|
63
|
+
o,
|
|
64
|
+
v,
|
|
65
|
+
u,
|
|
66
|
+
s,
|
|
67
|
+
a
|
|
68
|
+
]);
|
|
69
|
+
return {
|
|
70
|
+
items: c,
|
|
71
|
+
isLoading: u,
|
|
72
|
+
isLoadingMore: f,
|
|
73
|
+
initialError: m,
|
|
74
|
+
loadMoreError: g,
|
|
75
|
+
hasMore: v,
|
|
76
|
+
loadMore: E,
|
|
77
|
+
retryLoadMore: E,
|
|
78
|
+
refetch: e(() => x((e) => e + 1), [])
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { i as useScheduledTaskRuns };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
//#region src/scheduled-task/use-scheduled-tasks.ts
|
|
3
|
+
var i = (i, { enabled: a = !0, pageSize: o = 20, debounceMs: s = 300, initialSearch: c = "", initialSort: l = "first_to_run" } = {}) => {
|
|
4
|
+
let [u, d] = r([]), [f, p] = r(c), [m, h] = r(l), [g, _] = r(a), [v, y] = r(!1), [b, x] = r(null), [S, C] = r(null), [w, T] = r(!1), [E, D] = r(0), O = n(0), k = n(0), A = n(!1), j = n(null), [M, N] = r(c);
|
|
5
|
+
t(() => {
|
|
6
|
+
let e = setTimeout(() => N(f), s);
|
|
7
|
+
return () => clearTimeout(e);
|
|
8
|
+
}, [s, f]), t(() => {
|
|
9
|
+
let e = ++O.current, t = new AbortController();
|
|
10
|
+
j.current?.abort(), j.current = null, A.current = !1, y(!1), x(null), C(null), d([]), T(!1), k.current = 0;
|
|
11
|
+
let n = () => {
|
|
12
|
+
++O.current, t.abort(), j.current?.abort(), j.current = null;
|
|
13
|
+
};
|
|
14
|
+
return a ? ((async () => {
|
|
15
|
+
_(!0);
|
|
16
|
+
try {
|
|
17
|
+
let n = await i.listScheduledTasks({
|
|
18
|
+
limit: o,
|
|
19
|
+
offset: 0,
|
|
20
|
+
search: M,
|
|
21
|
+
sort: m,
|
|
22
|
+
signal: t.signal
|
|
23
|
+
});
|
|
24
|
+
if (O.current !== e) return;
|
|
25
|
+
d(n.items), k.current = n.items.length, T(n.next != null);
|
|
26
|
+
} catch (t) {
|
|
27
|
+
O.current === e && x(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load scheduled tasks"));
|
|
28
|
+
} finally {
|
|
29
|
+
O.current === e && _(!1);
|
|
30
|
+
}
|
|
31
|
+
})(), n) : (_(!1), d([]), T(!1), n);
|
|
32
|
+
}, [
|
|
33
|
+
i,
|
|
34
|
+
M,
|
|
35
|
+
a,
|
|
36
|
+
o,
|
|
37
|
+
E,
|
|
38
|
+
m
|
|
39
|
+
]);
|
|
40
|
+
let P = e(() => {
|
|
41
|
+
if (!a || !w || g || A.current) return;
|
|
42
|
+
A.current = !0;
|
|
43
|
+
let e = new AbortController();
|
|
44
|
+
j.current = e;
|
|
45
|
+
let t = O.current, n = k.current;
|
|
46
|
+
(async () => {
|
|
47
|
+
y(!0), C(null);
|
|
48
|
+
try {
|
|
49
|
+
let r = await i.listScheduledTasks({
|
|
50
|
+
limit: o,
|
|
51
|
+
offset: n,
|
|
52
|
+
signal: e.signal,
|
|
53
|
+
search: M,
|
|
54
|
+
sort: m
|
|
55
|
+
});
|
|
56
|
+
if (O.current !== t) return;
|
|
57
|
+
d((e) => {
|
|
58
|
+
let t = new Set(e.map(({ id: e }) => e));
|
|
59
|
+
return [...e, ...r.items.filter(({ id: e }) => t.has(e) ? !1 : (t.add(e), !0))];
|
|
60
|
+
}), k.current = n + r.items.length, T(r.next != null);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
O.current === t && C(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load more scheduled tasks"));
|
|
63
|
+
} finally {
|
|
64
|
+
O.current === t && (y(!1), A.current = !1, j.current = null);
|
|
65
|
+
}
|
|
66
|
+
})();
|
|
67
|
+
}, [
|
|
68
|
+
i,
|
|
69
|
+
M,
|
|
70
|
+
a,
|
|
71
|
+
w,
|
|
72
|
+
g,
|
|
73
|
+
o,
|
|
74
|
+
m
|
|
75
|
+
]);
|
|
76
|
+
return {
|
|
77
|
+
items: u,
|
|
78
|
+
searchQuery: f,
|
|
79
|
+
setSearchQuery: p,
|
|
80
|
+
sortKey: m,
|
|
81
|
+
setSortKey: h,
|
|
82
|
+
isLoading: g,
|
|
83
|
+
isLoadingMore: v,
|
|
84
|
+
initialError: b,
|
|
85
|
+
loadMoreError: S,
|
|
86
|
+
hasMore: w,
|
|
87
|
+
loadMore: P,
|
|
88
|
+
retryLoadMore: P,
|
|
89
|
+
refetch: e(() => D((e) => e + 1), [])
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { i as useScheduledTasks };
|
package/scheduled-tasks.d.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { CreatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
1
2
|
import { CreateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { Dispatch } from 'react';
|
|
4
|
+
import { ListScheduledTaskRunsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
5
|
+
import { ListScheduledTasksResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
6
|
+
import { ListScheduledTasksSortEnum } from '@epam/ai-dial-chat-api-client';
|
|
2
7
|
import { ScheduledTaskCreateFormValues } from '@epam/ai-dial-scheduled-tasks';
|
|
3
8
|
import { ScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
9
|
+
import { ScheduledTaskRunDto } from '@epam/ai-dial-chat-api-client';
|
|
10
|
+
import { ScheduledTaskValidationErrors } from '../../libs/scheduled-tasks/validation';
|
|
11
|
+
import { ScheduledTaskValidationOptions } from '../../libs/scheduled-tasks/validation';
|
|
12
|
+
import { ScheduleTriggerDto } from '@epam/ai-dial-chat-api-client';
|
|
13
|
+
import { SetStateAction } from 'react';
|
|
14
|
+
import { UpdatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
|
|
4
15
|
import { UpdateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
5
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Composes scheduler operations over an already configured generated client.
|
|
19
|
+
* Authentication, base URL, CSRF, and retries remain host responsibilities.
|
|
20
|
+
*/
|
|
21
|
+
export declare const createScheduledTasksApiClient: (client: ScheduledTasksConfiguredClient) => ScheduledTasksApiClient;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Describes the complete trigger without requiring unrelated task metadata.
|
|
25
|
+
* Unsupported constraints remain Custom, with the full source expression.
|
|
26
|
+
* Calendar-month shifts crossing month boundaries or days 29–31 remain
|
|
27
|
+
* Custom because a shifted monthly day is not equivalent around short months.
|
|
28
|
+
*/
|
|
29
|
+
export declare const describeScheduledTaskTrigger: (trigger: ScheduleTriggerDto, { timeZone, referenceDate, }?: ScheduledTaskTriggerDescriptionOptions) => ScheduledTaskTriggerDescription;
|
|
30
|
+
|
|
6
31
|
/**
|
|
7
32
|
* Maps validated create-form values to the `POST /api/v1/scheduled-tasks`
|
|
8
33
|
* request body, building `trigger.date` for a one-shot schedule or
|
|
@@ -29,6 +54,15 @@ export declare const mapFormValuesToUpdateBody: (values: ScheduledTaskCreateForm
|
|
|
29
54
|
*/
|
|
30
55
|
export declare const mapScheduledTaskDtoToFormValues: (dto: ScheduledTaskDto) => ScheduledTaskDtoMappingResult;
|
|
31
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Validates form values before creating a request body. Hosts translate the
|
|
59
|
+
* returned field codes and must not issue a write when `ok` is false.
|
|
60
|
+
*/
|
|
61
|
+
export declare const prepareScheduledTaskCreateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<CreateScheduledTaskBodyDto>;
|
|
62
|
+
|
|
63
|
+
/** Validates form values before preparing an update request body. */
|
|
64
|
+
export declare const prepareScheduledTaskUpdateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<UpdateScheduledTaskBodyDto>;
|
|
65
|
+
|
|
32
66
|
/** Result of mapping a scheduled task DTO back to editable form values. */
|
|
33
67
|
export declare type ScheduledTaskDtoMappingResult = {
|
|
34
68
|
ok: true;
|
|
@@ -38,6 +72,106 @@ export declare type ScheduledTaskDtoMappingResult = {
|
|
|
38
72
|
reason: UnsupportedTriggerReason;
|
|
39
73
|
};
|
|
40
74
|
|
|
75
|
+
/** A checked request preparation result that never serializes invalid values. */
|
|
76
|
+
export declare type ScheduledTaskPreparationResult<TBody> = {
|
|
77
|
+
ok: true;
|
|
78
|
+
body: TBody;
|
|
79
|
+
} | {
|
|
80
|
+
ok: false;
|
|
81
|
+
errors: ScheduledTaskValidationErrors;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export declare interface ScheduledTaskRunsListRequest {
|
|
85
|
+
scheduleId: string;
|
|
86
|
+
limit?: number;
|
|
87
|
+
offset?: number;
|
|
88
|
+
signal?: AbortSignal;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare interface ScheduledTasksApiClient {
|
|
92
|
+
listScheduledTasks: (request?: ScheduledTasksListRequest) => Promise<ListScheduledTasksResponseDto>;
|
|
93
|
+
listScheduledTaskRuns: (request: ScheduledTaskRunsListRequest) => Promise<ListScheduledTaskRunsResponseDto>;
|
|
94
|
+
createScheduledTask: (body: CreateScheduledTaskBodyDto) => Promise<CreatedScheduledTaskDto>;
|
|
95
|
+
getScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
96
|
+
updateScheduledTask: (scheduleId: string, body: UpdateScheduledTaskBodyDto) => Promise<UpdatedScheduledTaskDto>;
|
|
97
|
+
pauseScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
98
|
+
resumeScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
|
|
99
|
+
deleteScheduledTask: (scheduleId: string) => Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Narrow configured generated-client surface required by scheduler hooks. */
|
|
103
|
+
export declare interface ScheduledTasksConfiguredClient {
|
|
104
|
+
listScheduledTasks: (request: {
|
|
105
|
+
limit?: number;
|
|
106
|
+
offset?: number;
|
|
107
|
+
search?: string;
|
|
108
|
+
sort?: ListScheduledTasksSortEnum;
|
|
109
|
+
}, options?: RequestInit) => Promise<ListScheduledTasksResponseDto>;
|
|
110
|
+
listScheduledTaskRuns: (request: {
|
|
111
|
+
scheduleId: string;
|
|
112
|
+
limit?: number;
|
|
113
|
+
offset?: number;
|
|
114
|
+
}, options?: RequestInit) => Promise<ListScheduledTaskRunsResponseDto>;
|
|
115
|
+
createScheduledTask: (request: {
|
|
116
|
+
createScheduledTaskBodyDto: CreateScheduledTaskBodyDto;
|
|
117
|
+
}) => Promise<CreatedScheduledTaskDto>;
|
|
118
|
+
getScheduledTask: (request: {
|
|
119
|
+
scheduleId: string;
|
|
120
|
+
}) => Promise<ScheduledTaskDto>;
|
|
121
|
+
updateScheduledTask: (request: {
|
|
122
|
+
scheduleId: string;
|
|
123
|
+
updateScheduledTaskBodyDto: UpdateScheduledTaskBodyDto;
|
|
124
|
+
}) => Promise<UpdatedScheduledTaskDto>;
|
|
125
|
+
pauseScheduledTask: (request: {
|
|
126
|
+
scheduleId: string;
|
|
127
|
+
}) => Promise<ScheduledTaskDto>;
|
|
128
|
+
resumeScheduledTask: (request: {
|
|
129
|
+
scheduleId: string;
|
|
130
|
+
}) => Promise<ScheduledTaskDto>;
|
|
131
|
+
deleteScheduledTask: (request: {
|
|
132
|
+
scheduleId: string;
|
|
133
|
+
}) => Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** App-agnostic request options accepted by the scheduler facade. */
|
|
137
|
+
export declare interface ScheduledTasksListRequest {
|
|
138
|
+
limit?: number;
|
|
139
|
+
offset?: number;
|
|
140
|
+
search?: string;
|
|
141
|
+
sort?: ListScheduledTasksSortEnum;
|
|
142
|
+
signal?: AbortSignal;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export declare interface ScheduledTaskTriggerDescription {
|
|
146
|
+
kind: ScheduledTaskTriggerDescriptionKind;
|
|
147
|
+
time?: string;
|
|
148
|
+
dayOfWeek?: string;
|
|
149
|
+
dayOfMonth?: string;
|
|
150
|
+
intervalMinutes?: number;
|
|
151
|
+
date?: Date;
|
|
152
|
+
expression?: string;
|
|
153
|
+
sourceTimezone: 'utc';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Display categories are independent of task editability. */
|
|
157
|
+
export declare enum ScheduledTaskTriggerDescriptionKind {
|
|
158
|
+
OneTime = "oneTime",
|
|
159
|
+
Hourly = "hourly",
|
|
160
|
+
EveryNMinutes = "everyNMinutes",
|
|
161
|
+
Daily = "daily",
|
|
162
|
+
Weekly = "weekly",
|
|
163
|
+
Monthly = "monthly",
|
|
164
|
+
Custom = "custom",
|
|
165
|
+
Invalid = "invalid"
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export declare interface ScheduledTaskTriggerDescriptionOptions {
|
|
169
|
+
/** Display timezone; defaults to UTC for backwards compatibility. */
|
|
170
|
+
timeZone?: string;
|
|
171
|
+
/** Date whose timezone offset is used. Defaults to now (the existing UTC-storage policy). */
|
|
172
|
+
referenceDate?: Date;
|
|
173
|
+
}
|
|
174
|
+
|
|
41
175
|
/** Why a scheduled task DTO could not be mapped back to editable form values. */
|
|
42
176
|
export declare enum UnsupportedTriggerReason {
|
|
43
177
|
/** `trigger.cron.fields` uses a shape (extra keys, or both `day_of_week` and `day`) the editor's schedule controls cannot represent. */
|
|
@@ -48,4 +182,48 @@ export declare enum UnsupportedTriggerReason {
|
|
|
48
182
|
MissingRequiredFields = "missingRequiredFields"
|
|
49
183
|
}
|
|
50
184
|
|
|
185
|
+
/** Shared, cancellation-safe pagination for one schedule's run history. */
|
|
186
|
+
export declare const useScheduledTaskRuns: (client: ScheduledTasksApiClient, { scheduleId, enabled, pageSize }: UseScheduledTaskRunsOptions) => {
|
|
187
|
+
items: ScheduledTaskRunDto[];
|
|
188
|
+
isLoading: boolean;
|
|
189
|
+
isLoadingMore: boolean;
|
|
190
|
+
initialError: Error | null;
|
|
191
|
+
loadMoreError: Error | null;
|
|
192
|
+
hasMore: boolean;
|
|
193
|
+
loadMore: () => void;
|
|
194
|
+
retryLoadMore: () => void;
|
|
195
|
+
refetch: () => void;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export declare interface UseScheduledTaskRunsOptions {
|
|
199
|
+
scheduleId: string;
|
|
200
|
+
enabled?: boolean;
|
|
201
|
+
pageSize?: number;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Shared scheduler-list lifecycle with generation-scoped stale-response guards. */
|
|
205
|
+
export declare const useScheduledTasks: (client: ScheduledTasksApiClient, { enabled, pageSize, debounceMs, initialSearch, initialSort, }?: UseScheduledTasksOptions) => {
|
|
206
|
+
items: ScheduledTaskDto[];
|
|
207
|
+
searchQuery: string;
|
|
208
|
+
setSearchQuery: Dispatch<SetStateAction<string>>;
|
|
209
|
+
sortKey: "firstToRun" | "lastToRun" | "newest" | "nameAZ";
|
|
210
|
+
setSortKey: Dispatch<SetStateAction<"firstToRun" | "lastToRun" | "newest" | "nameAZ">>;
|
|
211
|
+
isLoading: boolean;
|
|
212
|
+
isLoadingMore: boolean;
|
|
213
|
+
initialError: Error | null;
|
|
214
|
+
loadMoreError: Error | null;
|
|
215
|
+
hasMore: boolean;
|
|
216
|
+
loadMore: () => void;
|
|
217
|
+
retryLoadMore: () => void;
|
|
218
|
+
refetch: () => void;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare interface UseScheduledTasksOptions {
|
|
222
|
+
enabled?: boolean;
|
|
223
|
+
pageSize?: number;
|
|
224
|
+
debounceMs?: number;
|
|
225
|
+
initialSearch?: string;
|
|
226
|
+
initialSort?: ListScheduledTasksSortEnum;
|
|
227
|
+
}
|
|
228
|
+
|
|
51
229
|
export { }
|
package/scheduled-tasks.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { UnsupportedTriggerReason as e } from "./scheduled-task/scheduled-task-mapping.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ScheduledTaskTriggerDescriptionKind as t, describeScheduledTaskTrigger as n } from "./scheduled-task/scheduled-task-description.js";
|
|
3
|
+
import { mapFormValuesToCreateBody as r, mapFormValuesToUpdateBody as i, mapScheduledTaskDtoToFormValues as a } from "./scheduled-task/scheduled-task-trigger.js";
|
|
4
|
+
import { prepareScheduledTaskCreateBody as o, prepareScheduledTaskUpdateBody as s } from "./scheduled-task/scheduled-task-preparation.js";
|
|
5
|
+
import { createScheduledTasksApiClient as c } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
6
|
+
import { useScheduledTasks as l } from "./scheduled-task/use-scheduled-tasks.js";
|
|
7
|
+
import { useScheduledTaskRuns as u } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
8
|
+
export { t as ScheduledTaskTriggerDescriptionKind, e as UnsupportedTriggerReason, c as createScheduledTasksApiClient, n as describeScheduledTaskTrigger, r as mapFormValuesToCreateBody, i as mapFormValuesToUpdateBody, a as mapScheduledTaskDtoToFormValues, o as prepareScheduledTaskCreateBody, s as prepareScheduledTaskUpdateBody, u as useScheduledTaskRuns, l as useScheduledTasks };
|