@technicity/data-service-generator 0.22.2-next.2 → 0.22.3

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.
@@ -601,6 +601,7 @@ function getMethodSourceOnHandlerPostOne(x) {
601
601
  return `on${(0, capitalizeFirstLetter_1.capitalizeFirstLetter)(x.methodName)}(handler:
602
602
  (sdk: InstanceType<typeof SDK>, input: { data: ${x.typeDataName} },
603
603
  output: Partial<${getTypeReturnName(x.table)}>,
604
+ before: null,
604
605
  context: TContext,
605
606
  ) => Promise<void>
606
607
  ): void {
@@ -715,6 +716,7 @@ function getMethodSourceOnHandlerDeleteOne(x, findOnes) {
715
716
  .map((findOne) => `{ ${findOne.name}: ${findOne.type}${findOne.nullable ? " | null" : ""} }`)
716
717
  .join(" | ")}, },
717
718
  output: void,
719
+ before: ${getTypeReturnName(x.table)} | null,
718
720
  context: TContext,
719
721
  ) => Promise<void>
720
722
  ): void {
@@ -70,7 +70,9 @@ async function resolve(input, dbCall, formatQuery, beginTransaction, dialect, mi
70
70
  const shouldRunOnHandler = typeof onHandler === "function" &&
71
71
  asyncLocalStorage != null &&
72
72
  asyncLocalStorage?.getStore()?.isInOnHandler !== true;
73
- const beforeValue = shouldRunOnHandler && input.passBeforeValueToAfterCallback
73
+ const beforeValue = shouldRunOnHandler &&
74
+ input.passBeforeValueToAfterCallback &&
75
+ input.action !== "create"
74
76
  ? await _resolve({
75
77
  ...paramsChanged,
76
78
  action: paramsChanged.action === "updateMany" ||
@@ -103,7 +105,9 @@ async function resolve(input, dbCall, formatQuery, beginTransaction, dialect, mi
103
105
  const shouldRunOnHandler = typeof onHandler === "function" &&
104
106
  asyncLocalStorage != null &&
105
107
  asyncLocalStorage?.getStore()?.isInOnHandler !== true;
106
- const beforeValue = shouldRunOnHandler && input.passBeforeValueToAfterCallback
108
+ const beforeValue = shouldRunOnHandler &&
109
+ input.passBeforeValueToAfterCallback &&
110
+ input.action !== "create"
107
111
  ? await _resolve({
108
112
  ...input,
109
113
  action: input.action === "updateMany" || input.action === "deleteMany"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technicity/data-service-generator",
3
- "version": "0.22.2-next.2",
3
+ "version": "0.22.3",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -22,7 +22,7 @@
22
22
  "ioredis": "^5.2.4",
23
23
  "join-monster": "git+https://github.com/apalm/join-monster.git#9b244fae1bdba0666d9875f6b9e0dff5f027aa69",
24
24
  "json-schema-to-typescript": "10.1.5",
25
- "lodash": "^4.17.20",
25
+ "lodash": "^4.17.23",
26
26
  "loglevel": "^1.8.1",
27
27
  "mysql2": "^3.10.1",
28
28
  "prettier": "^2.1.2",
@@ -47,6 +47,7 @@
47
47
  "typescript": "5.5.2"
48
48
  },
49
49
  "resolutions": {
50
- "tar-fs": "2.1.3"
50
+ "tar-fs": "2.1.3",
51
+ "lodash": "^4.17.23"
51
52
  }
52
53
  }