arc-1 1.4.0 → 1.5.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/adt/abapgit.d.ts.map +1 -1
- package/dist/adt/abapgit.js +64 -7
- package/dist/adt/abapgit.js.map +1 -1
- package/dist/adt/aunit.js +4 -4
- package/dist/adt/aunit.js.map +1 -1
- package/dist/adt/class-structure.d.ts +4 -2
- package/dist/adt/class-structure.d.ts.map +1 -1
- package/dist/adt/class-structure.js +18 -9
- package/dist/adt/class-structure.js.map +1 -1
- package/dist/adt/client.d.ts +19 -53
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +72 -96
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/codeintel.d.ts +1 -1
- package/dist/adt/codeintel.d.ts.map +1 -1
- package/dist/adt/codeintel.js +11 -4
- package/dist/adt/codeintel.js.map +1 -1
- package/dist/adt/config.d.ts +5 -0
- package/dist/adt/config.d.ts.map +1 -1
- package/dist/adt/config.js.map +1 -1
- package/dist/adt/crud.d.ts +3 -3
- package/dist/adt/crud.d.ts.map +1 -1
- package/dist/adt/crud.js +21 -6
- package/dist/adt/crud.js.map +1 -1
- package/dist/adt/data-source-policy.d.ts +21 -13
- package/dist/adt/data-source-policy.d.ts.map +1 -1
- package/dist/adt/data-source-policy.js +63 -114
- package/dist/adt/data-source-policy.js.map +1 -1
- package/dist/adt/ddic-xml.d.ts +9 -0
- package/dist/adt/ddic-xml.d.ts.map +1 -1
- package/dist/adt/ddic-xml.js +17 -3
- package/dist/adt/ddic-xml.js.map +1 -1
- package/dist/adt/devtools.js +3 -3
- package/dist/adt/devtools.js.map +1 -1
- package/dist/adt/diagnostics.js +4 -4
- package/dist/adt/diagnostics.js.map +1 -1
- package/dist/adt/enhancements.d.ts +7 -0
- package/dist/adt/enhancements.d.ts.map +1 -0
- package/dist/adt/enhancements.js +89 -0
- package/dist/adt/enhancements.js.map +1 -0
- package/dist/adt/errors.d.ts +19 -10
- package/dist/adt/errors.d.ts.map +1 -1
- package/dist/adt/errors.js +73 -53
- package/dist/adt/errors.js.map +1 -1
- package/dist/adt/fm-signature.d.ts +1 -1
- package/dist/adt/fm-signature.d.ts.map +1 -1
- package/dist/adt/fm-signature.js +9 -1
- package/dist/adt/fm-signature.js.map +1 -1
- package/dist/adt/http.d.ts +7 -27
- package/dist/adt/http.d.ts.map +1 -1
- package/dist/adt/http.js +34 -32
- package/dist/adt/http.js.map +1 -1
- package/dist/adt/internal-data-operations.d.ts +3 -2
- package/dist/adt/internal-data-operations.d.ts.map +1 -1
- package/dist/adt/internal-data-operations.js +8 -1
- package/dist/adt/internal-data-operations.js.map +1 -1
- package/dist/adt/legacy-content-handler.d.ts +3 -0
- package/dist/adt/legacy-content-handler.d.ts.map +1 -0
- package/dist/adt/legacy-content-handler.js +21 -0
- package/dist/adt/legacy-content-handler.js.map +1 -0
- package/dist/adt/lock-object.d.ts +92 -0
- package/dist/adt/lock-object.d.ts.map +1 -0
- package/dist/adt/lock-object.js +195 -0
- package/dist/adt/lock-object.js.map +1 -0
- package/dist/adt/rap-generate.d.ts +5 -1
- package/dist/adt/rap-generate.d.ts.map +1 -1
- package/dist/adt/rap-generate.js +112 -100
- package/dist/adt/rap-generate.js.map +1 -1
- package/dist/adt/server-driven.d.ts +42 -10
- package/dist/adt/server-driven.d.ts.map +1 -1
- package/dist/adt/server-driven.js +98 -18
- package/dist/adt/server-driven.js.map +1 -1
- package/dist/adt/source-precondition.d.ts +3 -0
- package/dist/adt/source-precondition.d.ts.map +1 -0
- package/dist/adt/source-precondition.js +12 -0
- package/dist/adt/source-precondition.js.map +1 -0
- package/dist/adt/text-search.js +5 -5
- package/dist/adt/text-search.js.map +1 -1
- package/dist/adt/transport.js +3 -3
- package/dist/adt/transport.js.map +1 -1
- package/dist/adt/types.d.ts +19 -1
- package/dist/adt/types.d.ts.map +1 -1
- package/dist/adt/user-agent.d.ts +4 -0
- package/dist/adt/user-agent.d.ts.map +1 -0
- package/dist/adt/user-agent.js +11 -0
- package/dist/adt/user-agent.js.map +1 -0
- package/dist/adt/xml-entities.d.ts +3 -0
- package/dist/adt/xml-entities.d.ts.map +1 -0
- package/dist/adt/xml-entities.js +19 -0
- package/dist/adt/xml-entities.js.map +1 -0
- package/dist/adt/xml-parser.d.ts +7 -30
- package/dist/adt/xml-parser.d.ts.map +1 -1
- package/dist/adt/xml-parser.js +25 -54
- package/dist/adt/xml-parser.js.map +1 -1
- package/dist/authz/policy.d.ts.map +1 -1
- package/dist/authz/policy.js +2 -0
- package/dist/authz/policy.js.map +1 -1
- package/dist/cache/caching-layer.d.ts.map +1 -1
- package/dist/cache/caching-layer.js +7 -11
- package/dist/cache/caching-layer.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/context/compressor.d.ts.map +1 -1
- package/dist/context/compressor.js +5 -25
- package/dist/context/compressor.js.map +1 -1
- package/dist/context/deps.d.ts.map +1 -1
- package/dist/context/deps.js +50 -4
- package/dist/context/deps.js.map +1 -1
- package/dist/context/grep.d.ts +14 -0
- package/dist/context/grep.d.ts.map +1 -1
- package/dist/context/grep.js +49 -0
- package/dist/context/grep.js.map +1 -1
- package/dist/context/unit-surgery.d.ts +3 -1
- package/dist/context/unit-surgery.d.ts.map +1 -1
- package/dist/context/unit-surgery.js +52 -5
- package/dist/context/unit-surgery.js.map +1 -1
- package/dist/handlers/activate.d.ts +1 -1
- package/dist/handlers/activate.d.ts.map +1 -1
- package/dist/handlers/activate.js +23 -35
- package/dist/handlers/activate.js.map +1 -1
- package/dist/handlers/diagnose.d.ts.map +1 -1
- package/dist/handlers/diagnose.js +8 -29
- package/dist/handlers/diagnose.js.map +1 -1
- package/dist/handlers/dispatch.d.ts.map +1 -1
- package/dist/handlers/dispatch.js +21 -5
- package/dist/handlers/dispatch.js.map +1 -1
- package/dist/handlers/editable-source.d.ts +6 -0
- package/dist/handlers/editable-source.d.ts.map +1 -0
- package/dist/handlers/editable-source.js +53 -0
- package/dist/handlers/editable-source.js.map +1 -0
- package/dist/handlers/feature-cache.d.ts +2 -0
- package/dist/handlers/feature-cache.d.ts.map +1 -1
- package/dist/handlers/feature-cache.js +8 -0
- package/dist/handlers/feature-cache.js.map +1 -1
- package/dist/handlers/hyperfocused.js +1 -1
- package/dist/handlers/hyperfocused.js.map +1 -1
- package/dist/handlers/lint.js +1 -1
- package/dist/handlers/lint.js.map +1 -1
- package/dist/handlers/navigate.d.ts.map +1 -1
- package/dist/handlers/navigate.js +12 -2
- package/dist/handlers/navigate.js.map +1 -1
- package/dist/handlers/object-types.d.ts +2 -3
- package/dist/handlers/object-types.d.ts.map +1 -1
- package/dist/handlers/object-types.js +13 -5
- package/dist/handlers/object-types.js.map +1 -1
- package/dist/handlers/read.d.ts.map +1 -1
- package/dist/handlers/read.js +38 -7
- package/dist/handlers/read.js.map +1 -1
- package/dist/handlers/schemas.d.ts +39 -0
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +50 -7
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/syntax.d.ts +5 -0
- package/dist/handlers/syntax.d.ts.map +1 -0
- package/dist/handlers/syntax.js +35 -0
- package/dist/handlers/syntax.js.map +1 -0
- package/dist/handlers/tool-descriptions.d.ts.map +1 -1
- package/dist/handlers/tool-descriptions.js +8 -6
- package/dist/handlers/tool-descriptions.js.map +1 -1
- package/dist/handlers/tool-registry.d.ts +4 -4
- package/dist/handlers/tool-registry.d.ts.map +1 -1
- package/dist/handlers/tool-registry.js +4 -0
- package/dist/handlers/tool-registry.js.map +1 -1
- package/dist/handlers/tools.d.ts +1 -16
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +44 -55
- package/dist/handlers/tools.js.map +1 -1
- package/dist/handlers/transport.d.ts.map +1 -1
- package/dist/handlers/transport.js +17 -3
- package/dist/handlers/transport.js.map +1 -1
- package/dist/handlers/where-used.d.ts.map +1 -1
- package/dist/handlers/where-used.js +0 -5
- package/dist/handlers/where-used.js.map +1 -1
- package/dist/handlers/write/class-edit.d.ts +16 -0
- package/dist/handlers/write/class-edit.d.ts.map +1 -0
- package/dist/handlers/write/class-edit.js +55 -0
- package/dist/handlers/write/class-edit.js.map +1 -0
- package/dist/handlers/write/class-surgery.d.ts +2 -2
- package/dist/handlers/write/class-surgery.d.ts.map +1 -1
- package/dist/handlers/write/class-surgery.js +189 -220
- package/dist/handlers/write/class-surgery.js.map +1 -1
- package/dist/handlers/write/context.d.ts +1 -8
- package/dist/handlers/write/context.d.ts.map +1 -1
- package/dist/handlers/write/create.d.ts.map +1 -1
- package/dist/handlers/write/create.js +11 -4
- package/dist/handlers/write/create.js.map +1 -1
- package/dist/handlers/write/metadata-update.d.ts +4 -0
- package/dist/handlers/write/metadata-update.d.ts.map +1 -0
- package/dist/handlers/write/metadata-update.js +58 -0
- package/dist/handlers/write/metadata-update.js.map +1 -0
- package/dist/handlers/write/rap.d.ts.map +1 -1
- package/dist/handlers/write/rap.js +132 -155
- package/dist/handlers/write/rap.js.map +1 -1
- package/dist/handlers/write/unit-surgery.d.ts +2 -2
- package/dist/handlers/write/unit-surgery.d.ts.map +1 -1
- package/dist/handlers/write/unit-surgery.js +14 -8
- package/dist/handlers/write/unit-surgery.js.map +1 -1
- package/dist/handlers/write/update-delete.d.ts.map +1 -1
- package/dist/handlers/write/update-delete.js +34 -82
- package/dist/handlers/write/update-delete.js.map +1 -1
- package/dist/handlers/write-helpers.d.ts +3 -2
- package/dist/handlers/write-helpers.d.ts.map +1 -1
- package/dist/handlers/write-helpers.js +123 -18
- package/dist/handlers/write-helpers.js.map +1 -1
- package/dist/handlers/write.d.ts.map +1 -1
- package/dist/handlers/write.js +15 -29
- package/dist/handlers/write.js.map +1 -1
- package/dist/public/read-only-client.d.ts +6 -0
- package/dist/public/read-only-client.d.ts.map +1 -0
- package/dist/public/read-only-client.js +66 -0
- package/dist/public/read-only-client.js.map +1 -0
- package/dist/public/types.d.ts +2 -13
- package/dist/public/types.d.ts.map +1 -1
- package/dist/server/audit.d.ts +6 -1
- package/dist/server/audit.d.ts.map +1 -1
- package/dist/server/audit.js.map +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +3 -0
- package/dist/server/config.js.map +1 -1
- package/dist/server/deny-actions.d.ts +2 -1
- package/dist/server/deny-actions.d.ts.map +1 -1
- package/dist/server/deny-actions.js +13 -2
- package/dist/server/deny-actions.js.map +1 -1
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +4 -0
- package/dist/server/http.js.map +1 -1
- package/dist/server/logger.d.ts +3 -3
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/logger.js +7 -7
- package/dist/server/logger.js.map +1 -1
- package/dist/server/multi-target-basic-auth.d.ts.map +1 -1
- package/dist/server/multi-target-basic-auth.js +1 -0
- package/dist/server/multi-target-basic-auth.js.map +1 -1
- package/dist/server/multi-target-runtime.d.ts.map +1 -1
- package/dist/server/multi-target-runtime.js +1 -0
- package/dist/server/multi-target-runtime.js.map +1 -1
- package/dist/server/plugin-loader.d.ts.map +1 -1
- package/dist/server/plugin-loader.js +1 -3
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/server/safe-http-client.d.ts +6 -12
- package/dist/server/safe-http-client.d.ts.map +1 -1
- package/dist/server/safe-http-client.js +28 -63
- package/dist/server/safe-http-client.js.map +1 -1
- package/dist/server/server.d.ts +5 -4
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +58 -51
- package/dist/server/server.js.map +1 -1
- package/dist/server/types.d.ts +1 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +2 -0
- package/dist/server/types.js.map +1 -1
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +7 -7
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* SAPWrite actions — update + delete.
|
|
3
3
|
*/
|
|
4
4
|
import { isTextElementObjectType, TEXT_ELEMENT_OBJECT_TYPES, TEXT_ELEMENT_PARTS, } from '../../adt/client.js';
|
|
5
|
-
import { deleteObject, lockObject, safeUpdateClassInclude,
|
|
6
|
-
import { formatKtdWriteReport, rewriteKtdDocument, } from '../../adt/ddic-xml.js';
|
|
5
|
+
import { deleteObject, lockObject, safeUpdateClassInclude, safeUpdateSource, unlockObject } from '../../adt/crud.js';
|
|
7
6
|
import { AdtApiError } from '../../adt/errors.js';
|
|
8
7
|
import { spliceFmSignature } from '../../adt/fm-signature.js';
|
|
9
8
|
import { buildCdsDeleteDependencyHint, buildCdsUpdateCrudHint, CDS_DEPENDENCY_SENSITIVE_TYPES, guardCdsSyntax, } from '../cds-hints.js';
|
|
10
9
|
import { getCachedFeatures } from '../feature-cache.js';
|
|
11
10
|
import { CLASS_WRITE_INCLUDES, canonicalTablType, classIncludeUrl } from '../object-types.js';
|
|
12
11
|
import { errorResult, textResult } from '../shared.js';
|
|
13
|
-
import {
|
|
12
|
+
import { isMetadataWriteType, mergePreWriteWarnings, runPreWriteLint, runPreWriteSyntaxCheck, runRapPreflightValidation, stripFmParamCommentBlock, } from '../write-helpers.js';
|
|
13
|
+
import { writeMetadataUpdate } from './metadata-update.js';
|
|
14
14
|
function isDeleteDependencyError(err) {
|
|
15
15
|
const clean = AdtApiError.extractCleanMessage(err.responseBody ?? err.message).toLowerCase();
|
|
16
16
|
const body = (err.responseBody ?? '').toLowerCase();
|
|
@@ -39,54 +39,13 @@ export async function writeActionUpdate(ctx) {
|
|
|
39
39
|
// the testclasses (CCAU) include is absent — a content PUT alone fails
|
|
40
40
|
// with HTTP 500 "…CCAU does not have any inactive version". safeUpdateClassInclude
|
|
41
41
|
// probes the include and POST-creates it (under the same lock) before the PUT.
|
|
42
|
-
const { initialized } = await safeUpdateClassInclude(client.http, client.safety, objectUrl, classIncludeUrl(name, include), source, transport, getCachedFeatures()?.abapRelease);
|
|
42
|
+
const { initialized } = await safeUpdateClassInclude(client.http, client.safety, objectUrl, classIncludeUrl(name, include), source, transport, getCachedFeatures()?.abapRelease, args.expectedSourceHash);
|
|
43
43
|
invalidateWrittenObject(type, name);
|
|
44
44
|
const initNote = initialized ? ` (initialised the ${include} include first)` : '';
|
|
45
45
|
return textResult(`Successfully updated ${type} ${name} include ${include}${initNote}. Active version remains unchanged until activation; read with SAPRead(version="inactive") to verify the draft.`);
|
|
46
46
|
}
|
|
47
|
-
if (type === 'SKTD') {
|
|
48
|
-
|
|
49
|
-
// body base64-encoded inside <sktd:text>, PUT with
|
|
50
|
-
// `application/vnd.sap.adt.sktdv2+xml`. PUTting raw text/plain silently
|
|
51
|
-
// no-ops (or 415s on strict systems). Fetch the current envelope,
|
|
52
|
-
// replace only the <sktd:text> body, and PUT it back — preserves
|
|
53
|
-
// responsible/masterLanguage/packageRef/refObject metadata.
|
|
54
|
-
//
|
|
55
|
-
// Deliberately no `version`: ADT's default view already carries the pending
|
|
56
|
-
// inactive draft, so consecutive node writes without an activation in between
|
|
57
|
-
// accumulate instead of reverting to the active version (live-verified
|
|
58
|
-
// 2026-09-02). SAPRead defaults to "active", so its node list can lag this one;
|
|
59
|
-
// every refusal raised below lists the ids of the envelope it actually merged.
|
|
60
|
-
const { source: currentEnvelope } = await client.getKtd(name);
|
|
61
|
-
const report = { proseHeadings: [] };
|
|
62
|
-
const body = rewriteKtdDocument(currentEnvelope, hasSource ? source : undefined, args.shortTexts, report);
|
|
63
|
-
// Report both changed nodes and headings retained as prose so a new body exposes its routing.
|
|
64
|
-
const summary = formatKtdWriteReport(currentEnvelope, body, report, args.dryRun === true);
|
|
65
|
-
// A KTD update is a merge: only the addressed nodes change. dryRun runs the identical
|
|
66
|
-
// validation and reports the outcome without the PUT, so a 90-node edit can be checked
|
|
67
|
-
// before it touches SAP.
|
|
68
|
-
if (args.dryRun === true) {
|
|
69
|
-
return textResult(`Dry run for ${type} ${name} — nothing was written.\n${summary}`);
|
|
70
|
-
}
|
|
71
|
-
await safeUpdateObject(client.http, client.safety, objectUrl, body, SKTD_V2_CONTENT_TYPE, transport, getCachedFeatures()?.abapRelease);
|
|
72
|
-
invalidateWrittenObject(type, name);
|
|
73
|
-
return textResult(`Successfully updated ${type} ${name}.\n${summary}`);
|
|
74
|
-
}
|
|
75
|
-
if (isMetadataWriteType(type)) {
|
|
76
|
-
// Metadata updates are full-XML-replace — we must fetch existing metadata
|
|
77
|
-
// and merge with provided fields so omitted fields keep their current values.
|
|
78
|
-
// Without this, updating just labels would reset dataType/typeKind to defaults.
|
|
79
|
-
const metadataProps = getMetadataWriteProperties(args);
|
|
80
|
-
const mergedProps = await mergeMetadataWriteProperties(client, type, name, metadataProps);
|
|
81
|
-
const description = String(args.description ?? mergedProps._description ?? name);
|
|
82
|
-
const pkg = String(args.package ?? existingPackage ?? mergedProps._package ?? '$TMP');
|
|
83
|
-
// Keep the full-XML-replace body cloud-correct on BTP (G-3); resolve the user from the JWT (G-5).
|
|
84
|
-
const systemType = resolveWriteSystemType(config, client);
|
|
85
|
-
const responsible = config.username || (await client.getEffectiveUser());
|
|
86
|
-
const body = buildCreateXml(type, name, pkg, description, mergedProps, config.language, responsible, systemType === 'btp');
|
|
87
|
-
await safeUpdateObject(client.http, client.safety, objectUrl, body, vendorContentTypeForType(type), transport, getCachedFeatures()?.abapRelease);
|
|
88
|
-
invalidateWrittenObject(type, name);
|
|
89
|
-
return textResult(`Successfully updated ${type} ${name}.`);
|
|
47
|
+
if (type === 'SKTD' || isMetadataWriteType(type)) {
|
|
48
|
+
return writeMetadataUpdate(ctx, existingPackage);
|
|
90
49
|
}
|
|
91
50
|
// RAP deterministic preflight validation
|
|
92
51
|
const preflightWarnings = runRapPreflightValidation(source, type, name, getCachedFeatures(), config.systemType, preflightOverride);
|
|
@@ -104,59 +63,52 @@ export async function writeActionUpdate(ctx) {
|
|
|
104
63
|
//
|
|
105
64
|
// Issue #252: when `parameters` is supplied as a structured array, splice
|
|
106
65
|
// it into the FM source as ABAP-source-based signature syntax. If `source`
|
|
107
|
-
// is omitted entirely,
|
|
66
|
+
// is omitted entirely, read the existing source under the lock to preserve the
|
|
108
67
|
// body. The structured clause replaces any existing signature region.
|
|
109
68
|
let effectiveSource = source;
|
|
110
69
|
let fmParamStripWarning;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (parameters !== undefined)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
let baseSource = source;
|
|
118
|
-
if (!baseSource || baseSource.trim() === '') {
|
|
119
|
-
const groupName = String(args.group ?? '');
|
|
120
|
-
const fetched = await client.getFunction(groupName, name).catch(() => null);
|
|
121
|
-
baseSource = fetched?.source ?? `FUNCTION ${name}.\nENDFUNCTION.\n`;
|
|
122
|
-
}
|
|
123
|
-
else if (!/^\s*FUNCTION\s+/i.test(baseSource)) {
|
|
124
|
-
// Body-only source: wrap in FUNCTION/ENDFUNCTION so the splicer has
|
|
125
|
-
// something to work with. Common shape from LLMs: just the body.
|
|
126
|
-
baseSource = `FUNCTION ${name}.\n${baseSource}\nENDFUNCTION.\n`;
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
effectiveSource = spliceFmSignature(baseSource, name, parameters);
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
// No FUNCTION token in the supplied source — fall back to user's source.
|
|
133
|
-
effectiveSource = baseSource;
|
|
134
|
-
fmParamMergeWarning =
|
|
135
|
-
'Could not splice structured parameters: source did not start with FUNCTION keyword. Used the supplied source verbatim.';
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Defense-in-depth: strip *" comment blocks even after splicing — the
|
|
139
|
-
// user's body may contain them (e.g. pasted from SAPGUI).
|
|
140
|
-
const stripped = stripFmParamCommentBlock(effectiveSource);
|
|
141
|
-
effectiveSource = stripped.source;
|
|
70
|
+
const parameters = args.parameters;
|
|
71
|
+
const needsCurrentFunctionSource = type === 'FUNC' && parameters !== undefined && !source.trim();
|
|
72
|
+
const prepareFunctionSource = (baseSource) => {
|
|
73
|
+
if (parameters !== undefined)
|
|
74
|
+
baseSource = spliceFmSignature(baseSource, name, parameters);
|
|
75
|
+
const stripped = stripFmParamCommentBlock(baseSource);
|
|
142
76
|
if (stripped.wasStripped) {
|
|
143
77
|
fmParamStripWarning =
|
|
144
78
|
'Stripped *"…IMPORTING/EXPORTING…*" parameter comment blocks (SAP rejects them on PUT — pass `parameters` as a structured array instead).';
|
|
145
79
|
}
|
|
80
|
+
return stripped.source;
|
|
81
|
+
};
|
|
82
|
+
if (type === 'FUNC' && !needsCurrentFunctionSource) {
|
|
83
|
+
// Only caller-supplied body text may be wrapped. A fetched source must contain the real FUNCTION envelope.
|
|
84
|
+
const bodyOnly = parameters !== undefined && !/^\s*FUNCTION\s+/i.test(source);
|
|
85
|
+
effectiveSource = prepareFunctionSource(bodyOnly ? `FUNCTION ${name}.\n${source}\nENDFUNCTION.\n` : source);
|
|
86
|
+
}
|
|
87
|
+
if (!needsCurrentFunctionSource && !effectiveSource.trim()) {
|
|
88
|
+
return errorResult(`"source" is required for action="update" on ${type} ${name}; no write was made.`);
|
|
146
89
|
}
|
|
147
90
|
// Pre-write lint validation (uses sanitized source for FUNC)
|
|
148
91
|
const lintWarnings = runPreWriteLint(effectiveSource, type, name, config, lintOverride);
|
|
149
92
|
if (lintWarnings.blocked)
|
|
150
93
|
return lintWarnings.result;
|
|
151
94
|
// Pre-write server-side syntax check (opt-in; never blocks — warnings only).
|
|
152
|
-
|
|
95
|
+
let checkNotes = '';
|
|
96
|
+
const checkSource = async (candidate, http = client.http) => {
|
|
97
|
+
checkNotes = await runPreWriteSyntaxCheck({ http, safety: client.safety }, type, candidate, objectUrl, config, checkOverride);
|
|
98
|
+
return candidate;
|
|
99
|
+
};
|
|
100
|
+
// A signature-only FUNC edit derives its replacement from fresh bytes under the lock.
|
|
101
|
+
// A failed read aborts; there is no empty-body fallback or unlocked source read.
|
|
102
|
+
const replacement = needsCurrentFunctionSource
|
|
103
|
+
? (current, session) => checkSource(prepareFunctionSource(current), session)
|
|
104
|
+
: await checkSource(effectiveSource);
|
|
153
105
|
// If safeUpdateSource throws (lock conflict, network error, etc.), checkNotes
|
|
154
106
|
// is intentionally discarded — pre-check warnings only matter when the write succeeded.
|
|
155
|
-
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl,
|
|
107
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl, replacement, transport, getCachedFeatures()?.abapRelease, args.expectedSourceHash);
|
|
156
108
|
invalidateWrittenObject(type, name);
|
|
157
109
|
const msg = `Successfully updated ${type} ${name}.`;
|
|
158
110
|
const cdsUpdateHint = type === 'DDLS' ? await buildCdsUpdateCrudHint(client, name, objectUrl) : undefined;
|
|
159
|
-
const warnings = mergePreWriteWarnings(preflightWarnings.warnings, lintWarnings.warnings, checkNotes, cdsUpdateHint, fmParamStripWarning
|
|
111
|
+
const warnings = mergePreWriteWarnings(preflightWarnings.warnings, lintWarnings.warnings, checkNotes, cdsUpdateHint, fmParamStripWarning);
|
|
160
112
|
return warnings ? textResult(`${msg}\n\n${warnings}`) : textResult(msg);
|
|
161
113
|
}
|
|
162
114
|
export async function writeActionDelete(ctx) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-delete.js","sourceRoot":"","sources":["../../../src/handlers/write/update-delete.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EAGpB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAoB,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EAC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C,CAAC;IACtH,CAAC;IACD,MAAM,+BAA+B,EAAE,CAAC;IACxC,MAAM,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACvE,uBAAuB,EAAE,CAAC;IAC1B,OAAO,UAAU,CAAC,WAAW,IAAI,OAAO,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED;gCACgC;AAChC,MAAM,iBAAiB,GAAoC;IACzD,OAAO,EAAE,kFAAkF;IAC3F,UAAU,EAAE,kFAAkF;IAC9F,QAAQ,EAAE,sDAAsD;CACjE,CAAC"}
|
|
@@ -103,8 +103,8 @@ export declare function enforceAllowedPackageForObjectUrl(client: AdtClient, obj
|
|
|
103
103
|
* (create gates the caller-supplied package like every create; update/delete resolve the object's true
|
|
104
104
|
* package under the metadata Accept). The `source` param carries AFF JSON or DDL text per the type's
|
|
105
105
|
* registry sourceFormat — the JSON ones are parse-validated before the
|
|
106
|
-
* PUT; ABAP-specific pre-write steps (lint, RAP preflight, CDS guard) do not apply.
|
|
107
|
-
*
|
|
106
|
+
* PUT; ABAP-specific pre-write steps (lint, RAP preflight, CDS guard) do not apply. SAP controls
|
|
107
|
+
* activation: APLO saves are immediately active; other types need SAPActivate.
|
|
108
108
|
*/
|
|
109
109
|
export declare function handleServerDrivenObjectWrite(client: AdtClient, action: string, type: string, name: string, args: Record<string, unknown>, cachingLayer: CachingLayer | undefined, cacheSecurity: CacheSecurityContext): Promise<ToolResult>;
|
|
110
110
|
/** Pre-write lint check result */
|
|
@@ -163,6 +163,7 @@ export declare function runPreWriteSyntaxCheck(client: Pick<AdtClient, 'http' |
|
|
|
163
163
|
export declare function inactiveSyntaxDiagnostic(client: AdtClient, type: string, name: string): Promise<string>;
|
|
164
164
|
export declare function tryPostSaveSyntaxCheck(client: AdtClient, type: string, name: string): Promise<string>;
|
|
165
165
|
export declare const TABL_DT_WRITE_UNAVAILABLE_HINT: string;
|
|
166
|
+
export declare const ENQU_WRITE_UNAVAILABLE_HINT: string;
|
|
166
167
|
export declare const TTYP_WRITE_UNAVAILABLE_HINT: string;
|
|
167
168
|
export declare const DOMA_WRITE_UNAVAILABLE_HINT: string;
|
|
168
169
|
export declare const DEVC_WRITE_UNAVAILABLE_HINT: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-helpers.d.ts","sourceRoot":"","sources":["../../src/handlers/write-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-helpers.d.ts","sourceRoot":"","sources":["../../src/handlers/write-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAqClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,oBAAoB,EAA0B,MAAM,qBAAqB,CAAC;AAIxF,OAAO,EAAe,KAAK,UAAU,EAAc,MAAM,aAAa,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAiB7G;AAID,eAAO,MAAM,sBAAsB,0DAA0D,CAAC;AAC9F,eAAO,MAAM,2BAA2B,+DAA+D,CAAC;AACxG,eAAO,MAAM,8BAA8B,kFACsC,CAAC;AAOlF,eAAO,MAAM,wBAAwB,mEAAmE,CAAC;AAGzG,eAAO,MAAM,oBAAoB,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GAAG,SAAS,CAIhG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EACpB,eAAe,CAAC,EAAE,OAAO,GACxB,kBAAkB,CAkEpB;AAkBD;;;;;;mFAMmF;AACnF,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,EAC1C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,EACpB,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAKD;+EAC+E;AAC/E,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB7G;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG3G;AAID,eAAO,MAAM,8BAA8B,QAMQ,CAAC;AAEpD,eAAO,MAAM,2BAA2B,QAGmD,CAAC;AAE5F,eAAO,MAAM,2BAA2B,QAG+F,CAAC;AAGxI,eAAO,MAAM,2BAA2B,QAIwD,CAAC;AAEjG,eAAO,MAAM,2BAA2B,QAI0B,CAAC"}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { adtResponsibleAttr, buildDataElementXml, buildDomainXml, buildMessageClassXml, buildServiceBindingXml, buildTableTypeXml, normalizeAdtLanguage, normalizeAdtResponsible, } from '../adt/ddic-xml.js';
|
|
9
9
|
import { syntaxCheck } from '../adt/devtools.js';
|
|
10
|
-
import { AdtSafetyError } from '../adt/errors.js';
|
|
10
|
+
import { AdtError, AdtSafetyError } from '../adt/errors.js';
|
|
11
|
+
import { buildLockObjectXml, getLockObject, LOCKOBJECT_CONTENT_TYPE, mergeLockObjectDefinition, parseLockObjectDefinition, } from '../adt/lock-object.js';
|
|
11
12
|
import { formatRapPreflightFindings, validateRapSource } from '../adt/rap-preflight.js';
|
|
12
13
|
import { checkPackage } from '../adt/safety.js';
|
|
13
14
|
import { createServerDrivenObject, deleteServerDrivenObject, ensureServerDrivenSupport, serverDrivenMetadataContentType, serverDrivenObjectUrl, serverDrivenSourceFormat, serverDrivenUnavailableMessage, updateServerDrivenObjectSource, } from '../adt/server-driven.js';
|
|
@@ -68,7 +69,7 @@ const FUNCTION_MODULE_CONTENT_TYPE = 'application/vnd.sap.adt.functions.fmodules
|
|
|
68
69
|
// "Supported Media Types: …fincludes.v2+xml" — verified on npl 7.50 and a4h 758.
|
|
69
70
|
const FUNCTION_INCLUDE_CONTENT_TYPE = 'application/vnd.sap.adt.functions.fincludes.v2+xml';
|
|
70
71
|
export function isMetadataWriteType(type) {
|
|
71
|
-
return type === 'DOMA' || type === 'DTEL' || type === 'MSAG' || type === 'SRVB' || type === 'TTYP';
|
|
72
|
+
return type === 'DOMA' || type === 'DTEL' || type === 'MSAG' || type === 'SRVB' || type === 'TTYP' || type === 'ENQU';
|
|
72
73
|
}
|
|
73
74
|
/** Types that require a specific vendor content type for creation (not application/*) */
|
|
74
75
|
function needsVendorContentType(type) {
|
|
@@ -78,6 +79,7 @@ function needsVendorContentType(type) {
|
|
|
78
79
|
type === 'MSAG' ||
|
|
79
80
|
type === 'SKTD' ||
|
|
80
81
|
type === 'TTYP' ||
|
|
82
|
+
type === 'ENQU' ||
|
|
81
83
|
type === 'FUGR' ||
|
|
82
84
|
type === 'FUNC');
|
|
83
85
|
}
|
|
@@ -114,6 +116,8 @@ export function vendorContentTypeForType(type) {
|
|
|
114
116
|
return SKTD_V2_CONTENT_TYPE;
|
|
115
117
|
case 'TTYP':
|
|
116
118
|
return TABLETYPE_CONTENT_TYPE;
|
|
119
|
+
case 'ENQU':
|
|
120
|
+
return LOCKOBJECT_CONTENT_TYPE;
|
|
117
121
|
case 'FUGR':
|
|
118
122
|
return FUNCTION_GROUP_CONTENT_TYPE;
|
|
119
123
|
case 'FUNC':
|
|
@@ -182,6 +186,8 @@ export function getMetadataWriteProperties(input) {
|
|
|
182
186
|
// /source/main. Preserve the ADT wire values exactly.
|
|
183
187
|
processingType: input.processingType,
|
|
184
188
|
updateTaskKind: input.updateTaskKind,
|
|
189
|
+
// ENQU carries its definition as JSON in "source" (the same shape SAPRead returns).
|
|
190
|
+
lockObjectSource: input.source,
|
|
185
191
|
};
|
|
186
192
|
return props;
|
|
187
193
|
}
|
|
@@ -267,6 +273,19 @@ export async function mergeMetadataWriteProperties(client, type, name, provided)
|
|
|
267
273
|
deactivateBIDIFiltering: existing.deactivateBIDIFiltering,
|
|
268
274
|
};
|
|
269
275
|
}
|
|
276
|
+
if (type === 'ENQU') {
|
|
277
|
+
// Merge over the developer view so consecutive unactivated edits accumulate.
|
|
278
|
+
const existing = await getLockObject(client.http, client.safety, name);
|
|
279
|
+
const source = provided.lockObjectSource;
|
|
280
|
+
const definition = source === undefined || source === null || String(source).trim() === ''
|
|
281
|
+
? {}
|
|
282
|
+
: parseLockObjectDefinition(String(source));
|
|
283
|
+
return {
|
|
284
|
+
_description: existing.description,
|
|
285
|
+
_package: existing.package,
|
|
286
|
+
lockObjectDefinition: mergeLockObjectDefinition(existing, definition),
|
|
287
|
+
};
|
|
288
|
+
}
|
|
270
289
|
if (type === 'SRVB') {
|
|
271
290
|
const { source: existingRaw } = await client.getSrvb(name);
|
|
272
291
|
const existing = JSON.parse(existingRaw);
|
|
@@ -280,6 +299,40 @@ export async function mergeMetadataWriteProperties(client, type, name, provided)
|
|
|
280
299
|
odataVersion: provided.odataVersion ?? existing.odataVersion,
|
|
281
300
|
};
|
|
282
301
|
}
|
|
302
|
+
if (type === 'TTYP') {
|
|
303
|
+
const existing = await client.getTableType(name).catch((err) => {
|
|
304
|
+
// SAP and transport failures are reported as they are; an unreadable shape has to say why the update stops.
|
|
305
|
+
if (err instanceof AdtError)
|
|
306
|
+
throw err;
|
|
307
|
+
throw new Error(`Cannot update TTYP ${name}: ARC-1 could not read its stored metadata ` +
|
|
308
|
+
`(${err instanceof Error ? err.message : String(err)}) and will not overwrite it blind. ` +
|
|
309
|
+
'Nothing was written. Change this table type in ADT or SE11.');
|
|
310
|
+
});
|
|
311
|
+
// The two row kinds buildTableTypeXml writes, as rowTypeKind values. Ref and range rows have none.
|
|
312
|
+
const storedKind = existing.rowTypeKind === 'predefinedAbapType'
|
|
313
|
+
? 'builtin'
|
|
314
|
+
: existing.rowTypeKind === 'dictionaryType'
|
|
315
|
+
? 'structure'
|
|
316
|
+
: undefined;
|
|
317
|
+
const requested = String(provided.rowType ?? '').trim();
|
|
318
|
+
// Without rowType the caller keeps the stored definition, so ARC-1 must be able to write it back unchanged.
|
|
319
|
+
if (!requested && !(storedKind && existing.plainStandardTable)) {
|
|
320
|
+
const lost = storedKind ? 'its access type, keys or initial row count' : `its ${existing.rowTypeKind} row type`;
|
|
321
|
+
throw new Error(`Cannot update TTYP ${name} without "rowType": ARC-1 rewrites a table type as a standard table with a ` +
|
|
322
|
+
`non-unique standard key and cannot keep ${lost}. Nothing was written. ` +
|
|
323
|
+
'Pass rowType to accept that rewrite, or change this table type in ADT or SE11.');
|
|
324
|
+
}
|
|
325
|
+
// The stored kind and built-in length describe the stored row type: keep them only while it is unchanged.
|
|
326
|
+
const unchanged = !!storedKind && (!requested || requested.toUpperCase() === existing.rowType.toUpperCase());
|
|
327
|
+
return {
|
|
328
|
+
_description: existing.description,
|
|
329
|
+
_package: existing.package,
|
|
330
|
+
rowType: requested || existing.rowType,
|
|
331
|
+
rowTypeKind: provided.rowTypeKind ?? (unchanged ? storedKind : undefined),
|
|
332
|
+
rowTypeLength: unchanged ? existing.rowTypeLength : undefined,
|
|
333
|
+
rowTypeDecimals: unchanged ? existing.rowTypeDecimals : undefined,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
283
336
|
return provided;
|
|
284
337
|
}
|
|
285
338
|
/**
|
|
@@ -386,9 +439,11 @@ function buildCreateXmlBody(type, name, pkg, description, properties, language,
|
|
|
386
439
|
case 'INCL': {
|
|
387
440
|
// With a parent group this is a FUGR STRUCTURAL include: a different collection
|
|
388
441
|
// (/functions/groups/{g}/includes), a different envelope, and Content-Type
|
|
389
|
-
// …fincludes.v2+xml. No packageRef — it inherits the group's package
|
|
390
|
-
//
|
|
391
|
-
const fugrGroup = String(properties?.group ?? '')
|
|
442
|
+
// …fincludes.v2+xml. No packageRef — it inherits the group's package. Default main-program
|
|
443
|
+
// INCLUDE insertion was verified for Z groups on 7.50/758; callers must check their group (#904).
|
|
444
|
+
const fugrGroup = String(properties?.group ?? '')
|
|
445
|
+
.trim()
|
|
446
|
+
.toUpperCase();
|
|
392
447
|
if (fugrGroup) {
|
|
393
448
|
const fugrGroupLc = encodeURIComponent(fugrGroup.toLowerCase());
|
|
394
449
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -556,10 +611,18 @@ function buildCreateXmlBody(type, name, pkg, description, properties, language,
|
|
|
556
611
|
package: pkg,
|
|
557
612
|
rowType,
|
|
558
613
|
rowTypeKind,
|
|
614
|
+
rowTypeLength: properties?.rowTypeLength,
|
|
615
|
+
rowTypeDecimals: properties?.rowTypeDecimals,
|
|
559
616
|
language: masterLanguage,
|
|
560
617
|
responsible: responsibleUser,
|
|
561
618
|
});
|
|
562
619
|
}
|
|
620
|
+
case 'ENQU': {
|
|
621
|
+
// Update passes the merged definition; create parses the caller's JSON source.
|
|
622
|
+
const definition = properties?.lockObjectDefinition ??
|
|
623
|
+
parseLockObjectDefinition(String(properties?.lockObjectSource ?? '{}'));
|
|
624
|
+
return buildLockObjectXml({ name, description, package: pkg, definition, masterLanguage, responsibleAttr });
|
|
625
|
+
}
|
|
563
626
|
case 'DTEL': {
|
|
564
627
|
const typeKindRaw = String(properties?.typeKind ?? '');
|
|
565
628
|
const typeKind = typeKindRaw === 'domain' || typeKindRaw === 'predefinedAbapType' ? typeKindRaw : undefined;
|
|
@@ -699,6 +762,7 @@ export const NAME_CASE_GUARD_ACTIONS = new Set([
|
|
|
699
762
|
'update',
|
|
700
763
|
'edit_method',
|
|
701
764
|
'edit_unit',
|
|
765
|
+
'add_unit',
|
|
702
766
|
'delete',
|
|
703
767
|
'edit_text_symbols',
|
|
704
768
|
]);
|
|
@@ -732,8 +796,8 @@ export async function enforceAllowedPackageForObjectUrl(client, objectUrl, label
|
|
|
732
796
|
* (create gates the caller-supplied package like every create; update/delete resolve the object's true
|
|
733
797
|
* package under the metadata Accept). The `source` param carries AFF JSON or DDL text per the type's
|
|
734
798
|
* registry sourceFormat — the JSON ones are parse-validated before the
|
|
735
|
-
* PUT; ABAP-specific pre-write steps (lint, RAP preflight, CDS guard) do not apply.
|
|
736
|
-
*
|
|
799
|
+
* PUT; ABAP-specific pre-write steps (lint, RAP preflight, CDS guard) do not apply. SAP controls
|
|
800
|
+
* activation: APLO saves are immediately active; other types need SAPActivate.
|
|
737
801
|
*/
|
|
738
802
|
export async function handleServerDrivenObjectWrite(client, action, type, name, args, cachingLayer, cacheSecurity) {
|
|
739
803
|
// Discovery gate — mirror handleSAPRead's server-driven branch.
|
|
@@ -743,6 +807,9 @@ export async function handleServerDrivenObjectWrite(client, action, type, name,
|
|
|
743
807
|
const transport = args.transport;
|
|
744
808
|
const objUrl = serverDrivenObjectUrl(type, name);
|
|
745
809
|
const metadataAccept = serverDrivenMetadataContentType(type);
|
|
810
|
+
const activationHint = type === 'APLO'
|
|
811
|
+
? 'APLO changes are active immediately; no activation is required.'
|
|
812
|
+
: `Next step: SAPActivate(type="${type}", name="${name}").`;
|
|
746
813
|
const invalidate = () => {
|
|
747
814
|
cachingLayer?.invalidate(type, name, 'all');
|
|
748
815
|
invalidateInactiveList(cachingLayer, client, cacheSecurity);
|
|
@@ -770,25 +837,51 @@ export async function handleServerDrivenObjectWrite(client, action, type, name,
|
|
|
770
837
|
case 'create': {
|
|
771
838
|
const pkg = String(args.package ?? '$TMP');
|
|
772
839
|
await checkPackage(client.safety, pkg, client.getPackageHierarchyResolver());
|
|
840
|
+
if (type === 'APLO' && name.length > 20) {
|
|
841
|
+
return errorResult('APLO names must be at most 20 characters. Nothing was created.');
|
|
842
|
+
}
|
|
773
843
|
const description = String(args.description ?? name);
|
|
774
844
|
// Validate BEFORE the create POST — validating after would leave an inactive orphan on SAP
|
|
775
845
|
// that the caller never asked for and has to clean up by hand.
|
|
776
846
|
const validated = hasSourceArg ? validateSource() : undefined;
|
|
777
847
|
if (validated && !validated.ok)
|
|
778
848
|
return validated.result;
|
|
849
|
+
// The job creation wizard requires this reference before the source PUT (notably on 758).
|
|
850
|
+
let creationProperties;
|
|
851
|
+
if (type === 'SAJC' || type === 'SAJT') {
|
|
852
|
+
const field = type === 'SAJC' ? 'className' : 'catalogName';
|
|
853
|
+
const reference = validated?.ok ? JSON.parse(validated.source)?.generalInformation?.[field] : undefined;
|
|
854
|
+
if (typeof reference !== 'string' || !reference.trim()) {
|
|
855
|
+
return errorResult(`Creating ${type} requires source.generalInformation.${field} in the AFF JSON source.`);
|
|
856
|
+
}
|
|
857
|
+
creationProperties = { [field]: reference };
|
|
858
|
+
}
|
|
779
859
|
await createServerDrivenObject(client.http, client.safety, type, name, {
|
|
780
860
|
package: pkg,
|
|
781
861
|
description,
|
|
782
862
|
transport,
|
|
863
|
+
creationProperties,
|
|
783
864
|
});
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
865
|
+
try {
|
|
866
|
+
if (validated?.ok) {
|
|
867
|
+
await updateServerDrivenObjectSource(client.http, client.safety, type, name, validated.source, { transport });
|
|
868
|
+
}
|
|
788
869
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
870
|
+
catch (cause) {
|
|
871
|
+
// The POST succeeded; both HTTP and network failures can leave the object with a partial source.
|
|
872
|
+
const err = cause instanceof AdtError ? cause : new AdtError(cause instanceof Error ? cause.message : String(cause));
|
|
873
|
+
err.extraHint = `${type} ${name} was created in package ${pkg}${type === 'APLO' ? ' and is active' : ''}, but the follow-up source step failed. Check it with SAPRead before using SAPWrite(action="update") — do not repeat create.`;
|
|
874
|
+
throw err;
|
|
875
|
+
}
|
|
876
|
+
finally {
|
|
877
|
+
try {
|
|
878
|
+
invalidate();
|
|
879
|
+
}
|
|
880
|
+
catch {
|
|
881
|
+
// Cache bookkeeping must not replace the confirmed create outcome or its original failure.
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return textResult(`Created ${type} ${name} in package ${pkg}${validated?.ok ? ' and wrote source' : ''}.\n${activationHint}`);
|
|
792
885
|
}
|
|
793
886
|
case 'update': {
|
|
794
887
|
if (!hasSourceArg) {
|
|
@@ -800,17 +893,26 @@ export async function handleServerDrivenObjectWrite(client, action, type, name,
|
|
|
800
893
|
await enforceAllowedPackageForObjectUrl(client, objUrl, `Operations on ${type} '${name}'`, metadataAccept);
|
|
801
894
|
await updateServerDrivenObjectSource(client.http, client.safety, type, name, v.source, { transport });
|
|
802
895
|
invalidate();
|
|
803
|
-
return textResult(`Updated source of ${type} ${name}.\
|
|
896
|
+
return textResult(`Updated source of ${type} ${name}.\n${activationHint}`);
|
|
804
897
|
}
|
|
805
898
|
case 'delete': {
|
|
806
899
|
await enforceAllowedPackageForObjectUrl(client, objUrl, `Operations on ${type} '${name}'`, metadataAccept);
|
|
807
|
-
|
|
808
|
-
|
|
900
|
+
try {
|
|
901
|
+
await deleteServerDrivenObject(client.http, client.safety, type, name, { transport });
|
|
902
|
+
}
|
|
903
|
+
finally {
|
|
904
|
+
try {
|
|
905
|
+
invalidate();
|
|
906
|
+
}
|
|
907
|
+
catch {
|
|
908
|
+
// Best-effort cleanup must not mask partial deletion or prevent the audit event.
|
|
909
|
+
}
|
|
910
|
+
}
|
|
809
911
|
return textResult(`Deleted ${type} ${name}.`);
|
|
810
912
|
}
|
|
811
913
|
default:
|
|
812
914
|
return errorResult(`Action "${action}" is not supported for server-driven object type ${type}. ` +
|
|
813
|
-
'Supported: create, update, delete
|
|
915
|
+
'Supported: create, update, delete.');
|
|
814
916
|
}
|
|
815
917
|
}
|
|
816
918
|
/**
|
|
@@ -1018,6 +1120,9 @@ export const TABL_DT_WRITE_UNAVAILABLE_HINT = 'Transparent table writes via ADT
|
|
|
1018
1120
|
'Use SE11 in SAPGUI, or connect ARC-1 to an SAP_BASIS ≥ 7.52 system. ' +
|
|
1019
1121
|
'Writing the source via /sap/bc/adt/ddic/structures/ would silently flip ' +
|
|
1020
1122
|
'DD02L-TABCLASS to INTTAB and corrupt the table.';
|
|
1123
|
+
export const ENQU_WRITE_UNAVAILABLE_HINT = 'Lock object (ENQU) writes are not available on this system ' +
|
|
1124
|
+
'(/sap/bc/adt/ddic/lockobjects/sources is not exposed by ADT discovery). ' +
|
|
1125
|
+
'Use SE11 in SAPGUI, or connect ARC-1 to a system that exposes the lock-object endpoint.';
|
|
1021
1126
|
export const TTYP_WRITE_UNAVAILABLE_HINT = 'Table type (TTYP) writes are not available on this system ' +
|
|
1022
1127
|
'(/sap/bc/adt/ddic/tabletypes/ is not exposed by ADT discovery — verified absent on NW 7.50). ' +
|
|
1023
1128
|
'Use SE11 in SAPGUI, or connect ARC-1 to a system that exposes the table-type endpoint (S/4HANA 2023 / ABAP Platform 2025 verified).';
|