meridianjs 0.2.3 → 0.2.4
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/CHANGELOG.md +65 -160
- package/README.md +560 -93
- package/dist/analytics/collector.d.ts +28 -0
- package/dist/analytics/collector.d.ts.map +1 -0
- package/dist/analytics/collector.js +62 -0
- package/dist/analytics/collector.js.map +1 -0
- package/dist/analytics/index.d.ts +3 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +2 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +2 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +6 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +61 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/core/pipeline.d.ts +3 -1
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +25 -0
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/types.d.ts +37 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/debug/index.d.ts +3 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +2 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/recorder.d.ts +32 -0
- package/dist/debug/recorder.d.ts.map +1 -0
- package/dist/debug/recorder.js +76 -0
- package/dist/debug/recorder.js.map +1 -0
- package/dist/generator/cli.d.ts +20 -0
- package/dist/generator/cli.d.ts.map +1 -0
- package/dist/generator/cli.js +56 -0
- package/dist/generator/cli.js.map +1 -0
- package/dist/generator/index.d.ts +9 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +49 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/openapi.d.ts +13 -0
- package/dist/generator/openapi.d.ts.map +1 -0
- package/dist/generator/openapi.js +49 -0
- package/dist/generator/openapi.js.map +1 -0
- package/dist/generator/templates.d.ts +16 -0
- package/dist/generator/templates.d.ts.map +1 -0
- package/dist/generator/templates.js +290 -0
- package/dist/generator/templates.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -1
- package/dist/policies/builtin.d.ts +24 -0
- package/dist/policies/builtin.d.ts.map +1 -0
- package/dist/policies/builtin.js +94 -0
- package/dist/policies/builtin.js.map +1 -0
- package/dist/policies/index.d.ts +2 -0
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +2 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/public.d.ts +15 -0
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +15 -0
- package/dist/public.js.map +1 -1
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +2 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/monitor.d.ts +10 -0
- package/dist/schema/monitor.d.ts.map +1 -0
- package/dist/schema/monitor.js +46 -0
- package/dist/schema/monitor.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/service-client.d.ts +34 -0
- package/dist/services/service-client.d.ts.map +1 -0
- package/dist/services/service-client.js +156 -0
- package/dist/services/service-client.js.map +1 -0
- package/dist/transactions/index.d.ts +3 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +2 -0
- package/dist/transactions/index.js.map +1 -0
- package/dist/transactions/saga.d.ts +22 -0
- package/dist/transactions/saga.d.ts.map +1 -0
- package/dist/transactions/saga.js +58 -0
- package/dist/transactions/saga.js.map +1 -0
- package/dist/validation/drift-detector.d.ts.map +1 -1
- package/dist/validation/drift-detector.js +17 -8
- package/dist/validation/drift-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AC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,UAAU,KAAU,CAAC;IAErB,YAAY,CAAC,OAAe,IAAS,CAAC;IAEtC,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Meridian Generator CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx meridian generate --provider <name> [options]
|
|
7
|
+
*
|
|
8
|
+
* Options:
|
|
9
|
+
* --provider <name> Provider name, e.g. "myapi" (required)
|
|
10
|
+
* --openapi <path> Path to an OpenAPI 3.x JSON spec
|
|
11
|
+
* --base-url <url> Base URL override
|
|
12
|
+
* --auth <type> Auth type: apiKey | bearer | basic | oauth2
|
|
13
|
+
* --output <dir> Output directory (default: src/providers/<name>)
|
|
14
|
+
*
|
|
15
|
+
* Examples:
|
|
16
|
+
* npx meridian generate --provider acme --base-url https://api.acme.com
|
|
17
|
+
* npx meridian generate --provider acme --openapi ./acme-openapi.json
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/generator/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Meridian Generator CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx meridian generate --provider <name> [options]
|
|
7
|
+
*
|
|
8
|
+
* Options:
|
|
9
|
+
* --provider <name> Provider name, e.g. "myapi" (required)
|
|
10
|
+
* --openapi <path> Path to an OpenAPI 3.x JSON spec
|
|
11
|
+
* --base-url <url> Base URL override
|
|
12
|
+
* --auth <type> Auth type: apiKey | bearer | basic | oauth2
|
|
13
|
+
* --output <dir> Output directory (default: src/providers/<name>)
|
|
14
|
+
*
|
|
15
|
+
* Examples:
|
|
16
|
+
* npx meridian generate --provider acme --base-url https://api.acme.com
|
|
17
|
+
* npx meridian generate --provider acme --openapi ./acme-openapi.json
|
|
18
|
+
*/
|
|
19
|
+
import { generate } from "./index.js";
|
|
20
|
+
function parseArgs(argv) {
|
|
21
|
+
const out = {};
|
|
22
|
+
for (let i = 0; i < argv.length; i++) {
|
|
23
|
+
const arg = argv[i];
|
|
24
|
+
if (arg?.startsWith("--") && i + 1 < argv.length) {
|
|
25
|
+
const key = arg.slice(2);
|
|
26
|
+
out[key] = argv[i + 1] ?? "";
|
|
27
|
+
i++;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
const args = process.argv.slice(2);
|
|
33
|
+
if (args[0] !== "generate" && args[0] !== "gen") {
|
|
34
|
+
process.stderr.write("Usage: meridian generate --provider <name> [--openapi <path>] [--base-url <url>] [--auth <type>]\n");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const flags = parseArgs(args.slice(1));
|
|
38
|
+
if (!flags.provider) {
|
|
39
|
+
process.stderr.write("Error: --provider is required\n");
|
|
40
|
+
process.stderr.write("Example: meridian generate --provider myapi --base-url https://api.myapi.com\n");
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const opts = { provider: flags.provider };
|
|
44
|
+
if (flags.openapi !== undefined)
|
|
45
|
+
opts.openapi = flags.openapi;
|
|
46
|
+
if (flags["base-url"] !== undefined)
|
|
47
|
+
opts.baseUrl = flags["base-url"];
|
|
48
|
+
if (flags.auth !== undefined)
|
|
49
|
+
opts.auth = flags.auth;
|
|
50
|
+
if (flags.output !== undefined)
|
|
51
|
+
opts.output = flags.output;
|
|
52
|
+
generate(opts).catch((err) => {
|
|
53
|
+
process.stderr.write(`Error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/generator/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACjD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7B,CAAC,EAAE,CAAC;QACN,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,IA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,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface GeneratorOptions {
|
|
2
|
+
provider: string;
|
|
3
|
+
openapi?: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
auth?: "apiKey" | "bearer" | "basic" | "oauth2";
|
|
6
|
+
output?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function generate(opts: GeneratorOptions): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDpE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parseOpenAPI } from "./openapi.js";
|
|
4
|
+
import { generateAdapter, generateIndex, generatePagination, generateTest } from "./templates.js";
|
|
5
|
+
export async function generate(opts) {
|
|
6
|
+
const { provider } = opts;
|
|
7
|
+
const outputDir = opts.output ?? join("src", "providers", provider);
|
|
8
|
+
let ctx = {
|
|
9
|
+
provider,
|
|
10
|
+
baseUrl: opts.baseUrl ?? `https://api.${provider}.com`,
|
|
11
|
+
authType: opts.auth ?? "apiKey",
|
|
12
|
+
authKeyName: "apiKey",
|
|
13
|
+
endpoints: [],
|
|
14
|
+
};
|
|
15
|
+
if (opts.openapi) {
|
|
16
|
+
const raw = await readFile(opts.openapi, "utf-8");
|
|
17
|
+
const spec = parseOpenAPI(JSON.parse(raw));
|
|
18
|
+
ctx = {
|
|
19
|
+
provider,
|
|
20
|
+
baseUrl: opts.baseUrl ?? spec.baseUrl,
|
|
21
|
+
authType: opts.auth ?? spec.authType,
|
|
22
|
+
authKeyName: spec.authKeyName,
|
|
23
|
+
endpoints: spec.endpoints,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
await mkdir(outputDir, { recursive: true });
|
|
27
|
+
await Promise.all([
|
|
28
|
+
writeFile(join(outputDir, "adapter.ts"), generateAdapter(ctx), "utf-8"),
|
|
29
|
+
writeFile(join(outputDir, "adapter.test.ts"), generateTest(ctx), "utf-8"),
|
|
30
|
+
writeFile(join(outputDir, "pagination.ts"), generatePagination(ctx), "utf-8"),
|
|
31
|
+
writeFile(join(outputDir, "index.ts"), generateIndex(ctx), "utf-8"),
|
|
32
|
+
]);
|
|
33
|
+
const lines = [
|
|
34
|
+
`✓ Generated adapter for "${provider}" → ${outputDir}/`,
|
|
35
|
+
" adapter.ts core adapter (auth, error mapping, rate-limit headers)",
|
|
36
|
+
" adapter.test.ts 8 tests that pass immediately",
|
|
37
|
+
" pagination.ts pagination strategy stub",
|
|
38
|
+
" index.ts barrel export",
|
|
39
|
+
"",
|
|
40
|
+
"Next steps:",
|
|
41
|
+
` 1. Add "${provider}" to BUILTIN_ADAPTER_CLASSES in src/index.ts`,
|
|
42
|
+
" 2. Fill in the TODO comments in adapter.ts and pagination.ts",
|
|
43
|
+
` 3. npm test -- --reporter=verbose src/providers/${provider}/adapter.test.ts`,
|
|
44
|
+
];
|
|
45
|
+
for (const line of lines) {
|
|
46
|
+
process.stdout.write(`${line}\n`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generator/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CAAC,CAAC;IAE5C,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;QACvE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;QACzE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;QAC7E,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;KACpE,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG;QACZ,6BAA6B,QAAQ,OAAO,SAAS,GAAG;QACxD,4EAA4E;QAC5E,mDAAmD;QACnD,8CAA8C;QAC9C,mCAAmC;QACnC,EAAE;QACF,aAAa;QACb,aAAa,QAAQ,8CAA8C;QACnE,gEAAgE;QAChE,qDAAqD,QAAQ,kBAAkB;KAChF,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ParsedSpec {
|
|
2
|
+
title: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
authType: "apiKey" | "bearer" | "basic" | "oauth2";
|
|
5
|
+
authKeyName: string;
|
|
6
|
+
endpoints: Array<{
|
|
7
|
+
method: string;
|
|
8
|
+
path: string;
|
|
9
|
+
operationId?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseOpenAPI(doc: unknown): ParsedSpec;
|
|
13
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/generator/openapi.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAkDrD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function parseOpenAPI(doc) {
|
|
2
|
+
const spec = doc;
|
|
3
|
+
const title = spec.info?.title ?? "Unknown";
|
|
4
|
+
let baseUrl = "https://api.example.com";
|
|
5
|
+
if (spec.servers?.[0]?.url) {
|
|
6
|
+
baseUrl = spec.servers[0].url;
|
|
7
|
+
}
|
|
8
|
+
else if (spec.host) {
|
|
9
|
+
baseUrl = `https://${spec.host}${spec.basePath ?? ""}`;
|
|
10
|
+
}
|
|
11
|
+
let authType = "apiKey";
|
|
12
|
+
let authKeyName = "apiKey";
|
|
13
|
+
const schemes = spec.components?.securitySchemes ?? spec.securityDefinitions ?? {};
|
|
14
|
+
for (const scheme of Object.values(schemes)) {
|
|
15
|
+
if (scheme.type === "http" && scheme.scheme === "basic") {
|
|
16
|
+
authType = "basic";
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
if (scheme.type === "http" && scheme.scheme === "bearer") {
|
|
20
|
+
authType = "bearer";
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
if (scheme.type === "oauth2") {
|
|
24
|
+
authType = "oauth2";
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
if (scheme.type === "apiKey") {
|
|
28
|
+
authType = "apiKey";
|
|
29
|
+
authKeyName = scheme.name ?? "x-api-key";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const endpoints = [];
|
|
33
|
+
const httpMethods = new Set(["get", "post", "put", "patch", "delete"]);
|
|
34
|
+
for (const [path, methods] of Object.entries(spec.paths ?? {})) {
|
|
35
|
+
for (const [method, op] of Object.entries(methods)) {
|
|
36
|
+
if (httpMethods.has(method)) {
|
|
37
|
+
const ep = {
|
|
38
|
+
method: method.toUpperCase(),
|
|
39
|
+
path,
|
|
40
|
+
};
|
|
41
|
+
if (op.operationId !== undefined)
|
|
42
|
+
ep.operationId = op.operationId;
|
|
43
|
+
endpoints.push(ep);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { title, baseUrl, authType, authKeyName, endpoints };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=openapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../src/generator/openapi.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,MAAM,IAAI,GAAG,GAAiB,CAAC;IAE/B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,SAAS,CAAC;IAE5C,IAAI,OAAO,GAAG,yBAAyB,CAAC;IACxC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC3B,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAChC,CAAC;SAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,GAAG,WAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;IACzD,CAAC;IAED,IAAI,QAAQ,GAA2B,Q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EAAE,CAAC;gBAC5B,MAAM,EAAE,GAA2D;oBACjE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;oBAC5B,IAAI;iBACL,CAAC;gBACF,IAAI,EAAE,CAAC,WAAW,KAAK,SAAS;oBAAE,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC;gBAClE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface GeneratorContext {
|
|
2
|
+
provider: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
authType: "apiKey" | "bearer" | "basic" | "oauth2";
|
|
5
|
+
authKeyName: string;
|
|
6
|
+
endpoints: Array<{
|
|
7
|
+
method: string;
|
|
8
|
+
path: string;
|
|
9
|
+
operationId?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare function generateAdapter(ctx: GeneratorContext): string;
|
|
13
|
+
export declare function generatePagination(ctx: GeneratorContext): string;
|
|
14
|
+
export declare function generateIndex(ctx: GeneratorContext): string;
|
|
15
|
+
export declare function generateTest(ctx: GeneratorContext): string;
|
|
16
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/generator/templates.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E;AAwCD,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAqH7D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAiChE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAI3D;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAoG1D"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
function pascal(name) {
|
|
2
|
+
return name
|
|
3
|
+
.split(/[-_\s]+/)
|
|
4
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
5
|
+
.join("");
|
|
6
|
+
}
|
|
7
|
+
function authHeaderLine(ctx) {
|
|
8
|
+
if (ctx.authType === "basic") {
|
|
9
|
+
return `"Authorization": \`Basic \${Buffer.from(\`\${authToken.token}:\${authToken.secret ?? ""}\`).toString("base64")}\``;
|
|
10
|
+
}
|
|
11
|
+
return '"Authorization": `Bearer ${authToken.token}`';
|
|
12
|
+
}
|
|
13
|
+
function authStrategyBody(ctx) {
|
|
14
|
+
const className = `${pascal(ctx.provider)}`;
|
|
15
|
+
if (ctx.authType === "basic") {
|
|
16
|
+
return ` const user = config.username ?? config.apiKey ?? "";
|
|
17
|
+
const pass = config.password ?? "";
|
|
18
|
+
if (!user) throw new Error("${className}: username or apiKey is required");
|
|
19
|
+
return { token: user, secret: pass };`;
|
|
20
|
+
}
|
|
21
|
+
return ` const key = config.apiKey ?? config.token ?? "";
|
|
22
|
+
if (!key) throw new Error("${className}: apiKey or token is required");
|
|
23
|
+
return { token: key };`;
|
|
24
|
+
}
|
|
25
|
+
function endpointComments(ctx) {
|
|
26
|
+
if (ctx.endpoints.length === 0)
|
|
27
|
+
return "";
|
|
28
|
+
const lines = ctx.endpoints
|
|
29
|
+
.slice(0, 20)
|
|
30
|
+
.map((e) => ` // ${e.method.padEnd(7)} ${e.path}${e.operationId ? ` (${e.operationId})` : ""}`)
|
|
31
|
+
.join("\n");
|
|
32
|
+
return `\n // Known endpoints from OpenAPI spec:\n${lines}\n`;
|
|
33
|
+
}
|
|
34
|
+
export function generateAdapter(ctx) {
|
|
35
|
+
const name = pascal(ctx.provider);
|
|
36
|
+
return `import { ResponseNormalizer } from "../../core/normalizer.js";
|
|
37
|
+
import type {
|
|
38
|
+
AdapterInput,
|
|
39
|
+
AuthConfig,
|
|
40
|
+
AuthToken,
|
|
41
|
+
BuiltRequest,
|
|
42
|
+
IdempotencyConfig,
|
|
43
|
+
NormalizedResponse,
|
|
44
|
+
PaginationStrategy,
|
|
45
|
+
ProviderAdapter,
|
|
46
|
+
RateLimitInfo,
|
|
47
|
+
RawResponse,
|
|
48
|
+
} from "../../core/types.js";
|
|
49
|
+
import { MeridianError, SDK_VERSION } from "../../core/types.js";
|
|
50
|
+
import { ${name}PaginationStrategy } from "./pagination.js";
|
|
51
|
+
${endpointComments(ctx)}
|
|
52
|
+
export class ${name}Adapter implements ProviderAdapter {
|
|
53
|
+
private baseUrl: string;
|
|
54
|
+
|
|
55
|
+
constructor(baseUrl = "${ctx.baseUrl}") {
|
|
56
|
+
this.baseUrl = baseUrl;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
buildRequest(input: AdapterInput): BuiltRequest {
|
|
60
|
+
const { endpoint, options, authToken, baseUrl } = input;
|
|
61
|
+
const effectiveBaseUrl = baseUrl ?? this.baseUrl;
|
|
62
|
+
|
|
63
|
+
const url = new URL(endpoint, effectiveBaseUrl);
|
|
64
|
+
|
|
65
|
+
if (options.query) {
|
|
66
|
+
for (const [key, value] of Object.entries(options.query)) {
|
|
67
|
+
url.searchParams.set(key, String(value));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const headers: Record<string, string> = {
|
|
72
|
+
${authHeaderLine(ctx)},
|
|
73
|
+
"User-Agent": \`Meridian-SDK/\${SDK_VERSION}\`,
|
|
74
|
+
"Content-Type": "application/json",
|
|
75
|
+
...options.headers,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
let body: string | undefined;
|
|
79
|
+
const method = options.method ?? "GET";
|
|
80
|
+
if (options.body && method !== "GET" && method !== "HEAD") {
|
|
81
|
+
body = JSON.stringify(options.body);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const built: BuiltRequest = { url: url.toString(), method, headers };
|
|
85
|
+
if (body !== undefined) built.body = body;
|
|
86
|
+
return built;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
parseResponse(raw: RawResponse): NormalizedResponse {
|
|
90
|
+
return new ResponseNormalizer("${ctx.provider}").normalize(raw);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
parseError(raw: unknown): MeridianError {
|
|
94
|
+
if (typeof raw === "object" && raw !== null && "status" in raw) {
|
|
95
|
+
const status = (raw as { status: number }).status;
|
|
96
|
+
const body = (raw as { body?: unknown }).body;
|
|
97
|
+
|
|
98
|
+
// TODO: extract provider-specific error message from body
|
|
99
|
+
const message =
|
|
100
|
+
typeof body === "object" && body !== null && "message" in body
|
|
101
|
+
? String((body as { message: unknown }).message)
|
|
102
|
+
: \`HTTP \${status}\`;
|
|
103
|
+
|
|
104
|
+
if (status === 401 || status === 403) {
|
|
105
|
+
return new MeridianError(message, "auth", "${ctx.provider}", false, "", {}, undefined, status);
|
|
106
|
+
}
|
|
107
|
+
if (status === 429) {
|
|
108
|
+
return new MeridianError(message, "rate_limit", "${ctx.provider}", true, "", {}, undefined, status);
|
|
109
|
+
}
|
|
110
|
+
if (status >= 400 && status < 500) {
|
|
111
|
+
return new MeridianError(message, "validation", "${ctx.provider}", false, "", {}, undefined, status);
|
|
112
|
+
}
|
|
113
|
+
if (status >= 500) {
|
|
114
|
+
return new MeridianError(message, "provider", "${ctx.provider}", true, "", {}, undefined, status);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (raw instanceof Error) {
|
|
118
|
+
return new MeridianError(raw.message, "network", "${ctx.provider}", true);
|
|
119
|
+
}
|
|
120
|
+
return new MeridianError("Unknown error", "provider", "${ctx.provider}", false);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async authStrategy(config: AuthConfig): Promise<AuthToken> {
|
|
124
|
+
${authStrategyBody(ctx)}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
rateLimitPolicy(headers: Headers): RateLimitInfo {
|
|
128
|
+
// TODO: verify ${ctx.provider} rate-limit header names
|
|
129
|
+
const reset = Number(headers.get("x-ratelimit-reset") ?? headers.get("x-rate-limit-reset") ?? 0);
|
|
130
|
+
return {
|
|
131
|
+
limit: Number(headers.get("x-ratelimit-limit") ?? headers.get("x-rate-limit-limit") ?? 100),
|
|
132
|
+
remaining: Number(
|
|
133
|
+
headers.get("x-ratelimit-remaining") ?? headers.get("x-rate-limit-remaining") ?? 100,
|
|
134
|
+
),
|
|
135
|
+
reset: new Date(reset > 1_000_000_000 ? reset * 1000 : Date.now() + 60_000),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
paginationStrategy(): PaginationStrategy {
|
|
140
|
+
return new ${name}PaginationStrategy();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
getIdempotencyConfig(): IdempotencyConfig {
|
|
144
|
+
return {
|
|
145
|
+
defaultSafeOperations: new Set(["GET", "HEAD"]),
|
|
146
|
+
operationOverrides: new Map(),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
export function generatePagination(ctx) {
|
|
153
|
+
const name = pascal(ctx.provider);
|
|
154
|
+
return `import type { PaginationStrategy, RawResponse, RequestOptions } from "../../core/types.js";
|
|
155
|
+
|
|
156
|
+
export class ${name}PaginationStrategy implements PaginationStrategy {
|
|
157
|
+
extractCursor(response: RawResponse): string | null {
|
|
158
|
+
// TODO: update with actual ${ctx.provider} pagination field names
|
|
159
|
+
const body = response.body as Record<string, unknown>;
|
|
160
|
+
return (body.next_cursor as string) ?? (body.cursor as string) ?? (body.next as string) ?? null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
extractTotal(response: RawResponse): number | null {
|
|
164
|
+
const body = response.body as Record<string, unknown>;
|
|
165
|
+
return typeof body.total === "number" ? body.total : null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
hasNext(response: RawResponse): boolean {
|
|
169
|
+
return this.extractCursor(response) !== null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
buildNextRequest(
|
|
173
|
+
endpoint: string,
|
|
174
|
+
options: RequestOptions,
|
|
175
|
+
cursor: string,
|
|
176
|
+
): { endpoint: string; options: RequestOptions } {
|
|
177
|
+
// TODO: update with the actual ${ctx.provider} cursor param name
|
|
178
|
+
return {
|
|
179
|
+
endpoint,
|
|
180
|
+
options: { ...options, query: { ...options.query, cursor } },
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
export function generateIndex(ctx) {
|
|
187
|
+
const name = pascal(ctx.provider);
|
|
188
|
+
return `export { ${name}Adapter } from "./adapter.js";
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
export function generateTest(ctx) {
|
|
192
|
+
const name = pascal(ctx.provider);
|
|
193
|
+
const authArg = ctx.authType === "basic"
|
|
194
|
+
? "{ username: 'testuser', password: 'testpass' }"
|
|
195
|
+
: "{ apiKey: 'test-key' }";
|
|
196
|
+
return `import { describe, expect, it } from "vitest";
|
|
197
|
+
import { ${name}Adapter } from "./adapter.js";
|
|
198
|
+
|
|
199
|
+
const adapter = new ${name}Adapter();
|
|
200
|
+
|
|
201
|
+
describe("${name}Adapter", () => {
|
|
202
|
+
describe("buildRequest", () => {
|
|
203
|
+
it("builds a GET request with auth header", () => {
|
|
204
|
+
const req = adapter.buildRequest({
|
|
205
|
+
endpoint: "/test",
|
|
206
|
+
options: { method: "GET" },
|
|
207
|
+
authToken: { token: "test-key" },
|
|
208
|
+
});
|
|
209
|
+
expect(req.url).toContain("/test");
|
|
210
|
+
expect(req.method).toBe("GET");
|
|
211
|
+
expect(req.headers["Authorization"]).toBeDefined();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("appends query parameters", () => {
|
|
215
|
+
const req = adapter.buildRequest({
|
|
216
|
+
endpoint: "/test",
|
|
217
|
+
options: { method: "GET", query: { page: 1, limit: 10 } },
|
|
218
|
+
authToken: { token: "test-key" },
|
|
219
|
+
});
|
|
220
|
+
expect(req.url).toContain("page=1");
|
|
221
|
+
expect(req.url).toContain("limit=10");
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("serialises POST body as JSON", () => {
|
|
225
|
+
const req = adapter.buildRequest({
|
|
226
|
+
endpoint: "/test",
|
|
227
|
+
options: { method: "POST", body: { name: "test" } },
|
|
228
|
+
authToken: { token: "test-key" },
|
|
229
|
+
});
|
|
230
|
+
expect(req.body).toBe(JSON.stringify({ name: "test" }));
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("omits body for GET requests", () => {
|
|
234
|
+
const req = adapter.buildRequest({
|
|
235
|
+
endpoint: "/test",
|
|
236
|
+
options: { method: "GET", body: { should: "be-ignored" } },
|
|
237
|
+
authToken: { token: "test-key" },
|
|
238
|
+
});
|
|
239
|
+
expect(req.body).toBeUndefined();
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
describe("parseError", () => {
|
|
244
|
+
it("returns auth error for 401", () => {
|
|
245
|
+
const err = adapter.parseError({ status: 401, headers: new Headers(), body: {} });
|
|
246
|
+
expect(err.category).toBe("auth");
|
|
247
|
+
expect(err.retryable).toBe(false);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("returns auth error for 403", () => {
|
|
251
|
+
const err = adapter.parseError({ status: 403, headers: new Headers(), body: {} });
|
|
252
|
+
expect(err.category).toBe("auth");
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("returns rate_limit error for 429", () => {
|
|
256
|
+
const err = adapter.parseError({ status: 429, headers: new Headers(), body: {} });
|
|
257
|
+
expect(err.category).toBe("rate_limit");
|
|
258
|
+
expect(err.retryable).toBe(true);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it("returns retryable provider error for 500", () => {
|
|
262
|
+
const err = adapter.parseError({ status: 500, headers: new Headers(), body: {} });
|
|
263
|
+
expect(err.category).toBe("provider");
|
|
264
|
+
expect(err.retryable).toBe(true);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("extracts message from error body", () => {
|
|
268
|
+
const err = adapter.parseError({
|
|
269
|
+
status: 400,
|
|
270
|
+
headers: new Headers(),
|
|
271
|
+
body: { message: "Invalid request" },
|
|
272
|
+
});
|
|
273
|
+
expect(err.message).toBe("Invalid request");
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
describe("authStrategy", () => {
|
|
278
|
+
it("throws when no credentials provided", async () => {
|
|
279
|
+
await expect(adapter.authStrategy({})).rejects.toThrow();
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("resolves token from config", async () => {
|
|
283
|
+
const token = await adapter.authStrategy(${authArg});
|
|
284
|
+
expect(token.token).toBeTruthy();
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
`;
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/generator/templates.ts"],"names":[],"mappings":"AAQA,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI;SACR,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,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C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { type StreamChunk } from "./core/streaming.js";
|
|
|
2
2
|
import type { BatchRequest, CircuitBreakerStatus, MeridianConfig, NormalizedResponse, ProviderConfig, RequestOptions } from "./core/types.js";
|
|
3
3
|
import { MeridianError } from "./core/types.js";
|
|
4
4
|
import type { ProviderAdapter } from "./core/types.js";
|
|
5
|
+
import { CircuitState } from "./core/types.js";
|
|
6
|
+
import { DebugRecorder } from "./debug/recorder.js";
|
|
7
|
+
import { SchemaMonitor } from "./schema/monitor.js";
|
|
8
|
+
import { ServiceClient } from "./services/service-client.js";
|
|
9
|
+
import type { TransactionResult, TransactionStep } from "./transactions/saga.js";
|
|
5
10
|
export declare const BUILTIN_ADAPTER_CLASSES: Record<string, new () => ProviderAdapter>;
|
|
6
11
|
export interface ProviderClient {
|
|
7
12
|
get<T = unknown>(endpoint: string, options?: RequestOptions): Promise<NormalizedResponse<T>>;
|
|
@@ -21,6 +26,10 @@ export declare class Meridian {
|
|
|
21
26
|
private adapters;
|
|
22
27
|
private started;
|
|
23
28
|
private adapterCache;
|
|
29
|
+
private serviceClients;
|
|
30
|
+
private analyticsCollector;
|
|
31
|
+
private debugRecorder;
|
|
32
|
+
private _schemaMonitor;
|
|
24
33
|
private constructor();
|
|
25
34
|
static create(config: MeridianConfig, adapters?: Map<string, ProviderAdapter>): Promise<Meridian>;
|
|
26
35
|
private emitLocalStateWarning;
|
|
@@ -68,6 +77,28 @@ export declare class Meridian {
|
|
|
68
77
|
provider(name: "mollie"): ProviderClient | undefined;
|
|
69
78
|
provider(name: "apollo"): ProviderClient | undefined;
|
|
70
79
|
provider(name: string): ProviderClient | undefined;
|
|
80
|
+
service(name: string): ServiceClient | undefined;
|
|
81
|
+
analytics(): Record<string, import("./analytics/collector.js").ProviderStats>;
|
|
82
|
+
health(): Record<string, {
|
|
83
|
+
status: "healthy" | "degraded" | "down";
|
|
84
|
+
successRate: string;
|
|
85
|
+
avgLatency: number;
|
|
86
|
+
circuitBreaker: CircuitState;
|
|
87
|
+
}>;
|
|
88
|
+
providers(): Array<{
|
|
89
|
+
name: string;
|
|
90
|
+
capabilities: string[];
|
|
91
|
+
}>;
|
|
92
|
+
findProviders(filter: {
|
|
93
|
+
capability: string;
|
|
94
|
+
}): Array<{
|
|
95
|
+
name: string;
|
|
96
|
+
capabilities: string[];
|
|
97
|
+
}>;
|
|
98
|
+
get debug(): DebugRecorder;
|
|
99
|
+
replay(requestId: string): Promise<NormalizedResponse<unknown>>;
|
|
100
|
+
get schema(): SchemaMonitor;
|
|
101
|
+
transaction(steps: TransactionStep[]): Promise<TransactionResult>;
|
|
71
102
|
registerProvider(name: string, adapter: ProviderAdapter, config: ProviderConfig): Promise<void>;
|
|
72
103
|
start(): Promise<void>;
|
|
73
104
|
private ensureStarted;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAElB,cAAc,EACd,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAoB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAElB,cAAc,EACd,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAoB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK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