136 lines
3.4 KiB
YAML
136 lines
3.4 KiB
YAML
info:
|
|
name: Codici fiscali ripartizioni
|
|
type: http
|
|
seq: 3
|
|
|
|
http:
|
|
method: POST
|
|
url: "{{elixFormsApiUrl}}/eftl/process/v1"
|
|
headers:
|
|
- name: x-requested-with
|
|
value: XMLHttpRequest
|
|
- name: x-api-key
|
|
value: "{{elixFormsWsAuthenticationToken}}"
|
|
- name: x-ef-request-id
|
|
value: "21223"
|
|
disabled: true
|
|
- name: x-ef-request-id
|
|
value: "21334"
|
|
body:
|
|
type: json
|
|
data: "{\r
|
|
|
|
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
|
|
|
\ \"userContext\": {\r
|
|
|
|
\ \"lang\": \"IT\",\r
|
|
|
|
\ \"crlf\": \"\\r\\n\"\r
|
|
|
|
\ }\r
|
|
|
|
}"
|
|
auth: inherit
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: before-request
|
|
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
|
|
|
var eftlDocumentToBeProcessed = String.raw`\r
|
|
|
|
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
|
|
|
[VAR name=\"ripartizioniIterableWithSep\" type=\"iterable\"][SPLIT regex=\"#\"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,CONCAT,#[/TAG][/SPLIT][/VAR]\r
|
|
|
|
[VAR name=\"ripartizioniCount\" type=\"string\"][SIZE_OF varname=\"ripartizioniIterableWithSep\" /][/VAR]\r
|
|
|
|
\r
|
|
|
|
[VAR name=\"ripartizioniJoin\" type=\"string\"][% ripartizioniJoin = \"\"; %][/VAR]\r
|
|
|
|
\r
|
|
|
|
[IF][CONDITION][% ripartizioniCount > 0 %][/CONDITION][THEN]\r
|
|
|
|
\ [VAR name=\"ripartizioneIdx\" type=\"string\"][% ripartizioneIdx = 0; %][/VAR]\r
|
|
|
|
\ [VAR name=\"firstItem\" type=\"number\"][% firstItem = 0; %][/VAR]\r
|
|
|
|
\ [VAR name=\"secondItem\" type=\"number\"][% secondItem = 1; %][/VAR]\r
|
|
|
|
\r
|
|
|
|
\ [WHILE threshold=\"99\"]\r
|
|
|
|
\ [CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION]\r
|
|
|
|
\ [DO]\r
|
|
|
|
\ [VAR name=\"ripartizioneFull\" type=\"string\"][VALUE_OF varname=\"ripartizioniIterableWithSep\" index=\"ripartizioneIdx\" /][/VAR]\r
|
|
|
|
\ [VAR name=\"ripartizioneFullIterable\" type=\"iterable\"][SPLIT regex=\" \\(CF: \"][TRIM][VALUE_OF varname=\"ripartizioneFull\" /][/TRIM][/SPLIT][/VAR]\r
|
|
|
|
\ [VAR name=\"ripartizioneCFIterable\" type=\"iterable\"][SPLIT regex=\"\\)\"][VALUE_OF varname=\"ripartizioneFullIterable\" index=\"secondItem\" /][/SPLIT][/VAR]\r
|
|
|
|
\ [VAR name=\"ripartizioneCF\" type=\"string\"][VALUE_OF varname=\"ripartizioneCFIterable\" index=\"firstItem\" /][/VAR]\r
|
|
|
|
\ [% ripartizioniJoin = ripartizioniJoin + ripartizioneCF; %]\r
|
|
|
|
\r
|
|
|
|
\ [% ripartizioneIdx = ripartizioneIdx + 1; %]\r
|
|
|
|
\r
|
|
|
|
\ [IF][CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION][THEN]\r
|
|
|
|
\ [% ripartizioniJoin = ripartizioniJoin + \"#\"; %]\r
|
|
|
|
\ [/THEN][/IF]\r
|
|
|
|
\ [/DO]\r
|
|
|
|
\ [/WHILE]\r
|
|
|
|
[/THEN][/IF]\r
|
|
|
|
\r
|
|
|
|
[!--\r
|
|
|
|
[%= ripartizioniCount %]\r
|
|
|
|
[%= crlf %]\r
|
|
|
|
[%= ripartizioneIdx %]\r
|
|
|
|
[%= crlf %]\r
|
|
|
|
[%= \"JOIN: \" ripartizioniJoin %]\r
|
|
|
|
--]\r
|
|
|
|
\r
|
|
|
|
[%= ripartizioniJoin %]\r
|
|
|
|
[/EFTL]\r
|
|
|
|
`;\r
|
|
|
|
\r
|
|
|
|
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
|
|
|
\r
|
|
|
|
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|