@happyvertical/smrt-jobs 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +71 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +151 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/background-policy.d.ts +121 -0
- package/dist/background-policy.d.ts.map +1 -0
- package/dist/chunks/runner-DV8FBO0y.js +1642 -0
- package/dist/chunks/runner-DV8FBO0y.js.map +1 -0
- package/dist/chunks/worker-liveness-DOTjoIjr.js +65 -0
- package/dist/chunks/worker-liveness-DOTjoIjr.js.map +1 -0
- package/dist/error-redaction.d.ts +48 -0
- package/dist/error-redaction.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +926 -0
- package/dist/index.js.map +1 -0
- package/dist/job-builder.d.ts +94 -0
- package/dist/job-builder.d.ts.map +1 -0
- package/dist/job-handle.d.ts +71 -0
- package/dist/job-handle.d.ts.map +1 -0
- package/dist/logger-extension.d.ts +58 -0
- package/dist/logger-extension.d.ts.map +1 -0
- package/dist/manifest.json +1327 -0
- package/dist/object-extension.d.ts +68 -0
- package/dist/object-extension.d.ts.map +1 -0
- package/dist/playground.d.ts +2 -0
- package/dist/playground.d.ts.map +1 -0
- package/dist/playground.js +179 -0
- package/dist/playground.js.map +1 -0
- package/dist/runner.d.ts +189 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +15 -0
- package/dist/runner.js.map +1 -0
- package/dist/schedule-runner.d.ts +151 -0
- package/dist/schedule-runner.d.ts.map +1 -0
- package/dist/smrt-job-event.d.ts +54 -0
- package/dist/smrt-job-event.d.ts.map +1 -0
- package/dist/smrt-job.d.ts +215 -0
- package/dist/smrt-job.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +508 -0
- package/dist/smrt-worker.d.ts +72 -0
- package/dist/smrt-worker.d.ts.map +1 -0
- package/dist/stale-recovery.d.ts +34 -0
- package/dist/stale-recovery.d.ts.map +1 -0
- package/dist/svelte/components/JobActions.svelte +103 -0
- package/dist/svelte/components/JobActions.svelte.d.ts +23 -0
- package/dist/svelte/components/JobActions.svelte.d.ts.map +1 -0
- package/dist/svelte/components/JobDashboard.svelte +199 -0
- package/dist/svelte/components/JobDashboard.svelte.d.ts +27 -0
- package/dist/svelte/components/JobDashboard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/JobDetail.svelte +256 -0
- package/dist/svelte/components/JobDetail.svelte.d.ts +17 -0
- package/dist/svelte/components/JobDetail.svelte.d.ts.map +1 -0
- package/dist/svelte/components/JobList.svelte +360 -0
- package/dist/svelte/components/JobList.svelte.d.ts +28 -0
- package/dist/svelte/components/JobList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/JobStats.svelte +242 -0
- package/dist/svelte/components/JobStats.svelte.d.ts +15 -0
- package/dist/svelte/components/JobStats.svelte.d.ts.map +1 -0
- package/dist/svelte/components/JobStatusBadge.svelte +23 -0
- package/dist/svelte/components/JobStatusBadge.svelte.d.ts +9 -0
- package/dist/svelte/components/JobStatusBadge.svelte.d.ts.map +1 -0
- package/dist/svelte/components/types.d.ts +9 -0
- package/dist/svelte/components/types.d.ts.map +1 -0
- package/dist/svelte/components/types.js +8 -0
- package/dist/svelte/i18n.d.ts +22 -0
- package/dist/svelte/i18n.d.ts.map +1 -0
- package/dist/svelte/i18n.js +22 -0
- package/dist/svelte/index.d.ts +25 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +28 -0
- package/dist/svelte/playground.d.ts +329 -0
- package/dist/svelte/playground.d.ts.map +1 -0
- package/dist/svelte/playground.js +174 -0
- package/dist/svelte/types.d.ts +191 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +87 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +69 -0
- package/dist/ui.js.map +1 -0
- package/dist/worker-liveness-thread.d.ts +2 -0
- package/dist/worker-liveness-thread.d.ts.map +1 -0
- package/dist/worker-liveness-thread.js +66 -0
- package/dist/worker-liveness-thread.js.map +1 -0
- package/dist/worker-liveness-ticker.d.ts +30 -0
- package/dist/worker-liveness-ticker.d.ts.map +1 -0
- package/dist/worker-liveness.d.ts +71 -0
- package/dist/worker-liveness.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export types for co-located component imports.
|
|
3
|
+
*
|
|
4
|
+
* svelte-package rewrites '../types.js' → './types.js' when building
|
|
5
|
+
* components in a subdirectory. This barrel file ensures the rewritten
|
|
6
|
+
* path resolves correctly in the dist output.
|
|
7
|
+
*/
|
|
8
|
+
export { formatDuration, formatRelativeTime, getPriorityClass, getPriorityLabel, getStatusVariant, type JobData, type JobFilter, type JobPriority, type JobSort, type JobStats, type JobStatus, type QueueStats, type TimeoutBehavior, } from '../types.js';
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export types for co-located component imports.
|
|
3
|
+
*
|
|
4
|
+
* svelte-package rewrites '../types.js' → './types.js' when building
|
|
5
|
+
* components in a subdirectory. This barrel file ensures the rewritten
|
|
6
|
+
* path resolves correctly in the dist output.
|
|
7
|
+
*/
|
|
8
|
+
export { formatDuration, formatRelativeTime, getPriorityClass, getPriorityLabel, getStatusVariant, } from '../types.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const M: {
|
|
2
|
+
readonly 'jobs.job_dashboard.recent_jobs': "jobs.job_dashboard.recent_jobs";
|
|
3
|
+
readonly 'jobs.job_dashboard.view_all': "jobs.job_dashboard.view_all";
|
|
4
|
+
readonly 'jobs.job_dashboard.no_recent_jobs': "jobs.job_dashboard.no_recent_jobs";
|
|
5
|
+
readonly 'jobs.job_dashboard.failed_jobs': "jobs.job_dashboard.failed_jobs";
|
|
6
|
+
readonly 'jobs.job_dashboard.view_all_count': "jobs.job_dashboard.view_all_count";
|
|
7
|
+
readonly 'jobs.job_dashboard.no_failed_jobs': "jobs.job_dashboard.no_failed_jobs";
|
|
8
|
+
readonly 'jobs.job_detail.job_info': "jobs.job_detail.job_info";
|
|
9
|
+
readonly 'jobs.job_detail.object_type': "jobs.job_detail.object_type";
|
|
10
|
+
readonly 'jobs.job_detail.object_id': "jobs.job_detail.object_id";
|
|
11
|
+
readonly 'jobs.job_detail.scheduled_for': "jobs.job_detail.scheduled_for";
|
|
12
|
+
readonly 'jobs.job_detail.last_error': "jobs.job_detail.last_error";
|
|
13
|
+
readonly 'jobs.job_list.run_at': "jobs.job_list.run_at";
|
|
14
|
+
readonly 'jobs.job_list.loading_jobs': "jobs.job_list.loading_jobs";
|
|
15
|
+
readonly 'jobs.job_list.no_jobs_found': "jobs.job_list.no_jobs_found";
|
|
16
|
+
readonly 'jobs.job_list.select_all_jobs': "jobs.job_list.select_all_jobs";
|
|
17
|
+
readonly 'jobs.job_list.select_job': "jobs.job_list.select_job";
|
|
18
|
+
readonly 'jobs.job_stats.total_jobs': "jobs.job_stats.total_jobs";
|
|
19
|
+
readonly 'jobs.job_stats.success_rate': "jobs.job_stats.success_rate";
|
|
20
|
+
readonly 'jobs.job_stats.avg_duration': "jobs.job_stats.avg_duration";
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;CAoBZ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMessages } from '@happyvertical/smrt-ui/i18n';
|
|
2
|
+
export const M = defineMessages({
|
|
3
|
+
'jobs.job_dashboard.recent_jobs': 'Recent Jobs',
|
|
4
|
+
'jobs.job_dashboard.view_all': 'View All',
|
|
5
|
+
'jobs.job_dashboard.no_recent_jobs': 'No recent jobs',
|
|
6
|
+
'jobs.job_dashboard.failed_jobs': 'Failed Jobs',
|
|
7
|
+
'jobs.job_dashboard.view_all_count': 'View All ({count})',
|
|
8
|
+
'jobs.job_dashboard.no_failed_jobs': 'No failed jobs',
|
|
9
|
+
'jobs.job_detail.job_info': 'Job Info',
|
|
10
|
+
'jobs.job_detail.object_type': 'Object Type',
|
|
11
|
+
'jobs.job_detail.object_id': 'Object ID',
|
|
12
|
+
'jobs.job_detail.scheduled_for': 'Scheduled For',
|
|
13
|
+
'jobs.job_detail.last_error': 'Last Error',
|
|
14
|
+
'jobs.job_list.run_at': 'Run At',
|
|
15
|
+
'jobs.job_list.loading_jobs': 'Loading jobs...',
|
|
16
|
+
'jobs.job_list.no_jobs_found': 'No jobs found',
|
|
17
|
+
'jobs.job_list.select_all_jobs': 'Select all jobs',
|
|
18
|
+
'jobs.job_list.select_job': 'Select job',
|
|
19
|
+
'jobs.job_stats.total_jobs': 'Total Jobs',
|
|
20
|
+
'jobs.job_stats.success_rate': 'Success Rate',
|
|
21
|
+
'jobs.job_stats.avg_duration': 'Avg Duration',
|
|
22
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jobs Module Svelte Components
|
|
3
|
+
*
|
|
4
|
+
* Optional Svelte UI components for background job management.
|
|
5
|
+
* Auto-registers components with ModuleUIRegistry on import.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { ComponentProps } from 'svelte';
|
|
10
|
+
import JobActions from './components/JobActions.svelte';
|
|
11
|
+
import JobDashboard from './components/JobDashboard.svelte';
|
|
12
|
+
import JobDetail from './components/JobDetail.svelte';
|
|
13
|
+
import JobList from './components/JobList.svelte';
|
|
14
|
+
import JobStats from './components/JobStats.svelte';
|
|
15
|
+
import JobStatusBadge from './components/JobStatusBadge.svelte';
|
|
16
|
+
export { JobActions, JobDashboard, JobDetail, JobList, JobStats, JobStatusBadge, };
|
|
17
|
+
export type JobActionsProps = ComponentProps<typeof JobActions>;
|
|
18
|
+
export type JobDashboardProps = ComponentProps<typeof JobDashboard>;
|
|
19
|
+
export type JobDetailProps = ComponentProps<typeof JobDetail>;
|
|
20
|
+
export type JobListProps = ComponentProps<typeof JobList>;
|
|
21
|
+
export type JobStatsProps = ComponentProps<typeof JobStats>;
|
|
22
|
+
export type JobStatusBadgeProps = ComponentProps<typeof JobStatusBadge>;
|
|
23
|
+
export type { JobActionsProps as JobActionsPropsLegacy, JobDashboardProps as JobDashboardPropsLegacy, JobData, JobDetailProps as JobDetailPropsLegacy, JobFilter, JobListProps as JobListPropsLegacy, JobPriority, JobSort, JobStats as JobStatsData, JobStatsProps as JobStatsPropsLegacy, JobStatus, QueueStats, TimeoutBehavior, } from './types.js';
|
|
24
|
+
export { formatDuration, formatRelativeTime, getPriorityClass, getPriorityLabel, getStatusVariant, } from './types.js';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAI7C,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,OAAO,MAAM,6BAA6B,CAAC;AAClD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAGhE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,GACf,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC;AAGxE,YAAY,EACV,eAAe,IAAI,qBAAqB,EACxC,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,EACP,cAAc,IAAI,oBAAoB,EACtC,SAAS,EACT,YAAY,IAAI,kBAAkB,EAClC,WAAW,EACX,OAAO,EACP,QAAQ,IAAI,YAAY,EACxB,aAAa,IAAI,mBAAmB,EACpC,SAAS,EACT,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jobs Module Svelte Components
|
|
3
|
+
*
|
|
4
|
+
* Optional Svelte UI components for background job management.
|
|
5
|
+
* Auto-registers components with ModuleUIRegistry on import.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';
|
|
10
|
+
import { JOBS_MODULE_META } from '../ui.js';
|
|
11
|
+
// Import components
|
|
12
|
+
import JobActions from './components/JobActions.svelte';
|
|
13
|
+
import JobDashboard from './components/JobDashboard.svelte';
|
|
14
|
+
import JobDetail from './components/JobDetail.svelte';
|
|
15
|
+
import JobList from './components/JobList.svelte';
|
|
16
|
+
import JobStats from './components/JobStats.svelte';
|
|
17
|
+
import JobStatusBadge from './components/JobStatusBadge.svelte';
|
|
18
|
+
// Export components
|
|
19
|
+
export { JobActions, JobDashboard, JobDetail, JobList, JobStats, JobStatusBadge, };
|
|
20
|
+
export { formatDuration, formatRelativeTime, getPriorityClass, getPriorityLabel, getStatusVariant, } from './types.js';
|
|
21
|
+
// Auto-register with ModuleUIRegistry
|
|
22
|
+
ModuleUIRegistry.registerModule(JOBS_MODULE_META);
|
|
23
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-dashboard', JobDashboard);
|
|
24
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-list', JobList);
|
|
25
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-detail', JobDetail);
|
|
26
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-stats', JobStats);
|
|
27
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-actions', JobActions);
|
|
28
|
+
ModuleUIRegistry.register('@happyvertical/smrt-jobs', 'job-status-badge', JobStatusBadge);
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
packageName: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
description: string | undefined;
|
|
5
|
+
moduleMeta: import("@happyvertical/smrt-types").SmrtModuleMeta;
|
|
6
|
+
entries: ({
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
loadComponent: () => Promise<typeof import("./components/JobDashboard.svelte")>;
|
|
11
|
+
order: number;
|
|
12
|
+
props: {
|
|
13
|
+
stats: {
|
|
14
|
+
total: number;
|
|
15
|
+
pending: number;
|
|
16
|
+
ready: number;
|
|
17
|
+
running: number;
|
|
18
|
+
completed: number;
|
|
19
|
+
failed: number;
|
|
20
|
+
cancelled: number;
|
|
21
|
+
avgDuration: number;
|
|
22
|
+
successRate: number;
|
|
23
|
+
};
|
|
24
|
+
queues: {
|
|
25
|
+
name: string;
|
|
26
|
+
pending: number;
|
|
27
|
+
running: number;
|
|
28
|
+
completed24h: number;
|
|
29
|
+
failed24h: number;
|
|
30
|
+
avgDuration: number;
|
|
31
|
+
}[];
|
|
32
|
+
recentJobs: ({
|
|
33
|
+
id: string;
|
|
34
|
+
queue: string;
|
|
35
|
+
objectType: string;
|
|
36
|
+
objectId: string;
|
|
37
|
+
method: string;
|
|
38
|
+
args: {
|
|
39
|
+
force: boolean;
|
|
40
|
+
profileKey?: undefined;
|
|
41
|
+
destination?: undefined;
|
|
42
|
+
};
|
|
43
|
+
status: string;
|
|
44
|
+
priority: number;
|
|
45
|
+
attempts: number;
|
|
46
|
+
maxAttempts: number;
|
|
47
|
+
timeout: number;
|
|
48
|
+
timeoutBehavior: string;
|
|
49
|
+
runAt: string;
|
|
50
|
+
startedAt: string;
|
|
51
|
+
completedAt: null;
|
|
52
|
+
lastError: null;
|
|
53
|
+
resultPointer: null;
|
|
54
|
+
workerId: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
updatedAt: string;
|
|
57
|
+
} | {
|
|
58
|
+
id: string;
|
|
59
|
+
queue: string;
|
|
60
|
+
objectType: string;
|
|
61
|
+
objectId: string;
|
|
62
|
+
method: string;
|
|
63
|
+
args: {
|
|
64
|
+
profileKey: string;
|
|
65
|
+
force?: undefined;
|
|
66
|
+
destination?: undefined;
|
|
67
|
+
};
|
|
68
|
+
status: string;
|
|
69
|
+
priority: number;
|
|
70
|
+
attempts: number;
|
|
71
|
+
maxAttempts: number;
|
|
72
|
+
timeout: number;
|
|
73
|
+
timeoutBehavior: string;
|
|
74
|
+
runAt: string;
|
|
75
|
+
startedAt: string;
|
|
76
|
+
completedAt: string;
|
|
77
|
+
lastError: string;
|
|
78
|
+
resultPointer: null;
|
|
79
|
+
workerId: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
} | {
|
|
83
|
+
id: string;
|
|
84
|
+
queue: string;
|
|
85
|
+
objectType: string;
|
|
86
|
+
objectId: null;
|
|
87
|
+
method: string;
|
|
88
|
+
args: {
|
|
89
|
+
destination: string;
|
|
90
|
+
force?: undefined;
|
|
91
|
+
profileKey?: undefined;
|
|
92
|
+
};
|
|
93
|
+
status: string;
|
|
94
|
+
priority: number;
|
|
95
|
+
attempts: number;
|
|
96
|
+
maxAttempts: number;
|
|
97
|
+
timeout: number;
|
|
98
|
+
timeoutBehavior: string;
|
|
99
|
+
runAt: string;
|
|
100
|
+
startedAt: string;
|
|
101
|
+
completedAt: string;
|
|
102
|
+
lastError: null;
|
|
103
|
+
resultPointer: string;
|
|
104
|
+
workerId: string;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
updatedAt: string;
|
|
107
|
+
})[];
|
|
108
|
+
failedJobs: ({
|
|
109
|
+
id: string;
|
|
110
|
+
queue: string;
|
|
111
|
+
objectType: string;
|
|
112
|
+
objectId: string;
|
|
113
|
+
method: string;
|
|
114
|
+
args: {
|
|
115
|
+
force: boolean;
|
|
116
|
+
profileKey?: undefined;
|
|
117
|
+
destination?: undefined;
|
|
118
|
+
};
|
|
119
|
+
status: string;
|
|
120
|
+
priority: number;
|
|
121
|
+
attempts: number;
|
|
122
|
+
maxAttempts: number;
|
|
123
|
+
timeout: number;
|
|
124
|
+
timeoutBehavior: string;
|
|
125
|
+
runAt: string;
|
|
126
|
+
startedAt: string;
|
|
127
|
+
completedAt: null;
|
|
128
|
+
lastError: null;
|
|
129
|
+
resultPointer: null;
|
|
130
|
+
workerId: string;
|
|
131
|
+
createdAt: string;
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
} | {
|
|
134
|
+
id: string;
|
|
135
|
+
queue: string;
|
|
136
|
+
objectType: string;
|
|
137
|
+
objectId: string;
|
|
138
|
+
method: string;
|
|
139
|
+
args: {
|
|
140
|
+
profileKey: string;
|
|
141
|
+
force?: undefined;
|
|
142
|
+
destination?: undefined;
|
|
143
|
+
};
|
|
144
|
+
status: string;
|
|
145
|
+
priority: number;
|
|
146
|
+
attempts: number;
|
|
147
|
+
maxAttempts: number;
|
|
148
|
+
timeout: number;
|
|
149
|
+
timeoutBehavior: string;
|
|
150
|
+
runAt: string;
|
|
151
|
+
startedAt: string;
|
|
152
|
+
completedAt: string;
|
|
153
|
+
lastError: string;
|
|
154
|
+
resultPointer: null;
|
|
155
|
+
workerId: string;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
updatedAt: string;
|
|
158
|
+
} | {
|
|
159
|
+
id: string;
|
|
160
|
+
queue: string;
|
|
161
|
+
objectType: string;
|
|
162
|
+
objectId: null;
|
|
163
|
+
method: string;
|
|
164
|
+
args: {
|
|
165
|
+
destination: string;
|
|
166
|
+
force?: undefined;
|
|
167
|
+
profileKey?: undefined;
|
|
168
|
+
};
|
|
169
|
+
status: string;
|
|
170
|
+
priority: number;
|
|
171
|
+
attempts: number;
|
|
172
|
+
maxAttempts: number;
|
|
173
|
+
timeout: number;
|
|
174
|
+
timeoutBehavior: string;
|
|
175
|
+
runAt: string;
|
|
176
|
+
startedAt: string;
|
|
177
|
+
completedAt: string;
|
|
178
|
+
lastError: null;
|
|
179
|
+
resultPointer: string;
|
|
180
|
+
workerId: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
updatedAt: string;
|
|
183
|
+
})[];
|
|
184
|
+
onJobClick: () => void;
|
|
185
|
+
onRetry: () => void;
|
|
186
|
+
onCancel: () => void;
|
|
187
|
+
onViewAll: () => void;
|
|
188
|
+
onViewFailed: () => void;
|
|
189
|
+
job?: undefined;
|
|
190
|
+
onDelete?: undefined;
|
|
191
|
+
status?: undefined;
|
|
192
|
+
size?: undefined;
|
|
193
|
+
};
|
|
194
|
+
modes: {
|
|
195
|
+
mock: {
|
|
196
|
+
label: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
} | {
|
|
200
|
+
id: string;
|
|
201
|
+
title: string;
|
|
202
|
+
description: string;
|
|
203
|
+
loadComponent: () => Promise<typeof import("./components/JobDetail.svelte")>;
|
|
204
|
+
order: number;
|
|
205
|
+
props: {
|
|
206
|
+
job: {
|
|
207
|
+
id: string;
|
|
208
|
+
queue: string;
|
|
209
|
+
objectType: string;
|
|
210
|
+
objectId: string;
|
|
211
|
+
method: string;
|
|
212
|
+
args: {
|
|
213
|
+
force: boolean;
|
|
214
|
+
profileKey?: undefined;
|
|
215
|
+
destination?: undefined;
|
|
216
|
+
};
|
|
217
|
+
status: string;
|
|
218
|
+
priority: number;
|
|
219
|
+
attempts: number;
|
|
220
|
+
maxAttempts: number;
|
|
221
|
+
timeout: number;
|
|
222
|
+
timeoutBehavior: string;
|
|
223
|
+
runAt: string;
|
|
224
|
+
startedAt: string;
|
|
225
|
+
completedAt: null;
|
|
226
|
+
lastError: null;
|
|
227
|
+
resultPointer: null;
|
|
228
|
+
workerId: string;
|
|
229
|
+
createdAt: string;
|
|
230
|
+
updatedAt: string;
|
|
231
|
+
} | {
|
|
232
|
+
id: string;
|
|
233
|
+
queue: string;
|
|
234
|
+
objectType: string;
|
|
235
|
+
objectId: string;
|
|
236
|
+
method: string;
|
|
237
|
+
args: {
|
|
238
|
+
profileKey: string;
|
|
239
|
+
force?: undefined;
|
|
240
|
+
destination?: undefined;
|
|
241
|
+
};
|
|
242
|
+
status: string;
|
|
243
|
+
priority: number;
|
|
244
|
+
attempts: number;
|
|
245
|
+
maxAttempts: number;
|
|
246
|
+
timeout: number;
|
|
247
|
+
timeoutBehavior: string;
|
|
248
|
+
runAt: string;
|
|
249
|
+
startedAt: string;
|
|
250
|
+
completedAt: string;
|
|
251
|
+
lastError: string;
|
|
252
|
+
resultPointer: null;
|
|
253
|
+
workerId: string;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
} | {
|
|
257
|
+
id: string;
|
|
258
|
+
queue: string;
|
|
259
|
+
objectType: string;
|
|
260
|
+
objectId: null;
|
|
261
|
+
method: string;
|
|
262
|
+
args: {
|
|
263
|
+
destination: string;
|
|
264
|
+
force?: undefined;
|
|
265
|
+
profileKey?: undefined;
|
|
266
|
+
};
|
|
267
|
+
status: string;
|
|
268
|
+
priority: number;
|
|
269
|
+
attempts: number;
|
|
270
|
+
maxAttempts: number;
|
|
271
|
+
timeout: number;
|
|
272
|
+
timeoutBehavior: string;
|
|
273
|
+
runAt: string;
|
|
274
|
+
startedAt: string;
|
|
275
|
+
completedAt: string;
|
|
276
|
+
lastError: null;
|
|
277
|
+
resultPointer: string;
|
|
278
|
+
workerId: string;
|
|
279
|
+
createdAt: string;
|
|
280
|
+
updatedAt: string;
|
|
281
|
+
};
|
|
282
|
+
onRetry: () => void;
|
|
283
|
+
onDelete: () => void;
|
|
284
|
+
stats?: undefined;
|
|
285
|
+
queues?: undefined;
|
|
286
|
+
recentJobs?: undefined;
|
|
287
|
+
failedJobs?: undefined;
|
|
288
|
+
onJobClick?: undefined;
|
|
289
|
+
onCancel?: undefined;
|
|
290
|
+
onViewAll?: undefined;
|
|
291
|
+
onViewFailed?: undefined;
|
|
292
|
+
status?: undefined;
|
|
293
|
+
size?: undefined;
|
|
294
|
+
};
|
|
295
|
+
modes: {
|
|
296
|
+
mock: {
|
|
297
|
+
label: string;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
} | {
|
|
301
|
+
id: string;
|
|
302
|
+
title: string;
|
|
303
|
+
description: string;
|
|
304
|
+
loadComponent: () => Promise<typeof import("./components/JobStatusBadge.svelte")>;
|
|
305
|
+
order: number;
|
|
306
|
+
props: {
|
|
307
|
+
status: string;
|
|
308
|
+
size: string;
|
|
309
|
+
stats?: undefined;
|
|
310
|
+
queues?: undefined;
|
|
311
|
+
recentJobs?: undefined;
|
|
312
|
+
failedJobs?: undefined;
|
|
313
|
+
onJobClick?: undefined;
|
|
314
|
+
onRetry?: undefined;
|
|
315
|
+
onCancel?: undefined;
|
|
316
|
+
onViewAll?: undefined;
|
|
317
|
+
onViewFailed?: undefined;
|
|
318
|
+
job?: undefined;
|
|
319
|
+
onDelete?: undefined;
|
|
320
|
+
};
|
|
321
|
+
modes: {
|
|
322
|
+
mock: {
|
|
323
|
+
label: string;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
})[];
|
|
327
|
+
};
|
|
328
|
+
export default _default;
|
|
329
|
+
//# sourceMappingURL=playground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../src/svelte/playground.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,wBAiEE"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { JOBS_MODULE_META } from '../ui.js';
|
|
2
|
+
const noop = () => { };
|
|
3
|
+
const sampleJobs = [
|
|
4
|
+
{
|
|
5
|
+
id: 'job-publish-1',
|
|
6
|
+
queue: 'content',
|
|
7
|
+
objectType: '@happyvertical/smrt-content:Article',
|
|
8
|
+
objectId: 'article-aurora-kitchen',
|
|
9
|
+
method: 'publish',
|
|
10
|
+
args: { force: false },
|
|
11
|
+
status: 'running',
|
|
12
|
+
priority: 80,
|
|
13
|
+
attempts: 1,
|
|
14
|
+
maxAttempts: 3,
|
|
15
|
+
timeout: 600000,
|
|
16
|
+
timeoutBehavior: 'fail',
|
|
17
|
+
runAt: '2026-03-21T16:15:00.000Z',
|
|
18
|
+
startedAt: '2026-03-21T16:15:15.000Z',
|
|
19
|
+
completedAt: null,
|
|
20
|
+
lastError: null,
|
|
21
|
+
resultPointer: null,
|
|
22
|
+
workerId: 'worker-content-1',
|
|
23
|
+
createdAt: '2026-03-21T16:14:50.000Z',
|
|
24
|
+
updatedAt: '2026-03-21T16:15:20.000Z',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'job-review-2',
|
|
28
|
+
queue: 'governance',
|
|
29
|
+
objectType: '@happyvertical/smrt-content:GovernancePolicy',
|
|
30
|
+
objectId: 'policy-facts',
|
|
31
|
+
method: 'recalculateReadiness',
|
|
32
|
+
args: { profileKey: 'publication' },
|
|
33
|
+
status: 'failed',
|
|
34
|
+
priority: 95,
|
|
35
|
+
attempts: 3,
|
|
36
|
+
maxAttempts: 3,
|
|
37
|
+
timeout: 300000,
|
|
38
|
+
timeoutBehavior: 'fail',
|
|
39
|
+
runAt: '2026-03-21T15:40:00.000Z',
|
|
40
|
+
startedAt: '2026-03-21T15:40:02.000Z',
|
|
41
|
+
completedAt: '2026-03-21T15:41:11.000Z',
|
|
42
|
+
lastError: 'Relationship column missing during readiness sync.',
|
|
43
|
+
resultPointer: null,
|
|
44
|
+
workerId: 'worker-governance-2',
|
|
45
|
+
createdAt: '2026-03-21T15:39:30.000Z',
|
|
46
|
+
updatedAt: '2026-03-21T15:41:11.000Z',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'job-export-3',
|
|
50
|
+
queue: 'exports',
|
|
51
|
+
objectType: '@happyvertical/smrt-content:ArticleCollection',
|
|
52
|
+
objectId: null,
|
|
53
|
+
method: 'buildStaticFeed',
|
|
54
|
+
args: { destination: 'cdn' },
|
|
55
|
+
status: 'completed',
|
|
56
|
+
priority: 40,
|
|
57
|
+
attempts: 1,
|
|
58
|
+
maxAttempts: 2,
|
|
59
|
+
timeout: 900000,
|
|
60
|
+
timeoutBehavior: 'warn',
|
|
61
|
+
runAt: '2026-03-21T14:30:00.000Z',
|
|
62
|
+
startedAt: '2026-03-21T14:30:00.000Z',
|
|
63
|
+
completedAt: '2026-03-21T14:31:25.000Z',
|
|
64
|
+
lastError: null,
|
|
65
|
+
resultPointer: 'results/exports/build-static-feed-3.json',
|
|
66
|
+
workerId: 'worker-export-1',
|
|
67
|
+
createdAt: '2026-03-21T14:29:52.000Z',
|
|
68
|
+
updatedAt: '2026-03-21T14:31:25.000Z',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
const sampleStats = {
|
|
72
|
+
total: 3421,
|
|
73
|
+
pending: 24,
|
|
74
|
+
ready: 13,
|
|
75
|
+
running: 4,
|
|
76
|
+
completed: 3340,
|
|
77
|
+
failed: 31,
|
|
78
|
+
cancelled: 9,
|
|
79
|
+
avgDuration: 18450,
|
|
80
|
+
successRate: 0.976,
|
|
81
|
+
};
|
|
82
|
+
const sampleQueues = [
|
|
83
|
+
{
|
|
84
|
+
name: 'content',
|
|
85
|
+
pending: 8,
|
|
86
|
+
running: 2,
|
|
87
|
+
completed24h: 412,
|
|
88
|
+
failed24h: 4,
|
|
89
|
+
avgDuration: 22800,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'governance',
|
|
93
|
+
pending: 5,
|
|
94
|
+
running: 1,
|
|
95
|
+
completed24h: 188,
|
|
96
|
+
failed24h: 7,
|
|
97
|
+
avgDuration: 31200,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'exports',
|
|
101
|
+
pending: 11,
|
|
102
|
+
running: 1,
|
|
103
|
+
completed24h: 94,
|
|
104
|
+
failed24h: 1,
|
|
105
|
+
avgDuration: 52200,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
const loadJobDashboard = () => import('./components/JobDashboard.svelte');
|
|
109
|
+
const loadJobDetail = () => import('./components/JobDetail.svelte');
|
|
110
|
+
const loadJobStatusBadge = () => import('./components/JobStatusBadge.svelte');
|
|
111
|
+
export default {
|
|
112
|
+
packageName: '@happyvertical/smrt-jobs',
|
|
113
|
+
displayName: JOBS_MODULE_META.displayName,
|
|
114
|
+
description: JOBS_MODULE_META.description,
|
|
115
|
+
moduleMeta: JOBS_MODULE_META,
|
|
116
|
+
entries: [
|
|
117
|
+
{
|
|
118
|
+
id: 'job-dashboard',
|
|
119
|
+
title: 'Job Dashboard',
|
|
120
|
+
description: 'Operational overview for background job queues with recent and failed work.',
|
|
121
|
+
loadComponent: loadJobDashboard,
|
|
122
|
+
order: 1,
|
|
123
|
+
props: {
|
|
124
|
+
stats: sampleStats,
|
|
125
|
+
queues: sampleQueues,
|
|
126
|
+
recentJobs: sampleJobs,
|
|
127
|
+
failedJobs: sampleJobs.filter((job) => job.status === 'failed'),
|
|
128
|
+
onJobClick: noop,
|
|
129
|
+
onRetry: noop,
|
|
130
|
+
onCancel: noop,
|
|
131
|
+
onViewAll: noop,
|
|
132
|
+
onViewFailed: noop,
|
|
133
|
+
},
|
|
134
|
+
modes: {
|
|
135
|
+
mock: {
|
|
136
|
+
label: 'Mock',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: 'job-detail',
|
|
142
|
+
title: 'Job Detail',
|
|
143
|
+
description: 'Detailed execution view for a single background job with retry and cancellation actions.',
|
|
144
|
+
loadComponent: loadJobDetail,
|
|
145
|
+
order: 2,
|
|
146
|
+
props: {
|
|
147
|
+
job: sampleJobs[1],
|
|
148
|
+
onRetry: noop,
|
|
149
|
+
onDelete: noop,
|
|
150
|
+
},
|
|
151
|
+
modes: {
|
|
152
|
+
mock: {
|
|
153
|
+
label: 'Mock',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'job-status-badge',
|
|
159
|
+
title: 'Job Status Badge',
|
|
160
|
+
description: 'Compact status treatment used throughout the jobs surface.',
|
|
161
|
+
loadComponent: loadJobStatusBadge,
|
|
162
|
+
order: 3,
|
|
163
|
+
props: {
|
|
164
|
+
status: 'running',
|
|
165
|
+
size: 'md',
|
|
166
|
+
},
|
|
167
|
+
modes: {
|
|
168
|
+
mock: {
|
|
169
|
+
label: 'Mock',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|