@webiny/tasks 6.3.0-beta.4 → 6.4.0-beta.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.
Files changed (203) hide show
  1. package/context.js +31 -43
  2. package/context.js.map +1 -1
  3. package/crud/TaskLogPrivateModel.js +33 -27
  4. package/crud/TaskLogPrivateModel.js.map +1 -1
  5. package/crud/TaskPrivateModel.js +48 -39
  6. package/crud/TaskPrivateModel.js.map +1 -1
  7. package/crud/cleanupTaskSubtree.js +55 -69
  8. package/crud/cleanupTaskSubtree.js.map +1 -1
  9. package/crud/crud.tasks.js +289 -352
  10. package/crud/crud.tasks.js.map +1 -1
  11. package/crud/definition.tasks.js +13 -16
  12. package/crud/definition.tasks.js.map +1 -1
  13. package/crud/service.tasks.js +119 -155
  14. package/crud/service.tasks.js.map +1 -1
  15. package/decorators/RunnableTaskDecorator.js +61 -77
  16. package/decorators/RunnableTaskDecorator.js.map +1 -1
  17. package/decorators/SelfCleaningTaskDecorator.js +75 -89
  18. package/decorators/SelfCleaningTaskDecorator.js.map +1 -1
  19. package/domain/errors.js +35 -39
  20. package/domain/errors.js.map +1 -1
  21. package/events/TaskAfterCreateEvent.js +8 -5
  22. package/events/TaskAfterCreateEvent.js.map +1 -1
  23. package/events/TaskAfterDeleteEvent.js +8 -5
  24. package/events/TaskAfterDeleteEvent.js.map +1 -1
  25. package/events/TaskAfterUpdateEvent.js +8 -5
  26. package/events/TaskAfterUpdateEvent.js.map +1 -1
  27. package/events/TaskBeforeCreateEvent.js +8 -5
  28. package/events/TaskBeforeCreateEvent.js.map +1 -1
  29. package/events/TaskBeforeDeleteEvent.js +8 -5
  30. package/events/TaskBeforeDeleteEvent.js.map +1 -1
  31. package/events/TaskBeforeUpdateEvent.js +8 -5
  32. package/events/TaskBeforeUpdateEvent.js.map +1 -1
  33. package/events/abstractions.js +7 -36
  34. package/events/abstractions.js.map +1 -1
  35. package/events/index.js +0 -2
  36. package/features/AbortTask/AbortTaskUseCase.js +9 -8
  37. package/features/AbortTask/AbortTaskUseCase.js.map +1 -1
  38. package/features/AbortTask/abstractions.js +2 -1
  39. package/features/AbortTask/abstractions.js.map +1 -1
  40. package/features/AbortTask/feature.js +6 -5
  41. package/features/AbortTask/feature.js.map +1 -1
  42. package/features/AbortTask/index.js +0 -2
  43. package/features/CleanupTaskSubtree/CleanupTaskSubtreeUseCase.js +8 -7
  44. package/features/CleanupTaskSubtree/CleanupTaskSubtreeUseCase.js.map +1 -1
  45. package/features/CleanupTaskSubtree/abstractions.js +2 -1
  46. package/features/CleanupTaskSubtree/abstractions.js.map +1 -1
  47. package/features/CleanupTaskSubtree/index.js +0 -2
  48. package/features/GetTask/GetTaskUseCase.js +8 -7
  49. package/features/GetTask/GetTaskUseCase.js.map +1 -1
  50. package/features/GetTask/abstractions.js +2 -1
  51. package/features/GetTask/abstractions.js.map +1 -1
  52. package/features/GetTask/feature.js +6 -5
  53. package/features/GetTask/feature.js.map +1 -1
  54. package/features/GetTask/index.js +0 -2
  55. package/features/GetTaskDefinition/GetTaskDefinitionUseCase.js +18 -16
  56. package/features/GetTaskDefinition/GetTaskDefinitionUseCase.js.map +1 -1
  57. package/features/GetTaskDefinition/abstractions.js +2 -1
  58. package/features/GetTaskDefinition/abstractions.js.map +1 -1
  59. package/features/GetTaskDefinition/feature.js +6 -5
  60. package/features/GetTaskDefinition/feature.js.map +1 -1
  61. package/features/GetTaskDefinition/index.js +0 -2
  62. package/features/ListTaskDefinitions/ListTaskDefinitionsUseCase.js +18 -12
  63. package/features/ListTaskDefinitions/ListTaskDefinitionsUseCase.js.map +1 -1
  64. package/features/ListTaskDefinitions/abstractions.js +2 -1
  65. package/features/ListTaskDefinitions/abstractions.js.map +1 -1
  66. package/features/ListTaskDefinitions/feature.js +6 -5
  67. package/features/ListTaskDefinitions/feature.js.map +1 -1
  68. package/features/ListTaskDefinitions/index.js +0 -2
  69. package/features/ListTasks/ListTasksUseCase.js +8 -7
  70. package/features/ListTasks/ListTasksUseCase.js.map +1 -1
  71. package/features/ListTasks/abstractions.js +2 -1
  72. package/features/ListTasks/abstractions.js.map +1 -1
  73. package/features/ListTasks/feature.js +6 -5
  74. package/features/ListTasks/feature.js.map +1 -1
  75. package/features/ListTasks/index.js +0 -2
  76. package/features/TaskController/TaskController.js +60 -60
  77. package/features/TaskController/TaskController.js.map +1 -1
  78. package/features/TaskController/augmentation.js +0 -3
  79. package/features/TaskController/index.js +0 -5
  80. package/features/TaskExecutionContext/TaskExecutionContext.js +38 -45
  81. package/features/TaskExecutionContext/TaskExecutionContext.js.map +1 -1
  82. package/features/TaskExecutionContext/abstractions.js +2 -10
  83. package/features/TaskExecutionContext/abstractions.js.map +1 -1
  84. package/features/TaskExecutionContext/feature.js +6 -5
  85. package/features/TaskExecutionContext/feature.js.map +1 -1
  86. package/features/TaskExecutionContext/index.js +0 -2
  87. package/features/TriggerTask/TriggerTaskUseCase.js +9 -8
  88. package/features/TriggerTask/TriggerTaskUseCase.js.map +1 -1
  89. package/features/TriggerTask/abstractions.js +2 -1
  90. package/features/TriggerTask/abstractions.js.map +1 -1
  91. package/features/TriggerTask/feature.js +6 -5
  92. package/features/TriggerTask/feature.js.map +1 -1
  93. package/features/TriggerTask/index.js +0 -2
  94. package/global.js +0 -2
  95. package/graphql/checkPermissions.js +16 -35
  96. package/graphql/checkPermissions.js.map +1 -1
  97. package/graphql/index.js +154 -187
  98. package/graphql/index.js.map +1 -1
  99. package/graphql/utils.js +15 -14
  100. package/graphql/utils.js.map +1 -1
  101. package/handler/index.js +46 -53
  102. package/handler/index.js.map +1 -1
  103. package/handler/register.js +7 -15
  104. package/handler/register.js.map +1 -1
  105. package/handler/types.js +0 -3
  106. package/index.js +2 -4
  107. package/package.json +17 -17
  108. package/plugins/TaskServicePlugin.js +9 -6
  109. package/plugins/TaskServicePlugin.js.map +1 -1
  110. package/plugins/index.js +0 -2
  111. package/response/DatabaseResponse.js +113 -132
  112. package/response/DatabaseResponse.js.map +1 -1
  113. package/response/Response.js +78 -96
  114. package/response/Response.js.map +1 -1
  115. package/response/ResponseAbortedResult.js +8 -7
  116. package/response/ResponseAbortedResult.js.map +1 -1
  117. package/response/ResponseContinueResult.js +12 -14
  118. package/response/ResponseContinueResult.js.map +1 -1
  119. package/response/ResponseDoneResult.js +10 -9
  120. package/response/ResponseDoneResult.js.map +1 -1
  121. package/response/ResponseErrorResult.js +9 -8
  122. package/response/ResponseErrorResult.js.map +1 -1
  123. package/response/TaskResponse.js +44 -64
  124. package/response/TaskResponse.js.map +1 -1
  125. package/response/abstractions/Response.js +0 -3
  126. package/response/abstractions/ResponseAbortedResult.js +0 -3
  127. package/response/abstractions/ResponseBaseResult.js +0 -3
  128. package/response/abstractions/ResponseContinueResult.js +0 -3
  129. package/response/abstractions/ResponseDoneResult.js +0 -3
  130. package/response/abstractions/ResponseErrorResult.js +0 -3
  131. package/response/abstractions/TaskResponse.js +0 -3
  132. package/response/abstractions/index.js +0 -2
  133. package/response/index.js +0 -2
  134. package/runner/TaskControl.js +150 -221
  135. package/runner/TaskControl.js.map +1 -1
  136. package/runner/TaskEventValidation.js +12 -13
  137. package/runner/TaskEventValidation.js.map +1 -1
  138. package/runner/TaskManager.js +68 -106
  139. package/runner/TaskManager.js.map +1 -1
  140. package/runner/TaskManagerStore.js +90 -139
  141. package/runner/TaskManagerStore.js.map +1 -1
  142. package/runner/TaskRunner.js +45 -65
  143. package/runner/TaskRunner.js.map +1 -1
  144. package/runner/abstractions/TaskControl.js +0 -3
  145. package/runner/abstractions/TaskEventValidation.js +0 -3
  146. package/runner/abstractions/TaskManager.js +0 -3
  147. package/runner/abstractions/TaskManagerStore.js +0 -3
  148. package/runner/abstractions/TaskRunner.js +0 -3
  149. package/runner/abstractions/index.js +0 -2
  150. package/runner/index.js +0 -2
  151. package/service/EventBridgeEventTransportPlugin.js +43 -42
  152. package/service/EventBridgeEventTransportPlugin.js.map +1 -1
  153. package/service/StepFunctionServicePlugin.js +65 -66
  154. package/service/StepFunctionServicePlugin.js.map +1 -1
  155. package/service/createService.js +10 -13
  156. package/service/createService.js.map +1 -1
  157. package/service/index.js +7 -5
  158. package/service/index.js.map +1 -1
  159. package/tasks/testingRunTask.js +11 -10
  160. package/tasks/testingRunTask.js.map +1 -1
  161. package/types.js +12 -12
  162. package/types.js.map +1 -1
  163. package/utils/ObjectUpdater.js +25 -31
  164. package/utils/ObjectUpdater.js.map +1 -1
  165. package/utils/getErrorProperties.js +5 -4
  166. package/utils/getErrorProperties.js.map +1 -1
  167. package/utils/getObjectProperties.js +8 -15
  168. package/utils/getObjectProperties.js.map +1 -1
  169. package/utils/index.js +0 -2
  170. package/utils/normalizeSelfCleanup.js +13 -12
  171. package/utils/normalizeSelfCleanup.js.map +1 -1
  172. package/events/index.js.map +0 -1
  173. package/features/AbortTask/index.js.map +0 -1
  174. package/features/CleanupTaskSubtree/index.js.map +0 -1
  175. package/features/GetTask/index.js.map +0 -1
  176. package/features/GetTaskDefinition/index.js.map +0 -1
  177. package/features/ListTaskDefinitions/index.js.map +0 -1
  178. package/features/ListTasks/index.js.map +0 -1
  179. package/features/TaskController/augmentation.js.map +0 -1
  180. package/features/TaskController/index.js.map +0 -1
  181. package/features/TaskExecutionContext/index.js.map +0 -1
  182. package/features/TriggerTask/index.js.map +0 -1
  183. package/global.js.map +0 -1
  184. package/handler/types.js.map +0 -1
  185. package/index.js.map +0 -1
  186. package/plugins/index.js.map +0 -1
  187. package/response/abstractions/Response.js.map +0 -1
  188. package/response/abstractions/ResponseAbortedResult.js.map +0 -1
  189. package/response/abstractions/ResponseBaseResult.js.map +0 -1
  190. package/response/abstractions/ResponseContinueResult.js.map +0 -1
  191. package/response/abstractions/ResponseDoneResult.js.map +0 -1
  192. package/response/abstractions/ResponseErrorResult.js.map +0 -1
  193. package/response/abstractions/TaskResponse.js.map +0 -1
  194. package/response/abstractions/index.js.map +0 -1
  195. package/response/index.js.map +0 -1
  196. package/runner/abstractions/TaskControl.js.map +0 -1
  197. package/runner/abstractions/TaskEventValidation.js.map +0 -1
  198. package/runner/abstractions/TaskManager.js.map +0 -1
  199. package/runner/abstractions/TaskManagerStore.js.map +0 -1
  200. package/runner/abstractions/TaskRunner.js.map +0 -1
  201. package/runner/abstractions/index.js.map +0 -1
  202. package/runner/index.js.map +0 -1
  203. package/utils/index.js.map +0 -1
@@ -1,109 +1,91 @@
1
- import sizeOfObject from "object-sizeof";
1
+ import object_sizeof from "object-sizeof";
2
2
  import { ResponseContinueResult } from "./ResponseContinueResult.js";
3
3
  import { ResponseDoneResult } from "./ResponseDoneResult.js";
4
4
  import { ResponseErrorResult } from "./ResponseErrorResult.js";
5
5
  import { ResponseAbortedResult } from "./ResponseAbortedResult.js";
6
6
  import { getErrorProperties } from "../utils/getErrorProperties.js";
7
7
  import { TaskResultStatus } from "@webiny/api-core/features/task/TaskDefinition/index.js";
8
-
9
- /**
10
- * Step Functions has a limit of 256KB for the output size.
11
- * We will set the max output to be 232KB to leave some room for the rest of the data.
12
- */
13
- const MAX_SIZE_BYTES = 232 * 1024;
14
- const createMaxSizeOutput = ({
15
- size
16
- }) => {
17
- return {
18
- message: `Output size exceeds the maximum allowed size.`,
19
- size,
20
- max: MAX_SIZE_BYTES
21
- };
8
+ const MAX_SIZE_BYTES = 237568;
9
+ const createMaxSizeOutput = ({ size })=>({
10
+ message: "Output size exceeds the maximum allowed size.",
11
+ size,
12
+ max: MAX_SIZE_BYTES
13
+ });
14
+ const getOutput = (output)=>{
15
+ if (!output || 0 === Object.keys(output).length) return;
16
+ let size = object_sizeof(output);
17
+ if (size > MAX_SIZE_BYTES) {
18
+ if (output.stack) {
19
+ delete output.stack;
20
+ size = object_sizeof(output);
21
+ if (size <= MAX_SIZE_BYTES) return output;
22
+ }
23
+ if (output.error?.stack) {
24
+ delete output.error.stack;
25
+ size = object_sizeof(output);
26
+ if (size <= MAX_SIZE_BYTES) return output;
27
+ }
28
+ return createMaxSizeOutput({
29
+ size
30
+ });
31
+ }
32
+ return output;
22
33
  };
23
- /**
24
- * Figure out the size of the output object and remove the stack trace if the size exceeds the maximum allowed size.
25
- * If the size is still greater than the maximum allowed size, just return the message that the output size exceeds the maximum allowed size.
26
- */
27
- const getOutput = output => {
28
- if (!output || Object.keys(output).length === 0) {
29
- return undefined;
30
- }
31
- let size = sizeOfObject(output);
32
- if (size > MAX_SIZE_BYTES) {
33
- if (output.stack) {
34
- delete output.stack;
35
- size = sizeOfObject(output);
36
- if (size <= MAX_SIZE_BYTES) {
37
- return output;
38
- }
34
+ class Response {
35
+ get event() {
36
+ return this._event;
39
37
  }
40
- if (output.error?.stack) {
41
- delete output.error.stack;
42
- size = sizeOfObject(output);
43
- if (size <= MAX_SIZE_BYTES) {
44
- return output;
45
- }
38
+ constructor(event){
39
+ this._event = event;
46
40
  }
47
- return createMaxSizeOutput({
48
- size
49
- });
50
- }
51
- return output;
52
- };
53
- export class Response {
54
- get event() {
55
- return this._event;
56
- }
57
- constructor(event) {
58
- this._event = event;
59
- }
60
- setEvent(event) {
61
- this._event = event;
62
- }
63
- from(params) {
64
- switch (params.status) {
65
- case TaskResultStatus.DONE:
66
- return this.done(params);
67
- case TaskResultStatus.CONTINUE:
68
- return this.continue(params);
69
- case TaskResultStatus.ERROR:
70
- return this.error(params);
41
+ setEvent(event) {
42
+ this._event = event;
43
+ }
44
+ from(params) {
45
+ switch(params.status){
46
+ case TaskResultStatus.DONE:
47
+ return this.done(params);
48
+ case TaskResultStatus.CONTINUE:
49
+ return this.continue(params);
50
+ case TaskResultStatus.ERROR:
51
+ return this.error(params);
52
+ }
53
+ }
54
+ continue(params) {
55
+ return new ResponseContinueResult({
56
+ message: params.message,
57
+ input: params.input,
58
+ webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,
59
+ webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
60
+ tenant: params?.tenant || this.event.tenant,
61
+ wait: params.wait
62
+ });
63
+ }
64
+ done(params) {
65
+ return new ResponseDoneResult({
66
+ webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,
67
+ webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
68
+ tenant: params?.tenant || this.event.tenant,
69
+ message: params?.message,
70
+ output: getOutput(params?.output)
71
+ });
72
+ }
73
+ aborted() {
74
+ return new ResponseAbortedResult({
75
+ webinyTaskId: this.event.webinyTaskId,
76
+ webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
77
+ tenant: this.event.tenant
78
+ });
79
+ }
80
+ error(params) {
81
+ return new ResponseErrorResult({
82
+ webinyTaskId: params.webinyTaskId || this.event.webinyTaskId,
83
+ webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
84
+ tenant: params.tenant || this.event.tenant,
85
+ error: params.error instanceof Error ? getErrorProperties(params.error) : params.error
86
+ });
71
87
  }
72
- }
73
- continue(params) {
74
- return new ResponseContinueResult({
75
- message: params.message,
76
- input: params.input,
77
- webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,
78
- webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
79
- tenant: params?.tenant || this.event.tenant,
80
- wait: params.wait
81
- });
82
- }
83
- done(params) {
84
- return new ResponseDoneResult({
85
- webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,
86
- webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
87
- tenant: params?.tenant || this.event.tenant,
88
- message: params?.message,
89
- output: getOutput(params?.output)
90
- });
91
- }
92
- aborted() {
93
- return new ResponseAbortedResult({
94
- webinyTaskId: this.event.webinyTaskId,
95
- webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
96
- tenant: this.event.tenant
97
- });
98
- }
99
- error(params) {
100
- return new ResponseErrorResult({
101
- webinyTaskId: params.webinyTaskId || this.event.webinyTaskId,
102
- webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,
103
- tenant: params.tenant || this.event.tenant,
104
- error: params.error instanceof Error ? getErrorProperties(params.error) : params.error
105
- });
106
- }
107
88
  }
89
+ export { Response };
108
90
 
109
91
  //# sourceMappingURL=Response.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["sizeOfObject","ResponseContinueResult","ResponseDoneResult","ResponseErrorResult","ResponseAbortedResult","getErrorProperties","TaskResultStatus","MAX_SIZE_BYTES","createMaxSizeOutput","size","message","max","getOutput","output","Object","keys","length","undefined","stack","error","Response","event","_event","constructor","setEvent","from","params","status","DONE","done","CONTINUE","continue","ERROR","input","webinyTaskId","webinyTaskDefinitionId","tenant","wait","aborted","Error"],"sources":["Response.ts"],"sourcesContent":["import sizeOfObject from \"object-sizeof\";\n\nimport type { ITaskEvent } from \"~/handler/types.js\";\nimport type {\n IResponse,\n IResponseAbortedResult,\n IResponseContinueParams,\n IResponseContinueResult,\n IResponseDoneParams,\n IResponseDoneResult,\n IResponseErrorParams,\n IResponseErrorResult,\n IResponseFromParams,\n IResponseResult\n} from \"./abstractions/index.js\";\nimport { ResponseContinueResult } from \"~/response/ResponseContinueResult.js\";\nimport { ResponseDoneResult } from \"~/response/ResponseDoneResult.js\";\nimport { ResponseErrorResult } from \"~/response/ResponseErrorResult.js\";\nimport { ResponseAbortedResult } from \"./ResponseAbortedResult.js\";\nimport { getErrorProperties } from \"~/utils/getErrorProperties.js\";\nimport {\n TaskDefinition,\n TaskResultStatus\n} from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\n/**\n * Step Functions has a limit of 256KB for the output size.\n * We will set the max output to be 232KB to leave some room for the rest of the data.\n */\nconst MAX_SIZE_BYTES: number = 232 * 1024;\n\ninterface ICreateMaxSizeOutputParams {\n size: number;\n}\n\nconst createMaxSizeOutput = <O extends TaskDefinition.TaskOutput>({\n size\n}: ICreateMaxSizeOutputParams): O => {\n return {\n message: `Output size exceeds the maximum allowed size.`,\n size,\n max: MAX_SIZE_BYTES\n } as unknown as O;\n};\n/**\n * Figure out the size of the output object and remove the stack trace if the size exceeds the maximum allowed size.\n * If the size is still greater than the maximum allowed size, just return the message that the output size exceeds the maximum allowed size.\n */\nconst getOutput = <O extends TaskDefinition.TaskOutput>(output?: O): O | undefined => {\n if (!output || Object.keys(output).length === 0) {\n return undefined;\n }\n let size = sizeOfObject(output);\n if (size > MAX_SIZE_BYTES) {\n if (output.stack) {\n delete output.stack;\n size = sizeOfObject(output);\n if (size <= MAX_SIZE_BYTES) {\n return output;\n }\n }\n if (output.error?.stack) {\n delete output.error.stack;\n size = sizeOfObject(output);\n if (size <= MAX_SIZE_BYTES) {\n return output;\n }\n }\n return createMaxSizeOutput<O>({ size });\n }\n return output;\n};\n\nexport class Response implements IResponse {\n private _event: ITaskEvent;\n\n public get event(): ITaskEvent {\n return this._event;\n }\n\n public constructor(event: ITaskEvent) {\n this._event = event;\n }\n\n public setEvent(event: ITaskEvent) {\n this._event = event;\n }\n\n public from(params: IResponseFromParams): IResponseResult {\n switch (params.status) {\n case TaskResultStatus.DONE:\n return this.done(params);\n case TaskResultStatus.CONTINUE:\n return this.continue(params);\n case TaskResultStatus.ERROR:\n return this.error(params);\n }\n }\n\n public continue(params: IResponseContinueParams): IResponseContinueResult {\n return new ResponseContinueResult({\n message: params.message,\n input: params.input,\n webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params?.tenant || this.event.tenant,\n wait: params.wait\n });\n }\n\n public done<O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput>(\n params?: IResponseDoneParams<O>\n ): IResponseDoneResult<O> {\n return new ResponseDoneResult<O>({\n webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params?.tenant || this.event.tenant,\n message: params?.message,\n output: getOutput<O>(params?.output)\n });\n }\n\n public aborted(): IResponseAbortedResult {\n return new ResponseAbortedResult({\n webinyTaskId: this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: this.event.tenant\n });\n }\n\n public error(params: IResponseErrorParams): IResponseErrorResult {\n return new ResponseErrorResult({\n webinyTaskId: params.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params.tenant || this.event.tenant,\n error: params.error instanceof Error ? getErrorProperties(params.error) : params.error\n });\n }\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"response/Response.js","sources":["../../src/response/Response.ts"],"sourcesContent":["import sizeOfObject from \"object-sizeof\";\n\nimport type { ITaskEvent } from \"~/handler/types.js\";\nimport type {\n IResponse,\n IResponseAbortedResult,\n IResponseContinueParams,\n IResponseContinueResult,\n IResponseDoneParams,\n IResponseDoneResult,\n IResponseErrorParams,\n IResponseErrorResult,\n IResponseFromParams,\n IResponseResult\n} from \"./abstractions/index.js\";\nimport { ResponseContinueResult } from \"~/response/ResponseContinueResult.js\";\nimport { ResponseDoneResult } from \"~/response/ResponseDoneResult.js\";\nimport { ResponseErrorResult } from \"~/response/ResponseErrorResult.js\";\nimport { ResponseAbortedResult } from \"./ResponseAbortedResult.js\";\nimport { getErrorProperties } from \"~/utils/getErrorProperties.js\";\nimport {\n TaskDefinition,\n TaskResultStatus\n} from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\n/**\n * Step Functions has a limit of 256KB for the output size.\n * We will set the max output to be 232KB to leave some room for the rest of the data.\n */\nconst MAX_SIZE_BYTES: number = 232 * 1024;\n\ninterface ICreateMaxSizeOutputParams {\n size: number;\n}\n\nconst createMaxSizeOutput = <O extends TaskDefinition.TaskOutput>({\n size\n}: ICreateMaxSizeOutputParams): O => {\n return {\n message: `Output size exceeds the maximum allowed size.`,\n size,\n max: MAX_SIZE_BYTES\n } as unknown as O;\n};\n/**\n * Figure out the size of the output object and remove the stack trace if the size exceeds the maximum allowed size.\n * If the size is still greater than the maximum allowed size, just return the message that the output size exceeds the maximum allowed size.\n */\nconst getOutput = <O extends TaskDefinition.TaskOutput>(output?: O): O | undefined => {\n if (!output || Object.keys(output).length === 0) {\n return undefined;\n }\n let size = sizeOfObject(output);\n if (size > MAX_SIZE_BYTES) {\n if (output.stack) {\n delete output.stack;\n size = sizeOfObject(output);\n if (size <= MAX_SIZE_BYTES) {\n return output;\n }\n }\n if (output.error?.stack) {\n delete output.error.stack;\n size = sizeOfObject(output);\n if (size <= MAX_SIZE_BYTES) {\n return output;\n }\n }\n return createMaxSizeOutput<O>({ size });\n }\n return output;\n};\n\nexport class Response implements IResponse {\n private _event: ITaskEvent;\n\n public get event(): ITaskEvent {\n return this._event;\n }\n\n public constructor(event: ITaskEvent) {\n this._event = event;\n }\n\n public setEvent(event: ITaskEvent) {\n this._event = event;\n }\n\n public from(params: IResponseFromParams): IResponseResult {\n switch (params.status) {\n case TaskResultStatus.DONE:\n return this.done(params);\n case TaskResultStatus.CONTINUE:\n return this.continue(params);\n case TaskResultStatus.ERROR:\n return this.error(params);\n }\n }\n\n public continue(params: IResponseContinueParams): IResponseContinueResult {\n return new ResponseContinueResult({\n message: params.message,\n input: params.input,\n webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params?.tenant || this.event.tenant,\n wait: params.wait\n });\n }\n\n public done<O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput>(\n params?: IResponseDoneParams<O>\n ): IResponseDoneResult<O> {\n return new ResponseDoneResult<O>({\n webinyTaskId: params?.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params?.tenant || this.event.tenant,\n message: params?.message,\n output: getOutput<O>(params?.output)\n });\n }\n\n public aborted(): IResponseAbortedResult {\n return new ResponseAbortedResult({\n webinyTaskId: this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: this.event.tenant\n });\n }\n\n public error(params: IResponseErrorParams): IResponseErrorResult {\n return new ResponseErrorResult({\n webinyTaskId: params.webinyTaskId || this.event.webinyTaskId,\n webinyTaskDefinitionId: this.event.webinyTaskDefinitionId,\n tenant: params.tenant || this.event.tenant,\n error: params.error instanceof Error ? getErrorProperties(params.error) : params.error\n });\n }\n}\n"],"names":["MAX_SIZE_BYTES","createMaxSizeOutput","size","getOutput","output","Object","sizeOfObject","Response","event","params","TaskResultStatus","ResponseContinueResult","ResponseDoneResult","ResponseAbortedResult","ResponseErrorResult","Error","getErrorProperties"],"mappings":";;;;;;;AA6BA,MAAMA,iBAAyB;AAM/B,MAAMC,sBAAsB,CAAsC,EAC9DC,IAAI,EACqB,GAClB;QACH,SAAS;QACTA;QACA,KAAKF;IACT;AAMJ,MAAMG,YAAY,CAAsCC;IACpD,IAAI,CAACA,UAAUC,AAA+B,MAA/BA,OAAO,IAAI,CAACD,QAAQ,MAAM,EACrC;IAEJ,IAAIF,OAAOI,cAAaF;IACxB,IAAIF,OAAOF,gBAAgB;QACvB,IAAII,OAAO,KAAK,EAAE;YACd,OAAOA,OAAO,KAAK;YACnBF,OAAOI,cAAaF;YACpB,IAAIF,QAAQF,gBACR,OAAOI;QAEf;QACA,IAAIA,OAAO,KAAK,EAAE,OAAO;YACrB,OAAOA,OAAO,KAAK,CAAC,KAAK;YACzBF,OAAOI,cAAaF;YACpB,IAAIF,QAAQF,gBACR,OAAOI;QAEf;QACA,OAAOH,oBAAuB;YAAEC;QAAK;IACzC;IACA,OAAOE;AACX;AAEO,MAAMG;IAGT,IAAW,QAAoB;QAC3B,OAAO,IAAI,CAAC,MAAM;IACtB;IAEA,YAAmBC,KAAiB,CAAE;QAClC,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEO,SAASA,KAAiB,EAAE;QAC/B,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEO,KAAKC,MAA2B,EAAmB;QACtD,OAAQA,OAAO,MAAM;YACjB,KAAKC,iBAAiB,IAAI;gBACtB,OAAO,IAAI,CAAC,IAAI,CAACD;YACrB,KAAKC,iBAAiB,QAAQ;gBAC1B,OAAO,IAAI,CAAC,QAAQ,CAACD;YACzB,KAAKC,iBAAiB,KAAK;gBACvB,OAAO,IAAI,CAAC,KAAK,CAACD;QAC1B;IACJ;IAEO,SAASA,MAA+B,EAA2B;QACtE,OAAO,IAAIE,uBAAuB;YAC9B,SAASF,OAAO,OAAO;YACvB,OAAOA,OAAO,KAAK;YACnB,cAAcA,QAAQ,gBAAgB,IAAI,CAAC,KAAK,CAAC,YAAY;YAC7D,wBAAwB,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,QAAQA,QAAQ,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM;YAC3C,MAAMA,OAAO,IAAI;QACrB;IACJ;IAEO,KACHA,MAA+B,EACT;QACtB,OAAO,IAAIG,mBAAsB;YAC7B,cAAcH,QAAQ,gBAAgB,IAAI,CAAC,KAAK,CAAC,YAAY;YAC7D,wBAAwB,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,QAAQA,QAAQ,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM;YAC3C,SAASA,QAAQ;YACjB,QAAQN,UAAaM,QAAQ;QACjC;IACJ;IAEO,UAAkC;QACrC,OAAO,IAAII,sBAAsB;YAC7B,cAAc,IAAI,CAAC,KAAK,CAAC,YAAY;YACrC,wBAAwB,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM;QAC7B;IACJ;IAEO,MAAMJ,MAA4B,EAAwB;QAC7D,OAAO,IAAIK,oBAAoB;YAC3B,cAAcL,OAAO,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY;YAC5D,wBAAwB,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,QAAQA,OAAO,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1C,OAAOA,OAAO,KAAK,YAAYM,QAAQC,mBAAmBP,OAAO,KAAK,IAAIA,OAAO,KAAK;QAC1F;IACJ;AACJ"}
@@ -1,11 +1,12 @@
1
1
  import { TaskResultStatus } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- export class ResponseAbortedResult {
3
- status = TaskResultStatus.ABORTED;
4
- constructor(params) {
5
- this.webinyTaskId = params.webinyTaskId;
6
- this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
7
- this.tenant = params.tenant;
8
- }
2
+ class ResponseAbortedResult {
3
+ constructor(params){
4
+ this.status = TaskResultStatus.ABORTED;
5
+ this.webinyTaskId = params.webinyTaskId;
6
+ this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
7
+ this.tenant = params.tenant;
8
+ }
9
9
  }
10
+ export { ResponseAbortedResult };
10
11
 
11
12
  //# sourceMappingURL=ResponseAbortedResult.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TaskResultStatus","ResponseAbortedResult","status","ABORTED","constructor","params","webinyTaskId","webinyTaskDefinitionId","tenant"],"sources":["ResponseAbortedResult.ts"],"sourcesContent":["import type { IResponseAbortedResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseAbortedResult implements IResponseAbortedResult {\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly status: TaskResultStatus.ABORTED = TaskResultStatus.ABORTED;\n\n public constructor(params: Omit<IResponseAbortedResult, \"status\">) {\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n }\n}\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,wDAAwD;AAEzF,OAAO,MAAMC,qBAAqB,CAAmC;EAIjDC,MAAM,GAA6BF,gBAAgB,CAACG,OAAO;EAEpEC,WAAWA,CAACC,MAA8C,EAAE;IAC/D,IAAI,CAACC,YAAY,GAAGD,MAAM,CAACC,YAAY;IACvC,IAAI,CAACC,sBAAsB,GAAGF,MAAM,CAACE,sBAAsB;IAC3D,IAAI,CAACC,MAAM,GAAGH,MAAM,CAACG,MAAM;EAC/B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"response/ResponseAbortedResult.js","sources":["../../src/response/ResponseAbortedResult.ts"],"sourcesContent":["import type { IResponseAbortedResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseAbortedResult implements IResponseAbortedResult {\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly status: TaskResultStatus.ABORTED = TaskResultStatus.ABORTED;\n\n public constructor(params: Omit<IResponseAbortedResult, \"status\">) {\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n }\n}\n"],"names":["ResponseAbortedResult","params","TaskResultStatus"],"mappings":";AAGO,MAAMA;IAMT,YAAmBC,MAA8C,CAAE;aAFnD,MAAM,GAA6BC,iBAAiB,OAAO;QAGvE,IAAI,CAAC,YAAY,GAAGD,OAAO,YAAY;QACvC,IAAI,CAAC,sBAAsB,GAAGA,OAAO,sBAAsB;QAC3D,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;AACJ"}
@@ -1,18 +1,16 @@
1
1
  import { TaskResultStatus } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- export class ResponseContinueResult {
3
- status = TaskResultStatus.CONTINUE;
4
- /**
5
- * We need this to make sure that the task will not use the delay from the previous iteration.
6
- */
7
- delay = -1;
8
- constructor(params) {
9
- this.message = params.message;
10
- this.webinyTaskId = params.webinyTaskId;
11
- this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
12
- this.tenant = params.tenant;
13
- this.input = params.input;
14
- this.wait = params.wait;
15
- }
2
+ class ResponseContinueResult {
3
+ constructor(params){
4
+ this.status = TaskResultStatus.CONTINUE;
5
+ this.delay = -1;
6
+ this.message = params.message;
7
+ this.webinyTaskId = params.webinyTaskId;
8
+ this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
9
+ this.tenant = params.tenant;
10
+ this.input = params.input;
11
+ this.wait = params.wait;
12
+ }
16
13
  }
14
+ export { ResponseContinueResult };
17
15
 
18
16
  //# sourceMappingURL=ResponseContinueResult.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TaskResultStatus","ResponseContinueResult","status","CONTINUE","delay","constructor","params","message","webinyTaskId","webinyTaskDefinitionId","tenant","input","wait"],"sources":["ResponseContinueResult.ts"],"sourcesContent":["import type { ITaskDataInput } from \"~/types.js\";\nimport type { IResponseContinueResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseContinueResult<T = ITaskDataInput> implements IResponseContinueResult<T> {\n public readonly message?: string | undefined;\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly status: TaskResultStatus.CONTINUE = TaskResultStatus.CONTINUE;\n public readonly input: T;\n /**\n * We need this to make sure that the task will not use the delay from the previous iteration.\n */\n public readonly delay = -1;\n public readonly wait?: number;\n\n public constructor(params: Omit<IResponseContinueResult<T>, \"delay\" | \"status\">) {\n this.message = params.message;\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.input = params.input;\n this.wait = params.wait;\n }\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,wDAAwD;AAEzF,OAAO,MAAMC,sBAAsB,CAA2D;EAK1EC,MAAM,GAA8BF,gBAAgB,CAACG,QAAQ;EAE7E;AACJ;AACA;EACoBC,KAAK,GAAG,CAAC,CAAC;EAGnBC,WAAWA,CAACC,MAA4D,EAAE;IAC7E,IAAI,CAACC,OAAO,GAAGD,MAAM,CAACC,OAAO;IAC7B,IAAI,CAACC,YAAY,GAAGF,MAAM,CAACE,YAAY;IACvC,IAAI,CAACC,sBAAsB,GAAGH,MAAM,CAACG,sBAAsB;IAC3D,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,KAAK,GAAGL,MAAM,CAACK,KAAK;IACzB,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;EAC3B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"response/ResponseContinueResult.js","sources":["../../src/response/ResponseContinueResult.ts"],"sourcesContent":["import type { ITaskDataInput } from \"~/types.js\";\nimport type { IResponseContinueResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseContinueResult<T = ITaskDataInput> implements IResponseContinueResult<T> {\n public readonly message?: string | undefined;\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly status: TaskResultStatus.CONTINUE = TaskResultStatus.CONTINUE;\n public readonly input: T;\n /**\n * We need this to make sure that the task will not use the delay from the previous iteration.\n */\n public readonly delay = -1;\n public readonly wait?: number;\n\n public constructor(params: Omit<IResponseContinueResult<T>, \"delay\" | \"status\">) {\n this.message = params.message;\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.input = params.input;\n this.wait = params.wait;\n }\n}\n"],"names":["ResponseContinueResult","params","TaskResultStatus"],"mappings":";AAIO,MAAMA;IAaT,YAAmBC,MAA4D,CAAE;aARjE,MAAM,GAA8BC,iBAAiB,QAAQ;QAI5E,KACe,KAAK,GAAG;QAIpB,IAAI,CAAC,OAAO,GAAGD,OAAO,OAAO;QAC7B,IAAI,CAAC,YAAY,GAAGA,OAAO,YAAY;QACvC,IAAI,CAAC,sBAAsB,GAAGA,OAAO,sBAAsB;QAC3D,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;QAC3B,IAAI,CAAC,KAAK,GAAGA,OAAO,KAAK;QACzB,IAAI,CAAC,IAAI,GAAGA,OAAO,IAAI;IAC3B;AACJ"}
@@ -1,13 +1,14 @@
1
1
  import { TaskResultStatus } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- export class ResponseDoneResult {
3
- status = TaskResultStatus.DONE;
4
- constructor(params) {
5
- this.message = params.message;
6
- this.webinyTaskId = params.webinyTaskId;
7
- this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
8
- this.tenant = params.tenant;
9
- this.output = Object.keys(params.output || {}).length > 0 ? params.output : undefined;
10
- }
2
+ class ResponseDoneResult {
3
+ constructor(params){
4
+ this.status = TaskResultStatus.DONE;
5
+ this.message = params.message;
6
+ this.webinyTaskId = params.webinyTaskId;
7
+ this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
8
+ this.tenant = params.tenant;
9
+ this.output = Object.keys(params.output || {}).length > 0 ? params.output : void 0;
10
+ }
11
11
  }
12
+ export { ResponseDoneResult };
12
13
 
13
14
  //# sourceMappingURL=ResponseDoneResult.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TaskResultStatus","ResponseDoneResult","status","DONE","constructor","params","message","webinyTaskId","webinyTaskDefinitionId","tenant","output","Object","keys","length","undefined"],"sources":["ResponseDoneResult.ts"],"sourcesContent":["import type { IResponseDoneResult } from \"./abstractions/index.js\";\nimport {\n TaskDefinition,\n TaskResultStatus\n} from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseDoneResult<\n O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput\n> implements IResponseDoneResult<O> {\n public readonly message?: string | undefined;\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly output?: O;\n public readonly status: TaskResultStatus.DONE = TaskResultStatus.DONE;\n\n public constructor(params: Omit<IResponseDoneResult<O>, \"status\">) {\n this.message = params.message;\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.output = Object.keys(params.output || {}).length > 0 ? params.output : undefined;\n }\n}\n"],"mappings":"AACA,SAEIA,gBAAgB,QACb,wDAAwD;AAE/D,OAAO,MAAMC,kBAAkB,CAEK;EAMhBC,MAAM,GAA0BF,gBAAgB,CAACG,IAAI;EAE9DC,WAAWA,CAACC,MAA8C,EAAE;IAC/D,IAAI,CAACC,OAAO,GAAGD,MAAM,CAACC,OAAO;IAC7B,IAAI,CAACC,YAAY,GAAGF,MAAM,CAACE,YAAY;IACvC,IAAI,CAACC,sBAAsB,GAAGH,MAAM,CAACG,sBAAsB;IAC3D,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACP,MAAM,CAACK,MAAM,IAAI,CAAC,CAAC,CAAC,CAACG,MAAM,GAAG,CAAC,GAAGR,MAAM,CAACK,MAAM,GAAGI,SAAS;EACzF;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"response/ResponseDoneResult.js","sources":["../../src/response/ResponseDoneResult.ts"],"sourcesContent":["import type { IResponseDoneResult } from \"./abstractions/index.js\";\nimport {\n TaskDefinition,\n TaskResultStatus\n} from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseDoneResult<\n O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput\n> implements IResponseDoneResult<O> {\n public readonly message?: string | undefined;\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly output?: O;\n public readonly status: TaskResultStatus.DONE = TaskResultStatus.DONE;\n\n public constructor(params: Omit<IResponseDoneResult<O>, \"status\">) {\n this.message = params.message;\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.output = Object.keys(params.output || {}).length > 0 ? params.output : undefined;\n }\n}\n"],"names":["ResponseDoneResult","params","TaskResultStatus","Object","undefined"],"mappings":";AAMO,MAAMA;IAUT,YAAmBC,MAA8C,CAAE;aAFnD,MAAM,GAA0BC,iBAAiB,IAAI;QAGjE,IAAI,CAAC,OAAO,GAAGD,OAAO,OAAO;QAC7B,IAAI,CAAC,YAAY,GAAGA,OAAO,YAAY;QACvC,IAAI,CAAC,sBAAsB,GAAGA,OAAO,sBAAsB;QAC3D,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;QAC3B,IAAI,CAAC,MAAM,GAAGE,OAAO,IAAI,CAACF,OAAO,MAAM,IAAI,CAAC,GAAG,MAAM,GAAG,IAAIA,OAAO,MAAM,GAAGG;IAChF;AACJ"}
@@ -1,12 +1,13 @@
1
1
  import { TaskResultStatus } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- export class ResponseErrorResult {
3
- status = TaskResultStatus.ERROR;
4
- constructor(params) {
5
- this.webinyTaskId = params.webinyTaskId;
6
- this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
7
- this.tenant = params.tenant;
8
- this.error = params.error;
9
- }
2
+ class ResponseErrorResult {
3
+ constructor(params){
4
+ this.status = TaskResultStatus.ERROR;
5
+ this.webinyTaskId = params.webinyTaskId;
6
+ this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;
7
+ this.tenant = params.tenant;
8
+ this.error = params.error;
9
+ }
10
10
  }
11
+ export { ResponseErrorResult };
11
12
 
12
13
  //# sourceMappingURL=ResponseErrorResult.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TaskResultStatus","ResponseErrorResult","status","ERROR","constructor","params","webinyTaskId","webinyTaskDefinitionId","tenant","error"],"sources":["ResponseErrorResult.ts"],"sourcesContent":["import type { IResponseError, IResponseErrorResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseErrorResult implements IResponseErrorResult {\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly error: IResponseError;\n public readonly status: TaskResultStatus.ERROR = TaskResultStatus.ERROR;\n\n public constructor(params: Omit<IResponseErrorResult, \"status\">) {\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.error = params.error;\n }\n}\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,wDAAwD;AAEzF,OAAO,MAAMC,mBAAmB,CAAiC;EAK7CC,MAAM,GAA2BF,gBAAgB,CAACG,KAAK;EAEhEC,WAAWA,CAACC,MAA4C,EAAE;IAC7D,IAAI,CAACC,YAAY,GAAGD,MAAM,CAACC,YAAY;IACvC,IAAI,CAACC,sBAAsB,GAAGF,MAAM,CAACE,sBAAsB;IAC3D,IAAI,CAACC,MAAM,GAAGH,MAAM,CAACG,MAAM;IAC3B,IAAI,CAACC,KAAK,GAAGJ,MAAM,CAACI,KAAK;EAC7B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"response/ResponseErrorResult.js","sources":["../../src/response/ResponseErrorResult.ts"],"sourcesContent":["import type { IResponseError, IResponseErrorResult } from \"./abstractions/index.js\";\nimport { TaskResultStatus } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport class ResponseErrorResult implements IResponseErrorResult {\n public readonly webinyTaskId: string;\n public readonly webinyTaskDefinitionId: string;\n public readonly tenant: string;\n public readonly error: IResponseError;\n public readonly status: TaskResultStatus.ERROR = TaskResultStatus.ERROR;\n\n public constructor(params: Omit<IResponseErrorResult, \"status\">) {\n this.webinyTaskId = params.webinyTaskId;\n this.webinyTaskDefinitionId = params.webinyTaskDefinitionId;\n this.tenant = params.tenant;\n this.error = params.error;\n }\n}\n"],"names":["ResponseErrorResult","params","TaskResultStatus"],"mappings":";AAGO,MAAMA;IAOT,YAAmBC,MAA4C,CAAE;aAFjD,MAAM,GAA2BC,iBAAiB,KAAK;QAGnE,IAAI,CAAC,YAAY,GAAGD,OAAO,YAAY;QACvC,IAAI,CAAC,sBAAsB,GAAGA,OAAO,sBAAsB;QAC3D,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;QAC3B,IAAI,CAAC,KAAK,GAAGA,OAAO,KAAK;IAC7B;AACJ"}
@@ -1,73 +1,53 @@
1
1
  import { getErrorProperties } from "../utils/getErrorProperties.js";
2
- /**
3
- * 355 days transformed into seconds.
4
- */
5
2
  const MAX_WAITING_TIME = 30672000;
6
-
7
- /**
8
- * There are options to send:
9
- * * seconds - number of seconds to wait
10
- * * date - date until which to wait
11
- */
12
- const getWaitingTime = options => {
13
- let waitingTime;
14
- if (!options) {
15
- return undefined;
16
- }
17
- if ("seconds" in options) {
18
- waitingTime = options.seconds;
19
- } else if ("date" in options) {
20
- const now = new Date();
21
- waitingTime = (options.date.getTime() - now.getTime()) / 1000;
22
- }
23
- if (!waitingTime || waitingTime < 0) {
24
- return undefined;
25
- }
26
- return waitingTime > MAX_WAITING_TIME ? MAX_WAITING_TIME : waitingTime;
3
+ const getWaitingTime = (options)=>{
4
+ let waitingTime;
5
+ if (!options) return;
6
+ if ("seconds" in options) waitingTime = options.seconds;
7
+ else if ("date" in options) {
8
+ const now = new Date();
9
+ waitingTime = (options.date.getTime() - now.getTime()) / 1000;
10
+ }
11
+ if (!waitingTime || waitingTime < 0) return;
12
+ return waitingTime > MAX_WAITING_TIME ? MAX_WAITING_TIME : waitingTime;
27
13
  };
28
- export class TaskResponse {
29
- constructor(response) {
30
- this.response = response;
31
- }
32
- done(message, output) {
33
- if (typeof message === "object" && !output) {
34
- return this.response.done({
35
- output: message
36
- });
14
+ class TaskResponse {
15
+ constructor(response){
16
+ this.response = response;
17
+ }
18
+ done(message, output) {
19
+ if ("object" == typeof message && !output) return this.response.done({
20
+ output: message
21
+ });
22
+ return this.response.done({
23
+ message: message,
24
+ output
25
+ });
26
+ }
27
+ continue(input, options) {
28
+ const wait = getWaitingTime(options);
29
+ if (!wait || wait < 1) return this.response.continue({
30
+ input: input
31
+ });
32
+ return this.response.continue({
33
+ input: input,
34
+ wait
35
+ });
36
+ }
37
+ error(error) {
38
+ return this.response.error({
39
+ error: this.getError(error)
40
+ });
37
41
  }
38
- return this.response.done({
39
- message: message,
40
- output
41
- });
42
- }
43
- continue(input, options) {
44
- const wait = getWaitingTime(options);
45
- if (!wait || wait < 1) {
46
- return this.response.continue({
47
- input: input
48
- });
42
+ aborted() {
43
+ return this.response.aborted();
49
44
  }
50
- return this.response.continue({
51
- input: input,
52
- wait
53
- });
54
- }
55
- error(error) {
56
- return this.response.error({
57
- error: this.getError(error)
58
- });
59
- }
60
- aborted() {
61
- return this.response.aborted();
62
- }
63
- getError(error) {
64
- if (error instanceof Error) {
65
- return getErrorProperties(error);
66
- } else if (typeof error === "string") {
67
- return getErrorProperties(new Error(error));
45
+ getError(error) {
46
+ if (error instanceof Error) ;
47
+ else if ("string" == typeof error) return getErrorProperties(new Error(error));
48
+ return getErrorProperties(error);
68
49
  }
69
- return getErrorProperties(error);
70
- }
71
50
  }
51
+ export { TaskResponse };
72
52
 
73
53
  //# sourceMappingURL=TaskResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getErrorProperties","MAX_WAITING_TIME","getWaitingTime","options","waitingTime","undefined","seconds","now","Date","date","getTime","TaskResponse","constructor","response","done","message","output","continue","input","wait","error","getError","aborted","Error"],"sources":["TaskResponse.ts"],"sourcesContent":["import type {\n IResponse,\n IResponseError,\n ITaskResponse,\n ITaskResponseContinueOptions\n} from \"./abstractions/index.js\";\nimport type { ITaskDataInput } from \"~/types.js\";\nimport { getErrorProperties } from \"~/utils/getErrorProperties.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\n/**\n * 355 days transformed into seconds.\n */\nconst MAX_WAITING_TIME = 30672000;\n\n/**\n * There are options to send:\n * * seconds - number of seconds to wait\n * * date - date until which to wait\n */\nconst getWaitingTime = (options?: ITaskResponseContinueOptions): number | undefined => {\n let waitingTime: number | undefined;\n if (!options) {\n return undefined;\n }\n if (\"seconds\" in options) {\n waitingTime = options.seconds;\n } else if (\"date\" in options) {\n const now = new Date();\n waitingTime = (options.date.getTime() - now.getTime()) / 1000;\n }\n if (!waitingTime || waitingTime < 0) {\n return undefined;\n }\n return waitingTime > MAX_WAITING_TIME ? MAX_WAITING_TIME : waitingTime;\n};\n\nexport class TaskResponse implements ITaskResponse {\n private readonly response: IResponse;\n\n public constructor(response: IResponse) {\n this.response = response;\n }\n\n public done<O extends TaskDefinition.ResultDone = TaskDefinition.ResultDone>(\n message?: string | O,\n output?: O\n ): TaskDefinition.ResultDone<O> {\n if (typeof message === \"object\" && !output) {\n return this.response.done({\n output: message\n });\n }\n return this.response.done<O>({\n message: message as string,\n output\n });\n }\n\n public continue<T = ITaskDataInput>(\n input: T,\n options?: ITaskResponseContinueOptions\n ): TaskDefinition.ResultContinue {\n const wait = getWaitingTime(options);\n if (!wait || wait < 1) {\n return this.response.continue({\n input: input as ITaskDataInput\n });\n }\n return this.response.continue({\n input: input as ITaskDataInput,\n wait\n });\n }\n\n public error(error: IResponseError | Error | string): TaskDefinition.ResultError {\n return this.response.error({\n error: this.getError(error)\n });\n }\n\n public aborted(): TaskDefinition.ResultAborted {\n return this.response.aborted();\n }\n\n private getError(error: IResponseError | Error | string): IResponseError | Error {\n if (error instanceof Error) {\n return getErrorProperties(error);\n } else if (typeof error === \"string\") {\n return getErrorProperties(new Error(error));\n }\n return getErrorProperties(error);\n }\n}\n"],"mappings":"AAOA,SAASA,kBAAkB;AAG3B;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,QAAQ;;AAEjC;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAIC,OAAsC,IAAyB;EACnF,IAAIC,WAA+B;EACnC,IAAI,CAACD,OAAO,EAAE;IACV,OAAOE,SAAS;EACpB;EACA,IAAI,SAAS,IAAIF,OAAO,EAAE;IACtBC,WAAW,GAAGD,OAAO,CAACG,OAAO;EACjC,CAAC,MAAM,IAAI,MAAM,IAAIH,OAAO,EAAE;IAC1B,MAAMI,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;IACtBJ,WAAW,GAAG,CAACD,OAAO,CAACM,IAAI,CAACC,OAAO,CAAC,CAAC,GAAGH,GAAG,CAACG,OAAO,CAAC,CAAC,IAAI,IAAI;EACjE;EACA,IAAI,CAACN,WAAW,IAAIA,WAAW,GAAG,CAAC,EAAE;IACjC,OAAOC,SAAS;EACpB;EACA,OAAOD,WAAW,GAAGH,gBAAgB,GAAGA,gBAAgB,GAAGG,WAAW;AAC1E,CAAC;AAED,OAAO,MAAMO,YAAY,CAA0B;EAGxCC,WAAWA,CAACC,QAAmB,EAAE;IACpC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC5B;EAEOC,IAAIA,CACPC,OAAoB,EACpBC,MAAU,EACkB;IAC5B,IAAI,OAAOD,OAAO,KAAK,QAAQ,IAAI,CAACC,MAAM,EAAE;MACxC,OAAO,IAAI,CAACH,QAAQ,CAACC,IAAI,CAAC;QACtBE,MAAM,EAAED;MACZ,CAAC,CAAC;IACN;IACA,OAAO,IAAI,CAACF,QAAQ,CAACC,IAAI,CAAI;MACzBC,OAAO,EAAEA,OAAiB;MAC1BC;IACJ,CAAC,CAAC;EACN;EAEOC,QAAQA,CACXC,KAAQ,EACRf,OAAsC,EACT;IAC7B,MAAMgB,IAAI,GAAGjB,cAAc,CAACC,OAAO,CAAC;IACpC,IAAI,CAACgB,IAAI,IAAIA,IAAI,GAAG,CAAC,EAAE;MACnB,OAAO,IAAI,CAACN,QAAQ,CAACI,QAAQ,CAAC;QAC1BC,KAAK,EAAEA;MACX,CAAC,CAAC;IACN;IACA,OAAO,IAAI,CAACL,QAAQ,CAACI,QAAQ,CAAC;MAC1BC,KAAK,EAAEA,KAAuB;MAC9BC;IACJ,CAAC,CAAC;EACN;EAEOC,KAAKA,CAACA,KAAsC,EAA8B;IAC7E,OAAO,IAAI,CAACP,QAAQ,CAACO,KAAK,CAAC;MACvBA,KAAK,EAAE,IAAI,CAACC,QAAQ,CAACD,KAAK;IAC9B,CAAC,CAAC;EACN;EAEOE,OAAOA,CAAA,EAAiC;IAC3C,OAAO,IAAI,CAACT,QAAQ,CAACS,OAAO,CAAC,CAAC;EAClC;EAEQD,QAAQA,CAACD,KAAsC,EAA0B;IAC7E,IAAIA,KAAK,YAAYG,KAAK,EAAE;MACxB,OAAOvB,kBAAkB,CAACoB,KAAK,CAAC;IACpC,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAClC,OAAOpB,kBAAkB,CAAC,IAAIuB,KAAK,CAACH,KAAK,CAAC,CAAC;IAC/C;IACA,OAAOpB,kBAAkB,CAACoB,KAAK,CAAC;EACpC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"response/TaskResponse.js","sources":["../../src/response/TaskResponse.ts"],"sourcesContent":["import type {\n IResponse,\n IResponseError,\n ITaskResponse,\n ITaskResponseContinueOptions\n} from \"./abstractions/index.js\";\nimport type { ITaskDataInput } from \"~/types.js\";\nimport { getErrorProperties } from \"~/utils/getErrorProperties.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\n/**\n * 355 days transformed into seconds.\n */\nconst MAX_WAITING_TIME = 30672000;\n\n/**\n * There are options to send:\n * * seconds - number of seconds to wait\n * * date - date until which to wait\n */\nconst getWaitingTime = (options?: ITaskResponseContinueOptions): number | undefined => {\n let waitingTime: number | undefined;\n if (!options) {\n return undefined;\n }\n if (\"seconds\" in options) {\n waitingTime = options.seconds;\n } else if (\"date\" in options) {\n const now = new Date();\n waitingTime = (options.date.getTime() - now.getTime()) / 1000;\n }\n if (!waitingTime || waitingTime < 0) {\n return undefined;\n }\n return waitingTime > MAX_WAITING_TIME ? MAX_WAITING_TIME : waitingTime;\n};\n\nexport class TaskResponse implements ITaskResponse {\n private readonly response: IResponse;\n\n public constructor(response: IResponse) {\n this.response = response;\n }\n\n public done<O extends TaskDefinition.ResultDone = TaskDefinition.ResultDone>(\n message?: string | O,\n output?: O\n ): TaskDefinition.ResultDone<O> {\n if (typeof message === \"object\" && !output) {\n return this.response.done({\n output: message\n });\n }\n return this.response.done<O>({\n message: message as string,\n output\n });\n }\n\n public continue<T = ITaskDataInput>(\n input: T,\n options?: ITaskResponseContinueOptions\n ): TaskDefinition.ResultContinue {\n const wait = getWaitingTime(options);\n if (!wait || wait < 1) {\n return this.response.continue({\n input: input as ITaskDataInput\n });\n }\n return this.response.continue({\n input: input as ITaskDataInput,\n wait\n });\n }\n\n public error(error: IResponseError | Error | string): TaskDefinition.ResultError {\n return this.response.error({\n error: this.getError(error)\n });\n }\n\n public aborted(): TaskDefinition.ResultAborted {\n return this.response.aborted();\n }\n\n private getError(error: IResponseError | Error | string): IResponseError | Error {\n if (error instanceof Error) {\n return getErrorProperties(error);\n } else if (typeof error === \"string\") {\n return getErrorProperties(new Error(error));\n }\n return getErrorProperties(error);\n }\n}\n"],"names":["MAX_WAITING_TIME","getWaitingTime","options","waitingTime","now","Date","TaskResponse","response","message","output","input","wait","error","Error","getErrorProperties"],"mappings":";AAaA,MAAMA,mBAAmB;AAOzB,MAAMC,iBAAiB,CAACC;IACpB,IAAIC;IACJ,IAAI,CAACD,SACD;IAEJ,IAAI,aAAaA,SACbC,cAAcD,QAAQ,OAAO;SAC1B,IAAI,UAAUA,SAAS;QAC1B,MAAME,MAAM,IAAIC;QAChBF,cAAeD,AAAAA,CAAAA,QAAQ,IAAI,CAAC,OAAO,KAAKE,IAAI,OAAO,EAAC,IAAK;IAC7D;IACA,IAAI,CAACD,eAAeA,cAAc,GAC9B;IAEJ,OAAOA,cAAcH,mBAAmBA,mBAAmBG;AAC/D;AAEO,MAAMG;IAGT,YAAmBC,QAAmB,CAAE;QACpC,IAAI,CAAC,QAAQ,GAAGA;IACpB;IAEO,KACHC,OAAoB,EACpBC,MAAU,EACkB;QAC5B,IAAI,AAAmB,YAAnB,OAAOD,WAAwB,CAACC,QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACtB,QAAQD;QACZ;QAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAI;YACzB,SAASA;YACTC;QACJ;IACJ;IAEO,SACHC,KAAQ,EACRR,OAAsC,EACT;QAC7B,MAAMS,OAAOV,eAAeC;QAC5B,IAAI,CAACS,QAAQA,OAAO,GAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC1B,OAAOD;QACX;QAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC1B,OAAOA;YACPC;QACJ;IACJ;IAEO,MAAMC,KAAsC,EAA8B;QAC7E,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YACvB,OAAO,IAAI,CAAC,QAAQ,CAACA;QACzB;IACJ;IAEO,UAAwC;QAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;IAChC;IAEQ,SAASA,KAAsC,EAA0B;QAC7E,IAAIA,iBAAiBC;aAEd,IAAI,AAAiB,YAAjB,OAAOD,OACd,OAAOE,mBAAmB,IAAID,MAAMD;QAExC,OAAOE,mBAAmBF;IAC9B;AACJ"}
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=Response.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=ResponseAbortedResult.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=ResponseBaseResult.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=ResponseContinueResult.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=ResponseDoneResult.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=ResponseErrorResult.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=TaskResponse.js.map
@@ -5,5 +5,3 @@ export * from "./ResponseErrorResult.js";
5
5
  export * from "./ResponseAbortedResult.js";
6
6
  export * from "./ResponseBaseResult.js";
7
7
  export * from "./TaskResponse.js";
8
-
9
- //# sourceMappingURL=index.js.map
package/response/index.js CHANGED
@@ -5,5 +5,3 @@ export * from "./ResponseDoneResult.js";
5
5
  export * from "./ResponseAbortedResult.js";
6
6
  export * from "./ResponseErrorResult.js";
7
7
  export * from "./TaskResponse.js";
8
-
9
- //# sourceMappingURL=index.js.map