medusa-test-utils 1.1.45 → 2.0.0-rc-20241001083650
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/database.d.ts +2 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +100 -146
- package/dist/database.js.map +1 -1
- package/dist/events.d.ts +3 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +41 -0
- package/dist/events.js.map +1 -0
- package/dist/id-map.d.ts +3 -2
- package/dist/id-map.d.ts.map +1 -0
- package/dist/id-map.js +8 -11
- package/dist/id-map.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/init-modules.d.ts +2 -1
- package/dist/init-modules.d.ts.map +1 -0
- package/dist/init-modules.js +39 -97
- package/dist/init-modules.js.map +1 -1
- package/dist/jest.d.ts +1 -0
- package/dist/jest.d.ts.map +1 -0
- package/dist/jest.js +15 -64
- package/dist/jest.js.map +1 -1
- package/dist/medusa-test-runner-utils/bootstrap-app.d.ts +10 -5
- package/dist/medusa-test-runner-utils/bootstrap-app.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/bootstrap-app.js +53 -147
- package/dist/medusa-test-runner-utils/bootstrap-app.js.map +1 -1
- package/dist/medusa-test-runner-utils/clear-instances.d.ts +8 -0
- package/dist/medusa-test-runner-utils/clear-instances.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/clear-instances.js +14 -0
- package/dist/medusa-test-runner-utils/clear-instances.js.map +1 -0
- package/dist/medusa-test-runner-utils/config.d.ts +5 -0
- package/dist/medusa-test-runner-utils/config.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/config.js +28 -0
- package/dist/medusa-test-runner-utils/config.js.map +1 -0
- package/dist/medusa-test-runner-utils/index.d.ts +6 -0
- package/dist/medusa-test-runner-utils/index.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/index.js +22 -0
- package/dist/medusa-test-runner-utils/index.js.map +1 -0
- package/dist/medusa-test-runner-utils/use-db.d.ts +15 -12
- package/dist/medusa-test-runner-utils/use-db.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/use-db.js +51 -143
- package/dist/medusa-test-runner-utils/use-db.js.map +1 -1
- package/dist/medusa-test-runner-utils/utils.d.ts +2 -0
- package/dist/medusa-test-runner-utils/utils.d.ts.map +1 -0
- package/dist/medusa-test-runner-utils/utils.js +10 -0
- package/dist/medusa-test-runner-utils/utils.js.map +1 -0
- package/dist/medusa-test-runner.d.ts +16 -6
- package/dist/medusa-test-runner.d.ts.map +1 -0
- package/dist/medusa-test-runner.js +123 -343
- package/dist/medusa-test-runner.js.map +1 -1
- package/dist/mock-event-bus-service.d.ts +5 -4
- package/dist/mock-event-bus-service.d.ts.map +1 -0
- package/dist/mock-event-bus-service.js +13 -51
- package/dist/mock-event-bus-service.js.map +1 -1
- package/dist/module-test-runner.d.ts +4 -2
- package/dist/module-test-runner.d.ts.map +1 -0
- package/dist/module-test-runner.js +117 -132
- package/dist/module-test-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -39
- package/dist/mock-manager.d.ts +0 -9
- package/dist/mock-manager.js +0 -30
- package/dist/mock-manager.js.map +0 -1
- package/dist/mock-repository.d.ts +0 -51
- package/dist/mock-repository.js +0 -193
- package/dist/mock-repository.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,oDAAiC;AACjC,2CAAwB;AACxB,2CAAwB;AACxB,0CAAuB"}
|
@@ -1,12 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
import type { MedusaAppLoader } from "@medusajs/framework";
|
2
|
+
import { MedusaContainer } from "@medusajs/framework/types";
|
3
|
+
/**
|
4
|
+
* Initiates the database connection
|
5
|
+
*/
|
6
|
+
export declare function initDb(): Promise<import("knex").Knex<any, any>>;
|
7
|
+
/**
|
8
|
+
* Migrates the database
|
9
|
+
*/
|
10
|
+
export declare function migrateDatabase(appLoader: MedusaAppLoader): Promise<void>;
|
11
|
+
/**
|
12
|
+
* Syncs links with the databse
|
13
|
+
*/
|
14
|
+
export declare function syncLinks(appLoader: MedusaAppLoader, directory: string, container: MedusaContainer): Promise<void>;
|
15
|
+
//# sourceMappingURL=use-db.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-db.d.ts","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAG3D;;GAEG;AACH,wBAAsB,MAAM,2CAS3B;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,eAAe,iBAO/D;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,eAAe,iBAe3B"}
|
@@ -1,148 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
25
|
-
function step(op) {
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
30
|
-
switch (op[0]) {
|
31
|
-
case 0: case 1: t = op; break;
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
35
|
-
default:
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
40
|
-
if (t[2]) _.ops.pop();
|
41
|
-
_.trys.pop(); continue;
|
42
|
-
}
|
43
|
-
op = body.call(thisArg, _);
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
46
|
-
}
|
47
|
-
};
|
48
|
-
var __read = (this && this.__read) || function (o, n) {
|
49
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
50
|
-
if (!m) return o;
|
51
|
-
var i = m.call(o), r, ar = [], e;
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.initDb = initDb;
|
4
|
+
exports.migrateDatabase = migrateDatabase;
|
5
|
+
exports.syncLinks = syncLinks;
|
6
|
+
const path_1 = require("path");
|
7
|
+
const utils_1 = require("@medusajs/framework/utils");
|
8
|
+
/**
|
9
|
+
* Initiates the database connection
|
10
|
+
*/
|
11
|
+
async function initDb() {
|
12
|
+
const { pgConnectionLoader, featureFlagsLoader } = await import("@medusajs/framework");
|
13
|
+
const pgConnection = pgConnectionLoader();
|
14
|
+
await featureFlagsLoader();
|
15
|
+
return pgConnection;
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Migrates the database
|
19
|
+
*/
|
20
|
+
async function migrateDatabase(appLoader) {
|
52
21
|
try {
|
53
|
-
|
22
|
+
await appLoader.runModulesMigrations();
|
54
23
|
}
|
55
|
-
catch (
|
56
|
-
|
57
|
-
|
58
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
59
|
-
}
|
60
|
-
finally { if (e) throw e.error; }
|
24
|
+
catch (err) {
|
25
|
+
console.error("Something went wrong while running the migrations");
|
26
|
+
throw err;
|
61
27
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
var cwd = _a.cwd,
|
74
|
-
// use for v1 datasource only
|
75
|
-
database_extra = _a.database_extra, env = _a.env, force_modules_migration = _a.force_modules_migration, _b = _a.dbUrl, dbUrl = _b === void 0 ? "" : _b, _c = _a.dbSchema, dbSchema = _c === void 0 ? "public" : _c;
|
76
|
-
return __awaiter(this, void 0, void 0, function () {
|
77
|
-
var configModuleLoader, configModule, featureFlagsLoader, featureFlagRouter, modelsLoader, entities, migrationDir, _d, getEnabledMigrations, getModuleSharedResources, _e, moduleMigrations, moduleModels, enabledMigrations, enabledEntities, dbDataSource, pgConnectionLoader, featureFlagLoader, container, featureFlagRouter_1, pgConnection, migrateMedusaApp;
|
78
|
-
var _f;
|
79
|
-
return __generator(this, function (_g) {
|
80
|
-
switch (_g.label) {
|
81
|
-
case 0:
|
82
|
-
if (isObject(env)) {
|
83
|
-
Object.entries(env).forEach(function (_a) {
|
84
|
-
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
85
|
-
return (process.env[k] = v);
|
86
|
-
});
|
87
|
-
}
|
88
|
-
configModuleLoader = require("@medusajs/medusa/dist/loaders/config").default;
|
89
|
-
configModule = configModuleLoader(cwd);
|
90
|
-
featureFlagsLoader = require("@medusajs/medusa/dist/loaders/feature-flags").default;
|
91
|
-
featureFlagRouter = featureFlagsLoader(configModule);
|
92
|
-
modelsLoader = require("@medusajs/medusa/dist/loaders/models").default;
|
93
|
-
entities = modelsLoader({}, { register: false });
|
94
|
-
migrationDir = path.resolve(path.join(cwd, "../../", "node_modules", "@medusajs", "medusa", "dist", "migrations", "*.js"));
|
95
|
-
_d = require("@medusajs/medusa/dist/commands/utils/get-migrations"), getEnabledMigrations = _d.getEnabledMigrations, getModuleSharedResources = _d.getModuleSharedResources;
|
96
|
-
_e = getModuleSharedResources(configModule, featureFlagRouter), moduleMigrations = _e.migrations, moduleModels = _e.models;
|
97
|
-
enabledMigrations = getEnabledMigrations([migrationDir], function (flag) {
|
98
|
-
return featureFlagRouter.isFeatureEnabled(flag);
|
99
|
-
});
|
100
|
-
enabledEntities = entities.filter(function (e) { return typeof e.isFeatureEnabled === "undefined" || e.isFeatureEnabled(); });
|
101
|
-
dbDataSource = new DataSource({
|
102
|
-
type: "postgres",
|
103
|
-
url: dbUrl || configModule.projectConfig.database_url,
|
104
|
-
entities: enabledEntities.concat(moduleModels),
|
105
|
-
migrations: enabledMigrations.concat(moduleMigrations),
|
106
|
-
extra: database_extra !== null && database_extra !== void 0 ? database_extra : {},
|
107
|
-
//name: "integration-tests",
|
108
|
-
schema: dbSchema,
|
109
|
-
});
|
110
|
-
return [4 /*yield*/, dbDataSource.initialize()];
|
111
|
-
case 1:
|
112
|
-
_g.sent();
|
113
|
-
return [4 /*yield*/, dbDataSource.runMigrations()];
|
114
|
-
case 2:
|
115
|
-
_g.sent();
|
116
|
-
if (!(force_modules_migration ||
|
117
|
-
featureFlagRouter.isFeatureEnabled(MedusaV2Flag.key))) return [3 /*break*/, 6];
|
118
|
-
pgConnectionLoader = require("@medusajs/medusa/dist/loaders/pg-connection").default;
|
119
|
-
featureFlagLoader = require("@medusajs/medusa/dist/loaders/feature-flags").default;
|
120
|
-
container = createMedusaContainer();
|
121
|
-
return [4 /*yield*/, featureFlagLoader(configModule)];
|
122
|
-
case 3:
|
123
|
-
featureFlagRouter_1 = _g.sent();
|
124
|
-
return [4 /*yield*/, pgConnectionLoader({
|
125
|
-
configModule: __assign(__assign({}, configModule), { projectConfig: __assign(__assign({}, configModule.projectConfig), { database_url: dbUrl || configModule.projectConfig.database_url }) }),
|
126
|
-
container: container,
|
127
|
-
})];
|
128
|
-
case 4:
|
129
|
-
pgConnection = _g.sent();
|
130
|
-
container.register((_f = {},
|
131
|
-
_f[ContainerRegistrationKeys.CONFIG_MODULE] = asValue(configModule),
|
132
|
-
_f[ContainerRegistrationKeys.LOGGER] = asValue(logger),
|
133
|
-
_f[ContainerRegistrationKeys.MANAGER] = asValue(dbDataSource.manager),
|
134
|
-
_f[ContainerRegistrationKeys.PG_CONNECTION] = asValue(pgConnection),
|
135
|
-
_f.featureFlagRouter = asValue(featureFlagRouter_1),
|
136
|
-
_f));
|
137
|
-
migrateMedusaApp = require("@medusajs/medusa/dist/loaders/medusa-app").migrateMedusaApp;
|
138
|
-
return [4 /*yield*/, migrateMedusaApp({ configModule: configModule, container: container }, { registerInContainer: false })];
|
139
|
-
case 5:
|
140
|
-
_g.sent();
|
141
|
-
_g.label = 6;
|
142
|
-
case 6: return [2 /*return*/, { dbDataSource: dbDataSource, pgConnection: pgConnection }];
|
143
|
-
}
|
144
|
-
});
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Syncs links with the databse
|
31
|
+
*/
|
32
|
+
async function syncLinks(appLoader, directory, container) {
|
33
|
+
try {
|
34
|
+
await loadCustomLinks(directory, container);
|
35
|
+
const planner = await appLoader.getLinksExecutionPlanner();
|
36
|
+
const actionPlan = await planner.createPlan();
|
37
|
+
actionPlan.forEach((action) => {
|
38
|
+
console.log(`Sync links: "${action.action}" ${action.tableName}`);
|
145
39
|
});
|
146
|
-
|
147
|
-
}
|
40
|
+
await planner.executePlan(actionPlan);
|
41
|
+
}
|
42
|
+
catch (err) {
|
43
|
+
console.error("Something went wrong while syncing links");
|
44
|
+
throw err;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
async function loadCustomLinks(directory, container) {
|
48
|
+
// TODO: move to framework once settle down
|
49
|
+
const { getResolvedPlugins, } = require("@medusajs/medusa/loaders/helpers/resolve-plugins");
|
50
|
+
const configModule = container.resolve(utils_1.ContainerRegistrationKeys.CONFIG_MODULE);
|
51
|
+
const plugins = getResolvedPlugins(directory, configModule, true) || [];
|
52
|
+
const linksSourcePaths = plugins.map((plugin) => (0, path_1.join)(plugin.resolve, "links"));
|
53
|
+
const { LinkLoader } = await import("@medusajs/framework");
|
54
|
+
await new LinkLoader(linksSourcePaths).load();
|
55
|
+
}
|
148
56
|
//# sourceMappingURL=use-db.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-db.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.
|
1
|
+
{"version":3,"file":"use-db.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.ts"],"names":[],"mappings":";;AAQA,wBASC;AAKD,0CAOC;AAKD,8BAkBC;AAnDD,+BAA2B;AAE3B,qDAAqE;AAErE;;GAEG;AACI,KAAK,UAAU,MAAM;IAC1B,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAC7D,qBAAqB,CACtB,CAAA;IAED,MAAM,YAAY,GAAG,kBAAkB,EAAE,CAAA;IACzC,MAAM,kBAAkB,EAAE,CAAA;IAE1B,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,eAAe,CAAC,SAA0B;IAC9D,IAAI,CAAC;QACH,MAAM,SAA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OAAO,EAAE,OAAO,CAAC,CAC9B,CAAA;IAED,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC1D,MAAM,IAAI,UAAU,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;AAC/C,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,QAI3D"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.applyEnvVarsToProcess = applyEnvVarsToProcess;
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
5
|
+
function applyEnvVarsToProcess(env) {
|
6
|
+
if ((0, utils_1.isObject)(env)) {
|
7
|
+
Object.entries(env).forEach(([k, v]) => (process.env[k] = v));
|
8
|
+
}
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/utils.ts"],"names":[],"mappings":";;AAEA,sDAIC;AAND,qDAAoD;AAEpD,SAAgB,qBAAqB,CAAC,GAAsB;IAC1D,IAAI,IAAA,gBAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC;AACH,CAAC"}
|
@@ -1,21 +1,31 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
1
|
+
import { MedusaAppOutput } from "@medusajs/framework/modules-sdk";
|
2
|
+
import { MedusaContainer } from "@medusajs/framework/types";
|
3
|
+
export interface MedusaSuiteOptions {
|
4
4
|
dbConnection: any;
|
5
5
|
getContainer: () => MedusaContainer;
|
6
6
|
api: any;
|
7
|
+
dbUtils: {
|
8
|
+
create: (dbName: string) => Promise<void>;
|
9
|
+
teardown: (options: {
|
10
|
+
schema?: string;
|
11
|
+
}) => Promise<void>;
|
12
|
+
shutdown: (dbName: string) => Promise<void>;
|
13
|
+
};
|
7
14
|
dbConfig: {
|
8
15
|
dbName: string;
|
9
16
|
schema: string;
|
10
17
|
clientUrl: string;
|
11
18
|
};
|
19
|
+
getMedusaApp: () => MedusaAppOutput;
|
12
20
|
}
|
13
|
-
export declare function medusaIntegrationTestRunner({ moduleName, dbName, schema, env,
|
21
|
+
export declare function medusaIntegrationTestRunner({ moduleName, dbName, medusaConfigFile, schema, env, debug, inApp, testSuite, }: {
|
14
22
|
moduleName?: string;
|
15
23
|
env?: Record<string, any>;
|
16
24
|
dbName?: string;
|
25
|
+
medusaConfigFile?: string;
|
17
26
|
schema?: string;
|
18
27
|
debug?: boolean;
|
19
|
-
|
20
|
-
testSuite:
|
28
|
+
inApp?: boolean;
|
29
|
+
testSuite: (options: MedusaSuiteOptions) => void;
|
21
30
|
}): void;
|
31
|
+
//# sourceMappingURL=medusa-test-runner.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"medusa-test-runner.d.ts","sourceRoot":"","sources":["../src/medusa-test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAiB,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAiB1E,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,GAAG,CAAA;IACjB,YAAY,EAAE,MAAM,eAAe,CAAA;IACnC,GAAG,EAAE,GAAG,CAAA;IACR,OAAO,EAAE;QACP,MAAM,EAAE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