@nestia/core 3.17.0 → 4.0.0-dev.20241010

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 (87) hide show
  1. package/README.md +0 -1
  2. package/lib/options/INestiaTransformProject.d.ts +2 -2
  3. package/lib/programmers/PlainBodyProgrammer.d.ts +6 -2
  4. package/lib/programmers/PlainBodyProgrammer.js +31 -13
  5. package/lib/programmers/PlainBodyProgrammer.js.map +1 -1
  6. package/lib/programmers/TypedBodyProgrammer.d.ts +6 -2
  7. package/lib/programmers/TypedBodyProgrammer.js +32 -13
  8. package/lib/programmers/TypedBodyProgrammer.js.map +1 -1
  9. package/lib/programmers/TypedFormDataBodyProgrammer.d.ts +6 -2
  10. package/lib/programmers/TypedFormDataBodyProgrammer.js +30 -17
  11. package/lib/programmers/TypedFormDataBodyProgrammer.js.map +1 -1
  12. package/lib/programmers/TypedHeadersProgrammer.d.ts +6 -2
  13. package/lib/programmers/TypedHeadersProgrammer.js +12 -7
  14. package/lib/programmers/TypedHeadersProgrammer.js.map +1 -1
  15. package/lib/programmers/TypedParamProgrammer.d.ts +7 -2
  16. package/lib/programmers/TypedParamProgrammer.js +12 -7
  17. package/lib/programmers/TypedParamProgrammer.js.map +1 -1
  18. package/lib/programmers/TypedQueryBodyProgrammer.d.ts +6 -2
  19. package/lib/programmers/TypedQueryBodyProgrammer.js +12 -7
  20. package/lib/programmers/TypedQueryBodyProgrammer.js.map +1 -1
  21. package/lib/programmers/TypedQueryProgrammer.d.ts +6 -2
  22. package/lib/programmers/TypedQueryProgrammer.js +13 -7
  23. package/lib/programmers/TypedQueryProgrammer.js.map +1 -1
  24. package/lib/programmers/TypedQueryRouteProgrammer.d.ts +6 -2
  25. package/lib/programmers/TypedQueryRouteProgrammer.js +10 -6
  26. package/lib/programmers/TypedQueryRouteProgrammer.js.map +1 -1
  27. package/lib/programmers/TypedRouteProgrammer.d.ts +6 -2
  28. package/lib/programmers/TypedRouteProgrammer.js +14 -9
  29. package/lib/programmers/TypedRouteProgrammer.js.map +1 -1
  30. package/lib/programmers/http/HttpAssertQuerifyProgrammer.d.ts +6 -2
  31. package/lib/programmers/http/HttpAssertQuerifyProgrammer.js +22 -3
  32. package/lib/programmers/http/HttpAssertQuerifyProgrammer.js.map +1 -1
  33. package/lib/programmers/http/HttpIsQuerifyProgrammer.d.ts +6 -2
  34. package/lib/programmers/http/HttpIsQuerifyProgrammer.js +21 -3
  35. package/lib/programmers/http/HttpIsQuerifyProgrammer.js.map +1 -1
  36. package/lib/programmers/http/HttpQuerifyProgrammer.d.ts +6 -2
  37. package/lib/programmers/http/HttpQuerifyProgrammer.js +27 -15
  38. package/lib/programmers/http/HttpQuerifyProgrammer.js.map +1 -1
  39. package/lib/programmers/http/HttpValidateQuerifyProgrammer.d.ts +6 -2
  40. package/lib/programmers/http/HttpValidateQuerifyProgrammer.js +25 -4
  41. package/lib/programmers/http/HttpValidateQuerifyProgrammer.js.map +1 -1
  42. package/lib/transform.d.ts +2 -2
  43. package/lib/transform.js.map +1 -1
  44. package/lib/transformers/FileTransformer.d.ts +2 -2
  45. package/lib/transformers/FileTransformer.js +24 -10
  46. package/lib/transformers/FileTransformer.js.map +1 -1
  47. package/lib/transformers/MethodTransformer.d.ts +5 -2
  48. package/lib/transformers/MethodTransformer.js +21 -14
  49. package/lib/transformers/MethodTransformer.js.map +1 -1
  50. package/lib/transformers/NodeTransformer.d.ts +5 -2
  51. package/lib/transformers/NodeTransformer.js +11 -5
  52. package/lib/transformers/NodeTransformer.js.map +1 -1
  53. package/lib/transformers/ParameterDecoratorTransformer.d.ts +6 -2
  54. package/lib/transformers/ParameterDecoratorTransformer.js +49 -40
  55. package/lib/transformers/ParameterDecoratorTransformer.js.map +1 -1
  56. package/lib/transformers/ParameterTransformer.d.ts +5 -2
  57. package/lib/transformers/ParameterTransformer.js +17 -9
  58. package/lib/transformers/ParameterTransformer.js.map +1 -1
  59. package/lib/transformers/TypedRouteTransformer.d.ts +6 -2
  60. package/lib/transformers/TypedRouteTransformer.js +20 -16
  61. package/lib/transformers/TypedRouteTransformer.js.map +1 -1
  62. package/lib/transformers/WebSocketRouteTransformer.d.ts +6 -2
  63. package/lib/transformers/WebSocketRouteTransformer.js +11 -11
  64. package/lib/transformers/WebSocketRouteTransformer.js.map +1 -1
  65. package/package.json +5 -5
  66. package/src/options/INestiaTransformProject.ts +3 -2
  67. package/src/programmers/PlainBodyProgrammer.ts +32 -13
  68. package/src/programmers/TypedBodyProgrammer.ts +106 -82
  69. package/src/programmers/TypedFormDataBodyProgrammer.ts +87 -77
  70. package/src/programmers/TypedHeadersProgrammer.ts +48 -41
  71. package/src/programmers/TypedParamProgrammer.ts +21 -15
  72. package/src/programmers/TypedQueryBodyProgrammer.ts +48 -41
  73. package/src/programmers/TypedQueryProgrammer.ts +50 -45
  74. package/src/programmers/TypedQueryRouteProgrammer.ts +44 -39
  75. package/src/programmers/TypedRouteProgrammer.ts +63 -61
  76. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +54 -40
  77. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +54 -41
  78. package/src/programmers/http/HttpQuerifyProgrammer.ts +60 -48
  79. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +54 -41
  80. package/src/transform.ts +2 -2
  81. package/src/transformers/FileTransformer.ts +68 -46
  82. package/src/transformers/MethodTransformer.ts +56 -51
  83. package/src/transformers/NodeTransformer.ts +16 -9
  84. package/src/transformers/ParameterDecoratorTransformer.ts +100 -91
  85. package/src/transformers/ParameterTransformer.ts +47 -38
  86. package/src/transformers/TypedRouteTransformer.ts +58 -55
  87. package/src/transformers/WebSocketRouteTransformer.ts +81 -78
@@ -11,38 +11,43 @@ const JsonStringifyProgrammer_1 = require("typia/lib/programmers/json/JsonString
11
11
  const JsonValidateStringifyProgrammer_1 = require("typia/lib/programmers/json/JsonValidateStringifyProgrammer");
12
12
  var TypedRouteProgrammer;
13
13
  (function (TypedRouteProgrammer) {
14
- TypedRouteProgrammer.generate = (project) => (modulo) => (type) => {
14
+ TypedRouteProgrammer.generate = (props) => {
15
15
  // GENERATE STRINGIFY PLAN
16
- const parameter = (props) => typescript_1.default.factory.createObjectLiteralExpression([
17
- typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("type"), typescript_1.default.factory.createStringLiteral(props.type)),
18
- typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier(props.key), props.programmer(Object.assign(Object.assign({}, project), { options: {} }))(modulo)(type)),
16
+ const parameter = (next) => typescript_1.default.factory.createObjectLiteralExpression([
17
+ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("type"), typescript_1.default.factory.createStringLiteral(next.type)),
18
+ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier(next.key), next.programmer({
19
+ context: Object.assign(Object.assign({}, props.context), { options: {} }),
20
+ modulo: props.modulo,
21
+ type: props.type,
22
+ name: undefined,
23
+ })),
19
24
  ]);
20
25
  // RETURNS
21
- if (project.options.stringify === "is")
26
+ if (props.context.options.stringify === "is")
22
27
  return parameter({
23
28
  type: "is",
24
29
  key: "is",
25
30
  programmer: JsonIsStringifyProgrammer_1.JsonIsStringifyProgrammer.write,
26
31
  });
27
- else if (project.options.stringify === "validate")
32
+ else if (props.context.options.stringify === "validate")
28
33
  return parameter({
29
34
  type: "validate",
30
35
  key: "validate",
31
36
  programmer: JsonValidateStringifyProgrammer_1.JsonValidateStringifyProgrammer.write,
32
37
  });
33
- else if (project.options.stringify === "stringify")
38
+ else if (props.context.options.stringify === "stringify")
34
39
  return parameter({
35
40
  type: "stringify",
36
41
  key: "stringify",
37
42
  programmer: JsonStringifyProgrammer_1.JsonStringifyProgrammer.write,
38
43
  });
39
- else if (project.options.stringify === "validate.log")
44
+ else if (props.context.options.stringify === "validate.log")
40
45
  return parameter({
41
46
  type: "validate.log",
42
47
  key: "validate",
43
48
  programmer: JsonValidateStringifyProgrammer_1.JsonValidateStringifyProgrammer.write,
44
49
  });
45
- else if (project.options.stringify === null)
50
+ else if (props.context.options.stringify === null)
46
51
  return typescript_1.default.factory.createNull();
47
52
  // ASSERT IS DEFAULT
48
53
  return parameter({
@@ -1 +1 @@
1
- {"version":3,"file":"TypedRouteProgrammer.js","sourceRoot":"","sources":["../../src/programmers/TypedRouteProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,4GAAyG;AACzG,oGAAiG;AACjG,gGAA6F;AAC7F,gHAA6G;AAK7G,IAAiB,oBAAoB,CAgEpC;AAhED,WAAiB,oBAAoB;IACtB,6BAAQ,GACnB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,MAAiC,EAAE,EAAE,CACtC,CAAC,IAAa,EAAiB,EAAE;QAC/B,0BAA0B;QAC1B,MAAM,SAAS,GAAG,CAAC,KAQlB,EAAE,EAAE,CACH,oBAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC;YACvC,oBAAE,CAAC,OAAO,CAAC,wBAAwB,CACjC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,EACnC,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAC3C;YACD,oBAAE,CAAC,OAAO,CAAC,wBAAwB,CACjC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EACtC,KAAK,CAAC,UAAU,iCACX,OAAO,KACV,OAAO,EAAE,EAAE,IACX,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CACjB;SACF,CAAC,CAAC;QAEL,UAAU;QACV,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI;YACpC,OAAO,SAAS,CAAC;gBACf,IAAI,EAAE,IAAI;gBACV,GAAG,EAAE,IAAI;gBACT,UAAU,EAAE,qDAAyB,CAAC,KAAK;aAC5C,CAAC,CAAC;aACA,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,UAAU;YAC/C,OAAO,SAAS,CAAC;gBACf,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,UAAU;gBACf,UAAU,EAAE,iEAA+B,CAAC,KAAK;aAClD,CAAC,CAAC;aACA,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,WAAW;YAChD,OAAO,SAAS,CAAC;gBACf,IAAI,EAAE,WAAW;gBACjB,GAAG,EAAE,WAAW;gBAChB,UAAU,EAAE,iDAAuB,CAAC,KAAK;aAC1C,CAAC,CAAC;aACA,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,cAAc;YACnD,OAAO,SAAS,CAAC;gBACf,IAAI,EAAE,cAAc;gBACpB,GAAG,EAAE,UAAU;gBACf,UAAU,EAAE,iEAA+B,CAAC,KAAK;aAClD,CAAC,CAAC;aACA,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI;YACzC,OAAO,oBAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAEjC,oBAAoB;QACpB,OAAO,SAAS,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,QAAQ;YACb,UAAU,EAAE,6DAA6B,CAAC,KAAK;SAChD,CAAC,CAAC;IACL,CAAC,CAAC;AACN,CAAC,EAhEgB,oBAAoB,oCAApB,oBAAoB,QAgEpC"}
1
+ {"version":3,"file":"TypedRouteProgrammer.js","sourceRoot":"","sources":["../../src/programmers/TypedRouteProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,4GAAyG;AACzG,oGAAiG;AACjG,gGAA6F;AAC7F,gHAA6G;AAK7G,IAAiB,oBAAoB,CAkEpC;AAlED,WAAiB,oBAAoB;IACtB,6BAAQ,GAAG,CAAC,KAIxB,EAAiB,EAAE;QAClB,0BAA0B;QAC1B,MAAM,SAAS,GAAG,CAAC,IAIlB,EAAE,EAAE,CACH,oBAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC;YACvC,oBAAE,CAAC,OAAO,CAAC,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AAE,iEAA+B,CAAC,KAAK;aAClD,CAAC,CAAC;aACA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI;YAC/C,OAAO,oBAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAEjC,oBAAoB;QACpB,OAAO,SAAS,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,QAAQ;YACb,UAAU,EAAE,6DAA6B,CAAC,KAAK;SAChD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,EAlEgB,oBAAoB,oCAApB,oBAAoB,QAkEpC"}
@@ -1,5 +1,9 @@
1
1
  import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
2
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
3
3
  export declare namespace HttpAssertQuerifyProgrammer {
4
- const write: (project: IProject) => (modulo: ts.LeftHandSideExpression) => (type: ts.Type, name?: string) => ts.ArrowFunction;
4
+ const write: (props: {
5
+ context: ITypiaContext;
6
+ modulo: ts.LeftHandSideExpression;
7
+ type: ts.Type;
8
+ }) => ts.ArrowFunction;
5
9
  }
@@ -11,9 +11,28 @@ const AssertProgrammer_1 = require("typia/lib/programmers/AssertProgrammer");
11
11
  const HttpQuerifyProgrammer_1 = require("./HttpQuerifyProgrammer");
12
12
  var HttpAssertQuerifyProgrammer;
13
13
  (function (HttpAssertQuerifyProgrammer) {
14
- HttpAssertQuerifyProgrammer.write = (project) => (modulo) => (type, name) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
- StatementFactory_1.StatementFactory.constant("assert", AssertProgrammer_1.AssertProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: false }) }))(modulo)(false)(type, name)),
16
- StatementFactory_1.StatementFactory.constant("stringify", HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: false }) }))(modulo)(type)),
14
+ HttpAssertQuerifyProgrammer.write = (props) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
+ StatementFactory_1.StatementFactory.constant({
16
+ name: "assert",
17
+ value: AssertProgrammer_1.AssertProgrammer.write({
18
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: false }) }),
19
+ modulo: props.modulo,
20
+ config: {
21
+ equals: false,
22
+ guard: false,
23
+ },
24
+ type: props.type,
25
+ name: undefined,
26
+ }),
27
+ }),
28
+ StatementFactory_1.StatementFactory.constant({
29
+ name: "stringify",
30
+ value: HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write({
31
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: false }) }),
32
+ modulo: props.modulo,
33
+ type: props.type,
34
+ }),
35
+ }),
17
36
  typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("stringify"), undefined, [
18
37
  typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("assert"), undefined, [typescript_1.default.factory.createIdentifier("input")]),
19
38
  ])),
@@ -1 +1 @@
1
- {"version":3,"file":"HttpAssertQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpAssertQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,6EAA0E;AAG1E,mEAAgE;AAEhE,IAAiB,2BAA2B,CAiD3C;AAjDD,WAAiB,2BAA2B;IAC7B,iCAAK,GAChB,CAAC,OAAiB,EAAE,EAAE,CACtB,CAAC,MAAiC,EAAE,EAAE,CACtC,CAAC,IAAa,EAAE,IAAa,EAAoB,EAAE,CACjD,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAC5B,SAAS,EACT,SAAS,EACT,CAAC,qCAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EACtC,SAAS,EACT,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,WAAW,CAAC;QACrB,mCAAgB,CAAC,QAAQ,CACvB,QAAQ,EACR,mCAAgB,CAAC,KAAK,iCACjB,OAAO,KACV,OAAO,kCACF,OAAO,CAAC,OAAO,KAClB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,OAEhB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAC9B;QACD,mCAAgB,CAAC,QAAQ,CACvB,WAAW,EACX,6CAAqB,CAAC,KAAK,iCACtB,OAAO,KACV,OAAO,kCACF,OAAO,CAAC,OAAO,KAClB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,OAEhB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CACjB;QACD,oBAAE,CAAC,OAAO,CAAC,qBAAqB,CAC9B,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,EACxC,SAAS,EACT;YACE,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACrC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACvC;SACF,CACF,CACF;KACF,CAAC,CACH,CAAC;AACR,CAAC,EAjDgB,2BAA2B,2CAA3B,2BAA2B,QAiD3C"}
1
+ {"version":3,"file":"HttpAssertQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpAssertQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,6E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,EACT;YACE,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACrC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACvC;SACF,CACF,CACF;KACF,CAAC,CACH,CAAC;AACN,CAAC,EA/DgB,2BAA2B,2CAA3B,2BAA2B,QA+D3C"}
@@ -1,5 +1,9 @@
1
1
  import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
2
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
3
3
  export declare namespace HttpIsQuerifyProgrammer {
4
- const write: (project: IProject) => (modulo: ts.LeftHandSideExpression) => (type: ts.Type) => ts.ArrowFunction;
4
+ const write: (props: {
5
+ context: ITypiaContext;
6
+ modulo: ts.LeftHandSideExpression;
7
+ type: ts.Type;
8
+ }) => ts.ArrowFunction;
5
9
  }
@@ -11,9 +11,27 @@ const IsProgrammer_1 = require("typia/lib/programmers/IsProgrammer");
11
11
  const HttpQuerifyProgrammer_1 = require("./HttpQuerifyProgrammer");
12
12
  var HttpIsQuerifyProgrammer;
13
13
  (function (HttpIsQuerifyProgrammer) {
14
- HttpIsQuerifyProgrammer.write = (project) => (modulo) => (type) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
- StatementFactory_1.StatementFactory.constant("is", IsProgrammer_1.IsProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: false }) }))(modulo)(false)(type)),
16
- StatementFactory_1.StatementFactory.constant("stringify", HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: false }) }))(modulo)(type)),
14
+ HttpIsQuerifyProgrammer.write = (props) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
+ StatementFactory_1.StatementFactory.constant({
16
+ name: "is",
17
+ value: IsProgrammer_1.IsProgrammer.write({
18
+ config: {
19
+ equals: false,
20
+ },
21
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: false }) }),
22
+ modulo: props.modulo,
23
+ type: props.type,
24
+ name: undefined,
25
+ }),
26
+ }),
27
+ StatementFactory_1.StatementFactory.constant({
28
+ name: "stringify",
29
+ value: HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write({
30
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: false }) }),
31
+ modulo: props.modulo,
32
+ type: props.type,
33
+ }),
34
+ }),
17
35
  typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("is"), undefined, [typescript_1.default.factory.createIdentifier("input")]), undefined, typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("stringify"), undefined, [typescript_1.default.factory.createIdentifier("input")]), undefined, typescript_1.default.factory.createNull())),
18
36
  ]));
19
37
  })(HttpIsQuerifyProgrammer || (exports.HttpIsQuerifyProgrammer = HttpIsQuerifyProgrammer = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"HttpIsQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpIsQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,qEAAkE;AAGlE,mEAAgE;AAEhE,IAAiB,uBAAuB,CAqDvC;AArDD,WAAiB,uBAAuB;IACzB,6BAAK,GAChB,CAAC,OAAiB,EAAE,EAAE,CACtB,CAAC,MAAiC,EAAE,EAAE,CACtC,CAAC,IAAa,EAAoB,EAAE,CAClC,oBA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sQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpIsQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,qEAAkE;AAGlE,mEAAgE;AAEhE,IAAiB,uBAAuB,CAkEvC;AAlED,WAAiB,uBAAuB;IACzB,6BAAK,GAAG,CAAC,KAIrB,EAAoB,EAAE,CACrB,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAC5B,SAAS,EACT,SAAS,EACT,CAAC,qCAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EACtC,SAAS,EACT,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,WAAW,CAAC;QACrB,mCAAgB,CAAC,QAAQ,CAAC;YACxB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,2BAAY,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE;oBACN,MAAM,EAAE,KAAK;iBACd;gBACD,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,OAAO,kCACF,KAAK,CAAC,OAAO,CAAC,OAAO,KACxB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,MAEjB;gBACD,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,SAAS;aAChB,CAAC;SACH,CAAC;QACF,mCAAgB,CAAC,QAAQ,CAAC;YACxB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,6CAAqB,CAAC,KAAK,CAAC;gBACjC,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,OAAO,kCACF,KAAK,CAAC,OAAO,CAAC,OAAO,KACxB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,MAEjB;gBACD,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC;SACH,CAAC;QACF,oBAAE,CAAC,OAAO,CAAC,qBAAqB,CAC9B,oBAAE,CAAC,OAAO,CAAC,2BAA2B,CACpC,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EACjC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACvC,EACD,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,EACxC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACvC,EACD,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CACxB,CACF;KACF,CAAC,CACH,CAAC;AACN,CAAC,EAlEgB,uBAAuB,uCAAvB,uBAAuB,QAkEvC"}
@@ -1,5 +1,9 @@
1
1
  import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
2
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
3
3
  export declare namespace HttpQuerifyProgrammer {
4
- const write: (project: IProject) => (modulo: ts.LeftHandSideExpression) => (type: ts.Type) => ts.ArrowFunction;
4
+ const write: (props: {
5
+ context: ITypiaContext;
6
+ modulo: ts.LeftHandSideExpression;
7
+ type: ts.Type;
8
+ }) => ts.ArrowFunction;
5
9
  }
@@ -9,36 +9,48 @@ const IdentifierFactory_1 = require("typia/lib/factories/IdentifierFactory");
9
9
  const MetadataCollection_1 = require("typia/lib/factories/MetadataCollection");
10
10
  const MetadataFactory_1 = require("typia/lib/factories/MetadataFactory");
11
11
  const StatementFactory_1 = require("typia/lib/factories/StatementFactory");
12
- const FunctionImporeter_1 = require("typia/lib/programmers/helpers/FunctionImporeter");
12
+ const FunctionProgrammer_1 = require("typia/lib/programmers/helpers/FunctionProgrammer");
13
13
  const HttpQueryProgrammer_1 = require("typia/lib/programmers/http/HttpQueryProgrammer");
14
14
  const TransformerError_1 = require("typia/lib/transformers/TransformerError");
15
15
  var HttpQuerifyProgrammer;
16
16
  (function (HttpQuerifyProgrammer) {
17
- HttpQuerifyProgrammer.write = (project) => (modulo) => (type) => {
17
+ HttpQuerifyProgrammer.write = (props) => {
18
18
  // GET OBJECT TYPE
19
- const importer = new FunctionImporeter_1.FunctionImporter(modulo.getText());
19
+ const functor = new FunctionProgrammer_1.FunctionProgrammer(props.modulo.getText());
20
20
  const collection = new MetadataCollection_1.MetadataCollection();
21
- const result = MetadataFactory_1.MetadataFactory.analyze(project.checker)({
22
- escape: false,
23
- constant: true,
24
- absorb: true,
25
- validate: HttpQueryProgrammer_1.HttpQueryProgrammer.validate,
26
- })(collection)(type);
21
+ const result = MetadataFactory_1.MetadataFactory.analyze({
22
+ checker: props.context.checker,
23
+ transformer: props.context.transformer,
24
+ options: {
25
+ escape: false,
26
+ constant: true,
27
+ absorb: true,
28
+ validate: HttpQueryProgrammer_1.HttpQueryProgrammer.validate,
29
+ },
30
+ type: props.type,
31
+ collection,
32
+ });
27
33
  if (result.success === false)
28
- throw TransformerError_1.TransformerError.from(`nestia.core.TypedQuery.${importer.method}`)(result.errors);
34
+ throw TransformerError_1.TransformerError.from({
35
+ code: `nestia.core.TypedQuery.${functor.method}`,
36
+ errors: result.errors,
37
+ });
29
38
  const object = result.data.objects[0];
30
39
  return typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
31
- ...importer.declare(modulo),
32
- StatementFactory_1.StatementFactory.constant("output", typescript_1.default.factory.createNewExpression(typescript_1.default.factory.createIdentifier("URLSearchParams"), undefined, [])),
40
+ ...functor.declare(),
41
+ StatementFactory_1.StatementFactory.constant({
42
+ name: "output",
43
+ value: typescript_1.default.factory.createNewExpression(typescript_1.default.factory.createIdentifier("URLSearchParams"), undefined, []),
44
+ }),
33
45
  ...object.properties.map((p) => typescript_1.default.factory.createExpressionStatement(decode(p.key.constants[0].values[0].value)(p.value))),
34
46
  typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createIdentifier("output")),
35
47
  ], true));
36
48
  };
37
49
  const decode = (key) => (value) => !!value.arrays.length
38
- ? typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("input"))(key))("forEach"), undefined, [
50
+ ? typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("input"), key), "forEach"), undefined, [
39
51
  typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, append(key)(typescript_1.default.factory.createIdentifier("elem"))),
40
52
  ])
41
- : append(key)(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("input"))(key));
42
- const append = (key) => (elem) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("output"))("append"), undefined, [typescript_1.default.factory.createStringLiteral(key), elem]);
53
+ : append(key)(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("input"), key));
54
+ const append = (key) => (elem) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("output"), "append"), undefined, [typescript_1.default.factory.createStringLiteral(key), elem]);
43
55
  })(HttpQuerifyProgrammer || (exports.HttpQuerifyProgrammer = HttpQuerifyProgrammer = {}));
44
56
  //# sourceMappingURL=HttpQuerifyProgrammer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,+EAA4E;AAC5E,yEAAsE;AACtE,2EAAwE;AACxE,u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C,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,qCAAiB,CAAC,MAAM,CACtB,qCAAiB,CAAC,MAAM,CACtB,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EACpC,GAAG,CACJ,EACD,SAAS,CACV,EACD,SAAS,EACT;YACE,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAC5B,SAAS,EACT,SAAS,EACT,CAAC,qCAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACrC,SAAS,EACT,SAAS,EACT,MAAM,CAAC,GAAG,CAAC,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CACjD;SACF,CACF;QACH,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACT,qCAAiB,CAAC,MAAM,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CACpE,CAAC;IAEV,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,IAAmB,EAAE,EAAE,CACtD,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,qCAAiB,CAAC,MAAM,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,EACzE,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAC5C,CAAC;AACN,CAAC,EA/FgB,qBAAqB,qCAArB,qBAAqB,QA+FrC"}
@@ -1,5 +1,9 @@
1
1
  import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
2
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
3
3
  export declare namespace HttpValidateQuerifyProgrammer {
4
- const write: (project: IProject) => (modulo: ts.LeftHandSideExpression) => (type: ts.Type, name?: string) => ts.ArrowFunction;
4
+ const write: (props: {
5
+ context: ITypiaContext;
6
+ modulo: ts.LeftHandSideExpression;
7
+ type: ts.Type;
8
+ }) => ts.ArrowFunction;
5
9
  }
@@ -11,10 +11,31 @@ const ValidateProgrammer_1 = require("typia/lib/programmers/ValidateProgrammer")
11
11
  const HttpQuerifyProgrammer_1 = require("./HttpQuerifyProgrammer");
12
12
  var HttpValidateQuerifyProgrammer;
13
13
  (function (HttpValidateQuerifyProgrammer) {
14
- HttpValidateQuerifyProgrammer.write = (project) => (modulo) => (type, name) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
- StatementFactory_1.StatementFactory.constant("validate", ValidateProgrammer_1.ValidateProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: true }) }))(modulo)(false)(type, name)),
16
- StatementFactory_1.StatementFactory.constant("query", HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write(Object.assign(Object.assign({}, project), { options: Object.assign(Object.assign({}, project.options), { functional: false, numeric: false }) }))(modulo)(type)),
17
- StatementFactory_1.StatementFactory.constant("output", typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("query"), undefined, [typescript_1.default.factory.createIdentifier("input")])),
14
+ HttpValidateQuerifyProgrammer.write = (props) => typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("input")], undefined, undefined, typescript_1.default.factory.createBlock([
15
+ StatementFactory_1.StatementFactory.constant({
16
+ name: "validate",
17
+ value: ValidateProgrammer_1.ValidateProgrammer.write({
18
+ config: {
19
+ equals: false,
20
+ },
21
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: true }) }),
22
+ modulo: props.modulo,
23
+ type: props.type,
24
+ name: undefined,
25
+ }),
26
+ }),
27
+ StatementFactory_1.StatementFactory.constant({
28
+ name: "query",
29
+ value: HttpQuerifyProgrammer_1.HttpQuerifyProgrammer.write({
30
+ context: Object.assign(Object.assign({}, props.context), { options: Object.assign(Object.assign({}, props.context.options), { functional: false, numeric: false }) }),
31
+ modulo: props.modulo,
32
+ type: props.type,
33
+ }),
34
+ }),
35
+ StatementFactory_1.StatementFactory.constant({
36
+ name: "output",
37
+ value: typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("query"), undefined, [typescript_1.default.factory.createIdentifier("input")]),
38
+ }),
18
39
  typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createAsExpression(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("validate"), undefined, [typescript_1.default.factory.createIdentifier("output")]), typescript_1.default.factory.createTypeReferenceNode("any"))),
19
40
  ]));
20
41
  })(HttpValidateQuerifyProgrammer || (exports.HttpValidateQuerifyProgrammer = HttpValidateQuerifyProgrammer = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"HttpValidateQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpValidateQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,iFAA8E;AAG9E,mEAAgE;AAEhE,IAAiB,6BAA6B,CAsD7C;AAtDD,WAAiB,6BAA6B;IAC/B,mCAAK,GAChB,CAAC,OAAiB,EAAE,EAAE,CACtB,CAAC,MAAiC,EAAE,EAAE,CACtC,CAAC,IAAa,EAAE,IAAa,EAAoB,EAAE,CACjD,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAC5B,SAAS,EACT,SAAS,EACT,CAAC,qCAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EACtC,SAAS,EACT,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,WAAW,CAAC;QACrB,mCAAgB,CAAC,QAAQ,CACvB,UAAU,EACV,uCAAkB,CAAC,KAAK,iCACnB,OAAO,KACV,OAAO,kCACF,OAAO,CAAC,OAAO,KAClB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,IAAI,OAEf,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAC9B;QACD,mCAAgB,CAAC,QAAQ,CACvB,OAAO,EACP,6CAAqB,CAAC,KAAK,iCACtB,OAAO,KACV,OAAO,kCACF,OAAO,CAAC,OAAO,KAClB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,KAAK,OAEhB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CACjB;QACD,mCAAgB,CAAC,QAAQ,CACvB,QAAQ,EACR,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EACpC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACvC,CACF;QACD,oBAAE,CAAC,OAAO,CAAC,qBAAqB,CAC9B,oBAAE,CAAC,OAAO,CAAC,kBAAkB,CAC3B,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,EACvC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CACxC,EACD,oBAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAC1C,CACF;KACF,CAAC,CACH,CAAC;AACR,CAAC,EAtDgB,6BAA6B,6CAA7B,6BAA6B,QAsD7C"}
1
+ {"version":3,"file":"HttpValidateQuerifyProgrammer.js","sourceRoot":"","sources":["../../../src/programmers/http/HttpValidateQuerifyProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAC1E,2EAAwE;AACxE,iFAA8E;AAG9E,mEAAgE;AAEhE,IAAiB,6BAA6B,CAmE7C;AAnED,WAAiB,6BAA6B;IAC/B,mCAAK,GAAG,CAAC,KAIrB,EAAo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AAC,qBAAqB,CAC9B,oBAAE,CAAC,OAAO,CAAC,kBAAkB,CAC3B,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,EACvC,SAAS,EACT,CAAC,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CACxC,EACD,oBAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAC1C,CACF;KACF,CAAC,CACH,CAAC;AACN,CAAC,EAnEgB,6BAA6B,6CAA7B,6BAA6B,QAmE7C"}
@@ -1,5 +1,5 @@
1
1
  import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
2
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
3
3
  import { INestiaTransformOptions } from "./options/INestiaTransformOptions";
4
- export declare const transform: (program: ts.Program, options: INestiaTransformOptions | undefined, extras: IProject["extras"]) => ts.TransformerFactory<ts.SourceFile>;
4
+ export declare const transform: (program: ts.Program, options: INestiaTransformOptions | undefined, extras: ITypiaContext["extras"]) => ts.TransformerFactory<ts.SourceFile>;
5
5
  export default transform;
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAI5B,oEAAiE;AAE1D,MAAM,SAAS,GAAG,CACvB,OAAmB,EACnB,OAA4C,EAC5C,MAA0B,EACY,EAAE;IACxC,MAAM,eAAe,GAAuB,OAAO,CAAC,kBAAkB,EAAE,CAAC;IACzE,MAAM,MAAM,GACV,eAAe,CAAC,gBAAgB,KAAK,SAAS;QAC5C,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,gBAAgB;QACpC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC;IAC/B,IAAI,MAAM,KAAK,KAAK;QAClB,MAAM,CAAC,aAAa,CAAC;YACnB,QAAQ,EAAE,oBAAE,CAAC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OAAO,EAAE,oBAAE,CAAC,aAAa,EAAE;QAC3B,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;QACtB,MAAM;KACP,CAAC,CAAC;AACL,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB;AACF,kBAAe,iBAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import ts from "typescript";
2
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
2
+ import { INestiaTransformContext } from "../options/INestiaTransformProject";
3
3
  export declare namespace FileTransformer {
4
- const transform: (project: Omit<INestiaTransformProject, "context">) => (context: ts.TransformationContext) => (file: ts.SourceFile) => ts.SourceFile;
4
+ const transform: (context: Omit<INestiaTransformContext, "importer" | "transformer">) => (transformer: ts.TransformationContext) => (file: ts.SourceFile) => ts.SourceFile;
5
5
  }
@@ -5,36 +5,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FileTransformer = void 0;
7
7
  const typescript_1 = __importDefault(require("typescript"));
8
+ const ImportProgrammer_1 = require("typia/lib/programmers/ImportProgrammer");
8
9
  const NodeTransformer_1 = require("./NodeTransformer");
9
10
  var FileTransformer;
10
11
  (function (FileTransformer) {
11
- FileTransformer.transform = (project) => (context) => (file) => file.isDeclarationFile
12
- ? file
13
- : typescript_1.default.visitEachChild(file, (node) => iterate_node(Object.assign(Object.assign({}, project), { context }))(context)(file)(node), context);
14
- const iterate_node = (project) => (context) => (file) => (node) => {
12
+ FileTransformer.transform = (context) => (transformer) => (file) => {
13
+ if (file.isDeclarationFile)
14
+ return file;
15
+ const importer = new ImportProgrammer_1.ImportProgrammer();
16
+ file = typescript_1.default.visitEachChild(file, (node) => iterate_node({
17
+ context: Object.assign(Object.assign({}, context), { transformer,
18
+ importer }),
19
+ file,
20
+ node,
21
+ }), transformer);
22
+ return typescript_1.default.factory.updateSourceFile(file, [...importer.toStatements(), ...file.statements], false, file.referencedFiles, file.typeReferenceDirectives, file.hasNoDefaultLib, file.libReferenceDirectives);
23
+ };
24
+ const iterate_node = (props) => {
15
25
  var _a;
16
- return typescript_1.default.visitEachChild((_a = try_transform_node(project)(file)(node)) !== null && _a !== void 0 ? _a : node, (child) => iterate_node(project)(context)(file)(child), context);
26
+ return typescript_1.default.visitEachChild((_a = try_transform_node(props)) !== null && _a !== void 0 ? _a : props.node, (child) => iterate_node({
27
+ context: props.context,
28
+ file: props.file,
29
+ node: child,
30
+ }), props.context.transformer);
17
31
  };
18
- const try_transform_node = (project) => (file) => (node) => {
32
+ const try_transform_node = (props) => {
19
33
  var _a;
20
34
  var _b;
21
35
  try {
22
- return NodeTransformer_1.NodeTransformer.transform(project)(node);
36
+ return NodeTransformer_1.NodeTransformer.transform(props);
23
37
  }
24
38
  catch (exp) {
25
39
  // ONLY ACCEPT TRANSFORMER-ERROR
26
40
  if (!isTransformerError(exp))
27
41
  throw exp;
28
42
  // AVOID SPECIAL BUG OF TYPESCRIPT COMPILER API
29
- (_a = (_b = node).parent) !== null && _a !== void 0 ? _a : (_b.parent = file);
43
+ (_a = (_b = props.node).parent) !== null && _a !== void 0 ? _a : (_b.parent = props.file);
30
44
  // REPORT DIAGNOSTIC
31
- const diagnostic = typescript_1.default.createDiagnosticForNode(node, {
45
+ const diagnostic = typescript_1.default.createDiagnosticForNode(props.node, {
32
46
  key: exp.code,
33
47
  category: typescript_1.default.DiagnosticCategory.Error,
34
48
  message: exp.message,
35
49
  code: `(${exp.code})`,
36
50
  });
37
- project.extras.addDiagnostic(diagnostic);
51
+ props.context.extras.addDiagnostic(diagnostic);
38
52
  return null;
39
53
  }
40
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FileTransformer.js","sourceRoot":"","sources":["../../src/transformers/FileTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAI5B,uDAAoD;AAEpD,IAAiB,eAAe,CAoD/B;AApDD,WAAiB,eAAe;IACjB,yBAAS,GACpB,CAAC,OAAiD,EAAE,E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AC,CAAC;YACH,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,EAzEgB,eAAe,+BAAf,eAAe,QAyE/B;AAED,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA6B,EAAE,CACnE,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,kBAAkB;IAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import ts from "typescript";
2
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
2
+ import { INestiaTransformContext } from "../options/INestiaTransformProject";
3
3
  export declare namespace MethodTransformer {
4
- const transform: (project: INestiaTransformProject) => (method: ts.MethodDeclaration) => ts.MethodDeclaration;
4
+ const transform: (props: {
5
+ context: INestiaTransformContext;
6
+ method: ts.MethodDeclaration;
7
+ }) => ts.MethodDeclaration;
5
8
  }
@@ -9,27 +9,34 @@ const TypedRouteTransformer_1 = require("./TypedRouteTransformer");
9
9
  const WebSocketRouteTransformer_1 = require("./WebSocketRouteTransformer");
10
10
  var MethodTransformer;
11
11
  (function (MethodTransformer) {
12
- MethodTransformer.transform = (project) => (method) => {
12
+ MethodTransformer.transform = (props) => {
13
13
  const decorators = typescript_1.default.getDecorators
14
- ? typescript_1.default.getDecorators(method)
15
- : method.decorators;
14
+ ? typescript_1.default.getDecorators(props.method)
15
+ : props.method.decorators;
16
16
  if (!(decorators === null || decorators === void 0 ? void 0 : decorators.length))
17
- return method;
18
- const signature = project.checker.getSignatureFromDeclaration(method);
19
- const original = signature && project.checker.getReturnTypeOfSignature(signature);
20
- const escaped = original && get_escaped_type(project.checker)(original);
21
- if (escaped === undefined)
22
- return method;
17
+ return props.method;
18
+ const signature = props.context.checker.getSignatureFromDeclaration(props.method);
19
+ const original = signature && props.context.checker.getReturnTypeOfSignature(signature);
20
+ const type = original && get_escaped_type(props.context.checker)(original);
21
+ if (type === undefined)
22
+ return props.method;
23
23
  const operator = (decorator) => {
24
- decorator =
25
- TypedRouteTransformer_1.TypedRouteTransformer.transform(project)(escaped)(decorator);
26
- decorator = WebSocketRouteTransformer_1.WebSocketRouteTransformer.validate(project)(decorator, method);
24
+ decorator = TypedRouteTransformer_1.TypedRouteTransformer.transform({
25
+ context: props.context,
26
+ decorator,
27
+ type,
28
+ });
29
+ decorator = WebSocketRouteTransformer_1.WebSocketRouteTransformer.validate({
30
+ context: props.context,
31
+ method: props.method,
32
+ decorator,
33
+ });
27
34
  return decorator;
28
35
  };
29
36
  if (typescript_1.default.getDecorators !== undefined)
30
- return typescript_1.default.factory.updateMethodDeclaration(method, (method.modifiers || []).map((mod) => typescript_1.default.isDecorator(mod) ? operator(mod) : mod), method.asteriskToken, method.name, method.questionToken, method.typeParameters, method.parameters, method.type, method.body);
37
+ return typescript_1.default.factory.updateMethodDeclaration(props.method, (props.method.modifiers || []).map((mod) => typescript_1.default.isDecorator(mod) ? operator(mod) : mod), props.method.asteriskToken, props.method.name, props.method.questionToken, props.method.typeParameters, props.method.parameters, props.method.type, props.method.body);
31
38
  // eslint-disable-next-line
32
- return typescript_1.default.factory.updateMethodDeclaration(method, decorators.map(operator), method.modifiers, method.asteriskToken, method.name, method.questionToken, method.typeParameters, method.parameters, method.type, method.body);
39
+ return typescript_1.default.factory.updateMethodDeclaration(props.method, decorators.map(operator), props.method.modifiers, props.method.asteriskToken, props.method.name, props.method.questionToken, props.method.typeParameters, props.method.parameters, props.method.type, props.method.body);
33
40
  };
34
41
  })(MethodTransformer || (exports.MethodTransformer = MethodTransformer = {}));
35
42
  const get_escaped_type = (checker) => (type) => {
@@ -1 +1 @@
1
- {"version":3,"file":"MethodTransformer.js","sourceRoot":"","sources":["../../src/transformers/MethodTransformer.ts"],"names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,CAAC,eAAe,EAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAC/C,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,CAC9B,CAAC;AAEJ,MAAM,YAAY,GAChB,CAAC,IAAa,EAAE,EAAE,CAClB,CAAC,IAAY,EAAU,EAAE,CACvB,oBAAE,CAAC,aAAa,CAAC,IAAI,CAAC;IACpB,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAC9B,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CACnD;IACH,CAAC,CAAC,IAAI,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import ts from "typescript";
2
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
2
+ import { INestiaTransformContext } from "../options/INestiaTransformProject";
3
3
  export declare namespace NodeTransformer {
4
- const transform: (project: INestiaTransformProject) => (node: ts.Node) => ts.Node;
4
+ const transform: (props: {
5
+ context: INestiaTransformContext;
6
+ node: ts.Node;
7
+ }) => ts.Node;
5
8
  }
@@ -9,10 +9,16 @@ const MethodTransformer_1 = require("./MethodTransformer");
9
9
  const ParameterTransformer_1 = require("./ParameterTransformer");
10
10
  var NodeTransformer;
11
11
  (function (NodeTransformer) {
12
- NodeTransformer.transform = (project) => (node) => typescript_1.default.isMethodDeclaration(node)
13
- ? MethodTransformer_1.MethodTransformer.transform(project)(node)
14
- : typescript_1.default.isParameter(node)
15
- ? ParameterTransformer_1.ParameterTransformer.transform(project)(node)
16
- : node;
12
+ NodeTransformer.transform = (props) => typescript_1.default.isMethodDeclaration(props.node)
13
+ ? MethodTransformer_1.MethodTransformer.transform({
14
+ context: props.context,
15
+ method: props.node,
16
+ })
17
+ : typescript_1.default.isParameter(props.node)
18
+ ? ParameterTransformer_1.ParameterTransformer.transform({
19
+ context: props.context,
20
+ param: props.node,
21
+ })
22
+ : props.node;
17
23
  })(NodeTransformer || (exports.NodeTransformer = NodeTransformer = {}));
18
24
  //# sourceMappingURL=NodeTransformer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTransformer.js","sourceRoot":"","sources":["../../src/transformers/NodeTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAG5B,2DAAwD;AACxD,iEAA8D;AAE9D,IAAiB,eAAe,CAS/B;AATD,WAAiB,eAAe;IACjB,yBAAS,GACpB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,IAAa,EAAW,EAAE,CACzB,oBAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC;QAC1B,CAAC,CAAC,qCAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QAC5C,CAAC,CAAC,oBAAE,CAAC,WAAW,CAAC,IAAI,CAAC;YACpB,CAAC,CAAC,2CAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC;AACjB,CAAC,EATgB,eAAe,+BAAf,eAAe,QAS/B"}
1
+ {"version":3,"file":"NodeTransformer.js","sourceRoot":"","sources":["../../src/transformers/NodeTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAG5B,2DAAwD;AACxD,iEAA8D;AAE9D,IAAiB,eAAe,CAgB/B;AAhBD,WAAiB,eAAe;IACjB,yBAAS,GAAG,CAAC,KAGzB,EAAW,EAAE,CACZ,oBAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC;QAChC,CAAC,CAAC,qCAAiB,CAAC,SAAS,CAAC;YAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM,EAAE,KAAK,CAAC,IAAI;SACnB,CAAC;QACJ,CAAC,CAAC,oBAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1B,CAAC,CAAC,2CAAoB,CAAC,SAAS,CAAC;gBAC7B,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,KAAK,EAAE,KAAK,CAAC,IAAI;aAClB,CAAC;YACJ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AACrB,CAAC,EAhBgB,eAAe,+BAAf,eAAe,QAgB/B"}
@@ -1,5 +1,9 @@
1
1
  import ts from "typescript";
2
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
2
+ import { INestiaTransformContext } from "../options/INestiaTransformProject";
3
3
  export declare namespace ParameterDecoratorTransformer {
4
- const transform: (project: INestiaTransformProject) => (type: ts.Type) => (decorator: ts.Decorator) => ts.Decorator;
4
+ const transform: (props: {
5
+ context: INestiaTransformContext;
6
+ type: ts.Type;
7
+ decorator: ts.Decorator;
8
+ }) => ts.Decorator;
5
9
  }