@abapify/openai-codegen 0.4.17 → 0.4.21
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/cli.d.mts +1 -3
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +2 -3
- package/dist/{generate-BobARM00.mjs → generate-DgXsowgP.mjs} +21 -41
- package/dist/{generate-BobARM00.mjs.map → generate-DgXsowgP.mjs.map} +1 -1
- package/dist/index.d.mts +1 -51
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -17
- package/dist/index.mjs.map +1 -1
- package/dist/{naming-9hJCZKjv.d.mts → naming-D7P_Kp_Q.d.mts} +1 -3
- package/dist/naming-D7P_Kp_Q.d.mts.map +1 -0
- package/package.json +3 -3
- package/dist/naming-9hJCZKjv.d.mts.map +0 -1
package/dist/cli.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { r as ResolvedNames, t as NamesConfig } from "./naming-
|
|
1
|
+
import { r as ResolvedNames, t as NamesConfig } from "./naming-D7P_Kp_Q.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
//#region src/cli.d.ts
|
|
4
3
|
declare const SUPPORTED_FORMATS: readonly ["abapgit", "gcts"];
|
|
5
4
|
type SupportedFormat = (typeof SUPPORTED_FORMATS)[number];
|
|
6
5
|
/**
|
|
@@ -39,6 +38,5 @@ declare function buildCliRunOptions(raw: RawCliOptions): CliRunOptions;
|
|
|
39
38
|
*/
|
|
40
39
|
declare const buildGenerateOptions: typeof buildCliRunOptions;
|
|
41
40
|
declare function buildProgram(): Command;
|
|
42
|
-
//#endregion
|
|
43
41
|
export { CliRunOptions, GenerateOptions, SupportedFormat, buildCliRunOptions, buildGenerateOptions, buildProgram };
|
|
44
42
|
//# sourceMappingURL=cli.d.mts.map
|
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";;cAkBM;KACM,0BAA0B;;;;;;UAOrB;EACf;EACA;EACA,aAAa;EACb,OAAO;EACP,kBAAkB;EAClB;EACA;;;KAIU,gBAAgB;UAElB;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAyCc,mBAAmB,KAAK,gBAAgB;;;;;;cAsC3C,6BAAoB;iBAEjB,gBAAgB"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { h as resolveNames, m as NamesConfigError, t as generate } from "./generate-
|
|
2
|
+
import { h as resolveNames, m as NamesConfigError, t as generate } from "./generate-DgXsowgP.mjs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/cli.ts
|
|
7
7
|
/**
|
|
8
8
|
* openai-codegen CLI (v2).
|
|
9
9
|
*
|
|
@@ -111,6 +111,5 @@ if ((() => {
|
|
|
111
111
|
}
|
|
112
112
|
})()) main(process.argv);
|
|
113
113
|
|
|
114
|
-
//#endregion
|
|
115
114
|
export { buildCliRunOptions, buildGenerateOptions, buildProgram };
|
|
116
115
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -5,13 +5,12 @@ import { createHash } from "node:crypto";
|
|
|
5
5
|
import { assign, attributeDef, builtinType, call, classDef, comment, enumType, identifierExpr, interfaceDef, literal, methodDef, methodImpl, methodParam, namedTypeRef, print, raw, section, structureType, tableType, typeDef } from "@abapify/abap-ast";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/oas/types.ts
|
|
9
9
|
function isRef(x) {
|
|
10
10
|
return typeof x === "object" && x !== null && typeof x.$ref === "string";
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
//#region src/oas/load.ts
|
|
13
|
+
// src/oas/load.ts
|
|
15
14
|
const HTTP_METHODS = [
|
|
16
15
|
"get",
|
|
17
16
|
"post",
|
|
@@ -381,8 +380,7 @@ function synthesizeOperationId(method, path) {
|
|
|
381
380
|
return `${method}_${out.slice(start, end).join("")}`;
|
|
382
381
|
}
|
|
383
382
|
|
|
384
|
-
|
|
385
|
-
//#region src/types/naming.ts
|
|
383
|
+
// src/types/naming.ts
|
|
386
384
|
const DEFAULT_MAX_LEN = 30;
|
|
387
385
|
/** Split an identifier on camelCase boundaries, non-alnum runs, and digits-prev-letter. */
|
|
388
386
|
function splitWords(raw) {
|
|
@@ -439,8 +437,7 @@ function makeNameAllocator(usedNames) {
|
|
|
439
437
|
};
|
|
440
438
|
}
|
|
441
439
|
|
|
442
|
-
|
|
443
|
-
//#region src/types/errors.ts
|
|
440
|
+
// src/types/errors.ts
|
|
444
441
|
var CyclicTypeError = class extends Error {
|
|
445
442
|
constructor(message) {
|
|
446
443
|
super(message);
|
|
@@ -460,8 +457,7 @@ var UnsupportedSchemaError = class extends Error {
|
|
|
460
457
|
}
|
|
461
458
|
};
|
|
462
459
|
|
|
463
|
-
|
|
464
|
-
//#region src/types/plan.ts
|
|
460
|
+
// src/types/plan.ts
|
|
465
461
|
function isRecord$3(x) {
|
|
466
462
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
467
463
|
}
|
|
@@ -680,8 +676,7 @@ function topoSort(entries) {
|
|
|
680
676
|
return out;
|
|
681
677
|
}
|
|
682
678
|
|
|
683
|
-
|
|
684
|
-
//#region src/types/map.ts
|
|
679
|
+
// src/types/map.ts
|
|
685
680
|
function isRecord$2(x) {
|
|
686
681
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
687
682
|
}
|
|
@@ -937,8 +932,7 @@ function mapSchemaToTypeDef(entry, plan) {
|
|
|
937
932
|
}) };
|
|
938
933
|
}
|
|
939
934
|
|
|
940
|
-
|
|
941
|
-
//#region src/emit/naming.ts
|
|
935
|
+
// src/emit/naming.ts
|
|
942
936
|
var NamesConfigError = class extends Error {
|
|
943
937
|
constructor(message) {
|
|
944
938
|
super(message);
|
|
@@ -1014,8 +1008,7 @@ function resolveNames(config) {
|
|
|
1014
1008
|
return resolved;
|
|
1015
1009
|
}
|
|
1016
1010
|
|
|
1017
|
-
|
|
1018
|
-
//#region src/emit/types-interface.ts
|
|
1011
|
+
// src/emit/types-interface.ts
|
|
1019
1012
|
/**
|
|
1020
1013
|
* Layer-1 types interface emitter.
|
|
1021
1014
|
*
|
|
@@ -1408,8 +1401,7 @@ function mapPrimitiveLocal(schema) {
|
|
|
1408
1401
|
return "string";
|
|
1409
1402
|
}
|
|
1410
1403
|
|
|
1411
|
-
|
|
1412
|
-
//#region src/emit/operations-interface.ts
|
|
1404
|
+
// src/emit/operations-interface.ts
|
|
1413
1405
|
/**
|
|
1414
1406
|
* Layer 2 emitter — OPERATIONS INTERFACE (`ZIF_<base>`).
|
|
1415
1407
|
*
|
|
@@ -1753,8 +1745,7 @@ function renderTypeRefSource(ref) {
|
|
|
1753
1745
|
}
|
|
1754
1746
|
}
|
|
1755
1747
|
|
|
1756
|
-
|
|
1757
|
-
//#region src/emit/exception-class.ts
|
|
1748
|
+
// src/emit/exception-class.ts
|
|
1758
1749
|
/**
|
|
1759
1750
|
* Emit the generated ABAP exception class that carries HTTP error detail
|
|
1760
1751
|
* (status code, reason phrase, raw body, response headers).
|
|
@@ -1879,8 +1870,7 @@ function emitExceptionClass(opts) {
|
|
|
1879
1870
|
}) };
|
|
1880
1871
|
}
|
|
1881
1872
|
|
|
1882
|
-
|
|
1883
|
-
//#region src/emit/templates/locals-def.abap.ts
|
|
1873
|
+
// src/emit/templates/locals-def.abap.ts
|
|
1884
1874
|
function buildLocalsDef(names) {
|
|
1885
1875
|
const { localJsonClass: JSON_CLS, localJsonParserClass: JSON_PARSER, localResponseClass: RESPONSE, localHttpClass: HTTP } = names;
|
|
1886
1876
|
names.exceptionClass;
|
|
@@ -1977,8 +1967,7 @@ ENDCLASS.
|
|
|
1977
1967
|
`;
|
|
1978
1968
|
}
|
|
1979
1969
|
|
|
1980
|
-
|
|
1981
|
-
//#region src/emit/templates/locals-imp.abap.ts
|
|
1970
|
+
// src/emit/templates/locals-imp.abap.ts
|
|
1982
1971
|
function buildLocalsImp(names) {
|
|
1983
1972
|
const { localJsonClass: JSON_CLS, localJsonParserClass: JSON_PARSER, localResponseClass: RESPONSE, localHttpClass: HTTP } = names;
|
|
1984
1973
|
return `* Generated by @abapify/openai-codegen - local class implementations.
|
|
@@ -2182,8 +2171,7 @@ ENDCLASS.
|
|
|
2182
2171
|
`;
|
|
2183
2172
|
}
|
|
2184
2173
|
|
|
2185
|
-
|
|
2186
|
-
//#region src/emit/local-classes.ts
|
|
2174
|
+
// src/emit/local-classes.ts
|
|
2187
2175
|
function emitLocalClasses(names) {
|
|
2188
2176
|
const templateNames = {
|
|
2189
2177
|
exceptionClass: names.exceptionClass,
|
|
@@ -2198,8 +2186,7 @@ function emitLocalClasses(names) {
|
|
|
2198
2186
|
};
|
|
2199
2187
|
}
|
|
2200
2188
|
|
|
2201
|
-
|
|
2202
|
-
//#region src/emit/response-mapper.ts
|
|
2189
|
+
// src/emit/response-mapper.ts
|
|
2203
2190
|
/**
|
|
2204
2191
|
* Response-mapper for openai-codegen v2.
|
|
2205
2192
|
*
|
|
@@ -2302,8 +2289,7 @@ function mapResponseHandling(operation, opts) {
|
|
|
2302
2289
|
};
|
|
2303
2290
|
}
|
|
2304
2291
|
|
|
2305
|
-
|
|
2306
|
-
//#region src/format/validate.ts
|
|
2292
|
+
// src/format/validate.ts
|
|
2307
2293
|
/**
|
|
2308
2294
|
* ABAP identifier validation shared by all format writers.
|
|
2309
2295
|
*
|
|
@@ -2319,8 +2305,7 @@ function assertValidClassName(name) {
|
|
|
2319
2305
|
if (!/^[ZY][A-Z0-9_]*$/.test(name)) throw new Error(`Invalid ABAP class name '${name}': must be uppercase, start with Z or Y, and contain only A-Z, 0-9, _`);
|
|
2320
2306
|
}
|
|
2321
2307
|
|
|
2322
|
-
|
|
2323
|
-
//#region src/format/abapgit.ts
|
|
2308
|
+
// src/format/abapgit.ts
|
|
2324
2309
|
/**
|
|
2325
2310
|
* abapGit format writer.
|
|
2326
2311
|
*
|
|
@@ -2445,8 +2430,7 @@ async function writeAbapgitInterface(artifact, outDir) {
|
|
|
2445
2430
|
return { files: written };
|
|
2446
2431
|
}
|
|
2447
2432
|
|
|
2448
|
-
|
|
2449
|
-
//#region src/format/gcts.ts
|
|
2433
|
+
// src/format/gcts.ts
|
|
2450
2434
|
/**
|
|
2451
2435
|
* gCTS / AFF format writer.
|
|
2452
2436
|
*
|
|
@@ -2564,8 +2548,7 @@ async function writeGctsInterface(artifact, outDir) {
|
|
|
2564
2548
|
return { files: written };
|
|
2565
2549
|
}
|
|
2566
2550
|
|
|
2567
|
-
|
|
2568
|
-
//#region src/format/index.ts
|
|
2551
|
+
// src/format/index.ts
|
|
2569
2552
|
/**
|
|
2570
2553
|
* Format plugins barrel.
|
|
2571
2554
|
*
|
|
@@ -2604,8 +2587,7 @@ async function writeClientBundle(artifacts, format, outDir) {
|
|
|
2604
2587
|
return { files: [...all].sort((a, b) => a.localeCompare(b)) };
|
|
2605
2588
|
}
|
|
2606
2589
|
|
|
2607
|
-
|
|
2608
|
-
//#region src/emit/implementation-class.ts
|
|
2590
|
+
// src/emit/implementation-class.ts
|
|
2609
2591
|
/**
|
|
2610
2592
|
* Layer 3 emitter — IMPLEMENTATION CLASS (`ZCL_<base>`).
|
|
2611
2593
|
*
|
|
@@ -2849,8 +2831,7 @@ function escapeSingleQuotes(s) {
|
|
|
2849
2831
|
return s.replaceAll("'", "''");
|
|
2850
2832
|
}
|
|
2851
2833
|
|
|
2852
|
-
|
|
2853
|
-
//#region src/generate.ts
|
|
2834
|
+
// src/generate.ts
|
|
2854
2835
|
/**
|
|
2855
2836
|
* End-to-end pipeline for the v2 openai-codegen emitter.
|
|
2856
2837
|
*
|
|
@@ -2952,6 +2933,5 @@ async function generate(options) {
|
|
|
2952
2933
|
}
|
|
2953
2934
|
}
|
|
2954
2935
|
|
|
2955
|
-
//#endregion
|
|
2956
2936
|
export { makeNameAllocator as C, isRef as D, normalizeSpec as E, UnsupportedSchemaError as S, loadSpec as T, mapSchemaToTypeDef as _, writeGctsLayout as a, CollisionError as b, mapResponseHandling as c, emitOperationsInterface as d, PolymorphismConflictError as f, mapPrimitive as g, resolveNames as h, writeGctsInterface as i, emitLocalClasses as l, NamesConfigError as m, writeClientBundle as n, writeAbapgitInterface as o, emitTypesInterface as p, writeLayout as r, writeAbapgitLayout as s, generate as t, emitExceptionClass as u, mapSchemaToTypeRef as v, sanitizeIdent as w, CyclicTypeError as x, planTypes as y };
|
|
2957
|
-
//# sourceMappingURL=generate-
|
|
2937
|
+
//# sourceMappingURL=generate-DgXsowgP.mjs.map
|