@hadss/turbo-trans-json-plugin 1.0.0-rc.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.
- package/LICENSE +177 -0
- package/README.md +253 -0
- package/dist/core/Types.d.ts +196 -0
- package/dist/core/Types.js +47 -0
- package/dist/core/analyzers/ClassAnalyzer.d.ts +23 -0
- package/dist/core/analyzers/ClassAnalyzer.js +480 -0
- package/dist/core/analyzers/CustomTypeAnalyzer.d.ts +21 -0
- package/dist/core/analyzers/CustomTypeAnalyzer.js +243 -0
- package/dist/core/analyzers/SendableMergeChecker.d.ts +9 -0
- package/dist/core/analyzers/SendableMergeChecker.js +100 -0
- package/dist/core/analyzers/SendableMergeabilityRegistry.d.ts +7 -0
- package/dist/core/analyzers/SendableMergeabilityRegistry.js +23 -0
- package/dist/core/constants/DecoratorConstants.d.ts +7 -0
- package/dist/core/constants/DecoratorConstants.js +13 -0
- package/dist/core/constants/PathConstants.d.ts +6 -0
- package/dist/core/constants/PathConstants.js +10 -0
- package/dist/core/constants/StringConstants.d.ts +83 -0
- package/dist/core/constants/StringConstants.js +87 -0
- package/dist/core/constants/index.d.ts +3 -0
- package/dist/core/constants/index.js +19 -0
- package/dist/core/handlers/BaseTypeHandler.d.ts +23 -0
- package/dist/core/handlers/BaseTypeHandler.js +57 -0
- package/dist/core/handlers/CustomClassHandler.d.ts +21 -0
- package/dist/core/handlers/CustomClassHandler.js +191 -0
- package/dist/core/handlers/DateHandler.d.ts +2 -0
- package/dist/core/handlers/DateHandler.js +60 -0
- package/dist/core/handlers/DecimalHandler.d.ts +2 -0
- package/dist/core/handlers/DecimalHandler.js +60 -0
- package/dist/core/handlers/EnumHandler.d.ts +2 -0
- package/dist/core/handlers/EnumHandler.js +89 -0
- package/dist/core/handlers/GenericContainerHandler.d.ts +2 -0
- package/dist/core/handlers/GenericContainerHandler.js +440 -0
- package/dist/core/handlers/GenericHandler.d.ts +18 -0
- package/dist/core/handlers/GenericHandler.js +92 -0
- package/dist/core/handlers/HandlerBootstrap.d.ts +2 -0
- package/dist/core/handlers/HandlerBootstrap.js +28 -0
- package/dist/core/handlers/ITypeHandler.d.ts +23 -0
- package/dist/core/handlers/ITypeHandler.js +8 -0
- package/dist/core/handlers/PrimitiveHandler.d.ts +2 -0
- package/dist/core/handlers/PrimitiveHandler.js +127 -0
- package/dist/core/handlers/TupleHandler.d.ts +2 -0
- package/dist/core/handlers/TupleHandler.js +98 -0
- package/dist/core/handlers/TypeHandlerRegistry.d.ts +20 -0
- package/dist/core/handlers/TypeHandlerRegistry.js +113 -0
- package/dist/core/handlers/UnionTypeHandler.d.ts +2 -0
- package/dist/core/handlers/UnionTypeHandler.js +263 -0
- package/dist/core/handlers/index.d.ts +2 -0
- package/dist/core/handlers/index.js +5 -0
- package/dist/core/import-rewrite/services/BuildProfileUpdater.d.ts +8 -0
- package/dist/core/import-rewrite/services/BuildProfileUpdater.js +92 -0
- package/dist/core/import-rewrite/services/ImportRewriteService.d.ts +9 -0
- package/dist/core/import-rewrite/services/ImportRewriteService.js +61 -0
- package/dist/core/import-rewrite/services/ImportTransformService.d.ts +15 -0
- package/dist/core/import-rewrite/services/ImportTransformService.js +109 -0
- package/dist/core/import-rewrite/strategies/ImportScanStrategy.d.ts +17 -0
- package/dist/core/import-rewrite/strategies/ImportScanStrategy.js +137 -0
- package/dist/core/import-rewrite/types/ImportRewriteTypes.d.ts +17 -0
- package/dist/core/import-rewrite/types/ImportRewriteTypes.js +2 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.js +27 -0
- package/dist/core/interfaces/ITask.d.ts +7 -0
- package/dist/core/interfaces/ITask.js +2 -0
- package/dist/core/interfaces/ITaskContext.d.ts +11 -0
- package/dist/core/interfaces/ITaskContext.js +2 -0
- package/dist/core/interfaces/index.d.ts +2 -0
- package/dist/core/interfaces/index.js +2 -0
- package/dist/core/logger/Logger.d.ts +13 -0
- package/dist/core/logger/Logger.js +78 -0
- package/dist/core/services/CodeAnalysisService.d.ts +7 -0
- package/dist/core/services/CodeAnalysisService.js +43 -0
- package/dist/core/services/CodeGenerationEngine.d.ts +12 -0
- package/dist/core/services/CodeGenerationEngine.js +102 -0
- package/dist/core/services/CodeGenerationService/CodeGenerationService.d.ts +13 -0
- package/dist/core/services/CodeGenerationService/CodeGenerationService.js +110 -0
- package/dist/core/services/CodeGenerationService/generators/MergedSendableClassGenerator.d.ts +13 -0
- package/dist/core/services/CodeGenerationService/generators/MergedSendableClassGenerator.js +119 -0
- package/dist/core/services/CodeGenerationService/generators/OriginalClassGenerator.d.ts +21 -0
- package/dist/core/services/CodeGenerationService/generators/OriginalClassGenerator.js +224 -0
- package/dist/core/services/CodeGenerationService/generators/SendableClassGenerator.d.ts +24 -0
- package/dist/core/services/CodeGenerationService/generators/SendableClassGenerator.js +307 -0
- package/dist/core/services/CodeGenerationService/generators/SerializerGenerator.d.ts +28 -0
- package/dist/core/services/CodeGenerationService/generators/SerializerGenerator.js +259 -0
- package/dist/core/services/CodeGenerationService/generators/TempSerializerGenerator.d.ts +19 -0
- package/dist/core/services/CodeGenerationService/generators/TempSerializerGenerator.js +178 -0
- package/dist/core/services/CodeGenerationService/index.d.ts +1 -0
- package/dist/core/services/CodeGenerationService/index.js +5 -0
- package/dist/core/services/CodeGenerationService/shared/ImportManager.d.ts +27 -0
- package/dist/core/services/CodeGenerationService/shared/ImportManager.js +127 -0
- package/dist/core/template/HandlebarsTemplateEngine.d.ts +26 -0
- package/dist/core/template/HandlebarsTemplateEngine.js +226 -0
- package/dist/core/utils/ConfigManager.d.ts +10 -0
- package/dist/core/utils/ConfigManager.js +32 -0
- package/dist/core/utils/CustomError.d.ts +30 -0
- package/dist/core/utils/CustomError.js +37 -0
- package/dist/core/utils/DeepCopyUtil.d.ts +15 -0
- package/dist/core/utils/DeepCopyUtil.js +138 -0
- package/dist/core/utils/GenericTypeSubstitutionUtil.d.ts +9 -0
- package/dist/core/utils/GenericTypeSubstitutionUtil.js +68 -0
- package/dist/core/utils/SerializationPathUtil.d.ts +18 -0
- package/dist/core/utils/SerializationPathUtil.js +107 -0
- package/dist/core/utils/TsMorphUtil.d.ts +8 -0
- package/dist/core/utils/TsMorphUtil.js +34 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +57 -0
- package/dist/json-plugin/JSONExecuteController.d.ts +13 -0
- package/dist/json-plugin/JSONExecuteController.js +103 -0
- package/dist/json-plugin/constants/TaskConstants.d.ts +7 -0
- package/dist/json-plugin/constants/TaskConstants.js +11 -0
- package/dist/json-plugin/interfaces/IModuleContext.d.ts +10 -0
- package/dist/json-plugin/interfaces/IModuleContext.js +2 -0
- package/dist/json-plugin/interfaces/ITargetContext.d.ts +8 -0
- package/dist/json-plugin/interfaces/ITargetContext.js +2 -0
- package/dist/json-plugin/interfaces/impl/ModuleContext.d.ts +12 -0
- package/dist/json-plugin/interfaces/impl/ModuleContext.js +24 -0
- package/dist/json-plugin/interfaces/impl/TargetContext.d.ts +23 -0
- package/dist/json-plugin/interfaces/impl/TargetContext.js +113 -0
- package/dist/json-plugin/tasks/BaseTask.d.ts +14 -0
- package/dist/json-plugin/tasks/BaseTask.js +53 -0
- package/dist/json-plugin/tasks/CleanTask.d.ts +8 -0
- package/dist/json-plugin/tasks/CleanTask.js +25 -0
- package/dist/json-plugin/tasks/CodeProcessingTask.d.ts +8 -0
- package/dist/json-plugin/tasks/CodeProcessingTask.js +26 -0
- package/dist/json-plugin/tasks/SyncTask.d.ts +8 -0
- package/dist/json-plugin/tasks/SyncTask.js +21 -0
- package/dist/json-plugin/tasks/WatchTask.d.ts +11 -0
- package/dist/json-plugin/tasks/WatchTask.js +102 -0
- package/package.json +46 -0
- package/src/core/Types.ts +356 -0
- package/src/core/analyzers/ClassAnalyzer.ts +824 -0
- package/src/core/analyzers/CustomTypeAnalyzer.ts +337 -0
- package/src/core/analyzers/SendableMergeChecker.ts +195 -0
- package/src/core/analyzers/SendableMergeabilityRegistry.ts +72 -0
- package/src/core/constants/DecoratorConstants.ts +27 -0
- package/src/core/constants/PathConstants.ts +31 -0
- package/src/core/constants/StringConstants.ts +152 -0
- package/src/core/constants/index.ts +21 -0
- package/src/core/handlers/BaseTypeHandler.ts +121 -0
- package/src/core/handlers/CustomClassHandler.ts +278 -0
- package/src/core/handlers/DateHandler.ts +75 -0
- package/src/core/handlers/DecimalHandler.ts +75 -0
- package/src/core/handlers/EnumHandler.ts +142 -0
- package/src/core/handlers/GenericContainerHandler.ts +621 -0
- package/src/core/handlers/GenericHandler.ts +130 -0
- package/src/core/handlers/HandlerBootstrap.ts +64 -0
- package/src/core/handlers/ITypeHandler.ts +133 -0
- package/src/core/handlers/PrimitiveHandler.ts +159 -0
- package/src/core/handlers/TupleHandler.ts +145 -0
- package/src/core/handlers/TypeHandlerRegistry.ts +236 -0
- package/src/core/handlers/UnionTypeHandler.ts +400 -0
- package/src/core/handlers/index.ts +18 -0
- package/src/core/import-rewrite/services/BuildProfileUpdater.ts +145 -0
- package/src/core/import-rewrite/services/ImportRewriteService.ts +129 -0
- package/src/core/import-rewrite/services/ImportTransformService.ts +200 -0
- package/src/core/import-rewrite/strategies/ImportScanStrategy.ts +303 -0
- package/src/core/import-rewrite/types/ImportRewriteTypes.ts +100 -0
- package/src/core/index.ts +31 -0
- package/src/core/interfaces/ITask.ts +23 -0
- package/src/core/interfaces/ITaskContext.ts +94 -0
- package/src/core/interfaces/index.ts +17 -0
- package/src/core/logger/Logger.ts +149 -0
- package/src/core/services/CodeAnalysisService.ts +67 -0
- package/src/core/services/CodeGenerationEngine.ts +181 -0
- package/src/core/services/CodeGenerationService/CodeGenerationService.ts +159 -0
- package/src/core/services/CodeGenerationService/generators/MergedSendableClassGenerator.ts +189 -0
- package/src/core/services/CodeGenerationService/generators/OriginalClassGenerator.ts +314 -0
- package/src/core/services/CodeGenerationService/generators/SendableClassGenerator.ts +421 -0
- package/src/core/services/CodeGenerationService/generators/SerializerGenerator.ts +392 -0
- package/src/core/services/CodeGenerationService/generators/TempSerializerGenerator.ts +277 -0
- package/src/core/services/CodeGenerationService/index.ts +16 -0
- package/src/core/services/CodeGenerationService/shared/ImportManager.ts +191 -0
- package/src/core/template/HandlebarsTemplateEngine.ts +282 -0
- package/src/core/utils/ConfigManager.ts +49 -0
- package/src/core/utils/CustomError.ts +51 -0
- package/src/core/utils/DeepCopyUtil.ts +185 -0
- package/src/core/utils/GenericTypeSubstitutionUtil.ts +136 -0
- package/src/core/utils/SerializationPathUtil.ts +142 -0
- package/src/core/utils/TsMorphUtil.ts +50 -0
- package/src/index.ts +81 -0
- package/src/json-plugin/JSONExecuteController.ts +134 -0
- package/src/json-plugin/constants/TaskConstants.ts +22 -0
- package/src/json-plugin/interfaces/IModuleContext.ts +27 -0
- package/src/json-plugin/interfaces/ITargetContext.ts +25 -0
- package/src/json-plugin/interfaces/impl/ModuleContext.ts +45 -0
- package/src/json-plugin/interfaces/impl/TargetContext.ts +196 -0
- package/src/json-plugin/tasks/BaseTask.ts +94 -0
- package/src/json-plugin/tasks/CleanTask.ts +36 -0
- package/src/json-plugin/tasks/CodeProcessingTask.ts +41 -0
- package/src/json-plugin/tasks/SyncTask.ts +33 -0
- package/src/json-plugin/tasks/WatchTask.ts +99 -0
- package/template/SerializerPerformanceTemplate.hbs +35 -0
- package/template/SerializerRegisterTemplate.hbs +10 -0
- package/template/SerializerStrictTemplate.hbs +89 -0
- package/template/SerializerTemplate.hbs +176 -0
- package/tsconfig.json +17 -0
- package/tslint.json +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# TurboTransJSON 插件配置指南
|
|
2
|
+
|
|
3
|
+
## 1. 功能简介
|
|
4
|
+
|
|
5
|
+
### 1.1 插件介绍
|
|
6
|
+
|
|
7
|
+
TurboTransJSONPlugin 是一个基于 Hvigor 构建系统的编译时插件,专门为项目提供自动化 JSON 序列化代码生成能力。该插件通过静态分析项目中的 `@Serializable` 装饰器,在编译期自动生成高性能的序列化和反序列化代码,让开发者无需手写繁琐的对象转换逻辑。
|
|
8
|
+
|
|
9
|
+
### 1.2 核心特性
|
|
10
|
+
|
|
11
|
+
- 编译时自动生成序列化和反序列化代码
|
|
12
|
+
- 支持泛型、继承、枚举、联合类型等复杂类型
|
|
13
|
+
- 支持通过装饰器覆盖类和属性名称、将某个属性设为必须验证、忽略某个属性
|
|
14
|
+
- 自动导入重写,生成的代码自动集成到项目中
|
|
15
|
+
|
|
16
|
+
## 2. 插件安装与配置
|
|
17
|
+
|
|
18
|
+
### 2.1 依赖配置
|
|
19
|
+
|
|
20
|
+
修改工程根目录下的 `hvigor/hvigor-config.json` 文件,加入序列化编译插件:
|
|
21
|
+
|
|
22
|
+
```json5
|
|
23
|
+
{
|
|
24
|
+
"modelVersion": "6.0.0",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@hadss/turbo-trans-json-plugin": "^1.0.0",
|
|
27
|
+
// 使用npm仓版本号
|
|
28
|
+
}
|
|
29
|
+
// ...其余配置
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2.2 Hvigor 集成
|
|
34
|
+
|
|
35
|
+
修改工程根目录下的 `hvigorfile.ts`,使用序列化编译插件:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// 工程根目录/hvigorfile.ts
|
|
39
|
+
import { hvigor } from "@ohos/hvigor";
|
|
40
|
+
import { appTasks } from '@ohos/hvigor-ohos-plugin';
|
|
41
|
+
import { turboTransJsonPlugin } from "@hadss/turbo-trans-json-plugin";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
system: appTasks,
|
|
45
|
+
plugins: [
|
|
46
|
+
turboTransJsonPlugin(hvigor, {
|
|
47
|
+
ignoreModuleNames: [/** 不需要扫描的模块名,如: 'SomeLibModule' */],
|
|
48
|
+
scanDir: ['src/main/ets'],
|
|
49
|
+
deserializationMode: 'performance', // 反序列化模式,可选值: 'performance' | 'strict'
|
|
50
|
+
}),
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 3. 配置选项
|
|
56
|
+
|
|
57
|
+
### 3.1 基础配置
|
|
58
|
+
|
|
59
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
60
|
+
|-----------------------|-------------------------|--------------------|:------------------------------------|
|
|
61
|
+
| `deserializationMode` | `performance \| strict` | `performance` | 反序列化模式:performance-性能优先,strict-验证优先 |
|
|
62
|
+
| `ignoreModuleNames` | `string[]` | `[]` | 跳过处理的模块名称列表 |
|
|
63
|
+
| `scanDir` | `string[]` | `['src/main/ets']` | 扫描源码的目录列表 |
|
|
64
|
+
| `importRewrite` | `ImportRewriteOptions` | `空` | 重写源代码中序列化类的导入路径 |
|
|
65
|
+
|
|
66
|
+
### 3.2 ImportRewriteOptions 导入重写配置
|
|
67
|
+
|
|
68
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
69
|
+
|---------------------------|------------|--------------------|:-------------|
|
|
70
|
+
| `scanPaths` | `string[]` | `['src/main/ets']` | 导入重写的扫描路径 |
|
|
71
|
+
| `preserveOriginalImports` | `boolean` | `false` | 保留原始导入语句组为注释 |
|
|
72
|
+
|
|
73
|
+
### 3.3 完整选项配置示例
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
turboTransJsonPlugin(hvigor, {
|
|
77
|
+
ignoreModuleNames: [/** 不需要扫描的模块名,如"SomeModule" */],
|
|
78
|
+
scanDir: ['src/main/ets'],
|
|
79
|
+
deserializationMode: 'performance',
|
|
80
|
+
importRewrite: {
|
|
81
|
+
scanPaths: ['src/main/ets'],
|
|
82
|
+
preserveOriginalImports: false
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 4. 插件命令与使用
|
|
88
|
+
|
|
89
|
+
序列化插件提供专门的任务命令,使用方式如下:
|
|
90
|
+
|
|
91
|
+
```shell
|
|
92
|
+
hvigorw [taskNames...]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 可用命令
|
|
96
|
+
|
|
97
|
+
| 任务 | 说明 |
|
|
98
|
+
|-------------|-------------------------------------------------------------------------------------------------------------|
|
|
99
|
+
| `jsonSync` | 同步模块配置并生成序列化器。该任务会扫描项目中使用 `@Serializable` 注解的模块,自动修改这些模块的 `build-profile.json5` 文件以添加必要的编译配置,然后生成对应的序列化器代码。 |
|
|
100
|
+
| `jsonClean` | 清空生成的序列化器代码 |
|
|
101
|
+
| `jsonWatch` | 监听 `@Serializable` 装饰器文件修改,自动重新执行同步和生成 |
|
|
102
|
+
|
|
103
|
+
### 使用示例
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# 同步模块配置,生成序列化器
|
|
107
|
+
hvigorw jsonSync
|
|
108
|
+
|
|
109
|
+
# 清空生成的序列化器
|
|
110
|
+
hvigorw jsonClean
|
|
111
|
+
|
|
112
|
+
# 监听文件变化自动重新生成
|
|
113
|
+
hvigorw jsonWatch
|
|
114
|
+
|
|
115
|
+
# 构建项目(自动生成序列化器)
|
|
116
|
+
hvigorw assembleHap
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
> **关于 `jsonSync` 任务的配置修改行为:**
|
|
120
|
+
>
|
|
121
|
+
> `jsonSync` 任务会自动修改使用了 `@Serializable` 注解的模块的 `build-profile.json5` 文件,添加序列化插件所需的编译配置。这样做的好处:配置写入文件后,IDE可以在静态编码阶段识别生成的序列化器代码,提供更好的代码提示和类型检查
|
|
122
|
+
>
|
|
123
|
+
> **使用建议:** 在项目中引入插件后,建议手动执行一次 `hvigorw jsonSync`,确保所有模块配置正确同步。之后在正常的构建流程(如 `assembleHap`)中,插件会自动处理序列化器的生成。
|
|
124
|
+
|
|
125
|
+
## 5. 完整使用示例
|
|
126
|
+
|
|
127
|
+
### 5.1 项目结构
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
├─/src/main/ets
|
|
131
|
+
├── model/
|
|
132
|
+
│ ├── User.ets
|
|
133
|
+
│ ├── Product.ets
|
|
134
|
+
│ └── Order.ets
|
|
135
|
+
├── pages/
|
|
136
|
+
│ └── MainPages.ets
|
|
137
|
+
└── ...
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 5.2 模型定义(User.ets)
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { Serializable, SerialName, Required, Transient } from '@hadss/turbo-trans-core';
|
|
144
|
+
|
|
145
|
+
export enum UserRole {
|
|
146
|
+
Admin = 'admin',
|
|
147
|
+
User = 'user',
|
|
148
|
+
Guest = 'guest'
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@Serializable({ generateSendable: true })
|
|
152
|
+
export class User {
|
|
153
|
+
@Required()
|
|
154
|
+
@SerialName({ name: 'user_id' })
|
|
155
|
+
id: string = '';
|
|
156
|
+
|
|
157
|
+
@Required()
|
|
158
|
+
name: string = '';
|
|
159
|
+
|
|
160
|
+
email: string = '';
|
|
161
|
+
age: number = 0;
|
|
162
|
+
role: UserRole = UserRole.Guest;
|
|
163
|
+
|
|
164
|
+
@Transient()
|
|
165
|
+
password: string = '';
|
|
166
|
+
|
|
167
|
+
createdAt: Date = new Date();
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 5.3 hvigorfile.ts 配置
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
|
175
|
+
import { turboTransJsonPlugin } from "@hadss/turbo-trans-json-plugin";
|
|
176
|
+
|
|
177
|
+
export default {
|
|
178
|
+
system: hapTasks,
|
|
179
|
+
plugins: [
|
|
180
|
+
turboTransJsonPlugin(hvigor, {
|
|
181
|
+
ignoreModuleNames: ['TurboTransCore', 'TurboTransJSON'],
|
|
182
|
+
scanDir: ['src/main/ets'],
|
|
183
|
+
deserializationMode: 'performance',
|
|
184
|
+
importRewrite: {
|
|
185
|
+
scanPaths: ['src/main/ets', 'src/ohosTest/ets'],
|
|
186
|
+
preserveOriginalImports: false
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 5.4 执行同步任务
|
|
194
|
+
|
|
195
|
+
```shell
|
|
196
|
+
hvigorw jsonSync
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 5.5 使用示例(MainPage.ets)
|
|
200
|
+
|
|
201
|
+
```extendtypescript
|
|
202
|
+
import { User, UserRole } from '../model/User';
|
|
203
|
+
import { TJSON } from '@hadss/turbo-trans-json';
|
|
204
|
+
|
|
205
|
+
@Entry
|
|
206
|
+
@Component
|
|
207
|
+
struct MainPage {
|
|
208
|
+
build() {
|
|
209
|
+
Column() {
|
|
210
|
+
Button('测试序列化')
|
|
211
|
+
.onClick(() => {
|
|
212
|
+
const user = new User();
|
|
213
|
+
user.id = '123';
|
|
214
|
+
user.name = 'John Doe';
|
|
215
|
+
user.email = 'john@example.com';
|
|
216
|
+
user.age = 25;
|
|
217
|
+
user.role = UserRole.User;
|
|
218
|
+
|
|
219
|
+
// 序列化为 JSON
|
|
220
|
+
const jsonString = TJSON.toString(user, User);
|
|
221
|
+
|
|
222
|
+
// 反序列化为实体类
|
|
223
|
+
const userInstance = TJSON.fromString<User>(jsonString, User);
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 5.5 构建和验证
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# 构建项目
|
|
234
|
+
hvigorw assembleHap
|
|
235
|
+
|
|
236
|
+
# 检查生成的代码(生成的代码位于各个模块/src/generated目录下)
|
|
237
|
+
# 插件会进行代码生成并重写导入语句(导入语句的路径会被重写为${模块的包名}/ets/开头的路径)
|
|
238
|
+
# 确认编译无错误后表示集成成功
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 6. 更多资料
|
|
242
|
+
|
|
243
|
+
- [API 参考](https://gitcode.com/openharmony-sig/turbo_trans/wiki/API-Reference.md)
|
|
244
|
+
- [TurboTransJSON 主文档](https://gitcode.com/openharmony-sig/turbo_trans/wiki)
|
|
245
|
+
- [TurboTransSample 参考项目](https://gitcode.com/openharmony-sig/turbo_trans/tree/master/TurboTransSample)
|
|
246
|
+
|
|
247
|
+
## 7. 贡献代码
|
|
248
|
+
|
|
249
|
+
使用过程中发现任何问题都可以提 [Issue](https://gitcode.com/openharmony-sig/turbo_trans/issues),当然,也非常欢迎发 [PullRequest](https://gitcode.com/openharmony-sig/turbo_trans/pulls) 共建。
|
|
250
|
+
|
|
251
|
+
## 8. 开源协议
|
|
252
|
+
|
|
253
|
+
本项目基于 [Apache License 2.0](https://gitcode.com/openharmony-sig/turbo_trans/blob/master/LICENSE),请自由地享受和参与开源。
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ClassDeclaration, InterfaceDeclaration, TypeNode } from 'ts-morph';
|
|
2
|
+
export declare enum PropertyKind {
|
|
3
|
+
STRING = "string",
|
|
4
|
+
NUMBER = "number",
|
|
5
|
+
BOOLEAN = "boolean",
|
|
6
|
+
BIGINT = "bigint",
|
|
7
|
+
NULL = "null",
|
|
8
|
+
UNDEFINED = "undefined",
|
|
9
|
+
ARRAY = "array",
|
|
10
|
+
MAP = "map",
|
|
11
|
+
SET = "set",
|
|
12
|
+
RECORD = "record",
|
|
13
|
+
COLLECTIONS_ARRAY = "collections.Array",
|
|
14
|
+
COLLECTIONS_SET = "collections.Set",
|
|
15
|
+
COLLECTIONS_MAP = "collections.Map",
|
|
16
|
+
OBJECT = "object",
|
|
17
|
+
GENERIC = "generic",
|
|
18
|
+
UNION = "union",
|
|
19
|
+
OPTIONAL = "optional",
|
|
20
|
+
NULLABLE = "nullable",
|
|
21
|
+
OPTIONAL_NULLABLE = "optionalNullable",
|
|
22
|
+
ENUM = "enum",
|
|
23
|
+
TUPLE = "tuple",
|
|
24
|
+
ARRAY_LIST = "arrayList",
|
|
25
|
+
HASH_MAP = "hashMap",
|
|
26
|
+
HASH_SET = "hashSet",
|
|
27
|
+
LIST = "list",
|
|
28
|
+
Date = "date",
|
|
29
|
+
Decimal = "decimal",
|
|
30
|
+
INTERFACE = "interface",
|
|
31
|
+
UNKNOWN = "unknown"
|
|
32
|
+
}
|
|
33
|
+
export declare enum DeserializationMode {
|
|
34
|
+
PERFORMANCE = "performance",
|
|
35
|
+
STRICT = "strict"
|
|
36
|
+
}
|
|
37
|
+
export interface ClassAnalysis {
|
|
38
|
+
className: string;
|
|
39
|
+
sourceFilePath: string;
|
|
40
|
+
originalClass?: ClassDeclaration;
|
|
41
|
+
generics: GenericInfo;
|
|
42
|
+
inheritance: InheritanceInfo;
|
|
43
|
+
decorators: ClassDecorators;
|
|
44
|
+
ownProperties: PropertyAnalysis[];
|
|
45
|
+
inheritedProperties: PropertyAnalysis[];
|
|
46
|
+
overriddenProperties: PropertyAnalysis[];
|
|
47
|
+
properties: PropertyAnalysis[];
|
|
48
|
+
constructorParams: ConstructorParam[];
|
|
49
|
+
canMerge?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface InterfaceAnalysis {
|
|
52
|
+
className: string;
|
|
53
|
+
sourceFilePath: string;
|
|
54
|
+
originalInterface: InterfaceDeclaration;
|
|
55
|
+
generics: GenericInfo;
|
|
56
|
+
inheritance: InheritanceInfo;
|
|
57
|
+
decorators?: ClassDecorators;
|
|
58
|
+
ownProperties: PropertyAnalysis[];
|
|
59
|
+
inheritedProperties: PropertyAnalysis[];
|
|
60
|
+
overriddenProperties: PropertyAnalysis[];
|
|
61
|
+
properties: PropertyAnalysis[];
|
|
62
|
+
}
|
|
63
|
+
export interface GenericInfo {
|
|
64
|
+
isGeneric: boolean;
|
|
65
|
+
parameters: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface InheritanceInfo {
|
|
68
|
+
isInherited: boolean;
|
|
69
|
+
baseClassAnalysis?: ClassAnalysis | InterfaceAnalysis;
|
|
70
|
+
genericTypeArguments?: TypeNode[];
|
|
71
|
+
}
|
|
72
|
+
export interface ClassDecorators {
|
|
73
|
+
serializable?: SerializableOptions;
|
|
74
|
+
serialName?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface SerializableOptions {
|
|
77
|
+
generateSendable?: boolean;
|
|
78
|
+
with?: string;
|
|
79
|
+
deserializationMode?: DeserializationMode;
|
|
80
|
+
}
|
|
81
|
+
export interface ConstructorParam {
|
|
82
|
+
name: string;
|
|
83
|
+
type: string;
|
|
84
|
+
isOptional: boolean;
|
|
85
|
+
defaultValue?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface PropertyAnalysis {
|
|
88
|
+
name: string;
|
|
89
|
+
defaultValue?: string;
|
|
90
|
+
decorators?: PropertyDecorators;
|
|
91
|
+
isMust: boolean;
|
|
92
|
+
type: TypeStructure;
|
|
93
|
+
}
|
|
94
|
+
export interface PropertyDecorators {
|
|
95
|
+
serialName?: string;
|
|
96
|
+
isRequired: boolean;
|
|
97
|
+
isTransient: boolean;
|
|
98
|
+
with?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface TypeStructure {
|
|
101
|
+
kind: PropertyKind;
|
|
102
|
+
depth: number;
|
|
103
|
+
sourceText: string;
|
|
104
|
+
args: TypeStructure[];
|
|
105
|
+
dependencies: TypeDependency[];
|
|
106
|
+
enumDetails?: EnumDetails;
|
|
107
|
+
classDetails?: ClassDetails;
|
|
108
|
+
interfaceDetails?: InterfaceDetails;
|
|
109
|
+
unionDetails?: TypeStructure[];
|
|
110
|
+
isOptional?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export declare enum TypeKind {
|
|
113
|
+
CLASS = "class",
|
|
114
|
+
INTERFACE = "interface",
|
|
115
|
+
ENUM = "enum",
|
|
116
|
+
TYPE = "type"
|
|
117
|
+
}
|
|
118
|
+
export interface TypeDependency {
|
|
119
|
+
typeName: string;
|
|
120
|
+
typeKind: TypeKind;
|
|
121
|
+
importPath: string;
|
|
122
|
+
source: DependencySource;
|
|
123
|
+
details?: TypeDetails;
|
|
124
|
+
}
|
|
125
|
+
export interface DependencySource {
|
|
126
|
+
type: 'local' | 'imported' | 'builtin';
|
|
127
|
+
sourceFilePath?: string;
|
|
128
|
+
originalImport?: string;
|
|
129
|
+
packageName?: string;
|
|
130
|
+
}
|
|
131
|
+
export type TypeDetails = EnumDetails | ClassDetails | InterfaceDetails | TypeAliasDetails;
|
|
132
|
+
export interface EnumDetails {
|
|
133
|
+
kind: TypeKind.ENUM;
|
|
134
|
+
members: EnumMemberInfo[];
|
|
135
|
+
valueType: 'string' | 'number';
|
|
136
|
+
}
|
|
137
|
+
export interface EnumMemberInfo {
|
|
138
|
+
name: string;
|
|
139
|
+
value: string | number;
|
|
140
|
+
literalValue: string;
|
|
141
|
+
}
|
|
142
|
+
export interface ClassDetails {
|
|
143
|
+
kind: TypeKind.CLASS;
|
|
144
|
+
classDecl: ClassDeclaration;
|
|
145
|
+
isGeneric: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface InterfaceDetails {
|
|
148
|
+
kind: TypeKind.INTERFACE;
|
|
149
|
+
interfaceDecl: InterfaceDeclaration;
|
|
150
|
+
isGeneric: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface TypeAliasDetails {
|
|
153
|
+
kind: TypeKind.TYPE;
|
|
154
|
+
aliasedType: string;
|
|
155
|
+
resolvedType: TypeStructure;
|
|
156
|
+
}
|
|
157
|
+
export interface GenerationContext {
|
|
158
|
+
class: ClassAnalysis | InterfaceAnalysis;
|
|
159
|
+
properties: PropertyGenerationInfo[];
|
|
160
|
+
serialNameConstant: string;
|
|
161
|
+
}
|
|
162
|
+
export interface PropertyGenerationInfo {
|
|
163
|
+
analysis: PropertyAnalysis;
|
|
164
|
+
serializer: SerializerMetadata;
|
|
165
|
+
}
|
|
166
|
+
export interface SerializerMetadata {
|
|
167
|
+
name: string;
|
|
168
|
+
typeDeclaration: string;
|
|
169
|
+
instantiationTemplate: string;
|
|
170
|
+
encodeMethod: string;
|
|
171
|
+
decodeMethod: string;
|
|
172
|
+
decoderType: string;
|
|
173
|
+
needsTypeAssertion?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface ImportRewriteOptions {
|
|
176
|
+
scanPaths: string[];
|
|
177
|
+
preserveOriginalImports?: boolean;
|
|
178
|
+
}
|
|
179
|
+
export interface TurboTransJsonPluginOptions {
|
|
180
|
+
ignoreModuleNames: string[];
|
|
181
|
+
scanDir: string[];
|
|
182
|
+
deserializationMode: DeserializationMode;
|
|
183
|
+
importRewrite?: ImportRewriteOptions;
|
|
184
|
+
}
|
|
185
|
+
export interface IGenerationResult {
|
|
186
|
+
generatedFiles: IGeneratedFile[];
|
|
187
|
+
skippedFiles: string[];
|
|
188
|
+
}
|
|
189
|
+
export interface IGeneratedFile {
|
|
190
|
+
sourcePath: string;
|
|
191
|
+
outputPath: string;
|
|
192
|
+
contentLength: number;
|
|
193
|
+
serializerCount: number;
|
|
194
|
+
generatedAt: number;
|
|
195
|
+
contentHash?: string;
|
|
196
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeKind = exports.DeserializationMode = exports.PropertyKind = void 0;
|
|
4
|
+
var PropertyKind;
|
|
5
|
+
(function (PropertyKind) {
|
|
6
|
+
PropertyKind["STRING"] = "string";
|
|
7
|
+
PropertyKind["NUMBER"] = "number";
|
|
8
|
+
PropertyKind["BOOLEAN"] = "boolean";
|
|
9
|
+
PropertyKind["BIGINT"] = "bigint";
|
|
10
|
+
PropertyKind["NULL"] = "null";
|
|
11
|
+
PropertyKind["UNDEFINED"] = "undefined";
|
|
12
|
+
PropertyKind["ARRAY"] = "array";
|
|
13
|
+
PropertyKind["MAP"] = "map";
|
|
14
|
+
PropertyKind["SET"] = "set";
|
|
15
|
+
PropertyKind["RECORD"] = "record";
|
|
16
|
+
PropertyKind["COLLECTIONS_ARRAY"] = "collections.Array";
|
|
17
|
+
PropertyKind["COLLECTIONS_SET"] = "collections.Set";
|
|
18
|
+
PropertyKind["COLLECTIONS_MAP"] = "collections.Map";
|
|
19
|
+
PropertyKind["OBJECT"] = "object";
|
|
20
|
+
PropertyKind["GENERIC"] = "generic";
|
|
21
|
+
PropertyKind["UNION"] = "union";
|
|
22
|
+
PropertyKind["OPTIONAL"] = "optional";
|
|
23
|
+
PropertyKind["NULLABLE"] = "nullable";
|
|
24
|
+
PropertyKind["OPTIONAL_NULLABLE"] = "optionalNullable";
|
|
25
|
+
PropertyKind["ENUM"] = "enum";
|
|
26
|
+
PropertyKind["TUPLE"] = "tuple";
|
|
27
|
+
PropertyKind["ARRAY_LIST"] = "arrayList";
|
|
28
|
+
PropertyKind["HASH_MAP"] = "hashMap";
|
|
29
|
+
PropertyKind["HASH_SET"] = "hashSet";
|
|
30
|
+
PropertyKind["LIST"] = "list";
|
|
31
|
+
PropertyKind["Date"] = "date";
|
|
32
|
+
PropertyKind["Decimal"] = "decimal";
|
|
33
|
+
PropertyKind["INTERFACE"] = "interface";
|
|
34
|
+
PropertyKind["UNKNOWN"] = "unknown";
|
|
35
|
+
})(PropertyKind || (exports.PropertyKind = PropertyKind = {}));
|
|
36
|
+
var DeserializationMode;
|
|
37
|
+
(function (DeserializationMode) {
|
|
38
|
+
DeserializationMode["PERFORMANCE"] = "performance";
|
|
39
|
+
DeserializationMode["STRICT"] = "strict";
|
|
40
|
+
})(DeserializationMode || (exports.DeserializationMode = DeserializationMode = {}));
|
|
41
|
+
var TypeKind;
|
|
42
|
+
(function (TypeKind) {
|
|
43
|
+
TypeKind["CLASS"] = "class";
|
|
44
|
+
TypeKind["INTERFACE"] = "interface";
|
|
45
|
+
TypeKind["ENUM"] = "enum";
|
|
46
|
+
TypeKind["TYPE"] = "type";
|
|
47
|
+
})(TypeKind || (exports.TypeKind = TypeKind = {}));
|