@abapify/openai-codegen 0.4.33 → 0.4.38

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as makeNameAllocator, D as isRef, E as normalizeSpec, S as UnsupportedSchemaError, T as loadSpec, _ as mapSchemaToTypeDef, a as writeGctsLayout, b as CollisionError, c as mapResponseHandling, d as emitOperationsInterface, f as PolymorphismConflictError, g as mapPrimitive, h as resolveNames, i as writeGctsInterface, l as emitLocalClasses, m as NamesConfigError, n as writeClientBundle, o as writeAbapgitInterface, p as emitTypesInterface, r as writeLayout, s as writeAbapgitLayout, t as generate, u as emitExceptionClass, v as mapSchemaToTypeRef, w as sanitizeIdent, x as CyclicTypeError, y as planTypes } from "./generate-DgXsowgP.mjs";
1
+ import { C as makeNameAllocator, D as isRef, E as normalizeSpec, S as UnsupportedSchemaError, T as loadSpec, _ as mapSchemaToTypeDef, a as writeGctsLayout, b as CollisionError, c as mapResponseHandling, d as emitOperationsInterface, f as PolymorphismConflictError, g as mapPrimitive, h as resolveNames, i as writeGctsInterface, l as emitLocalClasses, m as NamesConfigError, n as writeClientBundle, o as writeAbapgitInterface, p as emitTypesInterface, r as writeLayout, s as writeAbapgitLayout, t as generate, u as emitExceptionClass, v as mapSchemaToTypeRef, w as sanitizeIdent, x as CyclicTypeError, y as planTypes } from "./generate-BevNTSFF.mjs";
2
2
 
3
3
  // src/oas/iterate.ts
4
4
  /**
@@ -47,34 +47,36 @@ function walkSchemas(spec, cb) {
47
47
  "schemas",
48
48
  name
49
49
  ]);
50
- for (const op of spec.operations) {
51
- const base = ["operations", operationKey(op)];
52
- for (const p of op.parameters) visit(p.schema, [
53
- ...base,
54
- "parameters",
55
- `${p.in}:${p.name}`
56
- ]);
57
- if (op.requestBody !== void 0) for (const [mt, mtObj] of Object.entries(op.requestBody.content)) visit(mtObj.schema, [
58
- ...base,
59
- "requestBody",
60
- mt
61
- ]);
62
- for (const resp of op.responses) {
63
- for (const [mt, mtObj] of Object.entries(resp.content)) visit(mtObj.schema, [
64
- ...base,
65
- "responses",
66
- resp.statusCode,
67
- mt
68
- ]);
69
- for (const [hn, h] of Object.entries(resp.headers)) visit(h.schema, [
70
- ...base,
71
- "responses",
72
- resp.statusCode,
73
- "headers",
74
- hn
75
- ]);
76
- }
77
- }
50
+ for (const op of spec.operations) visitOperationSchemas(op, visit);
51
+ }
52
+ function visitOperationSchemas(op, visit) {
53
+ const base = ["operations", operationKey(op)];
54
+ for (const p of op.parameters) visit(p.schema, [
55
+ ...base,
56
+ "parameters",
57
+ `${p.in}:${p.name}`
58
+ ]);
59
+ for (const [mt, mtObj] of Object.entries(op.requestBody?.content ?? {})) visit(mtObj.schema, [
60
+ ...base,
61
+ "requestBody",
62
+ mt
63
+ ]);
64
+ for (const resp of op.responses) visitResponseSchemas(resp, base, visit);
65
+ }
66
+ function visitResponseSchemas(resp, base, visit) {
67
+ for (const [mt, mtObj] of Object.entries(resp.content)) visit(mtObj.schema, [
68
+ ...base,
69
+ "responses",
70
+ resp.statusCode,
71
+ mt
72
+ ]);
73
+ for (const [hn, h] of Object.entries(resp.headers)) visit(h.schema, [
74
+ ...base,
75
+ "responses",
76
+ resp.statusCode,
77
+ "headers",
78
+ hn
79
+ ]);
78
80
  }
79
81
  /** Stable key used to identify an operation, e.g. `GET /pet/{petId}`. */
80
82
  function operationKey(op) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/oas/iterate.ts","../src/profiles/errors.ts","../src/profiles/cloud.ts","../src/profiles/onprem-classic.ts","../src/profiles/onprem-modern.ts","../src/profiles/registry.ts","../src/types/emit.ts","../src/index.ts"],"sourcesContent":["import type {\n JsonSchema,\n NormalizedOperation,\n NormalizedSpec,\n} from './types.js';\n\nexport interface SchemaVisit {\n path: string[];\n schema: JsonSchema;\n}\n\nexport type SchemaVisitor = (visit: SchemaVisit) => void;\n\n/**\n * Depth-first walk over every distinct schema reachable from a normalized\n * spec. Ordering is deterministic: components.schemas (by insertion order),\n * then operations in spec order, with each operation yielding\n * `parameters → requestBody → responses`. Inside each schema we descend into\n * `properties`, `items`, `additionalProperties`, `allOf`/`anyOf`/`oneOf`, and\n * `not`.\n */\nexport function walkSchemas(spec: NormalizedSpec, cb: SchemaVisitor): void {\n const seen = new WeakSet<object>();\n\n const visit = (schema: unknown, path: string[]): void => {\n if (!isRecord(schema)) return;\n if (seen.has(schema)) return;\n seen.add(schema);\n cb({ path, schema });\n\n if (isRecord(schema.properties)) {\n for (const [name, sub] of Object.entries(schema.properties)) {\n visit(sub, [...path, 'properties', name]);\n }\n }\n if (schema.items !== undefined) {\n visit(schema.items, [...path, 'items']);\n }\n if (\n schema.additionalProperties !== undefined &&\n schema.additionalProperties !== true &&\n schema.additionalProperties !== false\n ) {\n visit(schema.additionalProperties, [...path, 'additionalProperties']);\n }\n for (const combinator of ['allOf', 'anyOf', 'oneOf'] as const) {\n const arr = schema[combinator];\n if (Array.isArray(arr)) {\n arr.forEach((sub, idx) => {\n visit(sub, [...path, combinator, String(idx)]);\n });\n }\n }\n if (schema.not !== undefined) {\n visit(schema.not, [...path, 'not']);\n }\n };\n\n for (const [name, schema] of Object.entries(spec.schemas)) {\n visit(schema, ['components', 'schemas', name]);\n }\n\n for (const op of spec.operations) {\n const base = ['operations', operationKey(op)];\n for (const p of op.parameters) {\n visit(p.schema, [...base, 'parameters', `${p.in}:${p.name}`]);\n }\n if (op.requestBody !== undefined) {\n for (const [mt, mtObj] of Object.entries(op.requestBody.content)) {\n visit(mtObj.schema, [...base, 'requestBody', mt]);\n }\n }\n for (const resp of op.responses) {\n for (const [mt, mtObj] of Object.entries(resp.content)) {\n visit(mtObj.schema, [...base, 'responses', resp.statusCode, mt]);\n }\n for (const [hn, h] of Object.entries(resp.headers)) {\n visit(h.schema, [...base, 'responses', resp.statusCode, 'headers', hn]);\n }\n }\n }\n}\n\n/** Stable key used to identify an operation, e.g. `GET /pet/{petId}`. */\nexport function operationKey(op: NormalizedOperation): string {\n return `${op.method.toUpperCase()} ${op.path}`;\n}\n\nfunction isRecord(x: unknown): x is Record<string, unknown> {\n return typeof x === 'object' && x !== null && !Array.isArray(x);\n}\n","export class WhitelistViolationError extends Error {\n readonly className: string;\n readonly profileId: string;\n\n constructor(className: string, profileId: string) {\n super(\n `Class '${className}' is not in the allow-list for target profile '${profileId}'.`,\n );\n this.name = 'WhitelistViolationError';\n this.className = className;\n this.profileId = profileId;\n }\n}\n","import type { TargetProfile } from './types';\n\nexport const s4CloudProfile: TargetProfile = {\n id: 's4-cloud',\n description:\n 'SAP S/4HANA Cloud (Steampunk) — uses if_web_http_client with destination provider and /ui2/cl_json (released for ABAP for Cloud Development per SAP Note 2931335).',\n http: {\n kind: 'if_web_http_client',\n factoryClass: 'cl_web_http_client_manager',\n destinationProviderClass: 'cl_http_destination_provider',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_web_http_client_manager',\n 'cl_http_destination_provider',\n 'if_web_http_client',\n 'if_web_http_request',\n 'if_web_http_response',\n 'cl_web_http_utility',\n 'cl_system_uuid',\n 'cl_abap_char_utilities',\n 'cl_abap_conv_codepage',\n 'cl_abap_codepage',\n 'cl_abap_conv_out_ce',\n 'cl_abap_conv_in_ce',\n 'cl_abap_typedescr',\n '/ui2/cl_json',\n ]),\n};\n","import type { TargetProfile } from './types';\n\n// TODO: flesh out on-prem classic emitter details (Wave ≥2).\nexport const onPremClassicProfile: TargetProfile = {\n id: 'on-prem-classic',\n description:\n 'TODO: Classic on-prem NetWeaver — uses if_http_client via cl_http_client and /ui2/cl_json for JSON.',\n http: {\n kind: 'if_http_client',\n factoryClass: 'cl_http_client',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_http_client',\n 'if_http_client',\n 'cl_http_utility',\n 'cl_system_uuid',\n '/ui2/cl_json',\n ]),\n};\n","import type { TargetProfile } from './types';\n\n// TODO: flesh out S/4 on-prem modern emitter details (Wave ≥2).\nexport const s4OnPremModernProfile: TargetProfile = {\n id: 's4-onprem-modern',\n description:\n 'TODO: S/4HANA on-prem modern — uses if_web_http_client with destination provider, plus /ui2/cl_json for JSON.',\n http: {\n kind: 'if_web_http_client',\n factoryClass: 'cl_web_http_client_manager',\n destinationProviderClass: 'cl_http_destination_provider',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_web_http_client_manager',\n 'cl_http_destination_provider',\n 'if_web_http_client',\n 'if_web_http_request',\n 'if_web_http_response',\n 'cl_http_utility',\n 'cl_system_uuid',\n '/ui2/cl_json',\n ]),\n};\n","import { s4CloudProfile } from './cloud';\nimport { onPremClassicProfile } from './onprem-classic';\nimport { s4OnPremModernProfile } from './onprem-modern';\nimport { WhitelistViolationError } from './errors';\nimport type { TargetProfile, TargetProfileId } from './types';\n\nconst PROFILES: Readonly<Record<TargetProfileId, TargetProfile>> = {\n 'on-prem-classic': onPremClassicProfile,\n 's4-onprem-modern': s4OnPremModernProfile,\n 's4-cloud': s4CloudProfile,\n};\n\nexport const ALL_PROFILES: ReadonlyArray<TargetProfileId> = [\n 'on-prem-classic',\n 's4-onprem-modern',\n 's4-cloud',\n];\n\nexport function getProfile(id: TargetProfileId): TargetProfile {\n const profile = PROFILES[id];\n if (!profile) {\n throw new Error(`Unknown target profile: ${String(id)}`);\n }\n return profile;\n}\n\nfunction normalizeAllowed(set: ReadonlySet<string>): Set<string> {\n const out = new Set<string>();\n for (const item of set) {\n out.add(item.toLowerCase());\n }\n return out;\n}\n\nexport function assertClassAllowed(\n profile: TargetProfile,\n className: string,\n): void {\n const normalized = normalizeAllowed(profile.allowedClasses);\n if (!normalized.has(className.toLowerCase())) {\n throw new WhitelistViolationError(className, profile.id);\n }\n}\n","import type { TypeDef } from '@abapify/abap-ast';\nimport type { TargetProfile } from '../profiles/index';\nimport type { TypePlan } from './plan';\nimport { mapSchemaToTypeDef } from './map';\n\n/** Emit all TypeDef nodes for the given plan, in topological order. */\nexport function emitTypeSection(\n plan: TypePlan,\n _profile: TargetProfile,\n): TypeDef[] {\n // Profile is accepted for forward-compat (e.g. per-profile type substitutions)\n // but currently does not alter emission. Silence unused-var lint.\n void _profile;\n const out: TypeDef[] = [];\n for (const entry of plan.entries) {\n const { typeDef } = mapSchemaToTypeDef(entry, plan);\n out.push(typeDef);\n }\n return out;\n}\n","export const OPENAI_CODEGEN_VERSION = '0.2.0';\n\nexport * from './oas/index';\nexport * from './profiles/index';\nexport * from './types/index';\nexport * from './emit/index';\nexport * from './format/index';\nexport { generate } from './generate';\nexport type {\n GenerateOptions,\n GenerateResult,\n GenerateTarget,\n} from './generate';\n"],"mappings":";;;;;;;;;;;AAqBA,SAAgB,YAAY,MAAsB,IAAyB;CACzE,MAAM,uBAAO,IAAI,QAAgB;CAEjC,MAAM,SAAS,QAAiB,SAAyB;EACvD,IAAI,CAAC,SAAS,MAAM,GAAG;EACvB,IAAI,KAAK,IAAI,MAAM,GAAG;EACtB,KAAK,IAAI,MAAM;EACf,GAAG;GAAE;GAAM;EAAO,CAAC;EAEnB,IAAI,SAAS,OAAO,UAAU,GAC5B,KAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,OAAO,UAAU,GACxD,MAAM,KAAK;GAAC,GAAG;GAAM;GAAc;EAAI,CAAC;EAG5C,IAAI,OAAO,UAAU,QACnB,MAAM,OAAO,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC;EAExC,IACE,OAAO,yBAAyB,UAChC,OAAO,yBAAyB,QAChC,OAAO,yBAAyB,OAEhC,MAAM,OAAO,sBAAsB,CAAC,GAAG,MAAM,sBAAsB,CAAC;EAEtE,KAAK,MAAM,cAAc;GAAC;GAAS;GAAS;EAAO,GAAY;GAC7D,MAAM,MAAM,OAAO;GACnB,IAAI,MAAM,QAAQ,GAAG,GACnB,IAAI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;CAEN,IAAI,CADe,iBAAiB,QAAQ,cAC9B,CAAC,CAAC,IAAI,UAAU,YAAY,CAAC,GACzC,MAAM,IAAI,wBAAwB,WAAW,QAAQ,EAAE;AAE3D;;;;ACpCA,SAAgB,gBACd,MACA,UACW;CAIX,MAAM,MAAiB,CAAC;CACxB,KAAK,MAAM,SAAS,KAAK,SAAS;EAChC,MAAM,EAAE,YAAY,mBAAmB,OAAO,IAAI;EAClD,IAAI,KAAK,OAAO;CAClB;CACA,OAAO;AACT;;;ACnBA,MAAa,yBAAyB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/oas/iterate.ts","../src/profiles/errors.ts","../src/profiles/cloud.ts","../src/profiles/onprem-classic.ts","../src/profiles/onprem-modern.ts","../src/profiles/registry.ts","../src/types/emit.ts","../src/index.ts"],"sourcesContent":["import type {\n JsonSchema,\n NormalizedOperation,\n NormalizedResponse,\n NormalizedSpec,\n} from './types.js';\n\nexport interface SchemaVisit {\n path: string[];\n schema: JsonSchema;\n}\n\nexport type SchemaVisitor = (visit: SchemaVisit) => void;\n\n/**\n * Depth-first walk over every distinct schema reachable from a normalized\n * spec. Ordering is deterministic: components.schemas (by insertion order),\n * then operations in spec order, with each operation yielding\n * `parameters → requestBody → responses`. Inside each schema we descend into\n * `properties`, `items`, `additionalProperties`, `allOf`/`anyOf`/`oneOf`, and\n * `not`.\n */\nexport function walkSchemas(spec: NormalizedSpec, cb: SchemaVisitor): void {\n const seen = new WeakSet<object>();\n\n const visit = (schema: unknown, path: string[]): void => {\n if (!isRecord(schema)) return;\n if (seen.has(schema)) return;\n seen.add(schema);\n cb({ path, schema });\n\n if (isRecord(schema.properties)) {\n for (const [name, sub] of Object.entries(schema.properties)) {\n visit(sub, [...path, 'properties', name]);\n }\n }\n if (schema.items !== undefined) {\n visit(schema.items, [...path, 'items']);\n }\n if (\n schema.additionalProperties !== undefined &&\n schema.additionalProperties !== true &&\n schema.additionalProperties !== false\n ) {\n visit(schema.additionalProperties, [...path, 'additionalProperties']);\n }\n for (const combinator of ['allOf', 'anyOf', 'oneOf'] as const) {\n const arr = schema[combinator];\n if (Array.isArray(arr)) {\n arr.forEach((sub, idx) => {\n visit(sub, [...path, combinator, String(idx)]);\n });\n }\n }\n if (schema.not !== undefined) {\n visit(schema.not, [...path, 'not']);\n }\n };\n\n for (const [name, schema] of Object.entries(spec.schemas)) {\n visit(schema, ['components', 'schemas', name]);\n }\n\n for (const op of spec.operations) {\n visitOperationSchemas(op, visit);\n }\n}\n\nfunction visitOperationSchemas(\n op: NormalizedOperation,\n visit: (schema: unknown, path: string[]) => void,\n): void {\n const base = ['operations', operationKey(op)];\n for (const p of op.parameters) {\n visit(p.schema, [...base, 'parameters', `${p.in}:${p.name}`]);\n }\n for (const [mt, mtObj] of Object.entries(op.requestBody?.content ?? {})) {\n visit(mtObj.schema, [...base, 'requestBody', mt]);\n }\n for (const resp of op.responses) {\n visitResponseSchemas(resp, base, visit);\n }\n}\n\nfunction visitResponseSchemas(\n resp: NormalizedResponse,\n base: string[],\n visit: (schema: unknown, path: string[]) => void,\n): void {\n for (const [mt, mtObj] of Object.entries(resp.content)) {\n visit(mtObj.schema, [...base, 'responses', resp.statusCode, mt]);\n }\n for (const [hn, h] of Object.entries(resp.headers)) {\n visit(h.schema, [...base, 'responses', resp.statusCode, 'headers', hn]);\n }\n}\n\n/** Stable key used to identify an operation, e.g. `GET /pet/{petId}`. */\nexport function operationKey(op: NormalizedOperation): string {\n return `${op.method.toUpperCase()} ${op.path}`;\n}\n\nfunction isRecord(x: unknown): x is Record<string, unknown> {\n return typeof x === 'object' && x !== null && !Array.isArray(x);\n}\n","export class WhitelistViolationError extends Error {\n readonly className: string;\n readonly profileId: string;\n\n constructor(className: string, profileId: string) {\n super(\n `Class '${className}' is not in the allow-list for target profile '${profileId}'.`,\n );\n this.name = 'WhitelistViolationError';\n this.className = className;\n this.profileId = profileId;\n }\n}\n","import type { TargetProfile } from './types';\n\nexport const s4CloudProfile: TargetProfile = {\n id: 's4-cloud',\n description:\n 'SAP S/4HANA Cloud (Steampunk) — uses if_web_http_client with destination provider and /ui2/cl_json (released for ABAP for Cloud Development per SAP Note 2931335).',\n http: {\n kind: 'if_web_http_client',\n factoryClass: 'cl_web_http_client_manager',\n destinationProviderClass: 'cl_http_destination_provider',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_web_http_client_manager',\n 'cl_http_destination_provider',\n 'if_web_http_client',\n 'if_web_http_request',\n 'if_web_http_response',\n 'cl_web_http_utility',\n 'cl_system_uuid',\n 'cl_abap_char_utilities',\n 'cl_abap_conv_codepage',\n 'cl_abap_codepage',\n 'cl_abap_conv_out_ce',\n 'cl_abap_conv_in_ce',\n 'cl_abap_typedescr',\n '/ui2/cl_json',\n ]),\n};\n","import type { TargetProfile } from './types';\n\n// Emitter details are minimal; richer on-prem classic emitter specifics are\n// deferred to Wave ≥2.\nexport const onPremClassicProfile: TargetProfile = {\n id: 'on-prem-classic',\n description:\n 'TODO: Classic on-prem NetWeaver — uses if_http_client via cl_http_client and /ui2/cl_json for JSON.',\n http: {\n kind: 'if_http_client',\n factoryClass: 'cl_http_client',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_http_client',\n 'if_http_client',\n 'cl_http_utility',\n 'cl_system_uuid',\n '/ui2/cl_json',\n ]),\n};\n","import type { TargetProfile } from './types';\n\n// Emitter details are minimal; richer S/4 on-prem modern emitter specifics\n// are deferred to Wave ≥2.\nexport const s4OnPremModernProfile: TargetProfile = {\n id: 's4-onprem-modern',\n description:\n 'TODO: S/4HANA on-prem modern — uses if_web_http_client with destination provider, plus /ui2/cl_json for JSON.',\n http: {\n kind: 'if_web_http_client',\n factoryClass: 'cl_web_http_client_manager',\n destinationProviderClass: 'cl_http_destination_provider',\n },\n json: {\n kind: 'ui2_cl_json',\n helperClass: '/ui2/cl_json',\n },\n allowedClasses: new Set<string>([\n 'cl_web_http_client_manager',\n 'cl_http_destination_provider',\n 'if_web_http_client',\n 'if_web_http_request',\n 'if_web_http_response',\n 'cl_http_utility',\n 'cl_system_uuid',\n '/ui2/cl_json',\n ]),\n};\n","import { s4CloudProfile } from './cloud';\nimport { onPremClassicProfile } from './onprem-classic';\nimport { s4OnPremModernProfile } from './onprem-modern';\nimport { WhitelistViolationError } from './errors';\nimport type { TargetProfile, TargetProfileId } from './types';\n\nconst PROFILES: Readonly<Record<TargetProfileId, TargetProfile>> = {\n 'on-prem-classic': onPremClassicProfile,\n 's4-onprem-modern': s4OnPremModernProfile,\n 's4-cloud': s4CloudProfile,\n};\n\nexport const ALL_PROFILES: ReadonlyArray<TargetProfileId> = [\n 'on-prem-classic',\n 's4-onprem-modern',\n 's4-cloud',\n];\n\nexport function getProfile(id: TargetProfileId): TargetProfile {\n const profile = PROFILES[id];\n if (!profile) {\n throw new Error(`Unknown target profile: ${String(id)}`);\n }\n return profile;\n}\n\nfunction normalizeAllowed(set: ReadonlySet<string>): Set<string> {\n const out = new Set<string>();\n for (const item of set) {\n out.add(item.toLowerCase());\n }\n return out;\n}\n\nexport function assertClassAllowed(\n profile: TargetProfile,\n className: string,\n): void {\n const normalized = normalizeAllowed(profile.allowedClasses);\n if (!normalized.has(className.toLowerCase())) {\n throw new WhitelistViolationError(className, profile.id);\n }\n}\n","import type { TypeDef } from '@abapify/abap-ast';\nimport type { TargetProfile } from '../profiles/index';\nimport type { TypePlan } from './plan';\nimport { mapSchemaToTypeDef } from './map';\n\n/** Emit all TypeDef nodes for the given plan, in topological order. */\nexport function emitTypeSection(\n plan: TypePlan,\n _profile: TargetProfile,\n): TypeDef[] {\n // Profile is accepted for forward-compat (e.g. per-profile type substitutions)\n // but currently does not alter emission.\n const out: TypeDef[] = [];\n for (const entry of plan.entries) {\n const { typeDef } = mapSchemaToTypeDef(entry, plan);\n out.push(typeDef);\n }\n return out;\n}\n","export const OPENAI_CODEGEN_VERSION = '0.2.0';\n\nexport * from './oas/index';\nexport * from './profiles/index';\nexport * from './types/index';\nexport * from './emit/index';\nexport * from './format/index';\nexport { generate } from './generate';\nexport type {\n GenerateOptions,\n GenerateResult,\n GenerateTarget,\n} from './generate';\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgB,YAAY,MAAsB,IAAyB;CACzE,MAAM,uBAAO,IAAI,QAAgB;CAEjC,MAAM,SAAS,QAAiB,SAAyB;EACvD,IAAI,CAAC,SAAS,MAAM,GAAG;EACvB,IAAI,KAAK,IAAI,MAAM,GAAG;EACtB,KAAK,IAAI,MAAM;EACf,GAAG;GAAE;GAAM;EAAO,CAAC;EAEnB,IAAI,SAAS,OAAO,UAAU,GAC5B,KAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,OAAO,UAAU,GACxD,MAAM,KAAK;GAAC,GAAG;GAAM;GAAc;EAAI,CAAC;EAG5C,IAAI,OAAO,UAAU,QACnB,MAAM,OAAO,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC;EAExC,IACE,OAAO,yBAAyB,UAChC,OAAO,yBAAyB,QAChC,OAAO,yBAAyB,OAEhC,MAAM,OAAO,sBAAsB,CAAC,GAAG,MAAM,sBAAsB,CAAC;EAEtE,KAAK,MAAM,cAAc;GAAC;GAAS;GAAS;EAAO,GAAY;GAC7D,MAAM,MAAM,OAAO;GACnB,IAAI,MAAM,QAAQ,GAAG,GACnB,IAAI,SAAS,KAAK,QAAQ;IACxB,MAAM,KAAK;KAAC,GAAG;KAAM;KAAY,OAAO,GAAG;IAAC,CAAC;GAC/C,CAAC;EAEL;EACA,IAAI,OAAO,QAAQ,QACjB,MAAM,OAAO,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC;CAEtC;CAEA,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,KAAK,OAAO,GACtD,MAAM,QAAQ;EAAC;EAAc;EAAW;CAAI,CAAC;CAG/C,KAAK,MAAM,MAAM,KAAK,YACpB,sBAAsB,IAAI,K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IAAI;EAClD,IAAI,KAAK,OAAO;CAClB;CACA,OAAO;AACT;;;AClBA,MAAa,yBAAyB"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.33",
6
+ "version": "0.4.38",
7
7
  "description": "Deterministic OpenAPI → ABAP client code generator. Emits a single zero-dependency ABAP class per OpenAPI spec, targeting SAP Cloud / on-prem profiles, packaged as abapGit or gCTS.",
8
8
  "type": "module",
9
9
  "types": "./dist/index.d.mts",
@@ -16,7 +16,7 @@
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "dependencies": {
19
- "@abapify/abap-ast": "0.4.33",
19
+ "@abapify/abap-ast": "0.4.38",
20
20
  "@apidevtools/swagger-parser": "^10.1.0",
21
21
  "commander": "^11.1.0",
22
22
  "fast-xml-parser": "^5.5.0",
@@ -38,7 +38,7 @@
38
38
  "license": "MIT",
39
39
  "devDependencies": {
40
40
  "@abaplint/core": "^2.118.12",
41
- "@abapify/aclass": "0.4.33"
41
+ "@abapify/aclass": "0.4.38"
42
42
  },
43
43
  "repository": {
44
44
  "type": "git",