@chevre/domain 26.0.0-alpha.15 → 26.0.0-alpha.16
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/lib/chevre/eventEmitter/task.d.ts +5 -21
- package/lib/chevre/repo/assetTransaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +9 -9
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
- package/package.json +1 -1
|
@@ -16,9 +16,6 @@ interface IReadyTask {
|
|
|
16
16
|
id: string;
|
|
17
17
|
name?: factory.taskName;
|
|
18
18
|
status: factory.taskStatus.Ready;
|
|
19
|
-
remainingNumberOfTries?: never;
|
|
20
|
-
expires?: Date;
|
|
21
|
-
executionResult?: never;
|
|
22
19
|
}
|
|
23
20
|
/**
|
|
24
21
|
* タスク名不明の遅延実行中タスク
|
|
@@ -27,9 +24,6 @@ interface IRunningTask {
|
|
|
27
24
|
id: string;
|
|
28
25
|
status: factory.taskStatus.Running;
|
|
29
26
|
name?: never;
|
|
30
|
-
remainingNumberOfTries?: never;
|
|
31
|
-
expires?: never;
|
|
32
|
-
executionResult?: never;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* タスク名指定での遅延実行中タスク
|
|
@@ -38,27 +32,17 @@ interface IRunningTaskByName {
|
|
|
38
32
|
id: string;
|
|
39
33
|
status: factory.taskStatus.Running;
|
|
40
34
|
name: factory.taskName;
|
|
41
|
-
remainingNumberOfTries?: never;
|
|
42
|
-
expires?: never;
|
|
43
|
-
executionResult?: never;
|
|
44
35
|
}
|
|
45
36
|
/**
|
|
46
|
-
*
|
|
37
|
+
* タスクステータス変更イベント発火時パラメータとしてのタスク
|
|
47
38
|
*/
|
|
48
|
-
|
|
39
|
+
type IChangedTask = IReadyTask | IRunningTask | IRunningTaskByName;
|
|
40
|
+
type IOperationExecute<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
41
|
+
interface ITaskAsNextFunctionParam {
|
|
49
42
|
id: string;
|
|
50
43
|
status: factory.taskStatus.Executed | factory.taskStatus.Running | factory.taskStatus.Aborted;
|
|
51
44
|
name: factory.taskName;
|
|
52
|
-
executionResult: factory.task.IExecutionResult;
|
|
53
|
-
/**
|
|
54
|
-
* 実行されたタスクの残り試行回数
|
|
55
|
-
*/
|
|
56
|
-
remainingNumberOfTries: number;
|
|
57
|
-
expires?: never;
|
|
58
45
|
}
|
|
59
|
-
type IChangedTask = IReadyTask | IRunningTask | IRunningTaskByName | IExecutedTask;
|
|
60
|
-
type IOperationExecute<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
61
|
-
type ITaskAsNextFunctionParam = Pick<IExecutedTask, 'id' | 'name' | 'status'>;
|
|
62
46
|
type IAsyncActionNextFunction = (task: ITaskAsNextFunctionParam) => IOperationExecute<void>;
|
|
63
47
|
type IOnTaskStatusChangedListener = (task: IChangedTask) => void;
|
|
64
48
|
type RedisClientType = ReturnType<typeof createClient>;
|
|
@@ -70,4 +54,4 @@ declare class TaskEventEmitter extends EventEmitter {
|
|
|
70
54
|
emitTaskStatusChanged(task: IChangedTask): void;
|
|
71
55
|
}
|
|
72
56
|
declare const taskEventEmitter: TaskEventEmitter;
|
|
73
|
-
export { IChangedTask, IReadyTask, IRunningTask, IRunningTaskByName,
|
|
57
|
+
export { IChangedTask, IReadyTask, IRunningTask, IRunningTaskByName, IExecuteSettings, IOnTaskStatusChangedListener, taskEventEmitter, ITaskAsNextFunctionParam, IAsyncActionNextFunction };
|
|
@@ -124,7 +124,7 @@ export declare class AssetTransactionRepo {
|
|
|
124
124
|
$in: factory.transactionStatusType[];
|
|
125
125
|
};
|
|
126
126
|
limit: number;
|
|
127
|
-
}): Promise<Pick<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction, "id" | "
|
|
127
|
+
}): Promise<Pick<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
128
128
|
/**
|
|
129
129
|
* set task status exported by transaction id
|
|
130
130
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -73,7 +73,7 @@ export declare class TransactionRepo {
|
|
|
73
73
|
$in: factory.transactionStatusType[];
|
|
74
74
|
};
|
|
75
75
|
limit: number;
|
|
76
|
-
}): Promise<Pick<import("@chevre/factory/lib/chevre/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/chevre/transaction/returnOrder").ITransaction, "id" | "
|
|
76
|
+
}): Promise<Pick<import("@chevre/factory/lib/chevre/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/chevre/transaction/returnOrder").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
77
77
|
/**
|
|
78
78
|
* set task status exported by transaction id
|
|
79
79
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -133,16 +133,16 @@ export declare class TransactionRepo {
|
|
|
133
133
|
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
134
134
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
135
135
|
error?: any;
|
|
136
|
-
status: factory.transactionStatusType;
|
|
137
|
-
expires: Date;
|
|
138
136
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
139
137
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
140
138
|
typeOf: factory.transactionType.PlaceOrder;
|
|
139
|
+
expires: Date;
|
|
141
140
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
142
141
|
startDate: Date;
|
|
143
142
|
endDate?: Date | undefined;
|
|
144
143
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
145
144
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
145
|
+
status: factory.transactionStatusType;
|
|
146
146
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
147
147
|
potentialActions?: undefined;
|
|
148
148
|
} & {
|
|
@@ -152,16 +152,16 @@ export declare class TransactionRepo {
|
|
|
152
152
|
}) | ({
|
|
153
153
|
object: import("@chevre/factory/lib/chevre/transaction/returnOrder").IObject;
|
|
154
154
|
error?: any;
|
|
155
|
-
status: factory.transactionStatusType;
|
|
156
|
-
expires: Date;
|
|
157
155
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
158
156
|
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
159
157
|
typeOf: factory.transactionType.ReturnOrder;
|
|
158
|
+
expires: Date;
|
|
160
159
|
result?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IResult | undefined;
|
|
161
160
|
startDate: Date;
|
|
162
161
|
endDate?: Date | undefined;
|
|
163
162
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
164
163
|
recipient?: undefined;
|
|
164
|
+
status: factory.transactionStatusType;
|
|
165
165
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
166
166
|
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
167
167
|
} & {
|
|
@@ -171,16 +171,16 @@ export declare class TransactionRepo {
|
|
|
171
171
|
})), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
172
172
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
173
173
|
error?: any;
|
|
174
|
-
status: factory.transactionStatusType;
|
|
175
|
-
expires: Date;
|
|
176
174
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
177
175
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
178
176
|
typeOf: factory.transactionType.PlaceOrder;
|
|
177
|
+
expires: Date;
|
|
179
178
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
180
179
|
startDate: Date;
|
|
181
180
|
endDate?: Date | undefined;
|
|
182
181
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
183
182
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
183
|
+
status: factory.transactionStatusType;
|
|
184
184
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
185
185
|
potentialActions?: undefined;
|
|
186
186
|
} & {
|
|
@@ -190,16 +190,16 @@ export declare class TransactionRepo {
|
|
|
190
190
|
}) | ({
|
|
191
191
|
object: import("@chevre/factory/lib/chevre/transaction/returnOrder").IObject;
|
|
192
192
|
error?: any;
|
|
193
|
-
status: factory.transactionStatusType;
|
|
194
|
-
expires: Date;
|
|
195
193
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
196
194
|
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
197
195
|
typeOf: factory.transactionType.ReturnOrder;
|
|
196
|
+
expires: Date;
|
|
198
197
|
result?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IResult | undefined;
|
|
199
198
|
startDate: Date;
|
|
200
199
|
endDate?: Date | undefined;
|
|
201
200
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
202
201
|
recipient?: undefined;
|
|
202
|
+
status: factory.transactionStatusType;
|
|
203
203
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
204
204
|
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
205
205
|
} & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ITaskAsNextFunctionParam } from '../../eventEmitter/task';
|
|
2
2
|
import type { AsyncActionRepo, IExecutableAsyncAction } from '../../repo/asyncAction';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行失敗時処理
|
|
@@ -10,6 +10,6 @@ declare function onOperationFailed(params: {
|
|
|
10
10
|
}): (repos: {
|
|
11
11
|
asyncAction: AsyncActionRepo;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
executedTask:
|
|
13
|
+
executedTask: ITaskAsNextFunctionParam;
|
|
14
14
|
}>;
|
|
15
15
|
export { onOperationFailed };
|
package/package.json
CHANGED