abapgit-agent 1.5.0 → 1.6.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 -0
- package/abap/guidelines/00_index.md +36 -0
- package/abap/guidelines/01_sql.md +88 -0
- package/abap/guidelines/02_exceptions.md +176 -0
- package/abap/guidelines/03_testing.md +269 -0
- package/abap/guidelines/04_cds.md +136 -0
- package/abap/guidelines/05_classes.md +58 -0
- package/abap/guidelines/06_objects.md +110 -0
- package/abap/guidelines/07_json.md +24 -0
- package/abap/guidelines/08_abapgit.md +222 -0
- package/abap/guidelines/09_unit_testable_code.md +568 -0
- package/bin/abapgit-agent +513 -38
- package/bin/abgagt +24 -0
- package/package.json +8 -2
- package/src/abap-client.js +65 -2
- package/src/agent.js +57 -3
- package/src/config.js +1 -1
- package/src/ref-search.js +1037 -0
- package/.abapGitAgent.example +0 -11
- package/.github/workflows/release.yml +0 -60
- package/API.md +0 -710
- package/CLAUDE.md +0 -1058
- package/CLAUDE_MEM.md +0 -88
- package/ERROR_HANDLING.md +0 -30
- package/INSTALL.md +0 -155
- package/RELEASE_NOTES.md +0 -143
- package/abap/CLAUDE.md +0 -1010
- package/abap/copilot-instructions.md +0 -79
- package/abap/package.devc.xml +0 -10
- package/abap/zcl_abgagt_agent.clas.abap +0 -420
- package/abap/zcl_abgagt_agent.clas.xml +0 -15
- package/abap/zcl_abgagt_cmd_factory.clas.abap +0 -48
- package/abap/zcl_abgagt_cmd_factory.clas.xml +0 -15
- package/abap/zcl_abgagt_command_create.clas.abap +0 -95
- package/abap/zcl_abgagt_command_create.clas.xml +0 -15
- package/abap/zcl_abgagt_command_import.clas.abap +0 -138
- package/abap/zcl_abgagt_command_import.clas.xml +0 -15
- package/abap/zcl_abgagt_command_inspect.clas.abap +0 -456
- package/abap/zcl_abgagt_command_inspect.clas.testclasses.abap +0 -121
- package/abap/zcl_abgagt_command_inspect.clas.xml +0 -16
- package/abap/zcl_abgagt_command_preview.clas.abap +0 -386
- package/abap/zcl_abgagt_command_preview.clas.xml +0 -15
- package/abap/zcl_abgagt_command_pull.clas.abap +0 -80
- package/abap/zcl_abgagt_command_pull.clas.testclasses.abap +0 -87
- package/abap/zcl_abgagt_command_pull.clas.xml +0 -16
- package/abap/zcl_abgagt_command_tree.clas.abap +0 -237
- package/abap/zcl_abgagt_command_tree.clas.xml +0 -15
- package/abap/zcl_abgagt_command_unit.clas.abap +0 -297
- package/abap/zcl_abgagt_command_unit.clas.xml +0 -15
- package/abap/zcl_abgagt_command_view.clas.abap +0 -240
- package/abap/zcl_abgagt_command_view.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_create.clas.abap +0 -71
- package/abap/zcl_abgagt_resource_create.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_health.clas.abap +0 -25
- package/abap/zcl_abgagt_resource_health.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_import.clas.abap +0 -66
- package/abap/zcl_abgagt_resource_import.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_inspect.clas.abap +0 -63
- package/abap/zcl_abgagt_resource_inspect.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_preview.clas.abap +0 -67
- package/abap/zcl_abgagt_resource_preview.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_pull.clas.abap +0 -71
- package/abap/zcl_abgagt_resource_pull.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_tree.clas.abap +0 -70
- package/abap/zcl_abgagt_resource_tree.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_unit.clas.abap +0 -64
- package/abap/zcl_abgagt_resource_unit.clas.xml +0 -15
- package/abap/zcl_abgagt_resource_view.clas.abap +0 -68
- package/abap/zcl_abgagt_resource_view.clas.xml +0 -15
- package/abap/zcl_abgagt_rest_handler.clas.abap +0 -32
- package/abap/zcl_abgagt_rest_handler.clas.xml +0 -15
- package/abap/zcl_abgagt_util.clas.abap +0 -93
- package/abap/zcl_abgagt_util.clas.testclasses.abap +0 -84
- package/abap/zcl_abgagt_util.clas.xml +0 -16
- package/abap/zcl_abgagt_viewer_clas.clas.abap +0 -58
- package/abap/zcl_abgagt_viewer_clas.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_ddls.clas.abap +0 -83
- package/abap/zcl_abgagt_viewer_ddls.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_dtel.clas.abap +0 -98
- package/abap/zcl_abgagt_viewer_dtel.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_factory.clas.abap +0 -41
- package/abap/zcl_abgagt_viewer_factory.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_intf.clas.abap +0 -58
- package/abap/zcl_abgagt_viewer_intf.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_stru.clas.abap +0 -59
- package/abap/zcl_abgagt_viewer_stru.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_tabl.clas.abap +0 -59
- package/abap/zcl_abgagt_viewer_tabl.clas.xml +0 -15
- package/abap/zcl_abgagt_viewer_ttyp.clas.abap +0 -93
- package/abap/zcl_abgagt_viewer_ttyp.clas.xml +0 -15
- package/abap/zif_abgagt_agent.intf.abap +0 -53
- package/abap/zif_abgagt_agent.intf.xml +0 -15
- package/abap/zif_abgagt_cmd_factory.intf.abap +0 -7
- package/abap/zif_abgagt_cmd_factory.intf.xml +0 -15
- package/abap/zif_abgagt_command.intf.abap +0 -26
- package/abap/zif_abgagt_command.intf.xml +0 -15
- package/abap/zif_abgagt_util.intf.abap +0 -28
- package/abap/zif_abgagt_util.intf.xml +0 -15
- package/abap/zif_abgagt_viewer.intf.abap +0 -12
- package/abap/zif_abgagt_viewer.intf.xml +0 -15
- package/docs/commands.md +0 -142
- package/docs/create-command.md +0 -129
- package/docs/health-command.md +0 -89
- package/docs/import-command.md +0 -195
- package/docs/init-command.md +0 -189
- package/docs/inspect-command.md +0 -169
- package/docs/list-command.md +0 -289
- package/docs/preview-command.md +0 -528
- package/docs/pull-command.md +0 -202
- package/docs/status-command.md +0 -68
- package/docs/tree-command.md +0 -303
- package/docs/unit-command.md +0 -167
- package/docs/view-command.md +0 -501
- package/img/claude.png +0 -0
- package/scripts/claude-integration.js +0 -351
- package/scripts/release.js +0 -298
- package/scripts/release.sh +0 -60
- package/scripts/test-integration.js +0 -139
- package/scripts/unrelease.js +0 -277
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
" VIEW command implementation - view ABAP object definitions
|
|
5
|
-
CLASS zcl_abgagt_command_view DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
|
6
|
-
|
|
7
|
-
PUBLIC SECTION.
|
|
8
|
-
INTERFACES zif_abgagt_command.
|
|
9
|
-
|
|
10
|
-
TYPES: BEGIN OF ty_view_params,
|
|
11
|
-
objects TYPE string_table,
|
|
12
|
-
type TYPE string,
|
|
13
|
-
END OF ty_view_params.
|
|
14
|
-
|
|
15
|
-
TYPES: BEGIN OF ty_component,
|
|
16
|
-
field TYPE string,
|
|
17
|
-
key TYPE abap_bool,
|
|
18
|
-
type TYPE string,
|
|
19
|
-
length TYPE int4,
|
|
20
|
-
dataelement TYPE string,
|
|
21
|
-
description TYPE string,
|
|
22
|
-
END OF ty_component.
|
|
23
|
-
|
|
24
|
-
TYPES: BEGIN OF ty_view_object,
|
|
25
|
-
name TYPE string,
|
|
26
|
-
type TYPE string,
|
|
27
|
-
type_text TYPE string,
|
|
28
|
-
description TYPE string,
|
|
29
|
-
domain TYPE string,
|
|
30
|
-
domain_type TYPE string,
|
|
31
|
-
domain_length TYPE int4,
|
|
32
|
-
domain_decimals TYPE int4,
|
|
33
|
-
source TYPE string,
|
|
34
|
-
definition TYPE string,
|
|
35
|
-
not_found TYPE abap_bool,
|
|
36
|
-
components TYPE STANDARD TABLE OF ty_component WITH DEFAULT KEY,
|
|
37
|
-
END OF ty_view_object.
|
|
38
|
-
|
|
39
|
-
TYPES ty_view_objects TYPE STANDARD TABLE OF ty_view_object WITH DEFAULT KEY.
|
|
40
|
-
|
|
41
|
-
TYPES: BEGIN OF ty_summary,
|
|
42
|
-
total TYPE i,
|
|
43
|
-
by_type TYPE string_table,
|
|
44
|
-
END OF ty_summary.
|
|
45
|
-
|
|
46
|
-
TYPES: BEGIN OF ty_view_result,
|
|
47
|
-
success TYPE abap_bool,
|
|
48
|
-
command TYPE string,
|
|
49
|
-
message TYPE string,
|
|
50
|
-
objects TYPE ty_view_objects,
|
|
51
|
-
summary TYPE ty_summary,
|
|
52
|
-
error TYPE string,
|
|
53
|
-
END OF ty_view_result.
|
|
54
|
-
|
|
55
|
-
METHODS detect_object_type
|
|
56
|
-
IMPORTING iv_name TYPE string
|
|
57
|
-
RETURNING VALUE(rv_type) TYPE string.
|
|
58
|
-
|
|
59
|
-
METHODS get_object_info
|
|
60
|
-
IMPORTING iv_name TYPE string
|
|
61
|
-
iv_type TYPE string
|
|
62
|
-
RETURNING VALUE(rs_object) TYPE ty_view_object.
|
|
63
|
-
|
|
64
|
-
METHODS build_summary
|
|
65
|
-
IMPORTING it_objects TYPE ty_view_objects
|
|
66
|
-
RETURNING VALUE(rs_summary) TYPE ty_summary.
|
|
67
|
-
|
|
68
|
-
ENDCLASS.
|
|
69
|
-
|
|
70
|
-
CLASS zcl_abgagt_command_view IMPLEMENTATION.
|
|
71
|
-
|
|
72
|
-
METHOD zif_abgagt_command~get_name.
|
|
73
|
-
rv_name = zif_abgagt_command=>gc_view.
|
|
74
|
-
ENDMETHOD.
|
|
75
|
-
|
|
76
|
-
METHOD zif_abgagt_command~execute.
|
|
77
|
-
DATA: ls_params TYPE ty_view_params,
|
|
78
|
-
ls_result TYPE ty_view_result,
|
|
79
|
-
lt_objects TYPE ty_view_objects,
|
|
80
|
-
lv_object TYPE string,
|
|
81
|
-
lo_factory TYPE REF TO zcl_abgagt_viewer_factory,
|
|
82
|
-
lo_viewer TYPE REF TO zif_abgagt_viewer,
|
|
83
|
-
ls_info TYPE ty_view_object.
|
|
84
|
-
|
|
85
|
-
ls_result-command = zif_abgagt_command=>gc_view.
|
|
86
|
-
|
|
87
|
-
IF is_param IS SUPPLIED.
|
|
88
|
-
ls_params = CORRESPONDING #( is_param ).
|
|
89
|
-
ENDIF.
|
|
90
|
-
|
|
91
|
-
IF ls_params-objects IS INITIAL.
|
|
92
|
-
ls_result-success = abap_false.
|
|
93
|
-
ls_result-error = 'Objects parameter is required'.
|
|
94
|
-
rv_result = /ui2/cl_json=>serialize( data = ls_result ).
|
|
95
|
-
RETURN.
|
|
96
|
-
ENDIF.
|
|
97
|
-
|
|
98
|
-
lo_factory = zcl_abgagt_viewer_factory=>get_instance( ).
|
|
99
|
-
|
|
100
|
-
LOOP AT ls_params-objects INTO lv_object.
|
|
101
|
-
ls_info-name = lv_object.
|
|
102
|
-
|
|
103
|
-
DATA(lv_type) = ls_params-type.
|
|
104
|
-
IF lv_type IS INITIAL.
|
|
105
|
-
lv_type = detect_object_type( lv_object ).
|
|
106
|
-
ENDIF.
|
|
107
|
-
|
|
108
|
-
" Check if object was not found in TADIR
|
|
109
|
-
IF lv_type IS INITIAL.
|
|
110
|
-
ls_info-not_found = abap_true.
|
|
111
|
-
ls_info-type_text = 'Unknown'.
|
|
112
|
-
ELSE.
|
|
113
|
-
ls_info-type = lv_type.
|
|
114
|
-
|
|
115
|
-
" Set type text
|
|
116
|
-
CASE lv_type.
|
|
117
|
-
WHEN 'CLAS'. ls_info-type_text = 'Class'.
|
|
118
|
-
WHEN 'INTF'. ls_info-type_text = 'Interface'.
|
|
119
|
-
WHEN 'TABL'. ls_info-type_text = 'Table'.
|
|
120
|
-
WHEN 'STRU'. ls_info-type_text = 'Structure'.
|
|
121
|
-
WHEN 'DTEL'. ls_info-type_text = 'Data Element'.
|
|
122
|
-
WHEN 'TTYP'. ls_info-type_text = 'Table Type'.
|
|
123
|
-
WHEN 'DDLS'. ls_info-type_text = 'CDS View'.
|
|
124
|
-
WHEN OTHERS. ls_info-type_text = lv_type.
|
|
125
|
-
ENDCASE.
|
|
126
|
-
|
|
127
|
-
" Get viewer and retrieve info only if object was found
|
|
128
|
-
TRY.
|
|
129
|
-
lo_viewer = lo_factory->get_viewer( lv_type ).
|
|
130
|
-
IF lo_viewer IS BOUND.
|
|
131
|
-
ls_info = lo_viewer->get_info( lv_object ).
|
|
132
|
-
ELSE.
|
|
133
|
-
ls_info = get_object_info( iv_name = lv_object iv_type = lv_type ).
|
|
134
|
-
ENDIF.
|
|
135
|
-
CATCH cx_sy_create_object_error.
|
|
136
|
-
" Fallback for unknown types
|
|
137
|
-
ls_info = get_object_info( iv_name = lv_object iv_type = lv_type ).
|
|
138
|
-
ENDTRY.
|
|
139
|
-
ENDIF.
|
|
140
|
-
|
|
141
|
-
APPEND ls_info TO lt_objects.
|
|
142
|
-
ENDLOOP.
|
|
143
|
-
|
|
144
|
-
ls_result-success = abap_true.
|
|
145
|
-
ls_result-message = 'Retrieved object(s)'.
|
|
146
|
-
ls_result-objects = lt_objects.
|
|
147
|
-
ls_result-summary = build_summary( lt_objects ).
|
|
148
|
-
|
|
149
|
-
rv_result = /ui2/cl_json=>serialize( data = ls_result ).
|
|
150
|
-
ENDMETHOD.
|
|
151
|
-
|
|
152
|
-
METHOD detect_object_type.
|
|
153
|
-
" Query TADIR to find actual object type
|
|
154
|
-
SELECT SINGLE object FROM tadir
|
|
155
|
-
INTO rv_type
|
|
156
|
-
WHERE obj_name = iv_name
|
|
157
|
-
AND object IN ('CLAS', 'INTF', 'TABL', 'DTEL', 'STRU', 'TTYP', 'DDLS').
|
|
158
|
-
ENDMETHOD.
|
|
159
|
-
|
|
160
|
-
METHOD get_object_info.
|
|
161
|
-
DATA lv_obj_name TYPE string.
|
|
162
|
-
DATA lv_devclass TYPE tadir-devclass.
|
|
163
|
-
|
|
164
|
-
rs_object-name = iv_name.
|
|
165
|
-
rs_object-type = iv_type.
|
|
166
|
-
|
|
167
|
-
CASE iv_type.
|
|
168
|
-
WHEN 'CLAS' OR 'INTF'.
|
|
169
|
-
IF iv_type = 'CLAS'.
|
|
170
|
-
rs_object-type_text = 'Class'.
|
|
171
|
-
ELSE.
|
|
172
|
-
rs_object-type_text = 'Interface'.
|
|
173
|
-
ENDIF.
|
|
174
|
-
|
|
175
|
-
SELECT SINGLE obj_name devclass FROM tadir
|
|
176
|
-
INTO (lv_obj_name, lv_devclass)
|
|
177
|
-
WHERE obj_name = iv_name
|
|
178
|
-
AND object = iv_type.
|
|
179
|
-
IF sy-subrc = 0.
|
|
180
|
-
rs_object-description = |{ rs_object-type_text } { iv_name } in { lv_devclass }|.
|
|
181
|
-
ENDIF.
|
|
182
|
-
|
|
183
|
-
WHEN 'TABL'.
|
|
184
|
-
rs_object-type_text = 'Table'.
|
|
185
|
-
SELECT SINGLE obj_name devclass FROM tadir
|
|
186
|
-
INTO (lv_obj_name, lv_devclass)
|
|
187
|
-
WHERE obj_name = iv_name
|
|
188
|
-
AND object = 'TABL'.
|
|
189
|
-
IF sy-subrc = 0.
|
|
190
|
-
rs_object-description = |Table { iv_name } in { lv_devclass }|.
|
|
191
|
-
ENDIF.
|
|
192
|
-
|
|
193
|
-
WHEN 'STRU'.
|
|
194
|
-
rs_object-type_text = 'Structure'.
|
|
195
|
-
SELECT SINGLE obj_name devclass FROM tadir
|
|
196
|
-
INTO (lv_obj_name, lv_devclass)
|
|
197
|
-
WHERE obj_name = iv_name
|
|
198
|
-
AND object = 'TABL'.
|
|
199
|
-
IF sy-subrc = 0.
|
|
200
|
-
rs_object-description = |Structure { iv_name } in { lv_devclass }|.
|
|
201
|
-
ENDIF.
|
|
202
|
-
|
|
203
|
-
WHEN 'DTEL'.
|
|
204
|
-
rs_object-type_text = 'Data Element'.
|
|
205
|
-
SELECT SINGLE obj_name devclass FROM tadir
|
|
206
|
-
INTO (lv_obj_name, lv_devclass)
|
|
207
|
-
WHERE obj_name = iv_name
|
|
208
|
-
AND object = 'DTEL'.
|
|
209
|
-
IF sy-subrc = 0.
|
|
210
|
-
rs_object-description = |Data Element { iv_name } in { lv_devclass }|.
|
|
211
|
-
ENDIF.
|
|
212
|
-
|
|
213
|
-
WHEN OTHERS.
|
|
214
|
-
rs_object-type_text = iv_type.
|
|
215
|
-
ENDCASE.
|
|
216
|
-
ENDMETHOD.
|
|
217
|
-
|
|
218
|
-
METHOD build_summary.
|
|
219
|
-
rs_summary-total = lines( it_objects ).
|
|
220
|
-
|
|
221
|
-
DATA lv_type TYPE string.
|
|
222
|
-
DATA lv_found.
|
|
223
|
-
DATA ls_type TYPE string.
|
|
224
|
-
|
|
225
|
-
LOOP AT it_objects INTO DATA(ls_obj).
|
|
226
|
-
lv_type = ls_obj-type.
|
|
227
|
-
lv_found = abap_false.
|
|
228
|
-
LOOP AT rs_summary-by_type INTO ls_type.
|
|
229
|
-
IF ls_type = lv_type.
|
|
230
|
-
lv_found = abap_true.
|
|
231
|
-
EXIT.
|
|
232
|
-
ENDIF.
|
|
233
|
-
ENDLOOP.
|
|
234
|
-
IF lv_found = abap_false.
|
|
235
|
-
APPEND lv_type TO rs_summary-by_type.
|
|
236
|
-
ENDIF.
|
|
237
|
-
ENDLOOP.
|
|
238
|
-
ENDMETHOD.
|
|
239
|
-
|
|
240
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_COMMAND_VIEW</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>VIEW command - view ABAP object definitions</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
CLASS zcl_abgagt_resource_create DEFINITION PUBLIC FINAL
|
|
5
|
-
INHERITING FROM cl_rest_resource
|
|
6
|
-
CREATE PUBLIC.
|
|
7
|
-
|
|
8
|
-
PUBLIC SECTION.
|
|
9
|
-
METHODS if_rest_resource~post REDEFINITION.
|
|
10
|
-
|
|
11
|
-
ENDCLASS.
|
|
12
|
-
|
|
13
|
-
CLASS zcl_abgagt_resource_create IMPLEMENTATION.
|
|
14
|
-
|
|
15
|
-
METHOD if_rest_resource~post.
|
|
16
|
-
DATA lv_json TYPE string.
|
|
17
|
-
lv_json = mo_request->get_entity( )->get_string_data( ).
|
|
18
|
-
|
|
19
|
-
" Parse JSON using /ui2/cl_json
|
|
20
|
-
DATA: BEGIN OF ls_request,
|
|
21
|
-
url TYPE string,
|
|
22
|
-
branch TYPE string,
|
|
23
|
-
package TYPE string,
|
|
24
|
-
display_name TYPE string,
|
|
25
|
-
name TYPE string,
|
|
26
|
-
folder_logic TYPE string,
|
|
27
|
-
folder TYPE string,
|
|
28
|
-
username TYPE string,
|
|
29
|
-
password TYPE string,
|
|
30
|
-
END OF ls_request.
|
|
31
|
-
|
|
32
|
-
/ui2/cl_json=>deserialize(
|
|
33
|
-
EXPORTING
|
|
34
|
-
json = lv_json
|
|
35
|
-
CHANGING
|
|
36
|
-
data = ls_request ).
|
|
37
|
-
|
|
38
|
-
" Validate required fields
|
|
39
|
-
IF ls_request-url IS INITIAL OR ls_request-package IS INITIAL.
|
|
40
|
-
DATA lv_json_resp TYPE string.
|
|
41
|
-
lv_json_resp = '{"success":"","error":"URL and package are required"}'.
|
|
42
|
-
DATA(lo_entity) = mo_response->create_entity( ).
|
|
43
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
44
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
45
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
46
|
-
RETURN.
|
|
47
|
-
ENDIF.
|
|
48
|
-
|
|
49
|
-
" Get command from factory
|
|
50
|
-
DATA(lo_factory) = zcl_abgagt_cmd_factory=>get_instance( ).
|
|
51
|
-
DATA(lo_command) = lo_factory->get_command( zif_abgagt_command=>gc_create ).
|
|
52
|
-
|
|
53
|
-
IF lo_command IS NOT BOUND.
|
|
54
|
-
lv_json_resp = '{"success":"","error":"CREATE command not found"}'.
|
|
55
|
-
lo_entity = mo_response->create_entity( ).
|
|
56
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
57
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
58
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
59
|
-
RETURN.
|
|
60
|
-
ENDIF.
|
|
61
|
-
|
|
62
|
-
" Execute command with is_param
|
|
63
|
-
DATA(lv_result) = lo_command->execute( is_param = ls_request ).
|
|
64
|
-
|
|
65
|
-
lo_entity = mo_response->create_entity( ).
|
|
66
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
67
|
-
lo_entity->set_string_data( lv_result ).
|
|
68
|
-
mo_response->set_status( cl_rest_status_code=>gc_success_ok ).
|
|
69
|
-
ENDMETHOD.
|
|
70
|
-
|
|
71
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_RESOURCE_CREATE</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>ABAP Git Agent - Create Resource</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
CLASS zcl_abgagt_resource_health DEFINITION PUBLIC FINAL
|
|
5
|
-
INHERITING FROM cl_rest_resource
|
|
6
|
-
CREATE PUBLIC.
|
|
7
|
-
|
|
8
|
-
PUBLIC SECTION.
|
|
9
|
-
METHODS if_rest_resource~get REDEFINITION.
|
|
10
|
-
|
|
11
|
-
ENDCLASS.
|
|
12
|
-
|
|
13
|
-
CLASS zcl_abgagt_resource_health IMPLEMENTATION.
|
|
14
|
-
|
|
15
|
-
METHOD if_rest_resource~get.
|
|
16
|
-
DATA lv_json TYPE string.
|
|
17
|
-
lv_json = '{"status":"OK","version":"1.4.0"}'.
|
|
18
|
-
|
|
19
|
-
DATA(lo_entity) = mo_response->create_entity( ).
|
|
20
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
21
|
-
lo_entity->set_string_data( lv_json ).
|
|
22
|
-
mo_response->set_status( cl_rest_status_code=>gc_success_ok ).
|
|
23
|
-
ENDMETHOD.
|
|
24
|
-
|
|
25
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_RESOURCE_HEALTH</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>ABAP Git Agent - Health Resource</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
CLASS zcl_abgagt_resource_import DEFINITION PUBLIC FINAL
|
|
5
|
-
INHERITING FROM cl_rest_resource
|
|
6
|
-
CREATE PUBLIC.
|
|
7
|
-
|
|
8
|
-
PUBLIC SECTION.
|
|
9
|
-
METHODS if_rest_resource~post REDEFINITION.
|
|
10
|
-
|
|
11
|
-
ENDCLASS.
|
|
12
|
-
|
|
13
|
-
CLASS zcl_abgagt_resource_import IMPLEMENTATION.
|
|
14
|
-
|
|
15
|
-
METHOD if_rest_resource~post.
|
|
16
|
-
DATA lv_json TYPE string.
|
|
17
|
-
lv_json = mo_request->get_entity( )->get_string_data( ).
|
|
18
|
-
|
|
19
|
-
" Parse JSON using /ui2/cl_json
|
|
20
|
-
DATA: BEGIN OF ls_request,
|
|
21
|
-
url TYPE string,
|
|
22
|
-
message TYPE string,
|
|
23
|
-
username TYPE string,
|
|
24
|
-
password TYPE string,
|
|
25
|
-
END OF ls_request.
|
|
26
|
-
|
|
27
|
-
/ui2/cl_json=>deserialize(
|
|
28
|
-
EXPORTING
|
|
29
|
-
json = lv_json
|
|
30
|
-
CHANGING
|
|
31
|
-
data = ls_request ).
|
|
32
|
-
|
|
33
|
-
" Validate required fields
|
|
34
|
-
IF ls_request-url IS INITIAL.
|
|
35
|
-
DATA lv_json_resp TYPE string.
|
|
36
|
-
lv_json_resp = '{"success":"","error":"URL is required"}'.
|
|
37
|
-
DATA(lo_entity) = mo_response->create_entity( ).
|
|
38
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
39
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
40
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
41
|
-
RETURN.
|
|
42
|
-
ENDIF.
|
|
43
|
-
|
|
44
|
-
" Get command from factory
|
|
45
|
-
DATA(lo_factory) = zcl_abgagt_cmd_factory=>get_instance( ).
|
|
46
|
-
DATA(lo_command) = lo_factory->get_command( zif_abgagt_command=>gc_import ).
|
|
47
|
-
|
|
48
|
-
IF lo_command IS NOT BOUND.
|
|
49
|
-
lv_json_resp = '{"success":"","error":"IMPORT command not found"}'.
|
|
50
|
-
lo_entity = mo_response->create_entity( ).
|
|
51
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
52
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
53
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
54
|
-
RETURN.
|
|
55
|
-
ENDIF.
|
|
56
|
-
|
|
57
|
-
" Execute command with is_param
|
|
58
|
-
DATA(lv_result) = lo_command->execute( is_param = ls_request ).
|
|
59
|
-
|
|
60
|
-
lo_entity = mo_response->create_entity( ).
|
|
61
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
62
|
-
lo_entity->set_string_data( lv_result ).
|
|
63
|
-
mo_response->set_status( cl_rest_status_code=>gc_success_ok ).
|
|
64
|
-
ENDMETHOD.
|
|
65
|
-
|
|
66
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_RESOURCE_IMPORT</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>REST resource handler for /import endpoint</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
CLASS zcl_abgagt_resource_inspect DEFINITION PUBLIC FINAL
|
|
5
|
-
INHERITING FROM cl_rest_resource
|
|
6
|
-
CREATE PUBLIC.
|
|
7
|
-
|
|
8
|
-
PUBLIC SECTION.
|
|
9
|
-
METHODS if_rest_resource~post REDEFINITION.
|
|
10
|
-
|
|
11
|
-
ENDCLASS.
|
|
12
|
-
|
|
13
|
-
CLASS zcl_abgagt_resource_inspect IMPLEMENTATION.
|
|
14
|
-
|
|
15
|
-
METHOD if_rest_resource~post.
|
|
16
|
-
DATA lv_json TYPE string.
|
|
17
|
-
lv_json = mo_request->get_entity( )->get_string_data( ).
|
|
18
|
-
|
|
19
|
-
" Parse JSON using /ui2/cl_json
|
|
20
|
-
DATA: BEGIN OF ls_request,
|
|
21
|
-
files TYPE string_table,
|
|
22
|
-
variant TYPE string,
|
|
23
|
-
END OF ls_request.
|
|
24
|
-
|
|
25
|
-
/ui2/cl_json=>deserialize(
|
|
26
|
-
EXPORTING
|
|
27
|
-
json = lv_json
|
|
28
|
-
CHANGING
|
|
29
|
-
data = ls_request ).
|
|
30
|
-
|
|
31
|
-
DATA lv_json_resp TYPE string.
|
|
32
|
-
IF ls_request-files IS INITIAL OR lines( ls_request-files ) = 0.
|
|
33
|
-
lv_json_resp = '{"success":"","object_type":"","object_name":"","error_count":1,"errors":[{"line":"1","column":"1","text":"Files list is required"}]}'.
|
|
34
|
-
DATA(lo_entity) = mo_response->create_entity( ).
|
|
35
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
36
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
37
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
38
|
-
RETURN.
|
|
39
|
-
ENDIF.
|
|
40
|
-
|
|
41
|
-
" Get command from factory
|
|
42
|
-
DATA(lo_factory) = zcl_abgagt_cmd_factory=>get_instance( ).
|
|
43
|
-
DATA(lo_command) = lo_factory->get_command( zif_abgagt_command=>gc_inspect ).
|
|
44
|
-
|
|
45
|
-
IF lo_command IS NOT BOUND.
|
|
46
|
-
lv_json_resp = '{"success":"","error":"INSPECT command not found"}'.
|
|
47
|
-
lo_entity = mo_response->create_entity( ).
|
|
48
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
49
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
50
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
51
|
-
RETURN.
|
|
52
|
-
ENDIF.
|
|
53
|
-
|
|
54
|
-
" Execute command with is_param
|
|
55
|
-
DATA(lv_result) = lo_command->execute( is_param = ls_request ).
|
|
56
|
-
|
|
57
|
-
lo_entity = mo_response->create_entity( ).
|
|
58
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
59
|
-
lo_entity->set_string_data( lv_result ).
|
|
60
|
-
mo_response->set_status( cl_rest_status_code=>gc_success_ok ).
|
|
61
|
-
ENDMETHOD.
|
|
62
|
-
|
|
63
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_RESOURCE_INSPECT</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>ABAP Git Agent - Inspect Resource</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
*"*"use source
|
|
2
|
-
*"*"Local Interface:
|
|
3
|
-
*"**********************************************************************
|
|
4
|
-
CLASS zcl_abgagt_resource_preview DEFINITION PUBLIC FINAL
|
|
5
|
-
INHERITING FROM cl_rest_resource
|
|
6
|
-
CREATE PUBLIC.
|
|
7
|
-
|
|
8
|
-
PUBLIC SECTION.
|
|
9
|
-
METHODS if_rest_resource~post REDEFINITION.
|
|
10
|
-
|
|
11
|
-
ENDCLASS.
|
|
12
|
-
|
|
13
|
-
CLASS zcl_abgagt_resource_preview IMPLEMENTATION.
|
|
14
|
-
|
|
15
|
-
METHOD if_rest_resource~post.
|
|
16
|
-
DATA lv_json TYPE string.
|
|
17
|
-
lv_json = mo_request->get_entity( )->get_string_data( ).
|
|
18
|
-
|
|
19
|
-
" Parse JSON using /ui2/cl_json
|
|
20
|
-
DATA: BEGIN OF ls_request,
|
|
21
|
-
objects TYPE string_table,
|
|
22
|
-
type TYPE string,
|
|
23
|
-
limit TYPE i,
|
|
24
|
-
where TYPE string,
|
|
25
|
-
columns TYPE string_table,
|
|
26
|
-
END OF ls_request.
|
|
27
|
-
|
|
28
|
-
/ui2/cl_json=>deserialize(
|
|
29
|
-
EXPORTING
|
|
30
|
-
json = lv_json
|
|
31
|
-
CHANGING
|
|
32
|
-
data = ls_request ).
|
|
33
|
-
|
|
34
|
-
DATA lv_json_resp TYPE string.
|
|
35
|
-
|
|
36
|
-
IF ls_request-objects IS INITIAL.
|
|
37
|
-
lv_json_resp = '{"success":false,"command":"PREVIEW","error":"Objects parameter is required"}'.
|
|
38
|
-
DATA(lo_entity) = mo_response->create_entity( ).
|
|
39
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
40
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
41
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
42
|
-
RETURN.
|
|
43
|
-
ENDIF.
|
|
44
|
-
|
|
45
|
-
" Get command from factory
|
|
46
|
-
DATA(lo_factory) = zcl_abgagt_cmd_factory=>get_instance( ).
|
|
47
|
-
DATA(lo_command) = lo_factory->get_command( zif_abgagt_command=>gc_preview ).
|
|
48
|
-
|
|
49
|
-
IF lo_command IS NOT BOUND.
|
|
50
|
-
lv_json_resp = '{"success":false,"command":"PREVIEW","error":"PREVIEW command not found"}'.
|
|
51
|
-
lo_entity = mo_response->create_entity( ).
|
|
52
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
53
|
-
lo_entity->set_string_data( lv_json_resp ).
|
|
54
|
-
mo_response->set_status( cl_rest_status_code=>gc_client_error_bad_request ).
|
|
55
|
-
RETURN.
|
|
56
|
-
ENDIF.
|
|
57
|
-
|
|
58
|
-
" Execute command - pass request as generic parameter
|
|
59
|
-
DATA(lv_result) = lo_command->execute( is_param = ls_request ).
|
|
60
|
-
|
|
61
|
-
lo_entity = mo_response->create_entity( ).
|
|
62
|
-
lo_entity->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
|
|
63
|
-
lo_entity->set_string_data( lv_result ).
|
|
64
|
-
mo_response->set_status( cl_rest_status_code=>gc_success_ok ).
|
|
65
|
-
ENDMETHOD.
|
|
66
|
-
|
|
67
|
-
ENDCLASS.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
|
3
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
4
|
-
<asx:values>
|
|
5
|
-
<VSEOCLASS>
|
|
6
|
-
<CLSNAME>ZCL_ABGAGT_RESOURCE_PREVIEW</CLSNAME>
|
|
7
|
-
<LANGU>E</LANGU>
|
|
8
|
-
<DESCRIPT>PREVIEW command REST resource handler</DESCRIPT>
|
|
9
|
-
<EXPOSURE>2</EXPOSURE>
|
|
10
|
-
<STATE>1</STATE>
|
|
11
|
-
<UNICODE>X</UNICODE>
|
|
12
|
-
</VSEOCLASS>
|
|
13
|
-
</asx:values>
|
|
14
|
-
</asx:abap>
|
|
15
|
-
</abapGit>
|