@jrojaspin/security-map-api-cli 1.3.0 → 1.4.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.
Files changed (119) hide show
  1. package/package.json +1 -2
  2. package/src/generated-client/.openapi-generator/FILES +0 -114
  3. package/src/generated-client/.openapi-generator/VERSION +0 -1
  4. package/src/generated-client/.openapi-generator-ignore +0 -23
  5. package/src/generated-client/apis/AccountApi.ts +0 -161
  6. package/src/generated-client/apis/ArticleApi.ts +0 -58
  7. package/src/generated-client/apis/DefaultApi.ts +0 -200
  8. package/src/generated-client/apis/HealthcheckApi.ts +0 -51
  9. package/src/generated-client/apis/ItemApi.ts +0 -369
  10. package/src/generated-client/apis/JournalApi.ts +0 -166
  11. package/src/generated-client/apis/LocationApi.ts +0 -66
  12. package/src/generated-client/apis/LoginApi.ts +0 -215
  13. package/src/generated-client/apis/MapApi.ts +0 -341
  14. package/src/generated-client/apis/MultimediaApi.ts +0 -140
  15. package/src/generated-client/apis/ReportApi.ts +0 -145
  16. package/src/generated-client/apis/SearchApi.ts +0 -82
  17. package/src/generated-client/apis/SourceApi.ts +0 -95
  18. package/src/generated-client/apis/StateMachineApi.ts +0 -58
  19. package/src/generated-client/apis/index.ts +0 -16
  20. package/src/generated-client/index.ts +0 -5
  21. package/src/generated-client/models/Def0.ts +0 -73
  22. package/src/generated-client/models/Def1.ts +0 -81
  23. package/src/generated-client/models/Def10.ts +0 -105
  24. package/src/generated-client/models/Def11.ts +0 -105
  25. package/src/generated-client/models/Def12.ts +0 -81
  26. package/src/generated-client/models/Def13.ts +0 -93
  27. package/src/generated-client/models/Def14.ts +0 -93
  28. package/src/generated-client/models/Def15.ts +0 -75
  29. package/src/generated-client/models/Def16.ts +0 -127
  30. package/src/generated-client/models/Def17.ts +0 -81
  31. package/src/generated-client/models/Def18.ts +0 -105
  32. package/src/generated-client/models/Def19.ts +0 -81
  33. package/src/generated-client/models/Def2.ts +0 -83
  34. package/src/generated-client/models/Def20.ts +0 -105
  35. package/src/generated-client/models/Def21.ts +0 -81
  36. package/src/generated-client/models/Def22.ts +0 -217
  37. package/src/generated-client/models/Def23.ts +0 -97
  38. package/src/generated-client/models/Def24.ts +0 -127
  39. package/src/generated-client/models/Def25.ts +0 -81
  40. package/src/generated-client/models/Def26.ts +0 -81
  41. package/src/generated-client/models/Def27.ts +0 -105
  42. package/src/generated-client/models/Def28.ts +0 -121
  43. package/src/generated-client/models/Def29.ts +0 -97
  44. package/src/generated-client/models/Def3.ts +0 -135
  45. package/src/generated-client/models/Def30.ts +0 -113
  46. package/src/generated-client/models/Def31.ts +0 -116
  47. package/src/generated-client/models/Def32.ts +0 -121
  48. package/src/generated-client/models/Def33.ts +0 -66
  49. package/src/generated-client/models/Def34.ts +0 -66
  50. package/src/generated-client/models/Def35.ts +0 -81
  51. package/src/generated-client/models/Def36.ts +0 -84
  52. package/src/generated-client/models/Def37.ts +0 -92
  53. package/src/generated-client/models/Def38.ts +0 -102
  54. package/src/generated-client/models/Def39.ts +0 -102
  55. package/src/generated-client/models/Def4.ts +0 -113
  56. package/src/generated-client/models/Def40.ts +0 -137
  57. package/src/generated-client/models/Def41.ts +0 -178
  58. package/src/generated-client/models/Def42.ts +0 -66
  59. package/src/generated-client/models/Def43.ts +0 -84
  60. package/src/generated-client/models/Def44.ts +0 -75
  61. package/src/generated-client/models/Def45.ts +0 -74
  62. package/src/generated-client/models/Def46.ts +0 -102
  63. package/src/generated-client/models/Def47.ts +0 -66
  64. package/src/generated-client/models/Def48.ts +0 -65
  65. package/src/generated-client/models/Def49.ts +0 -66
  66. package/src/generated-client/models/Def5.ts +0 -89
  67. package/src/generated-client/models/Def50.ts +0 -66
  68. package/src/generated-client/models/Def51.ts +0 -123
  69. package/src/generated-client/models/Def52.ts +0 -66
  70. package/src/generated-client/models/Def53.ts +0 -66
  71. package/src/generated-client/models/Def54.ts +0 -66
  72. package/src/generated-client/models/Def56.ts +0 -90
  73. package/src/generated-client/models/Def57.ts +0 -182
  74. package/src/generated-client/models/Def58.ts +0 -84
  75. package/src/generated-client/models/Def59.ts +0 -66
  76. package/src/generated-client/models/Def6.ts +0 -97
  77. package/src/generated-client/models/Def60.ts +0 -66
  78. package/src/generated-client/models/Def61.ts +0 -189
  79. package/src/generated-client/models/Def62.ts +0 -91
  80. package/src/generated-client/models/Def63.ts +0 -66
  81. package/src/generated-client/models/Def64.ts +0 -66
  82. package/src/generated-client/models/Def65.ts +0 -66
  83. package/src/generated-client/models/Def66.ts +0 -66
  84. package/src/generated-client/models/Def67.ts +0 -66
  85. package/src/generated-client/models/Def68.ts +0 -66
  86. package/src/generated-client/models/Def69.ts +0 -66
  87. package/src/generated-client/models/Def7.ts +0 -105
  88. package/src/generated-client/models/Def70.ts +0 -66
  89. package/src/generated-client/models/Def71.ts +0 -66
  90. package/src/generated-client/models/Def72.ts +0 -66
  91. package/src/generated-client/models/Def73.ts +0 -66
  92. package/src/generated-client/models/Def74.ts +0 -66
  93. package/src/generated-client/models/Def75.ts +0 -75
  94. package/src/generated-client/models/Def76.ts +0 -66
  95. package/src/generated-client/models/Def77.ts +0 -66
  96. package/src/generated-client/models/Def78.ts +0 -84
  97. package/src/generated-client/models/Def79.ts +0 -75
  98. package/src/generated-client/models/Def8.ts +0 -137
  99. package/src/generated-client/models/Def80.ts +0 -73
  100. package/src/generated-client/models/Def81.ts +0 -75
  101. package/src/generated-client/models/Def82.ts +0 -66
  102. package/src/generated-client/models/Def83.ts +0 -66
  103. package/src/generated-client/models/Def84.ts +0 -66
  104. package/src/generated-client/models/Def85.ts +0 -66
  105. package/src/generated-client/models/Def86.ts +0 -92
  106. package/src/generated-client/models/Def87.ts +0 -84
  107. package/src/generated-client/models/Def88.ts +0 -66
  108. package/src/generated-client/models/Def89.ts +0 -66
  109. package/src/generated-client/models/Def9.ts +0 -113
  110. package/src/generated-client/models/Def90.ts +0 -73
  111. package/src/generated-client/models/Def91.ts +0 -66
  112. package/src/generated-client/models/Def92.ts +0 -66
  113. package/src/generated-client/models/Def93.ts +0 -101
  114. package/src/generated-client/models/Def94.ts +0 -66
  115. package/src/generated-client/models/Def95.ts +0 -73
  116. package/src/generated-client/models/Def96.ts +0 -66
  117. package/src/generated-client/models/User.ts +0 -91
  118. package/src/generated-client/models/index.ts +0 -98
  119. package/src/generated-client/runtime.ts +0 -431
@@ -1,431 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Security Map API
5
- * Security Map API
6
- *
7
- * The version of the OpenAPI document: 0.1.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
17
-
18
- export interface ConfigurationParameters {
19
- basePath?: string; // override base path
20
- fetchApi?: FetchAPI; // override for fetch implementation
21
- middleware?: Middleware[]; // middleware to apply before/after fetch requests
22
- queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
23
- username?: string; // parameter for basic security
24
- password?: string; // parameter for basic security
25
- apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
26
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
27
- headers?: HTTPHeaders; //header params we want to use on every request
28
- credentials?: RequestCredentials; //value for the credentials param we want to use on each request
29
- }
30
-
31
- export class Configuration {
32
- constructor(private configuration: ConfigurationParameters = {}) {}
33
-
34
- set config(configuration: Configuration) {
35
- this.configuration = configuration;
36
- }
37
-
38
- get basePath(): string {
39
- return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
40
- }
41
-
42
- get fetchApi(): FetchAPI | undefined {
43
- return this.configuration.fetchApi;
44
- }
45
-
46
- get middleware(): Middleware[] {
47
- return this.configuration.middleware || [];
48
- }
49
-
50
- get queryParamsStringify(): (params: HTTPQuery) => string {
51
- return this.configuration.queryParamsStringify || querystring;
52
- }
53
-
54
- get username(): string | undefined {
55
- return this.configuration.username;
56
- }
57
-
58
- get password(): string | undefined {
59
- return this.configuration.password;
60
- }
61
-
62
- get apiKey(): ((name: string) => string | Promise<string>) | undefined {
63
- const apiKey = this.configuration.apiKey;
64
- if (apiKey) {
65
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
66
- }
67
- return undefined;
68
- }
69
-
70
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
71
- const accessToken = this.configuration.accessToken;
72
- if (accessToken) {
73
- return typeof accessToken === 'function' ? accessToken : async () => accessToken;
74
- }
75
- return undefined;
76
- }
77
-
78
- get headers(): HTTPHeaders | undefined {
79
- return this.configuration.headers;
80
- }
81
-
82
- get credentials(): RequestCredentials | undefined {
83
- return this.configuration.credentials;
84
- }
85
- }
86
-
87
- export const DefaultConfig = new Configuration();
88
-
89
- /**
90
- * This is the base class for all generated API classes.
91
- */
92
- export class BaseAPI {
93
-
94
- private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
95
- private middleware: Middleware[];
96
-
97
- constructor(protected configuration = DefaultConfig) {
98
- this.middleware = configuration.middleware;
99
- }
100
-
101
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
102
- const next = this.clone<T>();
103
- next.middleware = next.middleware.concat(...middlewares);
104
- return next;
105
- }
106
-
107
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
108
- const middlewares = preMiddlewares.map((pre) => ({ pre }));
109
- return this.withMiddleware<T>(...middlewares);
110
- }
111
-
112
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
113
- const middlewares = postMiddlewares.map((post) => ({ post }));
114
- return this.withMiddleware<T>(...middlewares);
115
- }
116
-
117
- /**
118
- * Check if the given MIME is a JSON MIME.
119
- * JSON MIME examples:
120
- * application/json
121
- * application/json; charset=UTF8
122
- * APPLICATION/JSON
123
- * application/vnd.company+json
124
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
125
- * @return True if the given MIME is JSON, false otherwise.
126
- */
127
- protected isJsonMime(mime: string | null | undefined): boolean {
128
- if (!mime) {
129
- return false;
130
- }
131
- return BaseAPI.jsonRegex.test(mime);
132
- }
133
-
134
- protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
135
- const { url, init } = await this.createFetchParams(context, initOverrides);
136
- const response = await this.fetchApi(url, init);
137
- if (response && (response.status >= 200 && response.status < 300)) {
138
- return response;
139
- }
140
- throw new ResponseError(response, 'Response returned an error code');
141
- }
142
-
143
- private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
144
- let url = this.configuration.basePath + context.path;
145
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
146
- // only add the querystring to the URL if there are query parameters.
147
- // this is done to avoid urls ending with a "?" character which buggy webservers
148
- // do not handle correctly sometimes.
149
- url += '?' + this.configuration.queryParamsStringify(context.query);
150
- }
151
-
152
- const headers = Object.assign({}, this.configuration.headers, context.headers);
153
- Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
154
-
155
- const initOverrideFn =
156
- typeof initOverrides === "function"
157
- ? initOverrides
158
- : async () => initOverrides;
159
-
160
- const initParams = {
161
- method: context.method,
162
- headers,
163
- body: context.body,
164
- credentials: this.configuration.credentials,
165
- };
166
-
167
- const overriddenInit: RequestInit = {
168
- ...initParams,
169
- ...(await initOverrideFn({
170
- init: initParams,
171
- context,
172
- }))
173
- };
174
-
175
- let body: any;
176
- if (isFormData(overriddenInit.body)
177
- || (overriddenInit.body instanceof URLSearchParams)
178
- || isBlob(overriddenInit.body)) {
179
- body = overriddenInit.body;
180
- } else if (this.isJsonMime(headers['Content-Type'])) {
181
- body = JSON.stringify(overriddenInit.body);
182
- } else {
183
- body = overriddenInit.body;
184
- }
185
-
186
- const init: RequestInit = {
187
- ...overriddenInit,
188
- body
189
- };
190
-
191
- return { url, init };
192
- }
193
-
194
- private fetchApi = async (url: string, init: RequestInit) => {
195
- let fetchParams = { url, init };
196
- for (const middleware of this.middleware) {
197
- if (middleware.pre) {
198
- fetchParams = await middleware.pre({
199
- fetch: this.fetchApi,
200
- ...fetchParams,
201
- }) || fetchParams;
202
- }
203
- }
204
- let response: Response | undefined = undefined;
205
- try {
206
- response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
207
- } catch (e) {
208
- for (const middleware of this.middleware) {
209
- if (middleware.onError) {
210
- response = await middleware.onError({
211
- fetch: this.fetchApi,
212
- url: fetchParams.url,
213
- init: fetchParams.init,
214
- error: e,
215
- response: response ? response.clone() : undefined,
216
- }) || response;
217
- }
218
- }
219
- if (response === undefined) {
220
- if (e instanceof Error) {
221
- throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
222
- } else {
223
- throw e;
224
- }
225
- }
226
- }
227
- for (const middleware of this.middleware) {
228
- if (middleware.post) {
229
- response = await middleware.post({
230
- fetch: this.fetchApi,
231
- url: fetchParams.url,
232
- init: fetchParams.init,
233
- response: response.clone(),
234
- }) || response;
235
- }
236
- }
237
- return response;
238
- }
239
-
240
- /**
241
- * Create a shallow clone of `this` by constructing a new instance
242
- * and then shallow cloning data members.
243
- */
244
- private clone<T extends BaseAPI>(this: T): T {
245
- const constructor = this.constructor as any;
246
- const next = new constructor(this.configuration);
247
- next.middleware = this.middleware.slice();
248
- return next;
249
- }
250
- };
251
-
252
- function isBlob(value: any): value is Blob {
253
- return typeof Blob !== 'undefined' && value instanceof Blob;
254
- }
255
-
256
- function isFormData(value: any): value is FormData {
257
- return typeof FormData !== "undefined" && value instanceof FormData;
258
- }
259
-
260
- export class ResponseError extends Error {
261
- override name: "ResponseError" = "ResponseError";
262
- constructor(public response: Response, msg?: string) {
263
- super(msg);
264
- }
265
- }
266
-
267
- export class FetchError extends Error {
268
- override name: "FetchError" = "FetchError";
269
- constructor(public cause: Error, msg?: string) {
270
- super(msg);
271
- }
272
- }
273
-
274
- export class RequiredError extends Error {
275
- override name: "RequiredError" = "RequiredError";
276
- constructor(public field: string, msg?: string) {
277
- super(msg);
278
- }
279
- }
280
-
281
- export const COLLECTION_FORMATS = {
282
- csv: ",",
283
- ssv: " ",
284
- tsv: "\t",
285
- pipes: "|",
286
- };
287
-
288
- export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
289
-
290
- export type Json = any;
291
- export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
292
- export type HTTPHeaders = { [key: string]: string };
293
- export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
294
- export type HTTPBody = Json | FormData | URLSearchParams;
295
- export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
296
- export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
297
-
298
- export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
299
-
300
- export interface FetchParams {
301
- url: string;
302
- init: RequestInit;
303
- }
304
-
305
- export interface RequestOpts {
306
- path: string;
307
- method: HTTPMethod;
308
- headers: HTTPHeaders;
309
- query?: HTTPQuery;
310
- body?: HTTPBody;
311
- }
312
-
313
- export function querystring(params: HTTPQuery, prefix: string = ''): string {
314
- return Object.keys(params)
315
- .map(key => querystringSingleKey(key, params[key], prefix))
316
- .filter(part => part.length > 0)
317
- .join('&');
318
- }
319
-
320
- function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
321
- const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
322
- if (value instanceof Array) {
323
- const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
324
- .join(`&${encodeURIComponent(fullKey)}=`);
325
- return `${encodeURIComponent(fullKey)}=${multiValue}`;
326
- }
327
- if (value instanceof Set) {
328
- const valueAsArray = Array.from(value);
329
- return querystringSingleKey(key, valueAsArray, keyPrefix);
330
- }
331
- if (value instanceof Date) {
332
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
333
- }
334
- if (value instanceof Object) {
335
- return querystring(value as HTTPQuery, fullKey);
336
- }
337
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
338
- }
339
-
340
- export function exists(json: any, key: string) {
341
- const value = json[key];
342
- return value !== null && value !== undefined;
343
- }
344
-
345
- export function mapValues(data: any, fn: (item: any) => any) {
346
- return Object.keys(data).reduce(
347
- (acc, key) => ({ ...acc, [key]: fn(data[key]) }),
348
- {}
349
- );
350
- }
351
-
352
- export function canConsumeForm(consumes: Consume[]): boolean {
353
- for (const consume of consumes) {
354
- if ('multipart/form-data' === consume.contentType) {
355
- return true;
356
- }
357
- }
358
- return false;
359
- }
360
-
361
- export interface Consume {
362
- contentType: string;
363
- }
364
-
365
- export interface RequestContext {
366
- fetch: FetchAPI;
367
- url: string;
368
- init: RequestInit;
369
- }
370
-
371
- export interface ResponseContext {
372
- fetch: FetchAPI;
373
- url: string;
374
- init: RequestInit;
375
- response: Response;
376
- }
377
-
378
- export interface ErrorContext {
379
- fetch: FetchAPI;
380
- url: string;
381
- init: RequestInit;
382
- error: unknown;
383
- response?: Response;
384
- }
385
-
386
- export interface Middleware {
387
- pre?(context: RequestContext): Promise<FetchParams | void>;
388
- post?(context: ResponseContext): Promise<Response | void>;
389
- onError?(context: ErrorContext): Promise<Response | void>;
390
- }
391
-
392
- export interface ApiResponse<T> {
393
- raw: Response;
394
- value(): Promise<T>;
395
- }
396
-
397
- export interface ResponseTransformer<T> {
398
- (json: any): T;
399
- }
400
-
401
- export class JSONApiResponse<T> {
402
- constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
403
-
404
- async value(): Promise<T> {
405
- return this.transformer(await this.raw.json());
406
- }
407
- }
408
-
409
- export class VoidApiResponse {
410
- constructor(public raw: Response) {}
411
-
412
- async value(): Promise<void> {
413
- return undefined;
414
- }
415
- }
416
-
417
- export class BlobApiResponse {
418
- constructor(public raw: Response) {}
419
-
420
- async value(): Promise<Blob> {
421
- return await this.raw.blob();
422
- };
423
- }
424
-
425
- export class TextApiResponse {
426
- constructor(public raw: Response) {}
427
-
428
- async value(): Promise<string> {
429
- return await this.raw.text();
430
- };
431
- }