@xylex-group/athena 1.6.0 → 1.6.1
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/README.md +1 -1
- package/dist/cli/index.cjs +36 -6
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +36 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/{errors-DQerAaXC.d.cts → errors-C4GJaFI_.d.cts} +1 -1
- package/dist/{errors-DQerAaXC.d.ts → errors-C4GJaFI_.d.ts} +1 -1
- package/dist/index.cjs +36 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +36 -6
- package/dist/index.js.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/package.json +2 -1
|
@@ -220,4 +220,4 @@ declare class AthenaGatewayError extends Error {
|
|
|
220
220
|
}
|
|
221
221
|
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
222
222
|
|
|
223
|
-
export { type
|
|
223
|
+
export { type AthenaGatewayCallOptions as A, type BackendConfig as B, type AthenaConditionValue as a, type AthenaConditionCastType as b, type AthenaConditionArrayValue as c, type AthenaConditionOperator as d, type AthenaGatewayErrorDetails as e, type AthenaRpcCallOptions as f, type BackendType as g, Backend as h, AthenaGatewayError as i, isAthenaGatewayError as j, type AthenaRpcFilter as k, type AthenaRpcFilterOperator as l, type AthenaRpcOrder as m, type AthenaRpcPayload as n, type AthenaGatewayErrorCode as o, type AthenaGatewayHookConfig as p, type AthenaGatewayHookResult as q, type AthenaFetchPayload as r, type AthenaInsertPayload as s, type AthenaUpdatePayload as t, type AthenaDeletePayload as u, type AthenaGatewayResponse as v };
|
|
@@ -220,4 +220,4 @@ declare class AthenaGatewayError extends Error {
|
|
|
220
220
|
}
|
|
221
221
|
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
222
222
|
|
|
223
|
-
export { type
|
|
223
|
+
export { type AthenaGatewayCallOptions as A, type BackendConfig as B, type AthenaConditionValue as a, type AthenaConditionCastType as b, type AthenaConditionArrayValue as c, type AthenaConditionOperator as d, type AthenaGatewayErrorDetails as e, type AthenaRpcCallOptions as f, type BackendType as g, Backend as h, AthenaGatewayError as i, isAthenaGatewayError as j, type AthenaRpcFilter as k, type AthenaRpcFilterOperator as l, type AthenaRpcOrder as m, type AthenaRpcPayload as n, type AthenaGatewayErrorCode as o, type AthenaGatewayHookConfig as p, type AthenaGatewayHookResult as q, type AthenaFetchPayload as r, type AthenaInsertPayload as s, type AthenaUpdatePayload as t, type AthenaDeletePayload as u, type AthenaGatewayResponse as v };
|
package/dist/index.cjs
CHANGED
|
@@ -2240,6 +2240,13 @@ function normalizeOutputConfig(output) {
|
|
|
2240
2240
|
}
|
|
2241
2241
|
};
|
|
2242
2242
|
}
|
|
2243
|
+
function isAthenaGeneratorConfig(value) {
|
|
2244
|
+
if (!value || typeof value !== "object") {
|
|
2245
|
+
return false;
|
|
2246
|
+
}
|
|
2247
|
+
const record = value;
|
|
2248
|
+
return Boolean(record.provider && typeof record.provider === "object") && Boolean(record.output && typeof record.output === "object");
|
|
2249
|
+
}
|
|
2243
2250
|
function normalizeGeneratorConfig(input) {
|
|
2244
2251
|
return {
|
|
2245
2252
|
provider: input.provider,
|
|
@@ -2271,18 +2278,41 @@ function findGeneratorConfigPath(cwd = process.cwd()) {
|
|
|
2271
2278
|
return void 0;
|
|
2272
2279
|
}
|
|
2273
2280
|
function extractConfigExport(module) {
|
|
2274
|
-
|
|
2275
|
-
|
|
2281
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2282
|
+
const queue = [module];
|
|
2283
|
+
while (queue.length > 0) {
|
|
2284
|
+
const current = queue.shift();
|
|
2285
|
+
if (!current || typeof current !== "object" || visited.has(current)) {
|
|
2286
|
+
continue;
|
|
2287
|
+
}
|
|
2288
|
+
visited.add(current);
|
|
2289
|
+
const record = current;
|
|
2290
|
+
if (isAthenaGeneratorConfig(record)) {
|
|
2291
|
+
return record;
|
|
2292
|
+
}
|
|
2276
2293
|
const defaultExport = record.default;
|
|
2277
2294
|
if (defaultExport && typeof defaultExport === "object") {
|
|
2278
|
-
|
|
2295
|
+
queue.push(defaultExport);
|
|
2279
2296
|
}
|
|
2280
2297
|
const namedConfigExport = record.config;
|
|
2281
2298
|
if (namedConfigExport && typeof namedConfigExport === "object") {
|
|
2282
|
-
|
|
2299
|
+
queue.push(namedConfigExport);
|
|
2300
|
+
}
|
|
2301
|
+
const moduleExports = record["module.exports"];
|
|
2302
|
+
if (moduleExports && typeof moduleExports === "object") {
|
|
2303
|
+
queue.push(moduleExports);
|
|
2283
2304
|
}
|
|
2284
2305
|
}
|
|
2285
|
-
throw new Error(
|
|
2306
|
+
throw new Error(
|
|
2307
|
+
"Generator config file must export a config object as default export or `config`."
|
|
2308
|
+
);
|
|
2309
|
+
}
|
|
2310
|
+
function importConfigModule(moduleSpecifier) {
|
|
2311
|
+
const runtimeImport = new Function(
|
|
2312
|
+
"moduleSpecifier",
|
|
2313
|
+
"return import(moduleSpecifier)"
|
|
2314
|
+
);
|
|
2315
|
+
return runtimeImport(moduleSpecifier);
|
|
2286
2316
|
}
|
|
2287
2317
|
async function loadGeneratorConfig(options = {}) {
|
|
2288
2318
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -2293,7 +2323,7 @@ async function loadGeneratorConfig(options = {}) {
|
|
|
2293
2323
|
);
|
|
2294
2324
|
}
|
|
2295
2325
|
const moduleUrl = url.pathToFileURL(resolvedPath);
|
|
2296
|
-
const module = await
|
|
2326
|
+
const module = await importConfigModule(`${moduleUrl.href}?cacheBust=${Date.now()}`);
|
|
2297
2327
|
const rawConfig = extractConfigExport(module);
|
|
2298
2328
|
return {
|
|
2299
2329
|
configPath: resolvedPath,
|