@powerhousedao/codegen 4.1.0-dev.15 → 4.1.0-dev.17
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/dist/src/codegen/.hygen/templates/powerhouse/generate-custom-subgraph/schema.esm.t +0 -5
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/reducer.esm.t +3 -0
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/error.esm.t +6 -10
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.d.ts +4 -0
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.d.ts.map +1 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.js +13 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.js.map +1 -1
- package/dist/src/ts-morph-generator/core/GenerationContext.d.ts +2 -1
- package/dist/src/ts-morph-generator/core/GenerationContext.d.ts.map +1 -1
- package/dist/src/ts-morph-generator/file-generators/ReducerGenerator.d.ts +1 -0
- package/dist/src/ts-morph-generator/file-generators/ReducerGenerator.d.ts.map +1 -1
- package/dist/src/ts-morph-generator/file-generators/ReducerGenerator.js +55 -0
- package/dist/src/ts-morph-generator/file-generators/ReducerGenerator.js.map +1 -1
- package/dist/tsconfig.hygen.tsbuildinfo +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/gen/reducer.ts"
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
|
+
// TODO: remove eslint-disable rules once refactor is done
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
5
8
|
import { type StateReducer, isDocumentAction, createReducer } from "document-model";
|
|
6
9
|
import { <%= 'type ' + h.changeCase.pascal(documentType) %>Document, z } from './types.js';
|
|
7
10
|
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/error.esm.t
CHANGED
|
@@ -2,20 +2,17 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/gen/<%= module %>/error.ts"
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
|
-
<% if (
|
|
5
|
+
<% if (errors.length > 0) { _%>
|
|
6
6
|
export type ErrorCode =
|
|
7
|
-
<%
|
|
8
|
-
|
|
9
|
-
| '<%= h.changeCase.pascal(error.name) %>'<% if (actionIndex === actions.length - 1 && errorIndex === action.errors.length - 1) { %>;<% } %>
|
|
10
|
-
<% }); _%>
|
|
7
|
+
<% errors.forEach((error, errorIndex) => { _%>
|
|
8
|
+
| '<%= h.changeCase.pascal(error.name) %>'<% if (errorIndex === errors.length - 1) { %>;<% } %>
|
|
11
9
|
<% }); _%>
|
|
12
10
|
|
|
13
11
|
export interface ReducerError {
|
|
14
12
|
errorCode: ErrorCode;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
<%
|
|
18
|
-
<% action.errors.forEach(error => { _%>
|
|
15
|
+
<% errors.forEach(error => { _%>
|
|
19
16
|
export class <%= h.changeCase.pascal(error.name) %> extends Error implements ReducerError {
|
|
20
17
|
errorCode = '<%= h.changeCase.pascal(error.name) %>' as ErrorCode;
|
|
21
18
|
constructor(message = '<%= h.changeCase.pascal(error.name) %>') {
|
|
@@ -23,7 +20,6 @@ export class <%= h.changeCase.pascal(error.name) %> extends Error implements Red
|
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
<% }); _%>
|
|
27
23
|
<% }); _%>
|
|
28
24
|
|
|
29
25
|
<% } _%>
|
|
@@ -32,9 +28,9 @@ export const errors = {
|
|
|
32
28
|
<% if(action.errors?.length > 0){ -%>
|
|
33
29
|
<%= h.changeCase.pascal(action.name) %>: {
|
|
34
30
|
<% action.errors.forEach(error => { _%>
|
|
35
|
-
|
|
31
|
+
<%= h.changeCase.pascal(error.name) %>,
|
|
36
32
|
<% }); _%>
|
|
37
|
-
},
|
|
33
|
+
},
|
|
38
34
|
<% } -%>
|
|
39
35
|
<% }); _%>
|
|
40
36
|
};
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { type DocumentModelState } from "document-model";
|
|
1
2
|
import { type Args } from "../generate-document-model/index.js";
|
|
2
3
|
type ModuleArgs = Args & {
|
|
3
4
|
module: string;
|
|
4
5
|
};
|
|
6
|
+
type OperationError = DocumentModelState["specifications"][number]["modules"][number]["operations"][number]["errors"][number];
|
|
5
7
|
type Actions = {
|
|
6
8
|
name: string | null;
|
|
7
9
|
hasInput: boolean;
|
|
8
10
|
hasAttachment: boolean | undefined;
|
|
9
11
|
scope: string;
|
|
10
12
|
state: string;
|
|
13
|
+
errors: OperationError[];
|
|
11
14
|
};
|
|
12
15
|
declare const _default: {
|
|
13
16
|
params: ({ args }: {
|
|
@@ -17,6 +20,7 @@ declare const _default: {
|
|
|
17
20
|
documentType: string;
|
|
18
21
|
module: string;
|
|
19
22
|
actions: Actions[];
|
|
23
|
+
errors: import("document-model").DocumentModelOperationError[];
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
export default _default;
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEhE,KAAK,UAAU,GAAG,IAAI,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5C,KAAK,cAAc,GACjB,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1G,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;;uBAGmB;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE;;;;;;;;AADzC,wBA2CE"}
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.js
CHANGED
|
@@ -11,17 +11,29 @@ exports.default = {
|
|
|
11
11
|
name: a.name,
|
|
12
12
|
hasInput: a.schema !== null,
|
|
13
13
|
hasAttachment: a.schema?.includes(": Attachment"),
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
15
14
|
scope: a.scope || "global",
|
|
16
15
|
state: a.scope === "global" ? "" : a.scope, // the state this action affects
|
|
17
16
|
errors: a.errors,
|
|
18
17
|
}))
|
|
19
18
|
: [];
|
|
19
|
+
const errors = actions.reduce((acc, action) => {
|
|
20
|
+
action.errors.forEach((error) => {
|
|
21
|
+
const existingError = acc.find((e) => e.code === error.code);
|
|
22
|
+
if (!existingError) {
|
|
23
|
+
acc.push(error);
|
|
24
|
+
}
|
|
25
|
+
else if (JSON.stringify(existingError) !== JSON.stringify(error)) {
|
|
26
|
+
console.warn(`Warning: Duplicate error code "${error.code}" with different fields found`);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return acc;
|
|
30
|
+
}, []);
|
|
20
31
|
return {
|
|
21
32
|
rootDir: args.rootDir,
|
|
22
33
|
documentType: documentModel.name,
|
|
23
34
|
module: (0, change_case_1.paramCase)(args.module),
|
|
24
35
|
actions,
|
|
36
|
+
errors,
|
|
25
37
|
};
|
|
26
38
|
},
|
|
27
39
|
};
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.ts"],"names":[],"mappings":";;AAAA,6CAAwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AAgBxC,kBAAe;IACb,MAAM,EAAE,CAAC,EAAE,IAAI,EAAwB,EAAE,EAAE;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAuB,CAAC;QAC3E,MAAM,UAAU,GACd,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACxE,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAC/C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAC9B,CAAC;QAEF,MAAM,OAAO,GACX,eAAe,CAAC,MAAM,GAAG,CAAC;YACxB,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACxC,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,KAAK,IAAI;gBAC3B,aAAa,EAAE,CAAC,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ModuleOperation } from "document-model/document-model/gen/schema/types";
|
|
2
2
|
import { type Project } from "ts-morph";
|
|
3
3
|
export type ModuleSpec = DocumentModelState["specifications"][0]["modules"][0];
|
|
4
|
+
export type OperationError = ModuleOperation["errors"][number];
|
|
4
5
|
export type Operation = ModuleOperation & {
|
|
5
6
|
hasInput: boolean;
|
|
6
7
|
hasAttachment: boolean | undefined;
|
|
7
8
|
scope: string;
|
|
8
9
|
state: string;
|
|
9
|
-
errors?:
|
|
10
|
+
errors?: OperationError[];
|
|
10
11
|
};
|
|
11
12
|
export interface GenerationContext {
|
|
12
13
|
rootDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerationContext.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-generator/core/GenerationContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,SAAS,IAAI,eAAe,EAClC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"GenerationContext.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-generator/core/GenerationContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,SAAS,IAAI,eAAe,EAClC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/E,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { type GenerationContext } from "../core/GenerationContext.js";
|
|
|
3
3
|
export declare class ReducerGenerator extends FileGenerator {
|
|
4
4
|
generate(context: GenerationContext): Promise<void>;
|
|
5
5
|
private static getDefaultReducerCode;
|
|
6
|
+
private addErrorImports;
|
|
6
7
|
private getOutputPath;
|
|
7
8
|
private createReducerObject;
|
|
8
9
|
private addReducerMethod;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReducerGenerator.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-generator/file-generators/ReducerGenerator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ReducerGenerator.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-generator/file-generators/ReducerGenerator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,8BAA8B,CAAC;AAEtC,qBAAa,gBAAiB,SAAQ,aAAa;IAC3C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCzD,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAOpC,OAAO,CAAC,eAAe;IAyEvB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,mBAAmB;IAsC3B,OAAO,CAAC,gBAAgB;IAiCxB,OAAO,CAAC,oBAAoB;CAK7B"}
|
|
@@ -15,6 +15,8 @@ export class ReducerGenerator extends FileGenerator {
|
|
|
15
15
|
this.importManager.addTypeImport(sourceFile, typeImportName, typeImportPath);
|
|
16
16
|
// AST logic (specific to reducers)
|
|
17
17
|
this.createReducerObject(sourceFile, typeImportName, context.operations, context.forceUpdate);
|
|
18
|
+
// Detect and import error classes used in the actual reducer code (after generation)
|
|
19
|
+
this.addErrorImports(sourceFile, context);
|
|
18
20
|
await sourceFile.save();
|
|
19
21
|
}
|
|
20
22
|
static getDefaultReducerCode(methodName) {
|
|
@@ -23,6 +25,59 @@ export class ReducerGenerator extends FileGenerator {
|
|
|
23
25
|
`throw new Error('Reducer "${methodName}" not yet implemented');`,
|
|
24
26
|
];
|
|
25
27
|
}
|
|
28
|
+
addErrorImports(sourceFile, context) {
|
|
29
|
+
// Collect all errors from all operations
|
|
30
|
+
const allErrors = [];
|
|
31
|
+
context.operations.forEach((operation) => {
|
|
32
|
+
if (Array.isArray(operation.errors)) {
|
|
33
|
+
operation.errors
|
|
34
|
+
.filter((error) => error.name)
|
|
35
|
+
.forEach((error) => {
|
|
36
|
+
// Deduplicate errors by name
|
|
37
|
+
if (!allErrors.find((e) => e.name === error.name)) {
|
|
38
|
+
allErrors.push(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (allErrors.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
// Analyze the actual source file content to find which errors are used
|
|
46
|
+
const sourceFileContent = sourceFile.getFullText();
|
|
47
|
+
const usedErrors = new Set();
|
|
48
|
+
allErrors.forEach((error) => {
|
|
49
|
+
// Check if error class name is mentioned anywhere in the source file
|
|
50
|
+
// Look for patterns like "new ErrorName" or "throw ErrorName" or "ErrorName("
|
|
51
|
+
const errorPattern = new RegExp(`\\b${error.name}\\b`, "g");
|
|
52
|
+
if (errorPattern.test(sourceFileContent)) {
|
|
53
|
+
usedErrors.add(error.name);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
// Add imports for used errors (only if they're not already imported)
|
|
57
|
+
if (usedErrors.size > 0) {
|
|
58
|
+
const errorImportPath = `../../gen/${paramCase(context.module.name)}/error.js`;
|
|
59
|
+
const errorClassNames = Array.from(usedErrors);
|
|
60
|
+
// Check if imports already exist to avoid duplicates
|
|
61
|
+
const existingImports = sourceFile.getImportDeclarations();
|
|
62
|
+
const existingErrorImport = existingImports.find((importDecl) => importDecl.getModuleSpecifierValue() === errorImportPath);
|
|
63
|
+
if (existingErrorImport) {
|
|
64
|
+
// Get already imported error names
|
|
65
|
+
const existingNamedImports = existingErrorImport
|
|
66
|
+
.getNamedImports()
|
|
67
|
+
.map((namedImport) => namedImport.getName());
|
|
68
|
+
// Only import errors that aren't already imported
|
|
69
|
+
const newErrorsToImport = errorClassNames.filter((errorName) => !existingNamedImports.includes(errorName));
|
|
70
|
+
if (newErrorsToImport.length > 0) {
|
|
71
|
+
// Add new named imports to existing import declaration
|
|
72
|
+
existingErrorImport.addNamedImports(newErrorsToImport);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Create new import declaration
|
|
77
|
+
this.importManager.addNamedImports(sourceFile, errorClassNames, errorImportPath);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
26
81
|
getOutputPath(context) {
|
|
27
82
|
return this.directoryManager.getReducerPath(context.rootDir, context.docModel.name, context.module.name);
|
|
28
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReducerGenerator.js","sourceRoot":"","sources":["../../../../src/ts-morph-generator/file-generators/ReducerGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,uBAAuB,GAIxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ReducerGenerator.js","sourceRoot":"","sources":["../../../../src/ts-morph-generator/file-generators/ReducerGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,uBAAuB,GAIxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAOzD,MAAM,OAAO,gBAAiB,SAAQ,aAAa;IACjD,KAAK,CAAC,QAAQ,CAAC,OAA0B;QACvC,iCAAiC;QACjC,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE5C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAC7D,OAAO,CAAC,OAAO,EACf,QAAQ,CACT,CAAC;QAEF,gCAAgC;QAChC,MAAM,cAAc,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CA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