arc-1 0.6.10 → 0.7.0
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 +8 -7
- package/bin/arc1-cli.js +10 -0
- package/bin/arc1.js +1 -1
- package/dist/adt/cds-impact.d.ts +35 -0
- package/dist/adt/cds-impact.d.ts.map +1 -1
- package/dist/adt/cds-impact.js +71 -0
- package/dist/adt/cds-impact.js.map +1 -1
- package/dist/adt/client.d.ts +4 -1
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +18 -5
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/crud.d.ts.map +1 -1
- package/dist/adt/crud.js +32 -5
- package/dist/adt/crud.js.map +1 -1
- package/dist/adt/devtools.d.ts +39 -3
- package/dist/adt/devtools.d.ts.map +1 -1
- package/dist/adt/devtools.js +237 -25
- package/dist/adt/devtools.js.map +1 -1
- package/dist/adt/diagnostics.d.ts +69 -7
- package/dist/adt/diagnostics.d.ts.map +1 -1
- package/dist/adt/diagnostics.js +694 -36
- package/dist/adt/diagnostics.js.map +1 -1
- package/dist/adt/errors.d.ts +14 -1
- package/dist/adt/errors.d.ts.map +1 -1
- package/dist/adt/errors.js +40 -9
- package/dist/adt/errors.js.map +1 -1
- package/dist/adt/http.d.ts.map +1 -1
- package/dist/adt/http.js +86 -1
- package/dist/adt/http.js.map +1 -1
- package/dist/adt/rap-handlers.d.ts +165 -0
- package/dist/adt/rap-handlers.d.ts.map +1 -0
- package/dist/adt/rap-handlers.js +835 -0
- package/dist/adt/rap-handlers.js.map +1 -0
- package/dist/adt/rap-preflight.d.ts +43 -0
- package/dist/adt/rap-preflight.d.ts.map +1 -0
- package/dist/adt/rap-preflight.js +405 -0
- package/dist/adt/rap-preflight.js.map +1 -0
- package/dist/adt/safety.d.ts +60 -36
- package/dist/adt/safety.d.ts.map +1 -1
- package/dist/adt/safety.js +202 -120
- package/dist/adt/safety.js.map +1 -1
- package/dist/adt/transport.d.ts +1 -1
- package/dist/adt/transport.js +2 -2
- package/dist/adt/transport.js.map +1 -1
- package/dist/adt/types.d.ts +88 -0
- package/dist/adt/types.d.ts.map +1 -1
- package/dist/adt/xml-parser.d.ts +13 -1
- package/dist/adt/xml-parser.d.ts.map +1 -1
- package/dist/adt/xml-parser.js +26 -15
- package/dist/adt/xml-parser.js.map +1 -1
- package/dist/authz/policy.d.ts +53 -0
- package/dist/authz/policy.d.ts.map +1 -0
- package/dist/authz/policy.js +199 -0
- package/dist/authz/policy.js.map +1 -0
- package/dist/cli-args.d.ts +14 -0
- package/dist/cli-args.d.ts.map +1 -0
- package/dist/cli-args.js +62 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli.d.ts +13 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +252 -55
- package/dist/cli.js.map +1 -1
- package/dist/extract-sap-cookies.d.ts +24 -0
- package/dist/extract-sap-cookies.d.ts.map +1 -0
- package/dist/extract-sap-cookies.js +317 -0
- package/dist/extract-sap-cookies.js.map +1 -0
- package/dist/handlers/hyperfocused.d.ts +4 -3
- package/dist/handlers/hyperfocused.d.ts.map +1 -1
- package/dist/handlers/hyperfocused.js +25 -16
- package/dist/handlers/hyperfocused.js.map +1 -1
- package/dist/handlers/intent.d.ts +4 -12
- package/dist/handlers/intent.d.ts.map +1 -1
- package/dist/handlers/intent.js +1238 -114
- package/dist/handlers/intent.js.map +1 -1
- package/dist/handlers/schemas.d.ts +38 -10
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +69 -4
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +251 -164
- package/dist/handlers/tools.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/server/audit.d.ts +26 -3
- package/dist/server/audit.d.ts.map +1 -1
- package/dist/server/audit.js.map +1 -1
- package/dist/server/config.d.ts +34 -19
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +320 -193
- package/dist/server/config.js.map +1 -1
- package/dist/server/deny-actions.d.ts +31 -0
- package/dist/server/deny-actions.d.ts.map +1 -0
- package/dist/server/deny-actions.js +156 -0
- package/dist/server/deny-actions.js.map +1 -0
- package/dist/server/effective-policy-log.d.ts +27 -0
- package/dist/server/effective-policy-log.d.ts.map +1 -0
- package/dist/server/effective-policy-log.js +103 -0
- package/dist/server/effective-policy-log.js.map +1 -0
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +15 -16
- package/dist/server/http.js.map +1 -1
- package/dist/server/server.d.ts +37 -3
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +231 -30
- package/dist/server/server.js.map +1 -1
- package/dist/server/types.d.ts +29 -13
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +10 -11
- package/dist/server/types.js.map +1 -1
- package/dist/server/xsuaa.d.ts +1 -2
- package/dist/server/xsuaa.d.ts.map +1 -1
- package/dist/server/xsuaa.js +13 -14
- package/dist/server/xsuaa.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RAP behavior-pool handler scaffolding.
|
|
3
|
+
*
|
|
4
|
+
* Context — this module exists because on-prem RAP development has a tight
|
|
5
|
+
* contract between a BDEF (behavior definition source) and its behavior pool
|
|
6
|
+
* (the ABAP global class named in `managed implementation in class ZBP_...`).
|
|
7
|
+
* Every `action` / `determination` / `validation` / `authorization master`
|
|
8
|
+
* declared in the BDEF requires a matching METHOD signature inside a local
|
|
9
|
+
* handler class (`lhc_<alias>`). If any signature is missing, the class will
|
|
10
|
+
* not activate and the error reported by ADT doesn't tell the developer
|
|
11
|
+
* which signatures are missing — they see a generic "behavior pool does not
|
|
12
|
+
* implement the required method for ..." message.
|
|
13
|
+
*
|
|
14
|
+
* The exported helpers cooperate:
|
|
15
|
+
* 1. extractRapHandlerRequirements — parse BDEF → list of required methods
|
|
16
|
+
* 2. findMissingRapHandlerRequirements — diff required vs. present in class
|
|
17
|
+
* 3. applyRapHandlerSignatures — insert the missing METHODS lines
|
|
18
|
+
* 4. applyRapHandlerImplementationStubs — insert empty METHOD stubs
|
|
19
|
+
* 5. applyRapHandlerScaffold — plan multi-include auto-apply
|
|
20
|
+
*
|
|
21
|
+
* The scaffolder writes declarations plus empty implementations only.
|
|
22
|
+
* Business logic remains the developer's responsibility and can be filled
|
|
23
|
+
* with edit_method.
|
|
24
|
+
*
|
|
25
|
+
* Naming convention: handler classes use the prefix `lhc_` (local handler
|
|
26
|
+
* class) followed by the lowercased alias from the BDEF. This is the RAP
|
|
27
|
+
* convention SAP's own templates use (see cl_abap_behavior_handler examples
|
|
28
|
+
* in /DMO/* and the "Create Behavior Implementation Class" wizard in ADT).
|
|
29
|
+
*/
|
|
30
|
+
export type RapHandlerKind = 'action' | 'determination' | 'validation' | 'instance_authorization' | 'global_authorization';
|
|
31
|
+
export interface RapHandlerRequirement {
|
|
32
|
+
kind: RapHandlerKind;
|
|
33
|
+
methodName: string;
|
|
34
|
+
entityName: string;
|
|
35
|
+
entityAlias: string;
|
|
36
|
+
targetHandlerClass: string;
|
|
37
|
+
declarationLine: number;
|
|
38
|
+
signature: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RapHandlerApplySkipped {
|
|
41
|
+
requirement: RapHandlerRequirement;
|
|
42
|
+
reason: string;
|
|
43
|
+
}
|
|
44
|
+
export interface RapHandlerApplyResult {
|
|
45
|
+
updatedSource: string;
|
|
46
|
+
inserted: RapHandlerRequirement[];
|
|
47
|
+
skipped: RapHandlerApplySkipped[];
|
|
48
|
+
changed: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type RapHandlerSectionName = 'main' | 'definitions' | 'implementations';
|
|
51
|
+
export interface RapHandlerSourceSections {
|
|
52
|
+
main: string;
|
|
53
|
+
definitions?: string;
|
|
54
|
+
implementations?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface RapHandlerSectionApplyResults {
|
|
57
|
+
main: RapHandlerApplyResult;
|
|
58
|
+
definitions?: RapHandlerApplyResult;
|
|
59
|
+
implementations?: RapHandlerApplyResult;
|
|
60
|
+
}
|
|
61
|
+
export interface RapHandlerScaffoldPlan {
|
|
62
|
+
sections: RapHandlerSourceSections;
|
|
63
|
+
signatures: RapHandlerSectionApplyResults;
|
|
64
|
+
implementationStubs: RapHandlerSectionApplyResults;
|
|
65
|
+
unresolved: RapHandlerRequirement[];
|
|
66
|
+
changed: Record<RapHandlerSectionName, boolean>;
|
|
67
|
+
changedSections: RapHandlerSectionName[];
|
|
68
|
+
insertedSignatureCount: number;
|
|
69
|
+
insertedImplementationStubCount: number;
|
|
70
|
+
}
|
|
71
|
+
export declare function rapHandlerRequirementKey(requirement: RapHandlerRequirement): string;
|
|
72
|
+
/**
|
|
73
|
+
* Extract RAP behavior-pool handler method requirements from interface BDEF source.
|
|
74
|
+
*
|
|
75
|
+
* For every behavior block (one per entity in the BDEF), this produces the
|
|
76
|
+
* exact METHOD signatures that the behavior pool's `lhc_<alias>` class must
|
|
77
|
+
* declare for the class to activate. The output is used by:
|
|
78
|
+
* - findMissingRapHandlerRequirements: to diff against an existing class
|
|
79
|
+
* - applyRapHandlerSignatures: to synthesize the missing METHODS lines
|
|
80
|
+
*
|
|
81
|
+
* The emitted signatures mirror what SAP's "Create Behavior Implementation"
|
|
82
|
+
* wizard would generate — same FOR MODIFY/FOR DETERMINE ON/FOR VALIDATE ON
|
|
83
|
+
* syntax, same `alias~method` entity reference, same RESULT clause only when
|
|
84
|
+
* the BDEF declares a `result` cardinality.
|
|
85
|
+
*/
|
|
86
|
+
export declare function extractRapHandlerRequirements(bdefSource: string): RapHandlerRequirement[];
|
|
87
|
+
/**
|
|
88
|
+
* Parse method declarations (`METHODS ...`) per class definition.
|
|
89
|
+
*
|
|
90
|
+
* The returned Set contains BOTH:
|
|
91
|
+
* 1. Every declared METHOD name in the class (e.g. `submitforapproval`,
|
|
92
|
+
* `set_status_accepted`, `validate_customer`)
|
|
93
|
+
* 2. Every RAP binding-key those methods are bound to (the action /
|
|
94
|
+
* determination / validation / authorization referenced in the
|
|
95
|
+
* `FOR ACTION <alias>~<name>` / `FOR <alias>~<name>` /
|
|
96
|
+
* `FOR INSTANCE AUTHORIZATION ... FOR <alias>` clauses)
|
|
97
|
+
*
|
|
98
|
+
* Why both? Hand-crafted behavior pools (like SAP's own /DMO/BP_TRAVEL_M)
|
|
99
|
+
* routinely use semantic method names that differ from the BDEF action
|
|
100
|
+
* names — e.g. BDEF `action acceptTravel` bound to METHOD
|
|
101
|
+
* `set_status_accepted` via `FOR ACTION travel~acceptTravel`. The
|
|
102
|
+
* scaffolder's missing-requirement check compares by BDEF identifier, so if
|
|
103
|
+
* we only indexed method names, it would incorrectly report
|
|
104
|
+
* `accepttravel` as missing and try to inject a duplicate METHOD line.
|
|
105
|
+
*
|
|
106
|
+
* METHOD declarations can span multiple lines (one line for the name +
|
|
107
|
+
* continuation lines for FOR / IMPORTING / RESULT), so we join the
|
|
108
|
+
* statement up to its terminating `.` before pattern-matching the binding.
|
|
109
|
+
*/
|
|
110
|
+
export declare function parseClassDefinitionMethods(source: string): Map<string, Set<string>>;
|
|
111
|
+
/**
|
|
112
|
+
* Determine which RAP handler requirements are missing from class definitions.
|
|
113
|
+
*
|
|
114
|
+
* If the target handler class (`lhc_<alias>`) doesn't exist in the source at
|
|
115
|
+
* all, every requirement for that class is reported missing so the caller
|
|
116
|
+
* can decide whether to create the class or fall through to another include
|
|
117
|
+
* (the scaffold flow searches `main` → `definitions` → `implementations`).
|
|
118
|
+
*
|
|
119
|
+
* Method-name comparison is case-insensitive because ABAP identifiers
|
|
120
|
+
* are — we normalize on both sides so `METHODS SubmitForApproval ...`
|
|
121
|
+
* matches a BDEF `action SubmitForApproval`.
|
|
122
|
+
*/
|
|
123
|
+
export declare function findMissingRapHandlerRequirements(requirements: RapHandlerRequirement[], classSource: string): RapHandlerRequirement[];
|
|
124
|
+
export declare function findMissingRapHandlerImplementationStubs(requirements: RapHandlerRequirement[], classSource: string): RapHandlerRequirement[];
|
|
125
|
+
/**
|
|
126
|
+
* Insert missing RAP handler signatures into matching `lhc_*` class definitions.
|
|
127
|
+
*
|
|
128
|
+
* Scope and contract:
|
|
129
|
+
* - Only DEFINITION sections are modified. Use
|
|
130
|
+
* applyRapHandlerImplementationStubs after this step when the scaffold
|
|
131
|
+
* should be immediately patchable with edit_method.
|
|
132
|
+
* - Requirements whose target class (`lhc_<alias>`) is not present in this
|
|
133
|
+
* source are returned in `skipped`, not silently dropped. The caller can
|
|
134
|
+
* then try another include (definitions/implementations) or surface a
|
|
135
|
+
* clear error to the user.
|
|
136
|
+
* - Edits are applied bottom-up (highest line index first) so that earlier
|
|
137
|
+
* splice operations don't shift the indices of later ones.
|
|
138
|
+
* - When a target class exists but has no PRIVATE SECTION at all, the
|
|
139
|
+
* entire PRIVATE SECTION with the signatures is inserted just before
|
|
140
|
+
* ENDCLASS — this covers freshly-generated behavior pools where ADT
|
|
141
|
+
* produced a skeleton without method declarations.
|
|
142
|
+
*/
|
|
143
|
+
export declare function applyRapHandlerSignatures(classSource: string, requirements: RapHandlerRequirement[]): RapHandlerApplyResult;
|
|
144
|
+
export declare function applyRapHandlerImplementationStubs(classSource: string, requirements: RapHandlerRequirement[], options?: {
|
|
145
|
+
createImplementationBlocks?: boolean;
|
|
146
|
+
definitionSource?: string;
|
|
147
|
+
}): RapHandlerApplyResult;
|
|
148
|
+
/**
|
|
149
|
+
* Build the complete auto-apply plan for a behavior pool without doing I/O.
|
|
150
|
+
*
|
|
151
|
+
* This is intentionally pure: the MCP handler owns safety checks, locks,
|
|
152
|
+
* linting, and ADT writes; this helper owns the RAP-specific sequencing:
|
|
153
|
+
* 1. insert missing METHODS declarations into whichever include contains
|
|
154
|
+
* the matching `lhc_<alias> DEFINITION`
|
|
155
|
+
* 2. skip stubs whose declarations still could not be placed
|
|
156
|
+
* 3. insert empty METHOD stubs using the concrete ABAP method name from
|
|
157
|
+
* existing/new declarations, including semantic names bound via
|
|
158
|
+
* `FOR ACTION alias~ActionName`
|
|
159
|
+
*
|
|
160
|
+
* Keeping this plan here prevents `intent.ts` from duplicating RAP parser
|
|
161
|
+
* invariants such as "deferred classes are not editable" and "stub method
|
|
162
|
+
* names come from declarations, not necessarily from BDEF action names".
|
|
163
|
+
*/
|
|
164
|
+
export declare function applyRapHandlerScaffold(sections: RapHandlerSourceSections, missingSignatures: RapHandlerRequirement[], missingImplementationStubs: RapHandlerRequirement[]): RapHandlerScaffoldPlan;
|
|
165
|
+
//# sourceMappingURL=rap-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rap-handlers.d.ts","sourceRoot":"","sources":["../../src/adt/rap-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,eAAe,GACf,YAAY,GACZ,wBAAwB,GACxB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,qBAAqB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE/E,MAAM,WAAW,wBAA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