@svadmin/core 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/core",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "author": "zuohuadong",
5
5
  "repository": {
6
6
  "type": "git",
@@ -280,6 +280,7 @@ const baseLocales: Record<string, Record<string, string>> = {
280
280
  'task.messageLabel': '消息',
281
281
  'task.errorLabel': '错误',
282
282
  'task.payloadLabel': '负载',
283
+ 'task.resultLabel': '结果',
283
284
  'task.searchPlaceholder': '按名称、ID、状态或消息筛选任务...',
284
285
  'task.statusFilterLabel': '状态筛选',
285
286
  'task.statusAll': '全部状态',
@@ -309,6 +310,12 @@ const baseLocales: Record<string, Record<string, string>> = {
309
310
  'task.status.done': '已完成',
310
311
  'task.status.failed': '失败',
311
312
  'task.status.error': '错误',
313
+ 'task.status.cancelled': '已取消',
314
+ 'task.status.canceled': '已取消',
315
+ 'task.status.succeeded': '已完成',
316
+ 'task.status.dead_lettered': '死信',
317
+ 'task.status.retry_scheduled': '等待重试',
318
+ 'task.status.leased': '已领取',
312
319
  },
313
320
  'en': {
314
321
  'common.list': 'List',
@@ -587,6 +594,7 @@ const baseLocales: Record<string, Record<string, string>> = {
587
594
  'task.messageLabel': 'Message',
588
595
  'task.errorLabel': 'Error',
589
596
  'task.payloadLabel': 'Payload',
597
+ 'task.resultLabel': 'Result',
590
598
  'task.searchPlaceholder': 'Filter tasks by name, ID, status, or message...',
591
599
  'task.statusFilterLabel': 'Status filter',
592
600
  'task.statusAll': 'All statuses',
@@ -616,6 +624,12 @@ const baseLocales: Record<string, Record<string, string>> = {
616
624
  'task.status.done': 'Done',
617
625
  'task.status.failed': 'Failed',
618
626
  'task.status.error': 'Error',
627
+ 'task.status.cancelled': 'Cancelled',
628
+ 'task.status.canceled': 'Canceled',
629
+ 'task.status.succeeded': 'Succeeded',
630
+ 'task.status.dead_lettered': 'Dead lettered',
631
+ 'task.status.retry_scheduled': 'Retry scheduled',
632
+ 'task.status.leased': 'Leased',
619
633
  },
620
634
  };
621
635
 
package/src/types.ts CHANGED
@@ -196,10 +196,42 @@ export interface DataProvider {
196
196
 
197
197
  export interface TaskRecord extends BaseRecord {
198
198
  id: string;
199
+ name?: string;
200
+ title?: string;
199
201
  status?: string;
202
+ progress?: number;
203
+ priority?: number;
204
+ queueName?: string;
205
+ queue_name?: string;
206
+ message?: string;
207
+ payload?: unknown;
208
+ /**
209
+ * Task output payload. `result` is the canonical camelCase field used by
210
+ * svadmin UI helpers; `result_data` is accepted for Supabase/Postgres-style
211
+ * task mirrors. Consumers should prefer `result`, then fall back to
212
+ * `result_data`, matching `resolveTaskResult`.
213
+ */
214
+ result?: unknown;
215
+ result_data?: unknown;
200
216
  createdAt?: string | Date;
217
+ created_at?: string | Date;
201
218
  updatedAt?: string | Date;
219
+ updated_at?: string | Date;
220
+ startedAt?: string | Date;
221
+ started_at?: string | Date;
222
+ finishedAt?: string | Date;
223
+ finished_at?: string | Date;
224
+ cancelledAt?: string | Date;
225
+ cancelled_at?: string | Date;
226
+ /**
227
+ * Task failure payload/message. `error` carries structured error details
228
+ * when available; `errorMessage` and `error_message` are string fallbacks for
229
+ * camelCase and snake_case providers. Consumers should prefer `error`, then
230
+ * `errorMessage`, then `error_message`, matching `resolveTaskError`.
231
+ */
202
232
  error?: unknown;
233
+ errorMessage?: string;
234
+ error_message?: string;
203
235
  }
204
236
 
205
237
  export interface SubmitTaskOptions {