@bratislava/ginis-sdk 0.4.0 → 0.5.0

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 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$1: {
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$1;
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
  }
@@ -208,4 +290,4 @@ declare class GinisError extends Error {
208
290
  constructor(message: string);
209
291
  }
210
292
 
211
- export { Ginis, GinisConfig, GinisError };
293
+ export { Ginis, type GinisConfig, GinisError };
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bratislava/ginis-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A small wrapper for most commonly used requests towards the Bratislava GINIS system",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -10,10 +10,9 @@
10
10
  "scripts": {
11
11
  "build": "tsup src/index.ts --dts",
12
12
  "test": "jest --watch",
13
- "typecheck": "tsc && tsc-strict",
14
- "eslint": "eslint --color --ext .js,.json,.ts .",
15
- "eslint:fix": "npm run eslint -- --fix",
16
- "docs": "typedoc --options typedoc.json"
13
+ "typecheck": "tsc",
14
+ "lint": "eslint --color --ext .js,.json,.ts .",
15
+ "lint:fix": "yarn lint --fix"
17
16
  },
18
17
  "bin": {
19
18
  "ginis-sdk": "./bin/index.js"
@@ -43,18 +42,17 @@
43
42
  "eslint": "^8.24.0",
44
43
  "eslint-config-prettier": "^8.5.0",
45
44
  "eslint-plugin-eslint-comments": "^3.2.0",
45
+ "eslint-plugin-import": "^2.29.1",
46
46
  "eslint-plugin-no-secrets": "^0.8.9",
47
47
  "jest": "^29.1.2",
48
+ "prettier": "^2.8.7",
48
49
  "ts-jest": "^29.0.3",
49
50
  "ts-loader": "^9.4.1",
50
- "tsup": "^7.2.0",
51
- "typedoc": "^0.23.16",
52
- "typedoc-theme-hierarchy": "^3.0.2",
53
- "typescript-strict-plugin": "^2.1.0"
51
+ "tsup": "^7.2.0"
54
52
  },
55
53
  "engines": {
56
- "node": "16.x.x",
57
- "npm": ">=6.0.0",
54
+ "node": ">=20.x.x",
55
+ "npm": ">=9.x.x",
58
56
  "yarn": "1.22"
59
57
  },
60
58
  "dependencies": {
@@ -65,6 +63,6 @@
65
63
  "typescript": "5.1.6"
66
64
  },
67
65
  "volta": {
68
- "node": "16.19.0"
66
+ "node": "20.11.1"
69
67
  }
70
68
  }