@sonamu-kit/tasks 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/package.json +15 -15
  2. package/dist/errors.d.ts +0 -8
  3. package/dist/errors.d.ts.map +0 -1
  4. package/dist/errors.js +0 -21
  5. package/dist/errors.js.map +0 -1
  6. package/dist/practices/01-remote.d.ts +0 -2
  7. package/dist/practices/01-remote.d.ts.map +0 -1
  8. package/dist/practices/01-remote.js +0 -87
  9. package/dist/practices/01-remote.js.map +0 -1
  10. package/dist/practices/02-local.d.ts +0 -2
  11. package/dist/practices/02-local.d.ts.map +0 -1
  12. package/dist/practices/02-local.js +0 -84
  13. package/dist/practices/02-local.js.map +0 -1
  14. package/dist/practices/03-local-retry.d.ts +0 -2
  15. package/dist/practices/03-local-retry.d.ts.map +0 -1
  16. package/dist/practices/03-local-retry.js +0 -85
  17. package/dist/practices/03-local-retry.js.map +0 -1
  18. package/dist/practices/04-scheduler-dispose.d.ts +0 -2
  19. package/dist/practices/04-scheduler-dispose.d.ts.map +0 -1
  20. package/dist/practices/04-scheduler-dispose.js +0 -65
  21. package/dist/practices/04-scheduler-dispose.js.map +0 -1
  22. package/dist/practices/05-router.d.ts +0 -2
  23. package/dist/practices/05-router.d.ts.map +0 -1
  24. package/dist/practices/05-router.js +0 -80
  25. package/dist/practices/05-router.js.map +0 -1
  26. package/dist/scheduler.d.ts +0 -22
  27. package/dist/scheduler.d.ts.map +0 -1
  28. package/dist/scheduler.js +0 -117
  29. package/dist/scheduler.js.map +0 -1
  30. package/dist/tasks/index.d.ts +0 -4
  31. package/dist/tasks/index.d.ts.map +0 -1
  32. package/dist/tasks/index.js +0 -5
  33. package/dist/tasks/index.js.map +0 -1
  34. package/dist/tasks/local-task.d.ts +0 -6
  35. package/dist/tasks/local-task.d.ts.map +0 -1
  36. package/dist/tasks/local-task.js +0 -95
  37. package/dist/tasks/local-task.js.map +0 -1
  38. package/dist/tasks/remote-task.d.ts +0 -11
  39. package/dist/tasks/remote-task.d.ts.map +0 -1
  40. package/dist/tasks/remote-task.js +0 -213
  41. package/dist/tasks/remote-task.js.map +0 -1
  42. package/dist/tasks/shared.d.ts +0 -8
  43. package/dist/tasks/shared.d.ts.map +0 -1
  44. package/dist/tasks/shared.js +0 -41
  45. package/dist/tasks/shared.js.map +0 -1
  46. package/dist/types/config.d.ts +0 -44
  47. package/dist/types/config.d.ts.map +0 -1
  48. package/dist/types/config.js +0 -3
  49. package/dist/types/config.js.map +0 -1
  50. package/dist/types/context.d.ts +0 -18
  51. package/dist/types/context.d.ts.map +0 -1
  52. package/dist/types/context.js +0 -4
  53. package/dist/types/context.js.map +0 -1
  54. package/dist/types/events.d.ts +0 -43
  55. package/dist/types/events.d.ts.map +0 -1
  56. package/dist/types/events.js +0 -3
  57. package/dist/types/events.js.map +0 -1
  58. package/dist/types/index.d.ts +0 -6
  59. package/dist/types/index.d.ts.map +0 -1
  60. package/dist/types/index.js +0 -3
  61. package/dist/types/index.js.map +0 -1
  62. package/dist/types/task-items.d.ts +0 -12
  63. package/dist/types/task-items.d.ts.map +0 -1
  64. package/dist/types/task-items.js +0 -3
  65. package/dist/types/task-items.js.map +0 -1
  66. package/dist/types/utils.d.ts +0 -4
  67. package/dist/types/utils.d.ts.map +0 -1
  68. package/dist/types/utils.js +0 -8
  69. package/dist/types/utils.js.map +0 -1
@@ -1,44 +0,0 @@
1
- import type { Knex } from "knex";
2
- import type { UnroutedTaskEvent } from "./events";
3
- import type { z } from "zod";
4
- import type { Duration } from "date-fns";
5
- import type { TaskRouterContext } from "./context";
6
- export interface RetryConfig {
7
- maxAttempts: number;
8
- delay?: Duration | ((attempt: number) => Duration);
9
- }
10
- export type OnEventFunction<T extends UnroutedTaskEvent = UnroutedTaskEvent> = (event: T) => void | Promise<void>;
11
- export interface RemoteTaskConfig {
12
- type: "remote";
13
- expression: string;
14
- options?: {
15
- timezone?: string;
16
- name?: string;
17
- noOverlap?: boolean;
18
- maxExecutions?: number;
19
- maxRandomDelay?: number;
20
- };
21
- }
22
- export interface LocalTaskConfig<T extends z.ZodType = z.ZodType> {
23
- type: "local";
24
- expression: string;
25
- namespace: string;
26
- payload: Buffer | z.infer<T>;
27
- options?: {
28
- timezone?: string;
29
- name?: string;
30
- noOverlap?: boolean;
31
- maxExecutions?: number;
32
- maxRandomDelay?: number;
33
- };
34
- }
35
- export interface SchedulerConfig {
36
- database: Knex.Config;
37
- name?: string;
38
- tasks: (RemoteTaskConfig | LocalTaskConfig)[];
39
- retry?: RetryConfig;
40
- routes: (Omit<TaskRouterContext, "retry"> & {
41
- retry?: RetryConfig;
42
- })[];
43
- }
44
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,WAAW,WAAW;IAE1B,WAAW,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IAAI,CAC7E,KAAK,EAAE,CAAC,KACL,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAG1B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAGD,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IAC9D,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;IAGtB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,CAAC,gBAAgB,GAAG,eAAe,CAAC,EAAE,CAAC;IAG9C,KAAK,CAAC,EAAE,WAAW,CAAC;IAGpB,MAAM,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC,EAAE,CAAC;CACxE"}
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/config.ts"],"sourcesContent":["import type { Knex } from \"knex\";\nimport type { UnroutedTaskEvent } from \"./events\";\nimport type { z } from \"zod\";\nimport type { Duration } from \"date-fns\";\nimport type { TaskRouterContext } from \"./context\";\n\nexport interface RetryConfig {\n // 최대 횟수 (def: 1, 재시도를 안함)\n maxAttempts: number;\n // 재시도 간격\n delay?: Duration | ((attempt: number) => Duration);\n}\n\nexport type OnEventFunction<T extends UnroutedTaskEvent = UnroutedTaskEvent> = (\n event: T,\n) => void | Promise<void>;\n\n// MySQL에서 받아와서 있으면 실행할 태스크\nexport interface RemoteTaskConfig {\n type: \"remote\";\n expression: string;\n options?: {\n timezone?: string;\n name?: string;\n noOverlap?: boolean;\n maxExecutions?: number;\n maxRandomDelay?: number;\n };\n}\n\n// 로컬에서 router로 잡아서 실행할 태스크\nexport interface LocalTaskConfig<T extends z.ZodType = z.ZodType> {\n type: \"local\";\n expression: string;\n // router 태울 namespace\n namespace: string;\n payload: Buffer | z.infer<T>;\n options?: {\n timezone?: string;\n name?: string;\n noOverlap?: boolean;\n maxExecutions?: number;\n maxRandomDelay?: number;\n };\n}\n\nexport interface SchedulerConfig {\n database: Knex.Config;\n\n // TaskNode에 이름을 지정할 수 있음\n name?: string;\n\n // Task 설정\n tasks: (RemoteTaskConfig | LocalTaskConfig)[];\n\n // 전역적 재시도 설정 (없으면 각 Task의 설정을 따름)\n retry?: RetryConfig;\n\n // 어느 Namespace의 Task를 어떻게 처리할지\n routes: (Omit<TaskRouterContext, \"retry\"> & { retry?: RetryConfig })[];\n}\n"],"names":[],"mappings":"AA8CA,WAcC"}
@@ -1,18 +0,0 @@
1
- import type { z } from "zod";
2
- import type { RetryConfig } from "./config";
3
- import type { TaskItem } from "./task-items";
4
- import type { Callback } from "./utils";
5
- export interface TaskRouterContext<T extends z.ZodType = z.ZodType> {
6
- path: string;
7
- retry: RetryConfig;
8
- schema: T;
9
- target: Callback<TaskContext<T>, void>;
10
- }
11
- export type TaskContext<T extends z.ZodType = z.ZodType> = {
12
- params?: Record<string, string>;
13
- retry: RetryConfig;
14
- taskItem: Omit<TaskItem, "payload"> & {
15
- payload: z.infer<T>;
16
- };
17
- };
18
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC;IACV,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;CACxC;AAGD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;CAC/D,CAAC"}
@@ -1,4 +0,0 @@
1
- // 각 Task Route 함수가 가지고 있을 Context 정보
2
- export { };
3
-
4
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/context.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { RetryConfig } from \"./config\";\nimport type { TaskItem } from \"./task-items\";\nimport type { Callback } from \"./utils\";\n\n// Router에서 가지고 있을 Context 정보\nexport interface TaskRouterContext<T extends z.ZodType = z.ZodType> {\n path: string;\n retry: RetryConfig;\n schema: T;\n target: Callback<TaskContext<T>, void>;\n}\n\n// 각 Task Route 함수가 가지고 있을 Context 정보\nexport type TaskContext<T extends z.ZodType = z.ZodType> = {\n params?: Record<string, string>;\n retry: RetryConfig;\n taskItem: Omit<TaskItem, \"payload\"> & { payload: z.infer<T> };\n};\n"],"names":[],"mappings":"AAaA,qCAAqC;AACrC,WAIE"}
@@ -1,43 +0,0 @@
1
- import type { TaskItem } from "./task-items";
2
- export type EventType = "start" | "stop" | "fetch" | "process:start" | "process:error" | "process:complete";
3
- export type TerminationReasonEnum = "app_shutdown" | "process_signal" | "unknown";
4
- export type ProcessErrorReasonEnum = "no_route" | "validation" | "timeout" | "max_retries_exceeded" | "exception";
5
- export interface SchedulerInfo {
6
- id: string;
7
- name?: string;
8
- }
9
- interface BaseNodeEvent {
10
- type: EventType;
11
- info: SchedulerInfo;
12
- timestamp: Date;
13
- }
14
- export interface StartEvent extends BaseNodeEvent {
15
- type: "start";
16
- }
17
- export interface StopEvent extends BaseNodeEvent {
18
- type: "stop";
19
- reason: TerminationReasonEnum;
20
- error?: Error;
21
- }
22
- export interface FetchEvent extends BaseNodeEvent {
23
- type: "fetch";
24
- }
25
- export interface ProcessStartEvent extends BaseNodeEvent {
26
- type: "process:start";
27
- task: TaskItem;
28
- }
29
- export interface ProcessCompleteEvent extends BaseNodeEvent {
30
- type: "process:complete";
31
- task: TaskItem;
32
- }
33
- export interface ProcessErrorEvent extends BaseNodeEvent {
34
- type: "process:error";
35
- task: TaskItem;
36
- reason: ProcessErrorReasonEnum;
37
- error?: Error;
38
- }
39
- export type RoutedTaskEvent = ProcessStartEvent | ProcessCompleteEvent | ProcessErrorEvent;
40
- export type UnroutedTaskEvent = StartEvent | StopEvent | FetchEvent;
41
- export type TaskEvent = UnroutedTaskEvent | RoutedTaskEvent;
42
- export {};
43
- //# sourceMappingURL=events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,MAAM,GACN,OAAO,GACP,eAAe,GACf,eAAe,GACf,kBAAkB,CAAC;AAMvB,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAQlF,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,YAAY,GACZ,SAAS,GACT,sBAAsB,GACtB,WAAW,CAAC;AAGhB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,IAAI,EAAE,OAAO,CAAC;CACf;AAGD,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,qBAAqB,CAAC;IAE9B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAGD,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,IAAI,EAAE,OAAO,CAAC;CACf;AAGD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAGD,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAGD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,sBAAsB,CAAC;IAE/B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,eAAe,CAAC"}
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/events.ts"],"sourcesContent":["import type { TaskItem } from \"./task-items\";\n\n// Event에는 시간, Event 타입, Task에 대한 namespace, Task ID, 처리한 Task의 노드 이름, 이벤트에 대한 메타 정보 데이터 등이 들어감.\nexport type EventType =\n | \"start\"\n | \"stop\"\n | \"fetch\"\n | \"process:start\"\n | \"process:error\"\n | \"process:complete\";\n\n// Task가 왜 중단되는지를 남김.\n// - app_shutdown: 애플리케이션의 정상적인 종료\n// - process_signal: 외부에서의 프로세스 시그널로 인한 중단\n// - unknown: 모름, 그래서 call stack을 남겨야함.\nexport type TerminationReasonEnum = \"app_shutdown\" | \"process_signal\" | \"unknown\";\n\n// Process Error 사유\n// - no_route: Task가 이 namespace를 지원하지 않음\n// - serialization: 인자 등 데이터의 검증에 실패함\n// - timeout: 처리 중 타임아웃\n// - max_retries_exceeded: 최대 재시도 횟수 초과\n// - exception: 다른 예외 발생\nexport type ProcessErrorReasonEnum =\n | \"no_route\"\n | \"validation\"\n | \"timeout\"\n | \"max_retries_exceeded\"\n | \"exception\";\n\n// id는 자동으로 생성된 uuidv7, 이름은 설정을 통해 명시적으로 지정 가능\nexport interface SchedulerInfo {\n id: string;\n name?: string;\n}\n\ninterface BaseNodeEvent {\n type: EventType;\n info: SchedulerInfo;\n timestamp: Date;\n}\n\n// Task가 시작될 때 생기는 이벤트\nexport interface StartEvent extends BaseNodeEvent {\n type: \"start\";\n}\n\n// Task가 종료될 때 생기는 이벤트\nexport interface StopEvent extends BaseNodeEvent {\n type: \"stop\";\n // Task가 종료된 이유\n reason: TerminationReasonEnum;\n // StopEvent.type가 unknown일 때는 call stack을 기록\n error?: Error;\n}\n\n// Remote Task에서 Task Item을 가져올 때 생기는 이벤트\nexport interface FetchEvent extends BaseNodeEvent {\n type: \"fetch\";\n}\n\n// Task에서 TaskItem 처리를 시작할 때 생기는 이벤트\nexport interface ProcessStartEvent extends BaseNodeEvent {\n type: \"process:start\";\n task: TaskItem;\n}\n\n// Task에서 TaskItem 처리를 완료했을 때 생기는 이벤트\nexport interface ProcessCompleteEvent extends BaseNodeEvent {\n type: \"process:complete\";\n task: TaskItem;\n}\n\n// Task에서 TaskItem 처리를 실패했을 때 생기는 이벤트\nexport interface ProcessErrorEvent extends BaseNodeEvent {\n type: \"process:error\";\n task: TaskItem;\n reason: ProcessErrorReasonEnum;\n // ProcessErrorEvent.type가 no_route, timeout, max_retries_exceeded이 아닐 때는 call stack을 기록\n error?: Error;\n}\n\nexport type RoutedTaskEvent = ProcessStartEvent | ProcessCompleteEvent | ProcessErrorEvent;\nexport type UnroutedTaskEvent = StartEvent | StopEvent | FetchEvent;\nexport type TaskEvent = UnroutedTaskEvent | RoutedTaskEvent;\n"],"names":[],"mappings":"AAoFA,WAA4D"}
@@ -1,6 +0,0 @@
1
- export * from "./utils";
2
- export type * from "./config";
3
- export type * from "./context";
4
- export type * from "./events";
5
- export type * from "./task-items";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./utils.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from \"./utils\";\nexport type * from \"./config\";\nexport type * from \"./context\";\nexport type * from \"./events\";\nexport type * from \"./task-items\";\n"],"names":[],"mappings":"AAAA,cAAc,aAAU"}
@@ -1,12 +0,0 @@
1
- import type { z } from "zod";
2
- export type TaskItemState = "pending" | "error" | "completed";
3
- export interface TaskItem<T extends z.ZodType = z.ZodType> {
4
- id: string;
5
- createdAt: Date;
6
- updatedAt: Date;
7
- status: TaskItemState;
8
- namespace: string;
9
- attempt: number;
10
- payload: Buffer | z.infer<T>;
11
- }
12
- //# sourceMappingURL=task-items.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-items.d.ts","sourceRoot":"","sources":["../../src/types/task-items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAO7B,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAE9D,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAC9B"}
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=task-items.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/task-items.ts"],"sourcesContent":["import type { z } from \"zod\";\n\n// Task 상태\n// - pending: 대기 중\n// - pending_for_retry: 재시도 대기 중\n// - error: 처리 중 에러 발생 (처리 종료)\n// - completed: 처리 완료\nexport type TaskItemState = \"pending\" | \"error\" | \"completed\";\n\nexport interface TaskItem<T extends z.ZodType = z.ZodType> {\n id: string;\n createdAt: Date;\n updatedAt: Date;\n status: TaskItemState;\n namespace: string;\n attempt: number;\n // Task의 payload.\n payload: Buffer | z.infer<T>;\n}\n"],"names":[],"mappings":"AASA,WASC"}
@@ -1,4 +0,0 @@
1
- export type Resolvable<T> = T | Promise<T> | (() => T | Promise<T>);
2
- export type Callback<TArg, TReturn> = ((arg: TArg) => TReturn) | ((arg: TArg) => Promise<TReturn>);
3
- export declare function resolve<T>(value: Resolvable<T>): Promise<T>;
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,MAAM,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnG,wBAAsB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMjE"}
@@ -1,8 +0,0 @@
1
- export async function resolve(value) {
2
- if (value instanceof Function) {
3
- return value();
4
- }
5
- return value;
6
- }
7
-
8
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/utils.ts"],"sourcesContent":["export type Resolvable<T> = T | Promise<T> | (() => T | Promise<T>);\nexport type Callback<TArg, TReturn> = ((arg: TArg) => TReturn) | ((arg: TArg) => Promise<TReturn>);\n\nexport async function resolve<T>(value: Resolvable<T>): Promise<T> {\n if (value instanceof Function) {\n return value();\n }\n\n return value;\n}\n"],"names":["resolve","value","Function"],"mappings":"AAGA,OAAO,eAAeA,QAAWC,KAAoB;IACnD,IAAIA,iBAAiBC,UAAU;QAC7B,OAAOD;IACT;IAEA,OAAOA;AACT"}