@orchesty/connector-flexi-bee 1.0.6 → 1.0.7

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.
@@ -0,0 +1,26 @@
1
+ import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
+ import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
3
+ export declare const NAME = "flexibee-create-zavazek-connector";
4
+ export default class FlexiBeeCreateZavazekConnector extends AConnector {
5
+ getName(): string;
6
+ processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>>;
7
+ }
8
+ export interface IResponse {
9
+ winstrom: {
10
+ '@version': string;
11
+ success: string;
12
+ stats: {
13
+ created: string;
14
+ updated: string;
15
+ deleted: string;
16
+ skipped: string;
17
+ failed: string;
18
+ };
19
+ results: IOutput[];
20
+ };
21
+ }
22
+ export interface IOutput {
23
+ id: string;
24
+ 'request-id': `ext:${string}`;
25
+ ref: string;
26
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NAME = void 0;
7
+ const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ const FexiBeeApplication_1 = require("../FexiBeeApplication");
10
+ exports.NAME = `${FexiBeeApplication_1.FLEXI_BEE_APPLICATION}-create-zavazek-connector`;
11
+ class FlexiBeeCreateZavazekConnector extends AConnector_1.default {
12
+ getName() {
13
+ return exports.NAME;
14
+ }
15
+ async processAction(dto) {
16
+ const applicationInstall = await this.getApplicationInstallFromProcess(dto);
17
+ const application = this.getApplication();
18
+ const request = await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.POST, application.getUrl(applicationInstall, 'zavazek'), dto.getJsonData());
19
+ const response = await this.getSender().send(request);
20
+ return dto.setNewJsonData(response.getJsonBody().winstrom.results);
21
+ }
22
+ }
23
+ exports.default = FlexiBeeCreateZavazekConnector;
@@ -0,0 +1,30 @@
1
+ import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
+ import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
3
+ export declare const NAME = "flexibee-create-zavazek-priloha-connector";
4
+ export default class FlexiBeeCreateZavazekPrilohaConnector extends AConnector {
5
+ getName(): string;
6
+ processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput[]>>;
7
+ }
8
+ export interface IInput {
9
+ id: string;
10
+ file: string;
11
+ }
12
+ export interface IResponse {
13
+ winstrom: {
14
+ '@version': string;
15
+ success: string;
16
+ stats: {
17
+ created: string;
18
+ updated: string;
19
+ deleted: string;
20
+ skipped: string;
21
+ failed: string;
22
+ };
23
+ results: IOutput[];
24
+ };
25
+ }
26
+ export interface IOutput {
27
+ id: string;
28
+ 'request-id': `ext:${string}`;
29
+ ref: string;
30
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NAME = void 0;
7
+ const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ const Headers_1 = require("@orchesty/nodejs-sdk/dist/lib/Utils/Headers");
10
+ const FexiBeeApplication_1 = require("../FexiBeeApplication");
11
+ exports.NAME = `${FexiBeeApplication_1.FLEXI_BEE_APPLICATION}-create-zavazek-priloha-connector`;
12
+ class FlexiBeeCreateZavazekPrilohaConnector extends AConnector_1.default {
13
+ getName() {
14
+ return exports.NAME;
15
+ }
16
+ async processAction(dto) {
17
+ const { id, file } = dto.getJsonData();
18
+ const application = this.getApplication();
19
+ const applicationInstall = await this.getApplicationInstallFromProcess(dto);
20
+ const requestDto = (await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PUT, application.getUrl(applicationInstall, `zavazek/${id}/prilohy/new/${id}.pdf`)))
21
+ .addHeaders({ [Headers_1.CommonHeaders.CONTENT_TYPE]: 'application/pdf' })
22
+ .setBody(Buffer.from(file, 'base64'));
23
+ const responseDto = await this.getSender().send(requestDto);
24
+ return dto.setNewJsonData(responseDto.getJsonBody().winstrom.results);
25
+ }
26
+ }
27
+ exports.default = FlexiBeeCreateZavazekPrilohaConnector;
@@ -0,0 +1,23 @@
1
+ import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
+ import ResponseDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/ResponseDto';
3
+ import { IResultRanges } from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/ResultCodeRange';
4
+ import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
5
+ import { FlexiBeeZavazek } from '../types/FlexiBeeZavazek';
6
+ export declare const FLEXI_BEE_GET_ZAVAZEK_CONNECTOR = "flexi-bee-get-zavazek-connector";
7
+ export default class FlexiBeeGetZavazekConnector extends AConnector {
8
+ protected dataKey: string | null;
9
+ constructor(dataKey?: string | null);
10
+ getName(): string;
11
+ processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<FlexiBeeZavazek>>;
12
+ protected getCodeRanges(): IResultRanges | null;
13
+ protected handleResponse(response: ResponseDto<IResponse>, dto: ProcessDto): ProcessDto;
14
+ }
15
+ export interface IInput {
16
+ id: string;
17
+ }
18
+ export interface IResponse {
19
+ winstrom: {
20
+ '@version': string;
21
+ zavazek: FlexiBeeZavazek[];
22
+ };
23
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FLEXI_BEE_GET_ZAVAZEK_CONNECTOR = void 0;
7
+ const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ exports.FLEXI_BEE_GET_ZAVAZEK_CONNECTOR = 'flexi-bee-get-zavazek-connector';
10
+ class FlexiBeeGetZavazekConnector extends AConnector_1.default {
11
+ dataKey;
12
+ constructor(dataKey = null) {
13
+ super();
14
+ this.dataKey = dataKey;
15
+ }
16
+ getName() {
17
+ return exports.FLEXI_BEE_GET_ZAVAZEK_CONNECTOR;
18
+ }
19
+ async processAction(dto) {
20
+ const applicationInstall = await this.getApplicationInstallFromProcess(dto);
21
+ const data = dto.getJsonData();
22
+ let id = data.id;
23
+ if (this.dataKey) {
24
+ id = data[this.dataKey].id;
25
+ }
26
+ const application = this.getApplication();
27
+ const request = await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.GET, application.getUrl(applicationInstall, `zavazek/${id}.json?detail=full`));
28
+ const response = await this.getSender().send(request, this.getCodeRanges());
29
+ return this.handleResponse(response, dto);
30
+ }
31
+ getCodeRanges() {
32
+ return null;
33
+ }
34
+ handleResponse(response, dto) {
35
+ const record = response.getJsonBody().winstrom.zavazek[0] ?? [];
36
+ if (this.dataKey) {
37
+ const data = dto.getJsonData();
38
+ data[this.dataKey] = record;
39
+ dto.setNewJsonData(data);
40
+ }
41
+ else {
42
+ dto.setNewJsonData(record);
43
+ }
44
+ return dto;
45
+ }
46
+ }
47
+ exports.default = FlexiBeeGetZavazekConnector;
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-flexi-bee",
3
3
  "description": "",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -0,0 +1,218 @@
1
+ export interface FlexiBeeZavazek {
2
+ 'external-ids'?: string[];
3
+ 'id': string;
4
+ 'lastUpdate': string;
5
+ 'updatedBy': string;
6
+ 'updatedBy@ref': string;
7
+ 'updatedBy@showAs': string;
8
+ 'createdBy': string;
9
+ 'createdBy@ref': string;
10
+ 'createdBy@showAs': string;
11
+ 'createdDate': string;
12
+ 'kod': string;
13
+ 'zamekK': string;
14
+ 'zamekK@showAs': string;
15
+ 'cisDosle': string;
16
+ 'varSym': string;
17
+ 'cisSml': string;
18
+ 'cisObj': string;
19
+ 'datObj': string;
20
+ 'cisDodak': string;
21
+ 'doprava': string;
22
+ 'datVyst': string;
23
+ 'duzpPuv': string;
24
+ 'duzpUcto': string;
25
+ 'datSplat': string;
26
+ 'datUhr': string;
27
+ 'datTermin': string;
28
+ 'datReal': string;
29
+ 'datSazbyDph': string;
30
+ 'popis': string;
31
+ 'poznam': string;
32
+ 'sumOsv': string;
33
+ 'sumZklSniz': string;
34
+ 'sumZklSniz2': string;
35
+ 'sumZklZakl': string;
36
+ 'sumZklCelkem': string;
37
+ 'sumDphSniz': string;
38
+ 'sumDphSniz2': string;
39
+ 'sumDphZakl': string;
40
+ 'sumDphCelkem': string;
41
+ 'sumCelkSniz': string;
42
+ 'sumCelkSniz2': string;
43
+ 'sumCelkZakl': string;
44
+ 'sumCelkem': string;
45
+ 'sumOsvMen': string;
46
+ 'sumZklSnizMen': string;
47
+ 'sumZklSniz2Men': string;
48
+ 'sumZklZaklMen': string;
49
+ 'sumZklCelkemMen': string;
50
+ 'sumDphZaklMen': string;
51
+ 'sumDphSnizMen': string;
52
+ 'sumDphSniz2Men': string;
53
+ 'sumDphCelkemMen': string;
54
+ 'sumCelkSnizMen': string;
55
+ 'sumCelkSniz2Men': string;
56
+ 'sumCelkZaklMen': string;
57
+ 'sumCelkemMen': string;
58
+ 'kurz': string;
59
+ 'kurzMnozstvi': string;
60
+ 'stavUzivK': string;
61
+ 'nazFirmy': string;
62
+ 'ulice': string;
63
+ 'mesto': string;
64
+ 'psc': string;
65
+ 'eanKod': string;
66
+ 'ic': string;
67
+ 'dic': string;
68
+ 'pocetPriloh': string;
69
+ 'buc': string;
70
+ 'iban': string;
71
+ 'bic': string;
72
+ 'specSym': string;
73
+ 'bezPolozek': string;
74
+ 'ucetni': string;
75
+ 'szbDphSniz': string;
76
+ 'szbDphSniz2': string;
77
+ 'szbDphZakl': string;
78
+ 'uzpTuzemsko': string;
79
+ 'zuctovano': string;
80
+ 'datUcto': string;
81
+ 'vyloucitSaldo': string;
82
+ 'storno': string;
83
+ 'stitky': string;
84
+ 'typDokl': string;
85
+ 'typDokl@ref': string;
86
+ 'typDokl@showAs': string;
87
+ 'mena': string;
88
+ 'mena@ref': string;
89
+ 'mena@showAs': string;
90
+ 'konSym': string;
91
+ 'firma': string;
92
+ 'firma@ref': string;
93
+ 'firma@showAs': string;
94
+ 'stat': string;
95
+ 'stat@ref': string;
96
+ 'stat@showAs': string;
97
+ 'region': string;
98
+ 'banSpojDod': string;
99
+ 'banSpojDod@showAs': string;
100
+ 'banSpojDod@if-not-found': string;
101
+ 'banSpojDod@ref': string;
102
+ 'bankovniUcet': string;
103
+ 'bankovniUcet@ref': string;
104
+ 'bankovniUcet@showAs': string;
105
+ 'typDoklBan': string;
106
+ 'typDoklBan@ref': string;
107
+ 'typDoklBan@showAs': string;
108
+ 'typUcOp': string;
109
+ 'typUcOp@ref': string;
110
+ 'typUcOp@showAs': string;
111
+ 'primUcet': string;
112
+ 'primUcet@ref': string;
113
+ 'primUcet@showAs': string;
114
+ 'protiUcet': string;
115
+ 'protiUcet@ref': string;
116
+ 'protiUcet@showAs': string;
117
+ 'dphZaklUcet': string;
118
+ 'dphZaklUcet@ref': string;
119
+ 'dphZaklUcet@showAs': string;
120
+ 'dphSnizUcet': string;
121
+ 'dphSnizUcet@ref': string;
122
+ 'dphSnizUcet@showAs': string;
123
+ 'dphSniz2Ucet': string;
124
+ 'dphSniz2Ucet@ref': string;
125
+ 'dphSniz2Ucet@showAs': string;
126
+ 'smerKod': string;
127
+ 'smerKod@ref': string;
128
+ 'smerKod@showAs': string;
129
+ 'statDph': string;
130
+ 'statDph@ref': string;
131
+ 'statDph@showAs': string;
132
+ 'clenDph': string;
133
+ 'clenDph@ref': string;
134
+ 'clenDph@showAs': string;
135
+ 'stredisko': string;
136
+ 'stredisko@ref': string;
137
+ 'stredisko@showAs': string;
138
+ 'cinnost': string;
139
+ 'cinnost@ref': string;
140
+ 'cinnost@showAs': string;
141
+ 'zakazka': string;
142
+ 'zakazka@ref': string;
143
+ 'zakazka@showAs': string;
144
+ 'statOdesl': string;
145
+ 'statUrc': string;
146
+ 'statPuvod': string;
147
+ 'statPuvod@ref': string;
148
+ 'statPuvod@showAs': string;
149
+ 'dodPodm': string;
150
+ 'obchTrans': string;
151
+ 'druhDopr': string;
152
+ 'zvlPoh': string;
153
+ 'krajUrc': string;
154
+ 'krajUrc@ref': string;
155
+ 'krajUrc@showAs': string;
156
+ 'uzivatel': string;
157
+ 'uzivatel@ref': string;
158
+ 'uzivatel@showAs': string;
159
+ 'zodpOsoba': string;
160
+ 'zodpOsoba@ref': string;
161
+ 'zodpOsoba@showAs': string;
162
+ 'kontaktOsoba': string;
163
+ 'kontaktJmeno': string;
164
+ 'kontaktEmail': string;
165
+ 'kontaktTel': string;
166
+ 'rada': string;
167
+ 'rada@showAs': string;
168
+ 'rada@if-not-found': string;
169
+ 'rada@ref': string;
170
+ 'sazbaDphOsv': string;
171
+ 'sazbaDphOsv@ref': string;
172
+ 'sazbaDphOsv@showAs': string;
173
+ 'sazbaDphSniz': string;
174
+ 'sazbaDphSniz@ref': string;
175
+ 'sazbaDphSniz@showAs': string;
176
+ 'sazbaDphSniz2': string;
177
+ 'sazbaDphSniz2@ref': string;
178
+ 'sazbaDphSniz2@showAs': string;
179
+ 'sazbaDphZakl': string;
180
+ 'sazbaDphZakl@ref': string;
181
+ 'sazbaDphZakl@showAs': string;
182
+ 'smlouva': string;
183
+ 'formaDopravy': string;
184
+ 'uuid': string;
185
+ 'source': string;
186
+ 'clenKonVykDph': string;
187
+ 'clenKonVykDph@ref': string;
188
+ 'clenKonVykDph@showAs': string;
189
+ 'datUp1': string;
190
+ 'datUp2': string;
191
+ 'datSmir': string;
192
+ 'datPenale': string;
193
+ 'podpisPrik': string;
194
+ 'prikazSum': string;
195
+ 'prikazSumMen': string;
196
+ 'juhSum': string;
197
+ 'juhSumMen': string;
198
+ 'juhDat': string;
199
+ 'juhDatMen': string;
200
+ 'zbyvaUhradit': string;
201
+ 'zbyvaUhraditMen': string;
202
+ 'formaUhradyCis': string;
203
+ 'formaUhradyCis@ref': string;
204
+ 'formaUhradyCis@showAs': string;
205
+ 'stavUhrK': string;
206
+ 'stavUhrK@showAs': string;
207
+ 'juhSumPp': string;
208
+ 'juhSumPpMen': string;
209
+ 'sumPrepl': string;
210
+ 'sumPreplMen': string;
211
+ 'sumZalohy': string;
212
+ 'sumZalohyMen': string;
213
+ 'stavOdpocetK': string;
214
+ 'zakazPlatba': string;
215
+ 'sumCelkemBezZaloh': string;
216
+ 'sumCelkemBezZalohMen': string;
217
+ 'osobUpravaDph': string;
218
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-flexi-bee",
3
3
  "description": "",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",