@orchesty/connector-flexi-bee 1.0.0 → 1.0.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.
Files changed (119) hide show
  1. package/dist/package.json +4 -1
  2. package/package.json +4 -1
  3. package/CHANGELOG.md +0 -7
  4. package/coverage/clover.xml +0 -389
  5. package/coverage/coverage-final.json +0 -19
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +0 -161
  10. package/coverage/lcov-report/prettify.css +0 -1
  11. package/coverage/lcov-report/prettify.js +0 -2
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +0 -210
  14. package/coverage/lcov-report/src/Batch/FlexiBeeFormaDopravyBatch.ts.html +0 -145
  15. package/coverage/lcov-report/src/Batch/FlexiBeeFormaUhradyBatch.ts.html +0 -148
  16. package/coverage/lcov-report/src/Batch/FlexiBeeGetSkladovyPohybBatch.ts.html +0 -139
  17. package/coverage/lcov-report/src/Batch/FlexiBeeObjednavkaPrijataBatch.ts.html +0 -145
  18. package/coverage/lcov-report/src/Batch/FlexiBeeObjednavkaVydanaBatch.ts.html +0 -145
  19. package/coverage/lcov-report/src/Batch/FlexiBeeSimpleIterator.ts.html +0 -295
  20. package/coverage/lcov-report/src/Batch/FlexiBeeSkladoveKartyBatch.ts.html +0 -298
  21. package/coverage/lcov-report/src/Batch/FlexiBeeStitkyBatch.ts.html +0 -145
  22. package/coverage/lcov-report/src/Batch/index.html +0 -221
  23. package/coverage/lcov-report/src/Connector/FlexiBeeCreateObjednavkaVydanaConnector.ts.html +0 -322
  24. package/coverage/lcov-report/src/Connector/FlexiBeeCreateSkladovyPohybConnector.ts.html +0 -346
  25. package/coverage/lcov-report/src/Connector/FlexiBeeGetCenikKartyConnector.ts.html +0 -829
  26. package/coverage/lcov-report/src/Connector/FlexiBeeGetObjednavkaVydanaConnector.ts.html +0 -316
  27. package/coverage/lcov-report/src/Connector/FlexiBeeGetSarzeExpiraceKartyConnector.ts.html +0 -304
  28. package/coverage/lcov-report/src/Connector/FlexiBeeUpdateObjednavkaPrijataConnector.ts.html +0 -322
  29. package/coverage/lcov-report/src/Connector/FlexiBeeUpdateSkladovyPohybConnector.ts.html +0 -361
  30. package/coverage/lcov-report/src/Connector/index.html +0 -206
  31. package/coverage/lcov-report/src/FexiBeeApplication.ts.html +0 -694
  32. package/coverage/lcov-report/src/FlexiBee.utils.ts.html +0 -142
  33. package/coverage/lcov-report/src/index.html +0 -131
  34. package/coverage/lcov-report/test/dataProvider.ts.html +0 -496
  35. package/coverage/lcov-report/test/index.html +0 -116
  36. package/coverage/lcov.info +0 -633
  37. package/jest.config.js +0 -13
  38. package/src/Batch/FlexiBeeFormaDopravyBatch.ts +0 -20
  39. package/src/Batch/FlexiBeeFormaUhradyBatch.ts +0 -21
  40. package/src/Batch/FlexiBeeGetSkladovyPohybBatch.ts +0 -18
  41. package/src/Batch/FlexiBeeObjednavkaPrijataBatch.ts +0 -20
  42. package/src/Batch/FlexiBeeObjednavkaVydanaBatch.ts +0 -20
  43. package/src/Batch/FlexiBeeSimpleIterator.ts +0 -70
  44. package/src/Batch/FlexiBeeSkladoveKartyBatch.ts +0 -71
  45. package/src/Batch/FlexiBeeStitkyBatch.ts +0 -20
  46. package/src/Batch/__tests__/Data/FlexiBeeFormaDopravyBatch/input.json +0 -6
  47. package/src/Batch/__tests__/Data/FlexiBeeFormaDopravyBatch/mock.json +0 -18
  48. package/src/Batch/__tests__/Data/FlexiBeeFormaDopravyBatch/output.json +0 -11
  49. package/src/Batch/__tests__/Data/FlexiBeeFormaUhradyBatch/input.json +0 -6
  50. package/src/Batch/__tests__/Data/FlexiBeeFormaUhradyBatch/mock.json +0 -19
  51. package/src/Batch/__tests__/Data/FlexiBeeFormaUhradyBatch/output.json +0 -11
  52. package/src/Batch/__tests__/Data/FlexiBeeGetSkladovyPohybBatch/input.json +0 -8
  53. package/src/Batch/__tests__/Data/FlexiBeeGetSkladovyPohybBatch/mock.json +0 -107
  54. package/src/Batch/__tests__/Data/FlexiBeeGetSkladovyPohybBatch/output.json +0 -11
  55. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaPrijataBatch/input.json +0 -6
  56. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaPrijataBatch/mock.json +0 -162
  57. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaPrijataBatch/output.json +0 -11
  58. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaVydanaBatch/input.json +0 -6
  59. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaVydanaBatch/mock.json +0 -200
  60. package/src/Batch/__tests__/Data/FlexiBeeObjednavkaVydanaBatch/output.json +0 -11
  61. package/src/Batch/__tests__/Data/FlexiBeeSkladoveKartyBatch/input.json +0 -6
  62. package/src/Batch/__tests__/Data/FlexiBeeSkladoveKartyBatch/mock.json +0 -66
  63. package/src/Batch/__tests__/Data/FlexiBeeSkladoveKartyBatch/output.json +0 -11
  64. package/src/Batch/__tests__/Data/FlexiBeeStitkyBatch/input.json +0 -6
  65. package/src/Batch/__tests__/Data/FlexiBeeStitkyBatch/mock.json +0 -18
  66. package/src/Batch/__tests__/Data/FlexiBeeStitkyBatch/output.json +0 -11
  67. package/src/Batch/__tests__/FlexiBeeFormaDopravyBatch.ts +0 -17
  68. package/src/Batch/__tests__/FlexiBeeFormaUhradyBatch.ts +0 -17
  69. package/src/Batch/__tests__/FlexiBeeGetSkladovyPohybBatch.ts +0 -17
  70. package/src/Batch/__tests__/FlexiBeeObjednavkaPrijataBatch.ts +0 -17
  71. package/src/Batch/__tests__/FlexiBeeObjednavkaVydanaBatch.ts +0 -17
  72. package/src/Batch/__tests__/FlexiBeeSkladoveKartyBatch.ts +0 -17
  73. package/src/Batch/__tests__/FlexiBeeStitkyBatch.ts +0 -17
  74. package/src/Connector/FlexiBeeCreateNewContactConnector.ts +0 -98
  75. package/src/Connector/FlexiBeeCreateObjednavkaVydanaConnector.ts +0 -79
  76. package/src/Connector/FlexiBeeCreateSkladovyPohybConnector.ts +0 -87
  77. package/src/Connector/FlexiBeeGetCenikKartyConnector.ts +0 -248
  78. package/src/Connector/FlexiBeeGetContactsArrayConnector.ts +0 -28
  79. package/src/Connector/FlexiBeeGetObjednavkaVydanaConnector.ts +0 -77
  80. package/src/Connector/FlexiBeeGetSarzeExpiraceKartyConnector.ts +0 -73
  81. package/src/Connector/FlexiBeeUpdateObjednavkaPrijataConnector.ts +0 -79
  82. package/src/Connector/FlexiBeeUpdateSkladovyPohybConnector.ts +0 -92
  83. package/src/Connector/__tests__/Data/FlexiBeeCreateObjednavkaVydanaConnector/input.json +0 -8
  84. package/src/Connector/__tests__/Data/FlexiBeeCreateObjednavkaVydanaConnector/mock.json +0 -24
  85. package/src/Connector/__tests__/Data/FlexiBeeCreateObjednavkaVydanaConnector/output.json +0 -12
  86. package/src/Connector/__tests__/Data/FlexiBeeCreateSkladovyPohybConnector/input.json +0 -8
  87. package/src/Connector/__tests__/Data/FlexiBeeCreateSkladovyPohybConnector/mock.json +0 -24
  88. package/src/Connector/__tests__/Data/FlexiBeeCreateSkladovyPohybConnector/output.json +0 -12
  89. package/src/Connector/__tests__/Data/FlexiBeeGetCenikKartyConnector/input.json +0 -59
  90. package/src/Connector/__tests__/Data/FlexiBeeGetCenikKartyConnector/mock.json +0 -211
  91. package/src/Connector/__tests__/Data/FlexiBeeGetCenikKartyConnector/output.json +0 -261
  92. package/src/Connector/__tests__/Data/FlexiBeeGetObjednavkaVydanaConnector/input.json +0 -8
  93. package/src/Connector/__tests__/Data/FlexiBeeGetObjednavkaVydanaConnector/mock.json +0 -193
  94. package/src/Connector/__tests__/Data/FlexiBeeGetObjednavkaVydanaConnector/output.json +0 -187
  95. package/src/Connector/__tests__/Data/FlexiBeeGetSarzeExpiraceKartyConnector/input.json +0 -261
  96. package/src/Connector/__tests__/Data/FlexiBeeGetSarzeExpiraceKartyConnector/mock.json +0 -49
  97. package/src/Connector/__tests__/Data/FlexiBeeGetSarzeExpiraceKartyConnector/output.json +0 -301
  98. package/src/Connector/__tests__/Data/FlexiBeeUpdateObjednavkaPrijataConnector/input.json +0 -8
  99. package/src/Connector/__tests__/Data/FlexiBeeUpdateObjednavkaPrijataConnector/mock.json +0 -24
  100. package/src/Connector/__tests__/Data/FlexiBeeUpdateObjednavkaPrijataConnector/output.json +0 -12
  101. package/src/Connector/__tests__/Data/FlexiBeeUpdateSkladovyPohybConnector/input.json +0 -9
  102. package/src/Connector/__tests__/Data/FlexiBeeUpdateSkladovyPohybConnector/mock.json +0 -24
  103. package/src/Connector/__tests__/Data/FlexiBeeUpdateSkladovyPohybConnector/output.json +0 -12
  104. package/src/Connector/__tests__/FlexiBeeCreateObjednavkaVydanaConnector.ts +0 -17
  105. package/src/Connector/__tests__/FlexiBeeCreateSkladovyPohybConnector.ts +0 -17
  106. package/src/Connector/__tests__/FlexiBeeGetCenikKartyConnector.ts +0 -17
  107. package/src/Connector/__tests__/FlexiBeeGetObjednavkaVydanaConnector.ts +0 -17
  108. package/src/Connector/__tests__/FlexiBeeGetSarzeExpiraceKartyConnector.ts +0 -17
  109. package/src/Connector/__tests__/FlexiBeeUpdateObjednavkaPrijataConnector.ts +0 -17
  110. package/src/Connector/__tests__/FlexiBeeUpdateSkladovyPohybConnector.ts +0 -17
  111. package/src/FexiBeeApplication.ts +0 -203
  112. package/src/FlexiBee.utils.ts +0 -19
  113. package/src/types/FlexiBeeObjednavkaPrijata.ts +0 -153
  114. package/src/types/FlexiBeeObjednavkaVydana.ts +0 -188
  115. package/src/types/FlexiBeeSkladovyPohyb.ts +0 -97
  116. package/test/dataProvider.ts +0 -137
  117. package/tsconfig.json +0 -8
  118. package/tsconfig.prod.json +0 -13
  119. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,79 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FlexiBeeApplication from '../FexiBeeApplication';
5
-
6
- export const FLEXI_BEE_CREATE_OBJEDNAVKA_VYDANA = 'flexi-bee-create-objednavka-vydana';
7
-
8
- export default class FlexiBeeCreateObjednavkaVydanaConnector extends AConnector {
9
-
10
- public constructor(
11
- protected dataKey: string | null = null,
12
- ) {
13
- super();
14
- }
15
-
16
- public getName(): string {
17
- return FLEXI_BEE_CREATE_OBJEDNAVKA_VYDANA;
18
- }
19
-
20
- public async processAction(
21
- dto: ProcessDto<FlexiBeeCreateObjednavkaVydanaInput>,
22
- ): Promise<ProcessDto<FlexiBeeCreateObjednavkaVydanaOutput>> {
23
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
24
-
25
- let data = dto.getJsonData();
26
- if (this.dataKey) {
27
- // eslint-disable-next-line
28
- data = (data as any)[this.dataKey];
29
- }
30
-
31
- const application = this.getApplication<FlexiBeeApplication>();
32
- const request = await application.getRequestDto(
33
- dto,
34
- applicationInstall,
35
- HttpMethods.POST,
36
- application.getUrl(applicationInstall, 'objednavka-vydana'),
37
- JSON.stringify({
38
- winstrom: {
39
- // eslint-disable-next-line
40
- 'objednavka-vydana': [
41
- data,
42
- ],
43
- },
44
- }),
45
- );
46
- const resp = (await this.getSender().send<Response>(request)).getJsonBody().winstrom.results;
47
-
48
- if (this.dataKey) {
49
- // eslint-disable-next-line
50
- const data = dto.getJsonData() as any;
51
- data[this.dataKey] = resp;
52
- dto.setNewJsonData(data);
53
- } else {
54
- dto.setNewJsonData(resp);
55
- }
56
-
57
- return dto as unknown as ProcessDto<FlexiBeeCreateObjednavkaVydanaOutput>;
58
- }
59
-
60
- }
61
-
62
- interface ResponseResult {
63
- results: {
64
- id: string;
65
- ref: string;
66
- };
67
- }
68
-
69
- interface Response {
70
- winstrom: {
71
- results: ResponseResult[];
72
- };
73
- }
74
-
75
- export interface FlexiBeeCreateObjednavkaVydanaInput {
76
- kod: string;
77
- }
78
-
79
- export type FlexiBeeCreateObjednavkaVydanaOutput = ResponseResult[];
@@ -1,87 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FlexiBeeApplication from '../FexiBeeApplication';
5
-
6
- export const FLEXI_BEE_CREATE_SKLADOVY_POHYB = 'flexi-bee-create-skladovy-pohyb';
7
-
8
- export default class FlexiBeeCreateSkladovyPohybConnector extends AConnector {
9
-
10
- public constructor(
11
- protected dataKey: string | null = null,
12
- ) {
13
- super();
14
- }
15
-
16
- public getName(): string {
17
- return FLEXI_BEE_CREATE_SKLADOVY_POHYB;
18
- }
19
-
20
- public async processAction(
21
- dto: ProcessDto<FlexiBeeCreateSkladovyPohybInput>,
22
- ): Promise<ProcessDto<FlexiBeeCreateSkladovyPohybOutput>> {
23
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
24
-
25
- let pohyb = dto.getJsonData();
26
- if (this.dataKey) {
27
- // eslint-disable-next-line
28
- pohyb = (pohyb as any)[this.dataKey];
29
- }
30
-
31
- const application = this.getApplication<FlexiBeeApplication>();
32
- const request = await application.getRequestDto(
33
- dto,
34
- applicationInstall,
35
- HttpMethods.POST,
36
- application.getUrl(applicationInstall, 'skladovy-pohyb'),
37
- JSON.stringify({
38
- winstrom: {
39
- // eslint-disable-next-line
40
- 'skladovy-pohyb': [
41
- pohyb,
42
- ],
43
- },
44
- }),
45
- );
46
- const resp = (await this.getSender().send<Response>(request)).getJsonBody().winstrom.results;
47
-
48
- if (this.dataKey) {
49
- // eslint-disable-next-line
50
- const data = dto.getJsonData() as any;
51
- data[this.dataKey] = resp;
52
- dto.setNewJsonData(data);
53
- } else {
54
- dto.setNewJsonData(resp);
55
- }
56
-
57
- return dto as unknown as ProcessDto<FlexiBeeCreateSkladovyPohybOutput>;
58
- }
59
-
60
- }
61
-
62
- interface ResponseResult {
63
- results: {
64
- id: string;
65
- ref: string;
66
- };
67
- }
68
-
69
- interface Response {
70
- winstrom: {
71
- results: ResponseResult[];
72
- };
73
- }
74
-
75
- export interface FlexiBeeCreateSkladovyPohybInput {
76
- kod: string;
77
- typPohybuK: string;
78
- typDokl: string;
79
- sklad: string;
80
- skladovePolozky: {
81
- cenik: string;
82
- sklad: string;
83
- mnozMj: string;
84
- }[];
85
- }
86
-
87
- export type FlexiBeeCreateSkladovyPohybOutput = ResponseResult[];
@@ -1,248 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import { FlexiBeeSkladoveKartyItemOutput } from '../Batch/FlexiBeeSkladoveKartyBatch';
5
- import FlexiBeeApplication from '../FexiBeeApplication';
6
- import { parseFlexiBeeUri } from '../FlexiBee.utils';
7
-
8
- export const FLEXI_BEE_GET_CENIK_KARTY_CONNECTOR = 'flexi-bee-get-cenik-karty-connector';
9
-
10
- export default class FlexiBeeGetCenikKartyConnector extends AConnector {
11
-
12
- public getName(): string {
13
- return FLEXI_BEE_GET_CENIK_KARTY_CONNECTOR;
14
- }
15
-
16
- public async processAction(
17
- dto: ProcessDto<FlexiBeeGetCenikKartyInput>,
18
- ): Promise<ProcessDto<FlexiBeeGetCenikKartyOutput>> {
19
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
20
- const data = dto.getJsonData() as FlexiBeeGetCenikKartyOutput;
21
-
22
- const application = this.getApplication<FlexiBeeApplication>();
23
- const request = await application.getRequestDto(
24
- dto,
25
- applicationInstall,
26
- HttpMethods.GET,
27
- application.getUrl(applicationInstall, parseFlexiBeeUri(data['cenik@ref'])),
28
- );
29
- const response = await this.getSender().send<Response>(request);
30
- data.cenikData = response.getJsonBody().winstrom.cenik;
31
-
32
- return dto.setNewJsonData(data);
33
- }
34
-
35
- }
36
-
37
- /* eslint-disable @typescript-eslint/naming-convention */
38
- type Cenik = {
39
- 'id': string;
40
- 'lastUpdate': string;
41
- 'kod': string;
42
- 'nazev': string;
43
- 'nazevA': string;
44
- 'nazevB': string;
45
- 'nazevC': string;
46
- 'poznam': string;
47
- 'popis': string;
48
- 'platiOd': string;
49
- 'platiDo': string;
50
- 'eanKod': string;
51
- 'kodPlu': string;
52
- 'typCenyDphK': string;
53
- 'typCenyDphK@showAs': string;
54
- 'procZakl': string;
55
- 'individCena': string;
56
- 'limMnoz2': string;
57
- 'limMnoz3': string;
58
- 'limMnoz4': string;
59
- 'limMnoz5': string;
60
- 'procento2': string;
61
- 'procento3': string;
62
- 'procento4': string;
63
- 'procento5': string;
64
- 'cena2': string;
65
- 'cena3': string;
66
- 'cena4': string;
67
- 'cena5': string;
68
- 'zaokrJakK': string;
69
- 'zaokrJakK@showAs': string;
70
- 'zaokrNaK': string;
71
- 'zaokrNaK@showAs': string;
72
- 'typSzbDphK': string;
73
- 'typSzbDphK@showAs': string;
74
- 'desetinMj': string;
75
- 'nakupCena': string;
76
- 'cenJednotka': string;
77
- 'typCenyVychoziK': string;
78
- 'typCenyVychoziK@showAs': string;
79
- 'typVypCenyK': string;
80
- 'typVypCenyK@showAs': string;
81
- 'typCenyVychozi25K': string;
82
- 'typCenyVychozi25K@showAs': string;
83
- 'typVypCeny25K': string;
84
- 'typVypCeny25K@showAs': string;
85
- 'evidVyrCis': string;
86
- 'unikVyrCis': string;
87
- 'zaruka': string;
88
- 'mjZarukyK': string;
89
- 'mjKoef2': string;
90
- 'mjKoef3': string;
91
- 'prodejMj': string;
92
- 'hmotMj': string;
93
- 'hmotObal': string;
94
- 'objem': string;
95
- 'zatrid': string;
96
- 'skladove': string;
97
- 'typZasobyK': string;
98
- 'typZasobyK@showAs': string;
99
- 'baleniNazev1': string;
100
- 'baleniNazev2': string;
101
- 'baleniNazev3': string;
102
- 'baleniNazev4': string;
103
- 'baleniNazev5': string;
104
- 'baleniMj1': string;
105
- 'baleniMj2': string;
106
- 'baleniMj3': string;
107
- 'baleniMj4': string;
108
- 'baleniMj5': string;
109
- 'baleniEan1': string;
110
- 'baleniEan2': string;
111
- 'baleniEan3': string;
112
- 'baleniEan4': string;
113
- 'baleniEan5': string;
114
- 'inEvid': string;
115
- 'inKoefMj': string;
116
- 'inKoefStat': string;
117
- 'inKodSled': string;
118
- 'popisA': string;
119
- 'popisB': string;
120
- 'popisC': string;
121
- 'cenaBezna': string;
122
- 'stitky': string;
123
- 'stavy': string;
124
- 'pocetPriloh': string;
125
- 'exportNaEshop': string;
126
- 'minMarzeCenik': string;
127
- 'minMarze': string;
128
- 'evidSarze': string;
129
- 'evidExpir': string;
130
- 'sada': string;
131
- 'dnyTrvanPoExpir': string;
132
- 'neseskupovatObj': string;
133
- 'kratkyPopis': string;
134
- 'klicSlova': string;
135
- 'techParam': string;
136
- 'dodaciLhuta': string;
137
- 'prodejKasa': string;
138
- 'skupZboz': string;
139
- 'skupZboz@ref': string;
140
- 'skupZboz@showAs': string;
141
- 'mj1': string;
142
- 'mj1@ref': string;
143
- 'mj1@showAs': string;
144
- 'mj2': string;
145
- 'mj2@ref': string;
146
- 'mj2@showAs': string;
147
- 'mj3': string;
148
- 'mj3@ref': string;
149
- 'mj3@showAs': string;
150
- 'mjHmot': string;
151
- 'mjHmot@ref': string;
152
- 'mjHmot@showAs': string;
153
- 'mjObj': string;
154
- 'mjObj@ref': string;
155
- 'mjObj@showAs': string;
156
- 'stat': string;
157
- 'nomen': string;
158
- 'dodavatel': string;
159
- 'dodavatel@ref': string;
160
- 'dodavatel@showAs': string;
161
- 'vyrobce': string;
162
- 'vyrobce@ref': string;
163
- 'vyrobce@showAs': string;
164
- 'dphPren': string;
165
- 'mjDodaciLhuta': string;
166
- 'mjDodaciLhuta@ref': string;
167
- 'mjDodaciLhuta@showAs': string;
168
- 'sumStavMj': string;
169
- 'sumRezerMj': string;
170
- 'sumPozadavkyMj': string;
171
- 'sumDostupMj': string;
172
- 'cenaZaklBezDph': string;
173
- 'cenaZaklVcDph': string;
174
- 'cenaZakl': string;
175
- 'sady-a-komplety': unknown[];
176
- 'poplatky': unknown[];
177
- 'dodavatele': {
178
- 'id': string;
179
- 'lastUpdate': string;
180
- 'kodIndi': string;
181
- 'nakupCena': string;
182
- 'poznam': string;
183
- 'primarni': string;
184
- 'stavMJ': string;
185
- 'dodaciLhuta': string;
186
- 'stitky': string;
187
- 'limMnoz2': string;
188
- 'limMnoz3': string;
189
- 'limMnoz4': string;
190
- 'limMnoz5': string;
191
- 'nakupCena2': string;
192
- 'nakupCena3': string;
193
- 'nakupCena4': string;
194
- 'nakupCena5': string;
195
- 'cenik': string;
196
- 'cenik@ref': string;
197
- 'cenik@showAs': string;
198
- 'firma': string;
199
- 'firma@ref': string;
200
- 'firma@showAs': string;
201
- 'mjDodaciLhuta': string;
202
- 'mena': string;
203
- }[],
204
- 'odberatele': {
205
- 'id': string;
206
- 'lastUpdate': string;
207
- 'kodIndi': string;
208
- 'prodejCena': string;
209
- 'poznam': string;
210
- 'platiOdData': string;
211
- 'platiDoData': string;
212
- 'rucneVybrat': string;
213
- 'limMnoz2': string;
214
- 'limMnoz3': string;
215
- 'limMnoz4': string;
216
- 'limMnoz5': string;
217
- 'prodejCena2': string;
218
- 'prodejCena3': string;
219
- 'prodejCena4': string;
220
- 'prodejCena5': string;
221
- 'cenik': string;
222
- 'cenik@ref': string;
223
- 'cenik@showAs': string;
224
- 'firma': string;
225
- 'firma@ref': string;
226
- 'firma@showAs': string;
227
- 'skupCen': string;
228
- 'stredisko': string;
229
- 'mena': string;
230
- }[]
231
- 'typy-sazeb-dph': unknown[];
232
- 'szbDph': string;
233
- }[];
234
-
235
- interface Response {
236
- 'winstrom': {
237
- '@version': string;
238
- 'cenik': Cenik;
239
- };
240
- }
241
-
242
- export type FlexiBeeGetCenikKartyInput = FlexiBeeSkladoveKartyItemOutput;
243
-
244
- export interface FlexiBeeGetCenikKartyOutput extends FlexiBeeSkladoveKartyItemOutput {
245
- cenikData: Cenik;
246
- }
247
-
248
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,28 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FlexiBeeApplication from '../FexiBeeApplication';
5
-
6
- export default class FlexiBeeGetContactsArrayConnector extends AConnector {
7
-
8
- public getName(): string {
9
- return 'flexibee-get-contacts-array';
10
- }
11
-
12
- public async processAction(dto: ProcessDto): Promise<ProcessDto> {
13
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
14
-
15
- const application = this.getApplication<FlexiBeeApplication>();
16
- const request = await application.getRequestDto(
17
- dto,
18
- applicationInstall,
19
- HttpMethods.GET,
20
- application.getUrl(applicationInstall, 'kontakt.json'),
21
- );
22
- const response = await this.getSender().send(request, { success: '200-201' });
23
- dto.setData(response.getBody());
24
-
25
- return dto;
26
- }
27
-
28
- }
@@ -1,77 +0,0 @@
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 { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
5
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
6
- import FlexiBeeApplication from '../FexiBeeApplication';
7
- import { FlexiBeeObjednavkaVydana } from '../types/FlexiBeeObjednavkaVydana';
8
-
9
- export const FLEXI_BEE_GET_OBJEDNAVKA_VYDANA_CONNECTOR = 'flexi-bee-get-objednavka-vydana-connector';
10
-
11
- export default class FlexiBeeGetObjednavkaVydanaConnector extends AConnector {
12
-
13
- public constructor(
14
- protected dataKey: string | null = null,
15
- ) {
16
- super();
17
- }
18
-
19
- public getName(): string {
20
- return FLEXI_BEE_GET_OBJEDNAVKA_VYDANA_CONNECTOR;
21
- }
22
-
23
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<FlexiBeeObjednavkaVydana>> {
24
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
25
- const data = dto.getJsonData();
26
- // eslint-disable-next-line
27
- let id = data.id;
28
- if (this.dataKey) {
29
- // eslint-disable-next-line
30
- id = (data as any)[this.dataKey].id;
31
- }
32
-
33
- const application = this.getApplication<FlexiBeeApplication>();
34
- const request = await application.getRequestDto(
35
- dto,
36
- applicationInstall,
37
- HttpMethods.GET,
38
- application.getUrl(applicationInstall, `objednavka-vydana/${id}.json?detail=full`),
39
- );
40
- const response = await this.getSender().send<IResponse>(request, this.getCodeRanges());
41
-
42
- return this.handleResponse(response, dto) as ProcessDto<FlexiBeeObjednavkaVydana>;
43
- }
44
-
45
- protected getCodeRanges(): IResultRanges|null {
46
- return null;
47
- }
48
-
49
- protected handleResponse(response: ResponseDto<IResponse>, dto: ProcessDto): ProcessDto {
50
- const order = response.getJsonBody().winstrom['objednavka-vydana'][0] ?? [];
51
-
52
- if (this.dataKey) {
53
- // eslint-disable-next-line
54
- const data = dto.getJsonData() as any;
55
- data[this.dataKey] = order;
56
- dto.setNewJsonData(data);
57
- } else {
58
- dto.setNewJsonData(order);
59
- }
60
-
61
- return dto as unknown as ProcessDto<FlexiBeeObjednavkaVydana>;
62
- }
63
-
64
- }
65
-
66
- export interface IInput {
67
- id: string;
68
- }
69
-
70
- /* eslint-disable @typescript-eslint/naming-convention */
71
- export interface IResponse {
72
- winstrom: {
73
- '@version': string;
74
- 'objednavka-vydana': FlexiBeeObjednavkaVydana[];
75
- }
76
- }
77
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,73 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FlexiBeeApplication from '../FexiBeeApplication';
5
- import { parseFlexiBeeId } from '../FlexiBee.utils';
6
- import { FlexiBeeGetCenikKartyOutput } from './FlexiBeeGetCenikKartyConnector';
7
-
8
- export const FLEXI_BEE_GET_SARZE_EXPIRACE_KARTY_CONNECTOR = 'flexi-bee-get-sarze-expirace-karty-connector';
9
-
10
- export default class FlexiBeeGetSarzeExpiraceKartyConnector extends AConnector {
11
-
12
- public getName(): string {
13
- return FLEXI_BEE_GET_SARZE_EXPIRACE_KARTY_CONNECTOR;
14
- }
15
-
16
- public async processAction(
17
- dto: ProcessDto<FlexiBeeGetSarzeExpiraceKartyInput>,
18
- ): Promise<ProcessDto<FlexiBeeGetSarzeExpiraceKartyOutput>> {
19
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
20
- const data = dto.getJsonData() as FlexiBeeGetSarzeExpiraceKartyOutput;
21
- const cenikId = parseFlexiBeeId(data['cenik@ref']);
22
- const skladId = parseFlexiBeeId(data['sklad@ref']);
23
-
24
- const application = this.getApplication<FlexiBeeApplication>();
25
- const request = await application.getRequestDto(
26
- dto,
27
- applicationInstall,
28
- HttpMethods.GET,
29
- application.getUrl(applicationInstall, `sarze-expirace/(cenik=${cenikId}%20and%20sklad=${skladId}).json?detail=full`),
30
- );
31
- const response = await this.getSender().send<Response>(request);
32
- data.sarzeExpiraceData = response.getJsonBody().winstrom['sarze-expirace'];
33
-
34
- return dto.setNewJsonData(data);
35
- }
36
-
37
- }
38
-
39
- /* eslint-disable @typescript-eslint/naming-convention */
40
- type SarzeExpirace = {
41
- 'id': string;
42
- 'pocet': string;
43
- 'cenaMj': string;
44
- 'datVyst': string;
45
- 'datSklad': string;
46
- 'datTrvan': string;
47
- 'datVyroby': string;
48
- 'expirace': string;
49
- 'sarze': string;
50
- 'typPohybuK': string;
51
- 'typPohybuK@showAs': string;
52
- 'sklad': string;
53
- 'sklad@ref': string;
54
- 'sklad@showAs': string;
55
- 'cenik': string;
56
- 'cenik@ref': string;
57
- 'cenik@showAs': string;
58
- }[];
59
-
60
- interface Response {
61
- 'winstrom': {
62
- '@version': string;
63
- 'sarze-expirace': SarzeExpirace;
64
- };
65
- }
66
-
67
- export type FlexiBeeGetSarzeExpiraceKartyInput = FlexiBeeGetCenikKartyOutput;
68
-
69
- export interface FlexiBeeGetSarzeExpiraceKartyOutput extends FlexiBeeGetCenikKartyOutput {
70
- sarzeExpiraceData: SarzeExpirace;
71
- }
72
-
73
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,79 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FlexiBeeApplication from '../FexiBeeApplication';
5
-
6
- export const FLEXI_BEE_UPDATE_OBJEDNAVKA_PRIJATA = 'flexi-bee-update-objednavka-prijata';
7
-
8
- export default class FlexiBeeUpdateObjednavkaPrijataConnector extends AConnector {
9
-
10
- public constructor(
11
- protected dataKey: string | null = null,
12
- ) {
13
- super();
14
- }
15
-
16
- public getName(): string {
17
- return FLEXI_BEE_UPDATE_OBJEDNAVKA_PRIJATA;
18
- }
19
-
20
- public async processAction(
21
- dto: ProcessDto<FlexiBeeUpdateObjednavkaPrijataInput>,
22
- ): Promise<ProcessDto<FlexiBeeUpdateObjednavkaPrijataOutput>> {
23
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
24
-
25
- let data = dto.getJsonData();
26
- if (this.dataKey) {
27
- // eslint-disable-next-line
28
- data = (data as any)[this.dataKey];
29
- }
30
-
31
- const application = this.getApplication<FlexiBeeApplication>();
32
- const request = await application.getRequestDto(
33
- dto,
34
- applicationInstall,
35
- HttpMethods.PUT,
36
- application.getUrl(applicationInstall, 'objednavka-prijata'),
37
- JSON.stringify({
38
- winstrom: {
39
- // eslint-disable-next-line
40
- 'objednavka-prijata': [
41
- data,
42
- ],
43
- },
44
- }),
45
- );
46
- const resp = (await this.getSender().send<Response>(request)).getJsonBody().winstrom.results;
47
-
48
- if (this.dataKey) {
49
- // eslint-disable-next-line
50
- const data = dto.getJsonData() as any;
51
- data[this.dataKey] = resp;
52
- dto.setNewJsonData(data);
53
- } else {
54
- dto.setNewJsonData(resp);
55
- }
56
-
57
- return dto as unknown as ProcessDto<FlexiBeeUpdateObjednavkaPrijataOutput>;
58
- }
59
-
60
- }
61
-
62
- interface ResponseResult {
63
- results: {
64
- id: string;
65
- ref: string;
66
- };
67
- }
68
-
69
- interface Response {
70
- winstrom: {
71
- results: ResponseResult[];
72
- };
73
- }
74
-
75
- export interface FlexiBeeUpdateObjednavkaPrijataInput {
76
- id: string;
77
- }
78
-
79
- export type FlexiBeeUpdateObjednavkaPrijataOutput = ResponseResult[];