@orchesty/connector-flexi-bee 1.0.4 → 1.0.5

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.
@@ -7,7 +7,7 @@ export default class FlexiBeeCreateFakturaPrijataPrilohaConnector extends AConne
7
7
  }
8
8
  export interface IInput {
9
9
  id: string;
10
- content: string;
10
+ file: string;
11
11
  }
12
12
  export interface IResponse {
13
13
  winstrom: {
@@ -14,12 +14,12 @@ class FlexiBeeCreateFakturaPrijataPrilohaConnector extends AConnector_1.default
14
14
  return exports.NAME;
15
15
  }
16
16
  async processAction(dto) {
17
- const { id, content } = dto.getJsonData();
17
+ const { id, file } = dto.getJsonData();
18
18
  const application = this.getApplication();
19
19
  const applicationInstall = await this.getApplicationInstallFromProcess(dto);
20
20
  const requestDto = (await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PUT, application.getUrl(applicationInstall, `faktura-prijata/${id}/prilohy/new/${id}.pdf`)))
21
21
  .addHeaders({ [Headers_1.CommonHeaders.CONTENT_TYPE]: 'application/pdf' })
22
- .setBody(Buffer.from(content, 'base64'));
22
+ .setBody(Buffer.from(file, 'base64'));
23
23
  const responseDto = await this.getSender().send(requestDto);
24
24
  return dto.setNewJsonData(responseDto.getJsonBody().winstrom.results);
25
25
  }
@@ -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 { FlexiBeeFakturaPrijata } from '../types/FlexiBeeFakturaPrijata';
6
+ export declare const FLEXI_BEE_GET_FAKTURA_PRIJATA_CONNECTOR = "flexi-bee-get-faktura-prijata-connector";
7
+ export default class FlexiBeeGetFakturaPrijataConnector extends AConnector {
8
+ protected dataKey: string | null;
9
+ constructor(dataKey?: string | null);
10
+ getName(): string;
11
+ processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<FlexiBeeFakturaPrijata>>;
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
+ 'faktura-prijata': FlexiBeeFakturaPrijata[];
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_FAKTURA_PRIJATA_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_FAKTURA_PRIJATA_CONNECTOR = 'flexi-bee-get-faktura-prijata-connector';
10
+ class FlexiBeeGetFakturaPrijataConnector 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_FAKTURA_PRIJATA_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, `faktura-prijata/${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 invoice = response.getJsonBody().winstrom['faktura-prijata'][0] ?? [];
36
+ if (this.dataKey) {
37
+ const data = dto.getJsonData();
38
+ data[this.dataKey] = invoice;
39
+ dto.setNewJsonData(data);
40
+ }
41
+ else {
42
+ dto.setNewJsonData(invoice);
43
+ }
44
+ return dto;
45
+ }
46
+ }
47
+ exports.default = FlexiBeeGetFakturaPrijataConnector;
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.3",
4
+ "version": "1.0.4",
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,204 @@
1
+ export interface FlexiBeeFakturaPrijata {
2
+ 'id': string;
3
+ 'lastUpdate': string;
4
+ 'updatedBy': string;
5
+ 'updatedBy@ref': string;
6
+ 'updatedBy@showAs': string;
7
+ 'createdBy': string;
8
+ 'createdBy@ref': string;
9
+ 'createdBy@showAs': string;
10
+ 'createdDate': string;
11
+ 'kod': string;
12
+ 'zamekK': string;
13
+ 'zamekK@showAs': string;
14
+ 'cisDosle': string;
15
+ 'varSym': string;
16
+ 'cisSml': string;
17
+ 'cisObj': string;
18
+ 'datObj': string;
19
+ 'cisDodak': string;
20
+ 'doprava': string;
21
+ 'datVyst': string;
22
+ 'duzpPuv': string;
23
+ 'duzpUcto': string;
24
+ 'datSplat': string;
25
+ 'datUhr': string;
26
+ 'datTermin': string;
27
+ 'datReal': string;
28
+ 'datSazbyDph': string;
29
+ 'popis': string;
30
+ 'poznam': string;
31
+ 'sumOsv': string;
32
+ 'sumZklSniz': string;
33
+ 'sumZklSniz2': string;
34
+ 'sumZklZakl': string;
35
+ 'sumZklCelkem': string;
36
+ 'sumDphSniz': string;
37
+ 'sumDphSniz2': string;
38
+ 'sumDphZakl': string;
39
+ 'sumDphCelkem': string;
40
+ 'sumCelkSniz': string;
41
+ 'sumCelkSniz2': string;
42
+ 'sumCelkZakl': string;
43
+ 'sumCelkem': string;
44
+ 'sumOsvMen': string;
45
+ 'sumZklSnizMen': string;
46
+ 'sumZklSniz2Men': string;
47
+ 'sumZklZaklMen': string;
48
+ 'sumZklCelkemMen': string;
49
+ 'sumDphZaklMen': string;
50
+ 'sumDphSnizMen': string;
51
+ 'sumDphSniz2Men': string;
52
+ 'sumDphCelkemMen': string;
53
+ 'sumCelkSnizMen': string;
54
+ 'sumCelkSniz2Men': string;
55
+ 'sumCelkZaklMen': string;
56
+ 'sumCelkemMen': string;
57
+ 'slevaDokl': 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
+ 'typDoklSkl': string;
109
+ 'typDoklSkl@ref': string;
110
+ 'typDoklSkl@showAs': string;
111
+ 'typUcOp': string;
112
+ 'primUcet': string;
113
+ 'primUcet@ref': string;
114
+ 'primUcet@showAs': string;
115
+ 'protiUcet': string;
116
+ 'dphZaklUcet': string;
117
+ 'dphSnizUcet': string;
118
+ 'dphSniz2Ucet': string;
119
+ 'smerKod': string;
120
+ 'smerKod@ref': string;
121
+ 'smerKod@showAs': string;
122
+ 'statDph': string;
123
+ 'statDph@ref': string;
124
+ 'statDph@showAs': string;
125
+ 'clenDph': string;
126
+ 'clenDph@ref': string;
127
+ 'clenDph@showAs': string;
128
+ 'stredisko': string;
129
+ 'stredisko@ref': string;
130
+ 'stredisko@showAs': string;
131
+ 'cinnost': string;
132
+ 'zakazka': string;
133
+ 'statOdesl': string;
134
+ 'statUrc': string;
135
+ 'statPuvod': string;
136
+ 'dodPodm': string;
137
+ 'obchTrans': string;
138
+ 'druhDopr': string;
139
+ 'zvlPoh': string;
140
+ 'krajUrc': string;
141
+ 'uzivatel': string;
142
+ 'uzivatel@ref': string;
143
+ 'uzivatel@showAs': string;
144
+ 'zodpOsoba': string;
145
+ 'zodpOsoba@ref': string;
146
+ 'zodpOsoba@showAs': string;
147
+ 'kontaktOsoba': string;
148
+ 'kontaktJmeno': string;
149
+ 'kontaktEmail': string;
150
+ 'kontaktTel': string;
151
+ 'rada': string;
152
+ 'rada@showAs': string;
153
+ 'rada@if-not-found': string;
154
+ 'rada@ref': string;
155
+ 'sazbaDphOsv': string;
156
+ 'sazbaDphOsv@ref': string;
157
+ 'sazbaDphOsv@showAs': string;
158
+ 'sazbaDphSniz': string;
159
+ 'sazbaDphSniz@ref': string;
160
+ 'sazbaDphSniz@showAs': string;
161
+ 'sazbaDphSniz2': string;
162
+ 'sazbaDphZakl': string;
163
+ 'sazbaDphZakl@ref': string;
164
+ 'sazbaDphZakl@showAs': string;
165
+ 'smlouva': string;
166
+ 'formaDopravy': string;
167
+ 'uuid': string;
168
+ 'source': string;
169
+ 'ekokomK': string;
170
+ 'dodatNa': string;
171
+ 'clenKonVykDph': string;
172
+ 'datUp1': string;
173
+ 'datUp2': string;
174
+ 'datSmir': string;
175
+ 'datPenale': string;
176
+ 'podpisPrik': string;
177
+ 'prikazSum': string;
178
+ 'prikazSumMen': string;
179
+ 'juhSum': string;
180
+ 'juhSumMen': string;
181
+ 'juhDat': string;
182
+ 'juhDatMen': string;
183
+ 'zbyvaUhradit': string;
184
+ 'zbyvaUhraditMen': string;
185
+ 'formaUhradyCis': string;
186
+ 'stavUhrK': string;
187
+ 'juhSumPp': string;
188
+ 'juhSumPpMen': string;
189
+ 'sumPrepl': string;
190
+ 'sumPreplMen': string;
191
+ 'sumZalohy': string;
192
+ 'sumZalohyMen': string;
193
+ 'stavOdpocetK': string;
194
+ 'generovatSkl': string;
195
+ 'hromFakt': string;
196
+ 'zdrojProSkl': string;
197
+ 'zakazPlatba': string;
198
+ 'dobropisovano': string;
199
+ 'sumCelkemBezZaloh': string;
200
+ 'sumCelkemBezZalohMen': string;
201
+ 'osobUpravaDph': string;
202
+ 'osobUpravaDphDodavatel': string;
203
+ 'polozkyFaktury': unknown[];
204
+ }
@@ -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.4",
4
+ "version": "1.0.5",
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",