Wiki source code of Tracking Type
Version 9.2 by Achraf El Kari on 2021/11/25 11:26
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
5 | = Introduction = | ||
6 | |||
7 | We will go through all endpoints needed to manage the Tracking type entity. | ||
8 | |||
9 | = Endpoints = | ||
10 | |||
11 | **PS:** __//For all those endpoints, the env params are mandatory on the header, otherwise you got an error 400 (BAD PARAMS).//__ | ||
12 | |||
13 | |||
14 | |(% style="width:202px" %)**URL [method]**|(% style="width:126px" %)**Description**|(% style="width:250px" %)**Input example**|(% style="width:449px" %)**Output example** | ||
15 | |(% style="width:202px" %)((( | ||
16 | /rest/trackingType [GET] | ||
17 | |||
18 | |||
19 | hedear : Authorization + env => Mandatory | ||
20 | |||
21 | )))|(% style="width:126px" %)((( | ||
22 | get **all **tracking Types of the giving environment ==> | ||
23 | |||
24 | order, orderLine... | ||
25 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)[[attach:TrackingTypes.json||target="_blank"]] | ||
26 | |(% style="width:202px" %)/rest/trackingType [POST]|(% style="width:126px" %)Insert or update new TrackingType|(% style="width:250px" %){{code language="json"}}{ | ||
27 | "alias": "order", | ||
28 | "env": "iXPath", | ||
29 | "label": { | ||
30 | "fr": "Commande de Merde", | ||
31 | "en": "Order" | ||
32 | }, | ||
33 | "dataTypes": [ | ||
34 | { | ||
35 | "alias": "orderNumber", | ||
36 | "label": { | ||
37 | "fr": "Numéro de commande", | ||
38 | "en": "Order Number" | ||
39 | }, | ||
40 | { | ||
41 | "alias": "orderLine", | ||
42 | "label": { | ||
43 | "fr": "Ligne de commande", | ||
44 | "en": "Order Lines" | ||
45 | }, | ||
46 | "type": "TRACKING", | ||
47 | "trackingType": "orderLine", | ||
48 | "mandatory": true, | ||
49 | "isList": false | ||
50 | } | ||
51 | ] | ||
52 | }{{/code}}|(% style="width:449px" %){{code language="JSON"}}{ | ||
53 | "timestamp": 1620217014704, | ||
54 | "status": "200", | ||
55 | "data": [ | ||
56 | { | ||
57 | "date": "Tue May 04 16:37:49 GMT+01:00 2021", | ||
58 | "current": "true", | ||
59 | "author": "person1232", | ||
60 | "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e", | ||
61 | "message": "version 2" | ||
62 | }, | ||
63 | { | ||
64 | "date": "Tue May 04 13:28:12 GMT+01:00 2021", | ||
65 | "current": "false", | ||
66 | "author": "person1", | ||
67 | "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c", | ||
68 | "message": "version 1" | ||
69 | } | ||
70 | ] | ||
71 | }{{/code}} | ||
72 | |(% style="width:202px" %)/rest/git/commit [POST]|(% style="width:126px" %)commit changes in files with a message|(% style="width:250px" %){{code language="JSON"}}{ | ||
73 | "files": | ||
74 | [ | ||
75 | {"fileName" : "newFile.xml"}, | ||
76 | {"fileName" : "/dir/modifiedFile.pdf"} | ||
77 | ], | ||
78 | "message": "this is a commit message" | ||
79 | }{{/code}}|(% style="width:449px" %)((( | ||
80 | it returns a String with the commit message meaning that the commit has passed successfully. | ||
81 | |||
82 | eg : | ||
83 | |||
84 | {{code language="JSON"}}{ | ||
85 | "timestamp": 1620217700570, | ||
86 | "status": "200", | ||
87 | "data": "this is a commit message" | ||
88 | }{{/code}} | ||
89 | ))) | ||
90 | |(% style="width:202px" %)((( | ||
91 | /rest/git/switchComit/{id} | ||
92 | |||
93 | [GET] | ||
94 | )))|(% style="width:126px" %)((( | ||
95 | switch to a certain version and return the history of all commits. | ||
96 | |||
97 | **__NB __**: if there are some modified files in the current version, these files will be moved to a new directory called : | ||
98 | |||
99 | .../archive/git-{timestamp} | ||
100 | )))|(% style="width:250px" %)((( | ||
101 | |||
102 | |||
103 | |||
104 | )))|(% style="width:449px" %)((( | ||
105 | {{code language="JSON"}} | ||
106 | { | ||
107 | "timestamp": 1620217014704, | ||
108 | "status": "200", | ||
109 | "data": [ | ||
110 | { | ||
111 | "date": "Tue May 04 16:37:49 GMT+01:00 2021", | ||
112 | "current": "false", | ||
113 | "author": "person1232", | ||
114 | "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e", | ||
115 | "message": "version 2" | ||
116 | }, | ||
117 | { | ||
118 | "date": "Tue May 04 13:28:12 GMT+01:00 2021", | ||
119 | "current": "true", | ||
120 | "author": "person1", | ||
121 | "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c", | ||
122 | "message": "version 1" | ||
123 | } | ||
124 | ] | ||
125 | } | ||
126 | {{/code}} | ||
127 | ))) | ||
128 | |(% style="width:202px" %)/rest/git/update [GET]|(% style="width:126px" %)((( | ||
129 | Integrates and pulls changes from a remote repository into the current branch. | ||
130 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)((( | ||
131 | it returns a success message. | ||
132 | |||
133 | eg : | ||
134 | |||
135 | {{code language="JSON"}} | ||
136 | { | ||
137 | "timestamp": 1620219625637, | ||
138 | "status": "200", | ||
139 | "data": "branch is now updated" | ||
140 | } | ||
141 | {{/code}} | ||
142 | ))) | ||
143 | |(% style="width:202px" %)/rest/environment/init [POST]|(% style="width:126px" %)((( | ||
144 | Clone a git repository into the directory of the current environment, | ||
145 | |||
146 | if it doesn't exist it creates a new directory and initialize the repo, | ||
147 | |||
148 | if the directory exists, the endpoint renames the directory and creates a new one and clones the repository. | ||
149 | )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)((( | ||
150 | it returns a "success" message : | ||
151 | |||
152 | eg : | ||
153 | |||
154 | {{code language="JSON"}} | ||
155 | { | ||
156 | "timestamp": 1620229625932, | ||
157 | "status": "200", | ||
158 | "data": "Repository initialized successfully !" | ||
159 | } | ||
160 | {{/code}} | ||
161 | ))) | ||
162 | |(% style="width:202px" %)/rest/git/checkout/{branch} [POST]|(% style="width:126px" %)switch to a certain branch|(% style="width:250px" %)((( | ||
163 | the {branch} must be replaced by the name of the branch destination. | ||
164 | |||
165 | eg : /rest/git/checkout/master | ||
166 | |||
167 | /rest/git/checkout/develop | ||
168 | )))|(% style="width:449px" %)((( | ||
169 | it returns a "success" message of checkout branch. | ||
170 | |||
171 | eg : | ||
172 | |||
173 | {{code language="JSON"}} | ||
174 | { | ||
175 | "timestamp": 1620229625932, | ||
176 | "status": "200", | ||
177 | "data": "switched to branch : master" | ||
178 | } | ||
179 | {{/code}} | ||
180 | ))) | ||
181 | |(% style="width:202px" %)((( | ||
182 | /rest/git/newbranch/{branch} | ||
183 | |||
184 | [POST] | ||
185 | )))|(% style="width:126px" %)create and switch to a new branch |(% style="width:250px" %)((( | ||
186 | the {branch} must be replaced by the name of the branch destination. | ||
187 | |||
188 | eg : | ||
189 | |||
190 | /rest/git/checkout/newBranch | ||
191 | )))|(% style="width:449px" %)((( | ||
192 | it returns a "success" message of the branch creation. | ||
193 | |||
194 | eg : | ||
195 | |||
196 | {{code language="JSON"}} | ||
197 | { | ||
198 | "timestamp": 1620229625932, | ||
199 | "status": "200", | ||
200 | "data": "new branch has been created : newBranch" | ||
201 | } | ||
202 | {{/code}} | ||
203 | ))) | ||
204 | |(% style="width:202px" %)/rest/git/revert [POST]|(% style="width:126px" %)switch the modified file to the initial head version. |(% style="width:250px" %) |(% style="width:449px" %)((( | ||
205 | it returns a "success" message. | ||
206 | |||
207 | eg : | ||
208 | |||
209 | {{code language="JSON"}} | ||
210 | { | ||
211 | "timestamp": 1620229625932, | ||
212 | "status": "200", | ||
213 | "data": "the selected files has been synchronized to HEAD successfully !" | ||
214 | } | ||
215 | {{/code}} | ||
216 | ))) | ||
217 | |||
218 | = Errors = | ||
219 | |||
220 | below, you can find an example of technical and functional errors : | ||
221 | |||
222 | {{code language="JSON"}} | ||
223 | { | ||
224 | "timestamp": 1620221672951, | ||
225 | "status": "500", | ||
226 | "error": "JSON file is not valid", | ||
227 | "thechnicalError": "JSONObject[\"fileName\"] not found." | ||
228 | } | ||
229 | {{/code}} | ||
230 | |||
231 | the functional error is shown with the JSON key "error", while technical error is stored in the "thechnicalError" key. | ||
232 | |||
233 | |||
234 | == == |