@bratislava/ginis-sdk 0.3.7 → 0.4.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.
- package/dist/index.d.ts +86 -4
- package/dist/index.js +48 -2
- package/package.json +4 -9
package/dist/index.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ type PridatSouborXrg = {
|
|
|
127
127
|
};
|
|
128
128
|
declare function pridatSoubor(this: Ginis, bodyObj: PridatSouborRequest): Promise<PridatSouborXrg>;
|
|
129
129
|
|
|
130
|
-
declare const _default$
|
|
130
|
+
declare const _default$2: {
|
|
131
131
|
detailDokumentu: typeof detailDokumentu;
|
|
132
132
|
pridatSoubor: typeof pridatSoubor;
|
|
133
133
|
};
|
|
@@ -162,10 +162,83 @@ type DetailElPodaniXrg = {
|
|
|
162
162
|
};
|
|
163
163
|
declare function detailElPodani(this: Ginis, bodyObj: DetailElPodaniRequest): Promise<DetailElPodaniXrg>;
|
|
164
164
|
|
|
165
|
-
declare const _default: {
|
|
165
|
+
declare const _default$1: {
|
|
166
166
|
detailElPodani: typeof detailElPodani;
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
+
type DetailFunkcnihoMistaRequest = {
|
|
170
|
+
'Id-funkce': string;
|
|
171
|
+
};
|
|
172
|
+
interface DetailFunkcnihoMistaXrg {
|
|
173
|
+
Atribut_Xrg_ixsExt?: string;
|
|
174
|
+
DetailFunkcnihoMista: Array<{
|
|
175
|
+
IdFunkce: string;
|
|
176
|
+
Aktivita: string;
|
|
177
|
+
Nazev?: string;
|
|
178
|
+
Zkratka?: string;
|
|
179
|
+
OficialniNazev?: string;
|
|
180
|
+
Poznamka?: string;
|
|
181
|
+
DatumOd: string;
|
|
182
|
+
DatumDo: string;
|
|
183
|
+
IdSpisovehoUzlu: string;
|
|
184
|
+
NazevSpisovehoUzlu?: string;
|
|
185
|
+
ZkratkaSpisovehoUzlu?: string;
|
|
186
|
+
UrovenFunkce: string;
|
|
187
|
+
KodFunkce?: string;
|
|
188
|
+
IdNad?: string;
|
|
189
|
+
IdReferenta: string;
|
|
190
|
+
NazevReferenta?: string;
|
|
191
|
+
IdOrj: string;
|
|
192
|
+
NazevOrj?: string;
|
|
193
|
+
KodMistnosti?: string;
|
|
194
|
+
Url?: string;
|
|
195
|
+
Mail?: string;
|
|
196
|
+
Telefon?: string;
|
|
197
|
+
Fax?: string;
|
|
198
|
+
DatumZmena: string;
|
|
199
|
+
}>;
|
|
200
|
+
}
|
|
201
|
+
declare function detailFunkcnihoMista(this: Ginis, bodyObj: DetailFunkcnihoMistaRequest): Promise<DetailFunkcnihoMistaXrg>;
|
|
202
|
+
|
|
203
|
+
type DetailReferentaRequest = {
|
|
204
|
+
'Id-osoby': string;
|
|
205
|
+
};
|
|
206
|
+
type DetailReferentaXrg = {
|
|
207
|
+
Atribut_Xrg_ixsExt?: string;
|
|
208
|
+
DetailReferenta: Array<{
|
|
209
|
+
IdOsoby: string;
|
|
210
|
+
Aktivita: string;
|
|
211
|
+
Nazev?: string;
|
|
212
|
+
Zkratka?: string;
|
|
213
|
+
Jmeno?: string;
|
|
214
|
+
Prijmeni?: string;
|
|
215
|
+
Poznamka?: string;
|
|
216
|
+
DatumOd: string;
|
|
217
|
+
DatumDo: string;
|
|
218
|
+
IdSpisovehoUzlu: string;
|
|
219
|
+
Login?: string;
|
|
220
|
+
AltLogin?: string;
|
|
221
|
+
ExtSysLogin?: string;
|
|
222
|
+
TitulPred?: string;
|
|
223
|
+
TitulZa?: string;
|
|
224
|
+
OsobniCislo?: string;
|
|
225
|
+
RodneCislo?: string;
|
|
226
|
+
RodnePrijmeni?: string;
|
|
227
|
+
Mail?: string;
|
|
228
|
+
Telefon?: string;
|
|
229
|
+
TelefonPrivat?: string;
|
|
230
|
+
TelefonMobil?: string;
|
|
231
|
+
Fax?: string;
|
|
232
|
+
DatumZmena: string;
|
|
233
|
+
}>;
|
|
234
|
+
};
|
|
235
|
+
declare function detailReferenta(this: Ginis, bodyObj: DetailReferentaRequest): Promise<DetailReferentaXrg>;
|
|
236
|
+
|
|
237
|
+
declare const _default: {
|
|
238
|
+
detailFunkcnihoMista: typeof detailFunkcnihoMista;
|
|
239
|
+
detailReferenta: typeof detailReferenta;
|
|
240
|
+
};
|
|
241
|
+
|
|
169
242
|
type GinisConfig = {
|
|
170
243
|
username: string;
|
|
171
244
|
password: string;
|
|
@@ -173,23 +246,31 @@ type GinisConfig = {
|
|
|
173
246
|
ude?: string;
|
|
174
247
|
ssl?: string;
|
|
175
248
|
pod?: string;
|
|
249
|
+
gin?: string;
|
|
176
250
|
};
|
|
177
251
|
debug?: boolean;
|
|
178
252
|
};
|
|
179
|
-
type _Ssl = typeof _default$
|
|
253
|
+
type _Ssl = typeof _default$2;
|
|
180
254
|
/**
|
|
181
255
|
* full SSL service docs: https://robot.gordic.cz/xrg/Default.html?c=OpenModuleDetail&moduleName=SSL&language=cs-CZ&version=390
|
|
182
256
|
*/
|
|
183
257
|
type Ssl = {
|
|
184
258
|
[P in keyof _Ssl]: OmitThisParameter<_Ssl[P]>;
|
|
185
259
|
};
|
|
186
|
-
type _Pod = typeof _default;
|
|
260
|
+
type _Pod = typeof _default$1;
|
|
187
261
|
/**
|
|
188
262
|
* full POD service docs: https://robot.gordic.cz/xrg/Default.html?c=OpenModuleDetail&moduleName=POD&language=cs-CZ&version=390
|
|
189
263
|
*/
|
|
190
264
|
type Pod = {
|
|
191
265
|
[P in keyof _Pod]: OmitThisParameter<_Pod[P]>;
|
|
192
266
|
};
|
|
267
|
+
type _Gin = typeof _default;
|
|
268
|
+
/**
|
|
269
|
+
* full GIN service docs: https://robot.gordic.cz/xrg/Default.html?c=OpenModuleDetail&moduleName=GIN&language=cs-CZ&version=390
|
|
270
|
+
*/
|
|
271
|
+
type Gin = {
|
|
272
|
+
[P in keyof _Gin]: OmitThisParameter<_Gin[P]>;
|
|
273
|
+
};
|
|
193
274
|
declare class Ginis {
|
|
194
275
|
config: GinisConfig;
|
|
195
276
|
/**
|
|
@@ -200,6 +281,7 @@ declare class Ginis {
|
|
|
200
281
|
json: {
|
|
201
282
|
ssl: Ssl;
|
|
202
283
|
pod: Pod;
|
|
284
|
+
gin: Gin;
|
|
203
285
|
};
|
|
204
286
|
constructor(config: GinisConfig);
|
|
205
287
|
}
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,6 @@ var makeAxiosRequest = async (axiosConfig, url, body, debug) => {
|
|
|
62
62
|
} catch (error) {
|
|
63
63
|
if (debug) {
|
|
64
64
|
let anyError = error;
|
|
65
|
-
console.error(anyError);
|
|
66
65
|
console.log("########### GINIS ERROR RESPONSE ###########");
|
|
67
66
|
console.log("status: ", anyError?.response?.status);
|
|
68
67
|
console.log("statusText: ", anyError?.response?.statusText);
|
|
@@ -174,6 +173,52 @@ var pod_default = {
|
|
|
174
173
|
detailElPodani
|
|
175
174
|
};
|
|
176
175
|
|
|
176
|
+
// src/api/json/gin/Detail-funkcniho-mista.ts
|
|
177
|
+
async function detailFunkcnihoMista(bodyObj) {
|
|
178
|
+
const url = this.config.urls.gin;
|
|
179
|
+
if (!url)
|
|
180
|
+
throw new GinisError("GINIS SDK Error: Missing GIN url in GINIS config");
|
|
181
|
+
const response = await makeAxiosRequest(
|
|
182
|
+
void 0,
|
|
183
|
+
`${url}/json/Detail-funkcniho-mista`,
|
|
184
|
+
{
|
|
185
|
+
GRestHeader: getGRestHeader(
|
|
186
|
+
this.config,
|
|
187
|
+
"http://www.gordic.cz/xrg/gin/detail-funkcniho-mista/request/v_1.0.0.0"
|
|
188
|
+
),
|
|
189
|
+
Xrg: { "Detail-funkcniho-mista": bodyObj }
|
|
190
|
+
},
|
|
191
|
+
this.config.debug
|
|
192
|
+
);
|
|
193
|
+
return response.data.Xrg;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// src/api/json/gin/Detail-referenta.ts
|
|
197
|
+
async function detailReferenta(bodyObj) {
|
|
198
|
+
const url = this.config.urls.gin;
|
|
199
|
+
if (!url)
|
|
200
|
+
throw new GinisError("GINIS SDK Error: Missing GIN url in GINIS config");
|
|
201
|
+
const response = await makeAxiosRequest(
|
|
202
|
+
void 0,
|
|
203
|
+
`${url}/json/Detail-referenta`,
|
|
204
|
+
{
|
|
205
|
+
GRestHeader: getGRestHeader(
|
|
206
|
+
this.config,
|
|
207
|
+
"http://www.gordic.cz/xrg/gin/detail-referenta/request/v_1.0.0.0"
|
|
208
|
+
),
|
|
209
|
+
Xrg: { "Detail-referenta": bodyObj }
|
|
210
|
+
},
|
|
211
|
+
this.config.debug
|
|
212
|
+
);
|
|
213
|
+
return response.data.Xrg;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/api/json/gin/index.ts
|
|
217
|
+
var gin_default = {
|
|
218
|
+
detailFunkcnihoMista,
|
|
219
|
+
detailReferenta
|
|
220
|
+
};
|
|
221
|
+
|
|
177
222
|
// src/ginis.ts
|
|
178
223
|
var import_lodash = require("lodash");
|
|
179
224
|
var defaultConfig = {};
|
|
@@ -185,7 +230,8 @@ var Ginis = class {
|
|
|
185
230
|
};
|
|
186
231
|
this.json = {
|
|
187
232
|
ssl: (0, import_lodash.mapValues)(ssl_default, (v) => (0, import_lodash.bind)(v, this)),
|
|
188
|
-
pod: (0, import_lodash.mapValues)(pod_default, (v) => (0, import_lodash.bind)(v, this))
|
|
233
|
+
pod: (0, import_lodash.mapValues)(pod_default, (v) => (0, import_lodash.bind)(v, this)),
|
|
234
|
+
gin: (0, import_lodash.mapValues)(gin_default, (v) => (0, import_lodash.bind)(v, this))
|
|
189
235
|
};
|
|
190
236
|
}
|
|
191
237
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bratislava/ginis-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "A small wrapper for most commonly used requests towards the Bratislava GINIS system",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "
|
|
11
|
+
"build": "tsup src/index.ts --dts",
|
|
12
12
|
"test": "jest --watch",
|
|
13
13
|
"typecheck": "tsc && tsc-strict",
|
|
14
14
|
"eslint": "eslint --color --ext .js,.json,.ts .",
|
|
@@ -40,22 +40,17 @@
|
|
|
40
40
|
"@typescript-eslint/parser": "^5.39.0",
|
|
41
41
|
"babel-jest": "^29.1.2",
|
|
42
42
|
"dotenv": "^16.0.3",
|
|
43
|
-
"esbuild": "^0.19.3",
|
|
44
|
-
"esbuild-node-externals": "^1.9.0",
|
|
45
43
|
"eslint": "^8.24.0",
|
|
46
44
|
"eslint-config-prettier": "^8.5.0",
|
|
47
45
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
48
46
|
"eslint-plugin-no-secrets": "^0.8.9",
|
|
49
|
-
"eslint-webpack-plugin": "^4.0.0",
|
|
50
47
|
"jest": "^29.1.2",
|
|
51
48
|
"ts-jest": "^29.0.3",
|
|
52
49
|
"ts-loader": "^9.4.1",
|
|
53
50
|
"tsup": "^7.2.0",
|
|
54
51
|
"typedoc": "^0.23.16",
|
|
55
52
|
"typedoc-theme-hierarchy": "^3.0.2",
|
|
56
|
-
"typescript-strict-plugin": "^2.1.0"
|
|
57
|
-
"webpack": "^5.74.0",
|
|
58
|
-
"webpack-cli": "^5.0.1"
|
|
53
|
+
"typescript-strict-plugin": "^2.1.0"
|
|
59
54
|
},
|
|
60
55
|
"engines": {
|
|
61
56
|
"node": "16.x.x",
|