@intelligentgraphics/ig.gfx.packager 3.1.4 → 3.2.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 (61) hide show
  1. package/build/bin.js +7 -0
  2. package/build/bin.js.map +1 -0
  3. package/build/build-CMbCj7x-.js +945 -0
  4. package/build/build-CMbCj7x-.js.map +1 -0
  5. package/build/build-kkMVBBJL.js +408 -0
  6. package/build/build-kkMVBBJL.js.map +1 -0
  7. package/build/cli-Co1DhAmx.js +405 -0
  8. package/build/cli-Co1DhAmx.js.map +1 -0
  9. package/build/docs-BkGeoYY2.js +30 -0
  10. package/build/docs-BkGeoYY2.js.map +1 -0
  11. package/build/generateIndex-C_DxQ2R4.js +209 -0
  12. package/build/generateIndex-C_DxQ2R4.js.map +1 -0
  13. package/build/generateParameterType-CdCi5BWM.js +46 -0
  14. package/build/generateParameterType-CdCi5BWM.js.map +1 -0
  15. package/build/package-DHx2bvVO.js +1 -0
  16. package/build/postinstall-DHTlEmNr.js +35 -0
  17. package/build/postinstall-DHTlEmNr.js.map +1 -0
  18. package/build/prompter-DONgUlzS.js +20 -0
  19. package/build/prompter-DONgUlzS.js.map +1 -0
  20. package/build/publish-E5zcQAo0.js +348 -0
  21. package/build/publish-E5zcQAo0.js.map +1 -0
  22. package/build/publishNpm-CBT1819u.js +115 -0
  23. package/build/publishNpm-CBT1819u.js.map +1 -0
  24. package/build/publishedPackage-D-KiU0FG.js +1 -0
  25. package/build/rollup-Csyght27.js +179 -0
  26. package/build/rollup-Csyght27.js.map +1 -0
  27. package/build/scripts-CBblHIL1.js +29 -0
  28. package/build/scripts-CBblHIL1.js.map +1 -0
  29. package/build/versionFile-DViDwgCa.js +123 -0
  30. package/build/versionFile-DViDwgCa.js.map +1 -0
  31. package/build/workspace-D0XY2EMu.js +1 -0
  32. package/lib/lib.js +1595 -0
  33. package/package.json +30 -30
  34. package/readme.md +5 -0
  35. package/build/bin.mjs +0 -5
  36. package/build/bin.mjs.map +0 -1
  37. package/build/cli-CTqQeYIu.mjs +0 -768
  38. package/build/cli-CTqQeYIu.mjs.map +0 -1
  39. package/build/dependencies-CCIr5dgH.mjs +0 -129
  40. package/build/dependencies-CCIr5dgH.mjs.map +0 -1
  41. package/build/docs-DvFV9WXA.mjs +0 -37
  42. package/build/docs-DvFV9WXA.mjs.map +0 -1
  43. package/build/generateIndex-COnAgsMM.mjs +0 -306
  44. package/build/generateIndex-COnAgsMM.mjs.map +0 -1
  45. package/build/generateParameterType-BFVUv72F.mjs +0 -71
  46. package/build/generateParameterType-BFVUv72F.mjs.map +0 -1
  47. package/build/index-Ck4_b8Wk.mjs +0 -1400
  48. package/build/index-Ck4_b8Wk.mjs.map +0 -1
  49. package/build/index-DHSUlJia.mjs +0 -477
  50. package/build/index-DHSUlJia.mjs.map +0 -1
  51. package/build/postinstall-BTuIhY_F.mjs +0 -61
  52. package/build/postinstall-BTuIhY_F.mjs.map +0 -1
  53. package/build/publishNpm-A02qW1UY.mjs +0 -167
  54. package/build/publishNpm-A02qW1UY.mjs.map +0 -1
  55. package/build/rollup-BeQ0dM8U.mjs +0 -221
  56. package/build/rollup-BeQ0dM8U.mjs.map +0 -1
  57. package/build/scripts-B3noxiX3.mjs +0 -45
  58. package/build/scripts-B3noxiX3.mjs.map +0 -1
  59. package/build/versionFile-B9z_qwQL.mjs +0 -206
  60. package/build/versionFile-B9z_qwQL.mjs.map +0 -1
  61. package/lib/lib.mjs +0 -2706
@@ -1,306 +0,0 @@
1
- import ts from 'typescript';
2
- import { resolveNamespaces, findNamespaceByMemberSourceFile, resolveNamespaceFullName } from '@intelligentgraphics/declarationbundler';
3
- import 'path';
4
- import 'fs';
5
- import 'resolve';
6
- import 'write-package';
7
- import { a as readPackageCreatorIndex, r as readPackageCreatorManifest, k as writePackageCreatorIndex } from './cli-CTqQeYIu.mjs';
8
- import { r as readScriptPackageTSConfig, g as getPackageTypescriptFiles, a as resolveScriptPackageEntryModule } from './scripts-B3noxiX3.mjs';
9
- import 'axios';
10
- import 'update-notifier';
11
- import 'yargs/yargs';
12
- import 'url';
13
- import 'glob';
14
- import '@inquirer/prompts';
15
-
16
- /**
17
- * Extracts and returns script array for _Index.json from a src folder
18
- *
19
- * @param folderPath path to a src folder
20
- */ function generateIndex({ location, ignore = [], strictOptional }) {
21
- const arr = [];
22
- const existingIndex = readPackageCreatorIndex(location) ?? [];
23
- const manifest = readPackageCreatorManifest(location);
24
- const compilerOptions = readScriptPackageTSConfig(location).options;
25
- const isModule = compilerOptions.module === ts.ModuleKind.ES2015 || compilerOptions.module === ts.ModuleKind.ESNext;
26
- if (strictOptional === undefined) {
27
- strictOptional = compilerOptions.strict === true || compilerOptions.strictNullChecks === true;
28
- }
29
- const files = getPackageTypescriptFiles(location).filter((path)=>!ignore.some((suffix)=>path.endsWith(suffix)));
30
- let program;
31
- let rootNamespace;
32
- if (isModule) {
33
- const entryFilePath = resolveScriptPackageEntryModule(location, manifest);
34
- if (entryFilePath === undefined) {
35
- throw new Error(`Could not resolve entry module`);
36
- }
37
- const host = ts.createCompilerHost({}, true);
38
- program = ts.createProgram([
39
- entryFilePath
40
- ], {
41
- allowJs: true,
42
- ...compilerOptions
43
- }, host);
44
- const entryFile = program.getSourceFile(entryFilePath);
45
- if (entryFile === undefined) {
46
- throw new Error(`Failed to find entry module`);
47
- }
48
- rootNamespace = resolveNamespaces(entryFile, program, host, program.getTypeChecker(), manifest.Scope ?? manifest.Package);
49
- } else {
50
- program = ts.createProgram(files, {
51
- allowJs: true
52
- });
53
- }
54
- const typeChecker = program.getTypeChecker();
55
- files.forEach((file)=>{
56
- // Create a Program to represent the project, then pull out the
57
- // source file to parse its AST.
58
- const sourceFile = program.getSourceFile(file);
59
- if (sourceFile === undefined) {
60
- return;
61
- }
62
- const namespace = rootNamespace === undefined ? undefined : findNamespaceByMemberSourceFile(rootNamespace, sourceFile);
63
- // Loop through the root AST nodes of the file
64
- for (const scriptingClass of findScriptingClasses(sourceFile)){
65
- if (scriptingClass.node.name === undefined) {
66
- throw new Error(`Expected ${scriptingClass.type} class to have a name`);
67
- }
68
- let name;
69
- if (isModule && namespace !== undefined) {
70
- const moduleNamespace = resolveNamespaceFullName(namespace);
71
- name = `${moduleNamespace}.${scriptingClass.node.name.text}`;
72
- } else {
73
- name = typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(scriptingClass.node.name));
74
- }
75
- const parameterDeclaration = getScriptingClassParameterdeclaration(scriptingClass);
76
- const parametersType = parameterDeclaration === undefined ? undefined : typeChecker.getTypeAtLocation(parameterDeclaration);
77
- if (parametersType === undefined) {
78
- console.log(`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`);
79
- }
80
- const existingIndexEntry = existingIndex.find((entry)=>entry.Name === name);
81
- const obj = {
82
- Name: name,
83
- Description: existingIndexEntry?.Description ?? name,
84
- Type: scriptingClass.type === "evaluator" ? "Evaluator" : "Interactor",
85
- Parameters: []
86
- };
87
- const rawDocTags = ts.getJSDocTags(scriptingClass.node);
88
- const dict = getTagDict(rawDocTags);
89
- if (dict.summary) {
90
- obj.Description = dict.summary;
91
- } else {
92
- const comment = typeChecker.getTypeAtLocation(scriptingClass.node).symbol.getDocumentationComment(typeChecker).map((comment)=>comment.text).join(" ");
93
- if (comment) {
94
- obj.Description = comment;
95
- }
96
- }
97
- if (parametersType !== undefined) {
98
- obj.Parameters = parseParametersList(typeChecker.getPropertiesOfType(parametersType), strictOptional);
99
- if (obj.Parameters.length === 0 && parametersType.getStringIndexType() !== undefined) {
100
- obj.Parameters = existingIndexEntry?.Parameters ?? [];
101
- }
102
- } else if (existingIndexEntry !== undefined) {
103
- obj.Parameters = existingIndexEntry.Parameters;
104
- }
105
- arr.push(obj);
106
- }
107
- });
108
- arr.sort((a, b)=>a.Name.localeCompare(b.Name));
109
- writePackageCreatorIndex(location, arr);
110
- }
111
- function capitalizeFirstLetter(string) {
112
- return string?.charAt(0).toUpperCase() + string?.slice(1);
113
- }
114
- const parseDefault = (value, type)=>{
115
- const uType = capitalizeFirstLetter(type);
116
- if (value === "null") return null;
117
- switch(uType){
118
- case "LengthM":
119
- case "ArcDEG":
120
- case "Float":
121
- return parseFloat(value);
122
- case "Integer":
123
- case "Int":
124
- return parseInt(value);
125
- case "Boolean":
126
- case "Bool":
127
- return value === "true";
128
- case "Material":
129
- case "String":
130
- case "Geometry":
131
- default:
132
- return value.replace(/^"/, "").replace(/"$/, "");
133
- }
134
- };
135
- const parseTypeFromName = (name)=>{
136
- const parts = name.split(".");
137
- const identifier = parts[parts.length - 1];
138
- switch(identifier){
139
- case "LengthM":
140
- case "ArcDEG":
141
- case "Float":
142
- case "Integer":
143
- return identifier;
144
- case "GeometryReference":
145
- return "Geometry";
146
- case "MaterialReference":
147
- return "Material";
148
- case "AnimationReference":
149
- return "Animation";
150
- case "InteractorReference":
151
- return "Interactor";
152
- case "EvaluatorReference":
153
- return "Evaluator";
154
- case "String":
155
- case "string":
156
- return "String";
157
- case "number":
158
- case "Number":
159
- return "Float";
160
- case "boolean":
161
- case "Boolean":
162
- return "Boolean";
163
- }
164
- };
165
- const parseParametersList = (properties, strictOptional)=>{
166
- return properties.map((symbol, i)=>{
167
- const parameter = {
168
- Name: symbol.name,
169
- Description: undefined,
170
- Type: "String",
171
- Default: undefined,
172
- DisplayIndex: i + 1
173
- };
174
- if (parameter.Name.length > 45) {
175
- throw new Error(`Parameter name length >45 '${parameter.Name}'`);
176
- }
177
- let declaration = symbol.getDeclarations()?.[0];
178
- let documentationComment = symbol.getDocumentationComment(undefined);
179
- let checkLinksSymbol = symbol;
180
- while(checkLinksSymbol !== undefined && declaration === undefined){
181
- const links = checkLinksSymbol.links;
182
- if (links?.syntheticOrigin) {
183
- declaration = links.syntheticOrigin.getDeclarations()?.[0];
184
- if (documentationComment.length === 0) {
185
- documentationComment = links.syntheticOrigin.getDocumentationComment(undefined);
186
- }
187
- checkLinksSymbol = links.syntheticOrigin;
188
- }
189
- }
190
- if (declaration !== undefined) {
191
- const rawDocTags = ts.getJSDocTags(declaration);
192
- const dict = getTagDict(rawDocTags);
193
- if (dict.summary) {
194
- parameter.Description = dict.summary;
195
- } else {
196
- const comment = documentationComment.map((comment)=>comment.text).join(" ");
197
- if (comment) {
198
- parameter.Description = comment;
199
- }
200
- }
201
- if (dict.creatorType) {
202
- parameter.Type = dict.creatorType;
203
- } else {
204
- const propertySignature = declaration;
205
- if (propertySignature.type !== undefined) {
206
- const parsedType = parseTypeFromName(propertySignature.type.getText());
207
- if (parsedType !== undefined) {
208
- parameter.Type = parsedType;
209
- }
210
- }
211
- }
212
- if (dict.default) {
213
- parameter.Default = parseDefault(dict.default, parameter.Type);
214
- }
215
- if (strictOptional && declaration.kind === ts.SyntaxKind.PropertySignature) {
216
- const propertySignature = declaration;
217
- if (propertySignature.questionToken === undefined) {
218
- parameter.Required = true;
219
- }
220
- }
221
- }
222
- return parameter;
223
- });
224
- };
225
- function getTagDict(tags) {
226
- const dict = {};
227
- for (const tag of tags){
228
- dict[tag.tagName.text] = tag.comment;
229
- }
230
- return dict;
231
- }
232
- const getScriptingClassParameterdeclaration = (scriptingClass)=>{
233
- for (const member of scriptingClass.node.members){
234
- if (ts.isMethodDeclaration(member)) {
235
- for(let index = 0; index < member.parameters.length; index++){
236
- const parameter = member.parameters[index];
237
- if (isScriptingClassParameterDeclaration(scriptingClass, member, index)) {
238
- return parameter;
239
- }
240
- }
241
- }
242
- if (ts.isConstructorDeclaration(member)) {
243
- for(let index = 0; index < member.parameters.length; index++){
244
- const parameter = member.parameters[index];
245
- if (isScriptingClassParameterDeclaration(scriptingClass, member, index)) {
246
- return parameter;
247
- }
248
- }
249
- }
250
- }
251
- };
252
- const isScriptingClassParameterDeclaration = (scriptingClass, memberNode, parameterIndex)=>{
253
- if (scriptingClass.type === "evaluator") {
254
- return memberNode?.name?.getText() == "Create" && parameterIndex === 2;
255
- }
256
- if (scriptingClass.type === "interactor") {
257
- return memberNode.kind === ts.SyntaxKind.Constructor && parameterIndex === 0;
258
- }
259
- return false;
260
- };
261
- /**
262
- * Finds interactors and evaluators within a script file
263
- *
264
- * @param {ts.Node} node
265
- * @return {*}
266
- */ function* findScriptingClasses(node) {
267
- for (const child of node.getChildren()){
268
- if (!ts.isClassDeclaration(child)) {
269
- yield* findScriptingClasses(child);
270
- continue;
271
- }
272
- const scriptingClass = detectScriptingClass(child);
273
- if (scriptingClass !== undefined) {
274
- yield scriptingClass;
275
- }
276
- }
277
- }
278
- const detectScriptingClass = (node)=>{
279
- const isEvaluator = node.heritageClauses?.some((clause)=>{
280
- if (clause.token !== ts.SyntaxKind.ExtendsKeyword && clause.token !== ts.SyntaxKind.ImplementsKeyword) {
281
- return false;
282
- }
283
- return clause.types.some((type)=>type.getText().includes("Evaluator"));
284
- });
285
- if (isEvaluator) {
286
- return {
287
- node,
288
- type: "evaluator"
289
- };
290
- }
291
- const isInteractor = node.heritageClauses?.some((clause)=>{
292
- if (clause.token !== ts.SyntaxKind.ExtendsKeyword) {
293
- return false;
294
- }
295
- return clause.types.some((type)=>type.getText().includes("Interactor"));
296
- });
297
- if (isInteractor) {
298
- return {
299
- node,
300
- type: "interactor"
301
- };
302
- }
303
- };
304
-
305
- export { generateIndex };
306
- //# sourceMappingURL=generateIndex-COnAgsMM.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateIndex-COnAgsMM.mjs","sources":["../src/commands/generateIndex.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\n\nimport {\n\tresolveNamespaceFullName,\n\tresolveNamespaces,\n\tNamespace,\n\tfindNamespaceByMemberSourceFile,\n} from \"@intelligentgraphics/declarationbundler\";\n\nimport {\n\tPackageLocation,\n\twritePackageCreatorIndex,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"../lib/package\";\nimport {\n\tgetPackageTypescriptFiles,\n\treadScriptPackageTSConfig,\n\tresolveScriptPackageEntryModule,\n} from \"../lib/scripts\";\nimport {\n\tCreatorIndexEntry,\n\tCreatorIndexParameter,\n\tCreatorIndexParameterType,\n} from \"../lib/package\";\n\nexport interface GenerateIndexOptions {\n\tignore?: string[];\n\tlocation: PackageLocation;\n\n\t/**\n\t * Marks non optional parameter object properties as required in the generated index\n\t *\n\t * @type {boolean}\n\t */\n\tstrictOptional?: boolean;\n}\n\n/**\n * Extracts and returns script array for _Index.json from a src folder\n *\n * @param folderPath path to a src folder\n */\nexport function generateIndex({\n\tlocation,\n\tignore = [],\n\tstrictOptional,\n}: GenerateIndexOptions) {\n\tconst arr: CreatorIndexEntry[] = [];\n\n\tconst existingIndex = readPackageCreatorIndex(location) ?? [];\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tconst compilerOptions = readScriptPackageTSConfig(location).options;\n\n\tconst isModule =\n\t\tcompilerOptions.module === ts.ModuleKind.ES2015 ||\n\t\tcompilerOptions.module === ts.ModuleKind.ESNext;\n\n\tif (strictOptional === undefined) {\n\t\tstrictOptional =\n\t\t\tcompilerOptions.strict === true ||\n\t\t\tcompilerOptions.strictNullChecks === true;\n\t}\n\n\tconst files = getPackageTypescriptFiles(location).filter(\n\t\t(path) => !ignore.some((suffix) => path.endsWith(suffix)),\n\t);\n\n\tlet program: ts.Program;\n\tlet rootNamespace: Namespace | undefined;\n\n\tif (isModule) {\n\t\tconst entryFilePath = resolveScriptPackageEntryModule(\n\t\t\tlocation,\n\t\t\tmanifest,\n\t\t);\n\n\t\tif (entryFilePath === undefined) {\n\t\t\tthrow new Error(`Could not resolve entry module`);\n\t\t}\n\n\t\tconst host = ts.createCompilerHost({}, true);\n\t\tprogram = ts.createProgram(\n\t\t\t[entryFilePath],\n\t\t\t{ allowJs: true, ...compilerOptions },\n\t\t\thost,\n\t\t);\n\n\t\tconst entryFile = program.getSourceFile(entryFilePath);\n\n\t\tif (entryFile === undefined) {\n\t\t\tthrow new Error(`Failed to find entry module`);\n\t\t}\n\n\t\trootNamespace = resolveNamespaces(\n\t\t\tentryFile,\n\t\t\tprogram,\n\t\t\thost,\n\t\t\tprogram.getTypeChecker(),\n\t\t\tmanifest.Scope ?? manifest.Package,\n\t\t);\n\t} else {\n\t\tprogram = ts.createProgram(files, { allowJs: true });\n\t}\n\n\tconst typeChecker = program.getTypeChecker();\n\n\tfiles.forEach((file) => {\n\t\t// Create a Program to represent the project, then pull out the\n\t\t// source file to parse its AST.\n\t\tconst sourceFile = program.getSourceFile(file);\n\n\t\tif (sourceFile === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst namespace =\n\t\t\trootNamespace === undefined\n\t\t\t\t? undefined\n\t\t\t\t: findNamespaceByMemberSourceFile(rootNamespace, sourceFile);\n\t\t// Loop through the root AST nodes of the file\n\n\t\tfor (const scriptingClass of findScriptingClasses(sourceFile)) {\n\t\t\tif (scriptingClass.node.name === undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expected ${scriptingClass.type} class to have a name`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet name: string;\n\n\t\t\tif (isModule && namespace !== undefined) {\n\t\t\t\tconst moduleNamespace = resolveNamespaceFullName(namespace);\n\t\t\t\tname = `${moduleNamespace}.${scriptingClass.node.name.text}`;\n\t\t\t} else {\n\t\t\t\tname = typeChecker.getFullyQualifiedName(\n\t\t\t\t\ttypeChecker.getSymbolAtLocation(scriptingClass.node.name)!,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst parameterDeclaration =\n\t\t\t\tgetScriptingClassParameterdeclaration(scriptingClass);\n\n\t\t\tconst parametersType =\n\t\t\t\tparameterDeclaration === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: typeChecker.getTypeAtLocation(parameterDeclaration);\n\n\t\t\tif (parametersType === undefined) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst existingIndexEntry = existingIndex.find(\n\t\t\t\t(entry) => entry.Name === name,\n\t\t\t);\n\n\t\t\tconst obj: CreatorIndexEntry = {\n\t\t\t\tName: name,\n\t\t\t\tDescription: existingIndexEntry?.Description ?? name,\n\t\t\t\tType:\n\t\t\t\t\tscriptingClass.type === \"evaluator\"\n\t\t\t\t\t\t? \"Evaluator\"\n\t\t\t\t\t\t: \"Interactor\",\n\t\t\t\tParameters: [],\n\t\t\t};\n\n\t\t\tconst rawDocTags = ts.getJSDocTags(scriptingClass.node);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\t\t\tif (dict.summary) {\n\t\t\t\tobj.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = typeChecker\n\t\t\t\t\t.getTypeAtLocation(scriptingClass.node)\n\t\t\t\t\t.symbol.getDocumentationComment(typeChecker)\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tobj.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parametersType !== undefined) {\n\t\t\t\tobj.Parameters = parseParametersList(\n\t\t\t\t\ttypeChecker.getPropertiesOfType(parametersType),\n\t\t\t\t\tstrictOptional,\n\t\t\t\t);\n\n\t\t\t\tif (\n\t\t\t\t\tobj.Parameters.length === 0 &&\n\t\t\t\t\tparametersType.getStringIndexType() !== undefined\n\t\t\t\t) {\n\t\t\t\t\tobj.Parameters = existingIndexEntry?.Parameters ?? [];\n\t\t\t\t}\n\t\t\t} else if (existingIndexEntry !== undefined) {\n\t\t\t\tobj.Parameters = existingIndexEntry.Parameters;\n\t\t\t}\n\n\t\t\tarr.push(obj);\n\t\t}\n\t});\n\n\tarr.sort((a, b) => a.Name.localeCompare(b.Name));\n\n\twritePackageCreatorIndex(location, arr);\n}\n\nfunction capitalizeFirstLetter(string: string) {\n\treturn string?.charAt(0).toUpperCase() + string?.slice(1);\n}\n\nconst parseDefault = (value: string, type: string) => {\n\tconst uType: CreatorIndexParameterType = capitalizeFirstLetter(\n\t\ttype,\n\t) as CreatorIndexParameterType;\n\tif (value === \"null\") return null;\n\tswitch (uType) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\t\treturn parseFloat(value);\n\t\tcase \"Integer\":\n\t\tcase \"Int\":\n\t\t\treturn parseInt(value);\n\t\tcase \"Boolean\":\n\t\tcase \"Bool\":\n\t\t\treturn value === \"true\";\n\t\tcase \"Material\":\n\t\tcase \"String\":\n\t\tcase \"Geometry\":\n\t\tdefault:\n\t\t\treturn value.replace(/^\"/, \"\").replace(/\"$/, \"\");\n\t}\n};\n\nconst parseTypeFromName = (\n\tname: string,\n): CreatorIndexParameterType | undefined => {\n\tconst parts = name.split(\".\");\n\tconst identifier = parts[parts.length - 1];\n\n\tswitch (identifier) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\tcase \"Integer\":\n\t\t\treturn identifier;\n\t\tcase \"GeometryReference\":\n\t\t\treturn \"Geometry\";\n\t\tcase \"MaterialReference\":\n\t\t\treturn \"Material\";\n\t\tcase \"AnimationReference\":\n\t\t\treturn \"Animation\";\n\t\tcase \"InteractorReference\":\n\t\t\treturn \"Interactor\";\n\t\tcase \"EvaluatorReference\":\n\t\t\treturn \"Evaluator\";\n\t\tcase \"String\":\n\t\tcase \"string\":\n\t\t\treturn \"String\";\n\t\tcase \"number\":\n\t\tcase \"Number\":\n\t\t\treturn \"Float\";\n\t\tcase \"boolean\":\n\t\tcase \"Boolean\":\n\t\t\treturn \"Boolean\";\n\t}\n};\n\nconst parseParametersList = (\n\tproperties: ts.Symbol[],\n\tstrictOptional: boolean,\n): CreatorIndexParameter[] => {\n\treturn properties.map((symbol, i) => {\n\t\tconst parameter: CreatorIndexParameter = {\n\t\t\tName: symbol.name,\n\t\t\tDescription: undefined,\n\t\t\tType: \"String\",\n\t\t\tDefault: undefined,\n\t\t\tDisplayIndex: i + 1,\n\t\t};\n\n\t\tif (parameter.Name.length > 45) {\n\t\t\tthrow new Error(`Parameter name length >45 '${parameter.Name}'`);\n\t\t}\n\n\t\tlet declaration: ts.Declaration | undefined =\n\t\t\tsymbol.getDeclarations()?.[0];\n\t\tlet documentationComment = symbol.getDocumentationComment(undefined);\n\n\t\tlet checkLinksSymbol: ts.Symbol | undefined = symbol;\n\n\t\twhile (checkLinksSymbol !== undefined && declaration === undefined) {\n\t\t\tconst links = (\n\t\t\t\tcheckLinksSymbol as {\n\t\t\t\t\tlinks?: {\n\t\t\t\t\t\tmappedType?: ts.Type;\n\t\t\t\t\t\tsyntheticOrigin?: ts.Symbol;\n\t\t\t\t\t};\n\t\t\t\t} & ts.Symbol\n\t\t\t).links;\n\n\t\t\tif (links?.syntheticOrigin) {\n\t\t\t\tdeclaration = links.syntheticOrigin.getDeclarations()?.[0];\n\n\t\t\t\tif (documentationComment.length === 0) {\n\t\t\t\t\tdocumentationComment =\n\t\t\t\t\t\tlinks.syntheticOrigin.getDocumentationComment(\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcheckLinksSymbol = links.syntheticOrigin;\n\t\t\t}\n\t\t}\n\n\t\tif (declaration !== undefined) {\n\t\t\tconst rawDocTags = ts.getJSDocTags(declaration);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\n\t\t\tif (dict.summary) {\n\t\t\t\tparameter.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = documentationComment\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tparameter.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.creatorType) {\n\t\t\t\tparameter.Type = dict.creatorType as CreatorIndexParameterType;\n\t\t\t} else {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.type !== undefined) {\n\t\t\t\t\tconst parsedType = parseTypeFromName(\n\t\t\t\t\t\tpropertySignature.type.getText(),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (parsedType !== undefined) {\n\t\t\t\t\t\tparameter.Type = parsedType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dict.default) {\n\t\t\t\tparameter.Default = parseDefault(dict.default, parameter.Type);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstrictOptional &&\n\t\t\t\tdeclaration.kind === ts.SyntaxKind.PropertySignature\n\t\t\t) {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.questionToken === undefined) {\n\t\t\t\t\tparameter.Required = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parameter;\n\t});\n};\n\ninterface IDocTags {\n\tdefault?: string;\n\tcreatorType?: string;\n\tsummary?: string;\n}\n\nfunction getTagDict(tags: readonly ts.JSDocTag[]): IDocTags {\n\tconst dict: IDocTags = {};\n\n\tfor (const tag of tags) {\n\t\tdict[tag.tagName.text] = tag.comment;\n\t}\n\n\treturn dict;\n}\n\nconst getScriptingClassParameterdeclaration = (\n\tscriptingClass: ScriptingClass,\n) => {\n\tfor (const member of scriptingClass.node.members) {\n\t\tif (ts.isMethodDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isConstructorDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst isScriptingClassParameterDeclaration = (\n\tscriptingClass: ScriptingClass,\n\tmemberNode: ts.ClassElement,\n\tparameterIndex: number,\n) => {\n\tif (scriptingClass.type === \"evaluator\") {\n\t\treturn memberNode?.name?.getText() == \"Create\" && parameterIndex === 2;\n\t}\n\tif (scriptingClass.type === \"interactor\") {\n\t\treturn (\n\t\t\tmemberNode.kind === ts.SyntaxKind.Constructor &&\n\t\t\tparameterIndex === 0\n\t\t);\n\t}\n\treturn false;\n};\n\ninterface ScriptingClass {\n\tnode: ts.ClassDeclaration;\n\ttype: \"interactor\" | \"evaluator\";\n}\n\n/**\n * Finds interactors and evaluators within a script file\n *\n * @param {ts.Node} node\n * @return {*}\n */\nfunction* findScriptingClasses(\n\tnode: ts.Node,\n): Generator<ScriptingClass, void, void> {\n\tfor (const child of node.getChildren()) {\n\t\tif (!ts.isClassDeclaration(child)) {\n\t\t\tyield* findScriptingClasses(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst scriptingClass = detectScriptingClass(child);\n\n\t\tif (scriptingClass !== undefined) {\n\t\t\tyield scriptingClass;\n\t\t}\n\t}\n}\n\nconst detectScriptingClass = (\n\tnode: ts.ClassDeclaration,\n): ScriptingClass | undefined => {\n\tconst isEvaluator = node.heritageClauses?.some((clause) => {\n\t\tif (\n\t\t\tclause.token !== ts.SyntaxKind.ExtendsKeyword &&\n\t\t\tclause.token !== ts.SyntaxKind.ImplementsKeyword\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Evaluator\"),\n\t\t);\n\t});\n\n\tif (isEvaluator) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"evaluator\",\n\t\t};\n\t}\n\n\tconst isInteractor = node.heritageClauses?.some((clause) => {\n\t\tif (clause.token !== ts.SyntaxKind.ExtendsKeyword) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Interactor\"),\n\t\t);\n\t});\n\n\tif (isInteractor) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"interactor\",\n\t\t};\n\t}\n};\n"],"names":["generateIndex","location","ignore","strictOptional","arr","existingIndex","readPackageCreatorIndex","manifest","readPackageCreatorManifest","compilerOptions","readScriptPackageTSConfig","options","isModule","module","ts","ModuleKind","ES2015","ESNext","undefined","strict","strictNullChecks","files","getPackageTypescriptFiles","filter","path","some","suffix","endsWith","program","rootNamespace","entryFilePath","resolveScriptPackageEntryModule","Error","host","createCompilerHost","createProgram","allowJs","entryFile","getSourceFile","resolveNamespaces","getTypeChecker","Scope","Package","typeChecker","forEach","file","sourceFile","namespace","findNamespaceByMemberSourceFile","scriptingClass","findScriptingClasses","node","name","type","moduleNamespace","resolveNamespaceFullName","text","getFullyQualifiedName","getSymbolAtLocation","parameterDeclaration","getScriptingClassParameterdeclaration","parametersType","getTypeAtLocation","console","log","existingIndexEntry","find","entry","Name","obj","Description","Type","Parameters","rawDocTags","getJSDocTags","dict","getTagDict","summary","comment","symbol","getDocumentationComment","map","join","parseParametersList","getPropertiesOfType","length","getStringIndexType","push","sort","a","b","localeCompare","writePackageCreatorIndex","capitalizeFirstLetter","string","charAt","toUpperCase","slice","parseDefault","value","uType","parseFloat","parseInt","replace","parseTypeFromName","parts","split","identifier","properties","i","parameter","Default","DisplayIndex","declaration","getDeclarations","documentationComment","checkLinksSymbol","links","syntheticOrigin","creatorType","propertySignature","parsedType","getText","default","kind","SyntaxKind","PropertySignature","questionToken","Required","tags","tag","tagName","member","members","isMethodDeclaration","index","parameters","isScriptingClassParameterDeclaration","isConstructorDeclaration","memberNode","parameterIndex","Constructor","child","getChildren","isClassDeclaration","detectScriptingClass","isEvaluator","heritageClauses","clause","token","ExtendsKeyword","ImplementsKeyword","types","includes","isInteractor"],"mappings":";;;;;;;;;;;;;;;AAwCA;;;;I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0 @@
1
- import ts from 'typescript';
2
- import * as fs from 'fs';
3
- import * as path from 'path';
4
- import * as os from 'os';
5
- import 'resolve';
6
- import 'write-package';
7
- import { a as readPackageCreatorIndex, r as readPackageCreatorManifest, l as getCreatorIndexParameterPrimaryJSType } from './cli-CTqQeYIu.mjs';
8
- import 'glob';
9
- import 'axios';
10
- import 'update-notifier';
11
- import 'yargs/yargs';
12
- import 'url';
13
- import '@inquirer/prompts';
14
-
15
- const generateParameterType = ({ location, name })=>{
16
- const index = readPackageCreatorIndex(location);
17
- const manifest = readPackageCreatorManifest(location);
18
- if (index === undefined) {
19
- throw new Error(`Could not find the _Index.json file`);
20
- }
21
- let qualifiedName = name;
22
- let className = name;
23
- const scope = manifest.Scope ?? manifest.Package;
24
- if (name.startsWith(scope)) {
25
- className = name.slice(scope.length + 1);
26
- } else {
27
- qualifiedName = `${scope}.${name}`;
28
- }
29
- const informations = index.find((item)=>item.Name === qualifiedName);
30
- if (informations === undefined) {
31
- throw new Error(`Could not find an index entry for ${name}`);
32
- }
33
- const members = [];
34
- if (informations.Parameters !== undefined) {
35
- const sortedList = informations.Parameters.slice();
36
- sortedList.sort((a, b)=>a.DisplayIndex - b.DisplayIndex);
37
- for (const parameter of sortedList){
38
- const jsType = getCreatorIndexParameterPrimaryJSType(parameter.Type);
39
- const type = jsType === "string" ? ts.factory.createTypeReferenceNode("string") : ts.factory.createUnionTypeNode([
40
- ts.factory.createTypeReferenceNode(jsType),
41
- ts.factory.createTypeReferenceNode("string")
42
- ]);
43
- let propertySignature = ts.factory.createPropertySignature(undefined, parameter.Name, parameter.Required ? undefined : ts.factory.createToken(ts.SyntaxKind.QuestionToken), type);
44
- const jsdocParts = [];
45
- if (parameter.Description !== undefined) {
46
- jsdocParts.push(parameter.Description, "");
47
- }
48
- jsdocParts.push(`@creatorType ${parameter.Type}`);
49
- if (jsType === "string") {
50
- jsdocParts.push(`@default "${parameter.Default}"`);
51
- } else {
52
- jsdocParts.push(`@default ${parameter.Default}`);
53
- }
54
- const jsdocContent = jsdocParts.map((part)=>`* ${part}`).join(os.EOL + " ");
55
- propertySignature = ts.addSyntheticLeadingComment(propertySignature, ts.SyntaxKind.MultiLineCommentTrivia, `*${os.EOL} ${jsdocContent}${os.EOL} `, true);
56
- members.push(propertySignature);
57
- }
58
- }
59
- const interfaceName = `${className}Params`;
60
- let interfaceDeclaration = ts.factory.createInterfaceDeclaration(undefined, interfaceName, undefined, undefined, members);
61
- interfaceDeclaration = ts.addSyntheticLeadingComment(interfaceDeclaration, ts.SyntaxKind.MultiLineCommentTrivia, `*${os.EOL} * Parameters for the ${className} class${os.EOL} `, true);
62
- const printer = ts.createPrinter({
63
- newLine: os.EOL === "\n" ? ts.NewLineKind.LineFeed : ts.NewLineKind.CarriageReturnLineFeed
64
- });
65
- const content = printer.printNode(ts.EmitHint.Unspecified, interfaceDeclaration, ts.createSourceFile("index.ts", "", ts.ScriptTarget.Latest)).replace(/ /g, "\t");
66
- const outFile = path.join(location.scriptsDir, `${interfaceName}.txt`);
67
- fs.writeFileSync(outFile, `Generated parameters interface for ${className}. Insert the interface declaration next to the class and use it as the type for the parameters. Afterwards you can delete this file.` + os.EOL + os.EOL + content);
68
- };
69
-
70
- export { generateParameterType };
71
- //# sourceMappingURL=generateParameterType-BFVUv72F.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateParameterType-BFVUv72F.mjs","sources":["../src/commands/generateParameterType.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as os from \"os\";\n\nimport {\n\tPackageLocation,\n\tgetCreatorIndexParameterPrimaryJSType,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport interface GenerateParameterTypeOptions {\n\tlocation: PackageLocation;\n\tname: string;\n}\n\nexport const generateParameterType = ({\n\tlocation,\n\tname,\n}: GenerateParameterTypeOptions) => {\n\tconst index = readPackageCreatorIndex(location);\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tif (index === undefined) {\n\t\tthrow new Error(`Could not find the _Index.json file`);\n\t}\n\n\tlet qualifiedName = name;\n\tlet className = name;\n\n\tconst scope = manifest.Scope ?? manifest.Package;\n\n\tif (name.startsWith(scope)) {\n\t\tclassName = name.slice(scope.length + 1);\n\t} else {\n\t\tqualifiedName = `${scope}.${name}`;\n\t}\n\n\tconst informations = index.find((item) => item.Name === qualifiedName);\n\n\tif (informations === undefined) {\n\t\tthrow new Error(`Could not find an index entry for ${name}`);\n\t}\n\n\tconst members: ts.TypeElement[] = [];\n\n\tif (informations.Parameters !== undefined) {\n\t\tconst sortedList = informations.Parameters.slice();\n\t\tsortedList.sort((a, b) => a.DisplayIndex - b.DisplayIndex);\n\n\t\tfor (const parameter of sortedList) {\n\t\t\tconst jsType = getCreatorIndexParameterPrimaryJSType(\n\t\t\t\tparameter.Type,\n\t\t\t);\n\n\t\t\tconst type =\n\t\t\t\tjsType === \"string\"\n\t\t\t\t\t? ts.factory.createTypeReferenceNode(\"string\")\n\t\t\t\t\t: ts.factory.createUnionTypeNode([\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(jsType),\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(\"string\"),\n\t\t\t\t\t\t]);\n\n\t\t\tlet propertySignature = ts.factory.createPropertySignature(\n\t\t\t\tundefined,\n\t\t\t\tparameter.Name,\n\t\t\t\tparameter.Required\n\t\t\t\t\t? undefined\n\t\t\t\t\t: ts.factory.createToken(ts.SyntaxKind.QuestionToken),\n\t\t\t\ttype,\n\t\t\t);\n\n\t\t\tconst jsdocParts: string[] = [];\n\n\t\t\tif (parameter.Description !== undefined) {\n\t\t\t\tjsdocParts.push(parameter.Description, \"\");\n\t\t\t}\n\n\t\t\tjsdocParts.push(`@creatorType ${parameter.Type}`);\n\n\t\t\tif (jsType === \"string\") {\n\t\t\t\tjsdocParts.push(`@default \"${parameter.Default}\"`);\n\t\t\t} else {\n\t\t\t\tjsdocParts.push(`@default ${parameter.Default}`);\n\t\t\t}\n\n\t\t\tconst jsdocContent = jsdocParts\n\t\t\t\t.map((part) => `* ${part}`)\n\t\t\t\t.join(os.EOL + \" \");\n\t\t\tpropertySignature = ts.addSyntheticLeadingComment(\n\t\t\t\tpropertySignature,\n\t\t\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t\t\t`*${os.EOL} ${jsdocContent}${os.EOL} `,\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tmembers.push(propertySignature);\n\t\t}\n\t}\n\n\tconst interfaceName = `${className}Params`;\n\n\tlet interfaceDeclaration = ts.factory.createInterfaceDeclaration(\n\t\tundefined,\n\t\tinterfaceName,\n\t\tundefined,\n\t\tundefined,\n\t\tmembers,\n\t);\n\n\tinterfaceDeclaration = ts.addSyntheticLeadingComment(\n\t\tinterfaceDeclaration,\n\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t`*${os.EOL} * Parameters for the ${className} class${os.EOL} `,\n\t\ttrue,\n\t);\n\n\tconst printer = ts.createPrinter({\n\t\tnewLine:\n\t\t\tos.EOL === \"\\n\"\n\t\t\t\t? ts.NewLineKind.LineFeed\n\t\t\t\t: ts.NewLineKind.CarriageReturnLineFeed,\n\t});\n\tconst content = printer\n\t\t.printNode(\n\t\t\tts.EmitHint.Unspecified,\n\t\t\tinterfaceDeclaration,\n\t\t\tts.createSourceFile(\"index.ts\", \"\", ts.ScriptTarget.Latest),\n\t\t)\n\t\t.replace(/ /g, \"\\t\");\n\n\tconst outFile = path.join(location.scriptsDir, `${interfaceName}.txt`);\n\n\tfs.writeFileSync(\n\t\toutFile,\n\t\t`Generated parameters interface for ${className}. Insert the interface declaration next to the class and use it as the type for the parameters. Afterwards you can delete this file.` +\n\t\t\tos.EOL +\n\t\t\tos.EOL +\n\t\t\tcontent,\n\t);\n};\n"],"names":["generateParameterType","location","name","index","readPackageCreatorIndex","manifest","readPackageCreatorManifest","undefined","Error","qualifiedName","className","scope","Scope","Package","startsWith","slice","length","informations","find","item","Name","members","Parameters","sortedList","sort","a","b","DisplayIndex","parameter","jsType","getCreatorIndexParameterPrimaryJSType","Type","type","ts","factory","createTypeReferenceNode","createUnionTypeNode","propertySignature","createPropertySignature","Required","createToken","SyntaxKind","QuestionToken","jsdocParts","Description","push","Default","jsdocContent","map","part","join","os","EOL","addSyntheticLeadingComment","MultiLineCommentTrivia","interfaceName","interfaceDeclaration","createInterfaceDeclaration","printer","createPrinter","newLine","NewLineKind","LineFeed","CarriageReturnLineFeed","content","printNode","EmitHint","Unspecified","createSourceFile","ScriptTarget","Latest","replace","outFile","path","scriptsDir","fs","writeFileSync"],"mappings":";;;;;;;;;;;;;;MAiBaA,qBAAAA,GAAwB,CAAC,EACrCC,QAAQ,EACRC,IAAI,EAC0B,GAAA;AAC9B,IAAA,MAAMC,QAAQC,uBAAAA,CAAwBH,QAAAA,CAAAA;AACtC,IAAA,MAAMI,WAAWC,0BAAAA,CAA2BL,QAAAA,CAAAA;AAE5C,IAAA,IAAIE,UAAUI,SAAAA,EAAW;AACxB,QAAA,MAAM,IAAIC,KAAAA,CAAM,CAAC,mCAAmC,CAAC,CAAA;AACtD,IAAA;AAEA,IAAA,IAAIC,aAAAA,GAAgBP,IAAAA;AACpB,IAAA,IAAIQ,SAAAA,GAAYR,IAAAA;AAEhB,IAAA,MAAMS,KAAAA,GAAQN,QAAAA,CAASO,KAAK,IAAIP,SAASQ,OAAO;IAEhD,IAAIX,IAAAA,CAAKY,UAAU,CAACH,KAAAA,CAAAA,EAAQ;AAC3BD,QAAAA,SAAAA,GAAYR,IAAAA,CAAKa,KAAK,CAACJ,KAAAA,CAAMK,MAAM,GAAG,CAAA,CAAA;IACvC,CAAA,MAAO;AACNP,QAAAA,aAAAA,GAAgB,CAAA,EAAGE,KAAAA,CAAM,CAAC,EAAET,IAAAA,CAAAA,CAAM;AACnC,IAAA;IAEA,MAAMe,YAAAA,GAAed,MAAMe,IAAI,CAAC,CAACC,IAAAA,GAASA,IAAAA,C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