@inceptionbg/main 2.0.98 → 2.0.100

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.
@@ -1,659 +1,664 @@
1
1
  import { NavigateFunction, Location, LinkProps } from 'react-router-dom';
2
2
 
3
- declare const ModuleIds = [
4
- 'ADMIN',
5
- 'EARCHIVE',
6
- 'ERDS',
7
- 'EINVOICE',
8
- 'EFORMS',
9
- 'EDMS',
10
- 'ESIGN',
11
- 'EVALIDATION',
12
- 'EPROCUREMENT',
13
- 'EREGISTER',
14
- 'PAM',
3
+ declare const ModuleIds = [
4
+ 'ADMIN',
5
+ 'EARCHIVE',
6
+ 'ERDS',
7
+ 'EINVOICE',
8
+ 'EFORMS',
9
+ 'EDMS',
10
+ 'ESIGN',
11
+ 'EVALIDATION',
12
+ 'EPROCUREMENT',
13
+ 'EREGISTER',
14
+ 'PAM',
15
+ 'ERP_CASH_REGISTER',
16
+ 'ERP_RIF',
17
+ 'ERP_MAT_ACC',
18
+ 'ERP_SMALL_INVENTORY',
19
+ 'ERP_WMS',
15
20
  ] as const;
16
21
 
17
22
  type IModuleId = (typeof ModuleIds)[number];
18
23
 
19
- type IEnv = 'DEV' | 'TEST' | 'PROD' | 'LOCAL' | 'UAT' | 'TEST_PPLCG';
20
- type IServiceApi =
21
- | 'auth'
22
- | 'idm'
23
- | 'codebook'
24
- | 'auditLog'
25
- | 'notifications'
26
- | 'indexData'
27
- | 'registration'
24
+ type IEnv = 'DEV' | 'TEST' | 'PROD' | 'LOCAL' | 'UAT' | 'TEST_PPLCG';
25
+ type IServiceApi =
26
+ | 'auth'
27
+ | 'idm'
28
+ | 'codebook'
29
+ | 'auditLog'
30
+ | 'notifications'
31
+ | 'indexData'
32
+ | 'registration'
28
33
  | 'reportTemplates';
29
34
 
30
- // TypeScript Version: 4.7
31
- type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
32
-
33
- type CustomHeader = {
34
- public?: boolean;
35
- baseUrl?: string;
36
- service?: IServiceApi;
37
- token?: string;
38
- noToast?: boolean;
39
- noErrors?: boolean;
40
- };
41
-
42
- interface RawAxiosHeaders {
43
- [key: string]: AxiosHeaderValue;
44
- }
45
-
46
- type MethodsHeaders = Partial<
47
- {
48
- [Key in Method as Lowercase<Key>]: AxiosHeaders;
49
- } & { common: AxiosHeaders }
50
- >;
51
-
52
- type AxiosHeaderMatcher =
53
- | string
54
- | RegExp
55
- | ((this: AxiosHeaders, value: string, name: string) => boolean);
56
-
57
- type AxiosHeaderParser = (
58
- this: AxiosHeaders,
59
- value: AxiosHeaderValue,
60
- header: string
61
- ) => any;
62
-
63
- declare class AxiosHeaders {
64
- constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
65
-
66
- [key: string]: any;
67
-
68
- set(
69
- headerName?: string,
70
- value?: AxiosHeaderValue,
71
- rewrite?: boolean | AxiosHeaderMatcher
72
- ): AxiosHeaders;
73
- set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
74
-
75
- get(headerName: string, parser: RegExp): RegExpExecArray | null;
76
- get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
77
-
78
- has(header: string, matcher?: AxiosHeaderMatcher): boolean;
79
-
80
- delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
81
-
82
- clear(matcher?: AxiosHeaderMatcher): boolean;
83
-
84
- normalize(format: boolean): AxiosHeaders;
85
-
86
- concat(
87
- ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
88
- ): AxiosHeaders;
89
-
90
- toJSON(asStrings?: boolean): RawAxiosHeaders;
91
-
92
- static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
93
-
94
- static accessor(header: string | string[]): AxiosHeaders;
95
-
96
- static concat(
97
- ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
98
- ): AxiosHeaders;
99
-
100
- setContentType(
101
- value: ContentType,
102
- rewrite?: boolean | AxiosHeaderMatcher
103
- ): AxiosHeaders;
104
- getContentType(parser?: RegExp): RegExpExecArray | null;
105
- getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
106
- hasContentType(matcher?: AxiosHeaderMatcher): boolean;
107
-
108
- setContentLength(
109
- value: AxiosHeaderValue,
110
- rewrite?: boolean | AxiosHeaderMatcher
111
- ): AxiosHeaders;
112
- getContentLength(parser?: RegExp): RegExpExecArray | null;
113
- getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
114
- hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
115
-
116
- setAccept(
117
- value: AxiosHeaderValue,
118
- rewrite?: boolean | AxiosHeaderMatcher
119
- ): AxiosHeaders;
120
- getAccept(parser?: RegExp): RegExpExecArray | null;
121
- getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
122
- hasAccept(matcher?: AxiosHeaderMatcher): boolean;
123
-
124
- setUserAgent(
125
- value: AxiosHeaderValue,
126
- rewrite?: boolean | AxiosHeaderMatcher
127
- ): AxiosHeaders;
128
- getUserAgent(parser?: RegExp): RegExpExecArray | null;
129
- getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
130
- hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
131
-
132
- setContentEncoding(
133
- value: AxiosHeaderValue,
134
- rewrite?: boolean | AxiosHeaderMatcher
135
- ): AxiosHeaders;
136
- getContentEncoding(parser?: RegExp): RegExpExecArray | null;
137
- getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
138
- hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
139
-
140
- setAuthorization(
141
- value: AxiosHeaderValue,
142
- rewrite?: boolean | AxiosHeaderMatcher
143
- ): AxiosHeaders;
144
- getAuthorization(parser?: RegExp): RegExpExecArray | null;
145
- getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
146
- hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
147
-
148
- [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
149
- }
150
-
151
- type CommonRequestHeadersList =
152
- | 'Accept'
153
- | 'Content-Length'
154
- | 'User-Agent'
155
- | 'Content-Encoding'
156
- | 'Authorization';
157
-
158
- type ContentType =
159
- | AxiosHeaderValue
160
- | 'text/html'
161
- | 'text/plain'
162
- | 'multipart/form-data'
163
- | 'application/json'
164
- | 'application/x-www-form-urlencoded'
165
- | 'application/octet-stream';
166
-
167
- type RawAxiosRequestHeaders = Partial<
168
- RawAxiosHeaders & {
169
- [Key in CommonRequestHeadersList]: AxiosHeaderValue;
170
- } & {
171
- 'Content-Type': ContentType;
172
- }
173
- >;
174
-
175
- type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
176
-
177
- type CommonResponseHeadersList =
178
- | 'Server'
179
- | 'Content-Type'
180
- | 'Content-Length'
181
- | 'Cache-Control'
182
- | 'Content-Encoding';
183
-
184
- type RawCommonResponseHeaders = {
185
- [Key in CommonResponseHeadersList]: AxiosHeaderValue;
186
- } & {
187
- 'set-cookie': string[];
188
- };
189
-
190
- type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
191
-
192
- type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
193
-
194
- interface AxiosRequestTransformer {
195
- (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
196
- }
197
-
198
- interface AxiosResponseTransformer {
199
- (
200
- this: InternalAxiosRequestConfig,
201
- data: any,
202
- headers: AxiosResponseHeaders,
203
- status?: number
204
- ): any;
205
- }
206
-
207
- interface AxiosAdapter {
208
- (config: InternalAxiosRequestConfig): AxiosPromise;
209
- }
210
-
211
- interface AxiosBasicCredentials {
212
- username: string;
213
- password: string;
214
- }
215
-
216
- interface AxiosProxyConfig {
217
- host: string;
218
- port: number;
219
- auth?: AxiosBasicCredentials;
220
- protocol?: string;
221
- }
222
-
223
- declare enum HttpStatusCode {
224
- Continue = 100,
225
- SwitchingProtocols = 101,
226
- Processing = 102,
227
- EarlyHints = 103,
228
- Ok = 200,
229
- Created = 201,
230
- Accepted = 202,
231
- NonAuthoritativeInformation = 203,
232
- NoContent = 204,
233
- ResetContent = 205,
234
- PartialContent = 206,
235
- MultiStatus = 207,
236
- AlreadyReported = 208,
237
- ImUsed = 226,
238
- MultipleChoices = 300,
239
- MovedPermanently = 301,
240
- Found = 302,
241
- SeeOther = 303,
242
- NotModified = 304,
243
- UseProxy = 305,
244
- Unused = 306,
245
- TemporaryRedirect = 307,
246
- PermanentRedirect = 308,
247
- BadRequest = 400,
248
- Unauthorized = 401,
249
- PaymentRequired = 402,
250
- Forbidden = 403,
251
- NotFound = 404,
252
- MethodNotAllowed = 405,
253
- NotAcceptable = 406,
254
- ProxyAuthenticationRequired = 407,
255
- RequestTimeout = 408,
256
- Conflict = 409,
257
- Gone = 410,
258
- LengthRequired = 411,
259
- PreconditionFailed = 412,
260
- PayloadTooLarge = 413,
261
- UriTooLong = 414,
262
- UnsupportedMediaType = 415,
263
- RangeNotSatisfiable = 416,
264
- ExpectationFailed = 417,
265
- ImATeapot = 418,
266
- MisdirectedRequest = 421,
267
- UnprocessableEntity = 422,
268
- Locked = 423,
269
- FailedDependency = 424,
270
- TooEarly = 425,
271
- UpgradeRequired = 426,
272
- PreconditionRequired = 428,
273
- TooManyRequests = 429,
274
- RequestHeaderFieldsTooLarge = 431,
275
- UnavailableForLegalReasons = 451,
276
- InternalServerError = 500,
277
- NotImplemented = 501,
278
- BadGateway = 502,
279
- ServiceUnavailable = 503,
280
- GatewayTimeout = 504,
281
- HttpVersionNotSupported = 505,
282
- VariantAlsoNegotiates = 506,
283
- InsufficientStorage = 507,
284
- LoopDetected = 508,
285
- NotExtended = 510,
286
- NetworkAuthenticationRequired = 511,
287
- }
288
-
289
- type Method =
290
- | 'get'
291
- | 'GET'
292
- | 'delete'
293
- | 'DELETE'
294
- | 'head'
295
- | 'HEAD'
296
- | 'options'
297
- | 'OPTIONS'
298
- | 'post'
299
- | 'POST'
300
- | 'put'
301
- | 'PUT'
302
- | 'patch'
303
- | 'PATCH'
304
- | 'purge'
305
- | 'PURGE'
306
- | 'link'
307
- | 'LINK'
308
- | 'unlink'
309
- | 'UNLINK';
310
-
311
- type ResponseType =
312
- | 'arraybuffer'
313
- | 'blob'
314
- | 'document'
315
- | 'json'
316
- | 'text'
317
- | 'stream'
318
- | 'formdata';
319
-
320
- type responseEncoding =
321
- | 'ascii'
322
- | 'ASCII'
323
- | 'ansi'
324
- | 'ANSI'
325
- | 'binary'
326
- | 'BINARY'
327
- | 'base64'
328
- | 'BASE64'
329
- | 'base64url'
330
- | 'BASE64URL'
331
- | 'hex'
332
- | 'HEX'
333
- | 'latin1'
334
- | 'LATIN1'
335
- | 'ucs-2'
336
- | 'UCS-2'
337
- | 'ucs2'
338
- | 'UCS2'
339
- | 'utf-8'
340
- | 'UTF-8'
341
- | 'utf8'
342
- | 'UTF8'
343
- | 'utf16le'
344
- | 'UTF16LE';
345
-
346
- interface TransitionalOptions {
347
- silentJSONParsing?: boolean;
348
- forcedJSONParsing?: boolean;
349
- clarifyTimeoutError?: boolean;
350
- }
351
-
352
- interface GenericAbortSignal {
353
- readonly aborted: boolean;
354
- onabort?: ((...args: any) => any) | null;
355
- addEventListener?: (...args: any) => any;
356
- removeEventListener?: (...args: any) => any;
357
- }
358
-
359
- interface FormDataVisitorHelpers {
360
- defaultVisitor: SerializerVisitor;
361
- convertValue: (value: any) => any;
362
- isVisitable: (value: any) => boolean;
363
- }
364
-
365
- interface SerializerVisitor {
366
- (
367
- this: GenericFormData,
368
- value: any,
369
- key: string | number,
370
- path: null | Array<string | number>,
371
- helpers: FormDataVisitorHelpers
372
- ): boolean;
373
- }
374
-
375
- interface SerializerOptions {
376
- visitor?: SerializerVisitor;
377
- dots?: boolean;
378
- metaTokens?: boolean;
379
- indexes?: boolean | null;
380
- }
381
-
382
- // tslint:disable-next-line
383
- interface FormSerializerOptions extends SerializerOptions {}
384
-
385
- interface ParamEncoder {
386
- (value: any, defaultEncoder: (value: any) => any): any;
387
- }
388
-
389
- interface CustomParamsSerializer {
390
- (params: Record<string, any>, options?: ParamsSerializerOptions): string;
391
- }
392
-
393
- interface ParamsSerializerOptions extends SerializerOptions {
394
- encode?: ParamEncoder;
395
- serialize?: CustomParamsSerializer;
396
- }
397
-
398
- type MaxUploadRate = number;
399
-
400
- type MaxDownloadRate = number;
401
-
402
- type BrowserProgressEvent = any;
403
-
404
- interface AxiosProgressEvent {
405
- loaded: number;
406
- total?: number;
407
- progress?: number;
408
- bytes: number;
409
- rate?: number;
410
- estimated?: number;
411
- upload?: boolean;
412
- download?: boolean;
413
- event?: BrowserProgressEvent;
414
- lengthComputable: boolean;
415
- }
416
-
417
- type Milliseconds = number;
418
-
419
- type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string;
420
-
421
- type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
422
-
423
- type AddressFamily = 4 | 6 | undefined;
424
-
425
- interface LookupAddressEntry {
426
- address: string;
427
- family?: AddressFamily;
428
- }
429
-
430
- type LookupAddress = string | LookupAddressEntry;
431
-
432
- interface AxiosRequestConfig<D = any> {
433
- url?: string;
434
- method?: Method | string;
435
- baseURL?: string;
436
- transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
437
- transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
438
- headers?: ((RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders) & CustomHeader;
439
- params?: any;
440
- paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
441
- data?: D;
442
- timeout?: Milliseconds;
443
- timeoutErrorMessage?: string;
444
- withCredentials?: boolean;
445
- adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
446
- auth?: AxiosBasicCredentials;
447
- responseType?: ResponseType;
448
- responseEncoding?: responseEncoding | string;
449
- xsrfCookieName?: string;
450
- xsrfHeaderName?: string;
451
- onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
452
- onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
453
- maxContentLength?: number;
454
- validateStatus?: ((status: number) => boolean) | null;
455
- maxBodyLength?: number;
456
- maxRedirects?: number;
457
- maxRate?: number | [MaxUploadRate, MaxDownloadRate];
458
- beforeRedirect?: (
459
- options: Record<string, any>,
460
- responseDetails: { headers: Record<string, string>; statusCode: HttpStatusCode }
461
- ) => void;
462
- socketPath?: string | null;
463
- transport?: any;
464
- httpAgent?: any;
465
- httpsAgent?: any;
466
- proxy?: AxiosProxyConfig | false;
467
- cancelToken?: CancelToken;
468
- decompress?: boolean;
469
- transitional?: TransitionalOptions;
470
- signal?: GenericAbortSignal;
471
- insecureHTTPParser?: boolean;
472
- env?: {
473
- FormData?: new (...args: any[]) => object;
474
- };
475
- formSerializer?: FormSerializerOptions;
476
- family?: AddressFamily;
477
- lookup?:
478
- | ((
479
- hostname: string,
480
- options: object,
481
- cb: (
482
- err: Error | null,
483
- address: LookupAddress | LookupAddress[],
484
- family?: AddressFamily
485
- ) => void
486
- ) => void)
487
- | ((
488
- hostname: string,
489
- options: object
490
- ) => Promise<
491
- | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]
492
- | LookupAddress
493
- >);
494
- withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
495
- fetchOptions?: Record<string, any>;
496
- }
497
-
498
- interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
499
- headers: AxiosRequestHeaders;
500
- }
501
-
502
- interface HeadersDefaults {
503
- common: RawAxiosRequestHeaders;
504
- delete: RawAxiosRequestHeaders;
505
- get: RawAxiosRequestHeaders;
506
- head: RawAxiosRequestHeaders;
507
- post: RawAxiosRequestHeaders;
508
- put: RawAxiosRequestHeaders;
509
- patch: RawAxiosRequestHeaders;
510
- options?: RawAxiosRequestHeaders;
511
- purge?: RawAxiosRequestHeaders;
512
- link?: RawAxiosRequestHeaders;
513
- unlink?: RawAxiosRequestHeaders;
514
- }
515
-
516
- interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
517
- headers: HeadersDefaults;
518
- }
519
-
520
- interface AxiosResponse<T = any, D = any> {
521
- data: T;
522
- status: number;
523
- statusText: string;
524
- headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
525
- config: InternalAxiosRequestConfig<D>;
526
- request?: any;
527
- }
528
-
529
- type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
530
-
531
- interface Cancel {
532
- message: string | undefined;
533
- }
534
-
535
- interface CancelToken {
536
- promise: Promise<Cancel>;
537
- reason?: Cancel;
538
- throwIfRequested(): void;
539
- }
540
-
541
- interface AxiosInterceptorOptions {
542
- synchronous?: boolean;
543
- runWhen?: (config: InternalAxiosRequestConfig) => boolean;
544
- }
545
-
546
- interface AxiosInterceptorManager<V> {
547
- use(
548
- onFulfilled?: ((value: V) => V | Promise<V>) | null,
549
- onRejected?: ((error: any) => any) | null,
550
- options?: AxiosInterceptorOptions
551
- ): number;
552
- eject(id: number): void;
553
- clear(): void;
554
- }
555
-
556
- declare class Axios {
557
- constructor(config?: AxiosRequestConfig);
558
- defaults: AxiosDefaults;
559
- interceptors: {
560
- request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
561
- response: AxiosInterceptorManager<AxiosResponse>;
562
- };
563
- getUri(config?: AxiosRequestConfig): string;
564
- request<T = any, R = AxiosResponse<T>, D = any>(
565
- config: AxiosRequestConfig<D>
566
- ): Promise<R>;
567
- get<T = any, R = AxiosResponse<T>, D = any>(
568
- url: string,
569
- config?: AxiosRequestConfig<D>
570
- ): Promise<R>;
571
- delete<T = any, R = AxiosResponse<T>, D = any>(
572
- url: string,
573
- config?: AxiosRequestConfig<D>
574
- ): Promise<R>;
575
- head<T = any, R = AxiosResponse<T>, D = any>(
576
- url: string,
577
- config?: AxiosRequestConfig<D>
578
- ): Promise<R>;
579
- options<T = any, R = AxiosResponse<T>, D = any>(
580
- url: string,
581
- config?: AxiosRequestConfig<D>
582
- ): Promise<R>;
583
- post<T = any, R = AxiosResponse<T>, D = any>(
584
- url: string,
585
- data?: D,
586
- config?: AxiosRequestConfig<D>
587
- ): Promise<R>;
588
- put<T = any, R = AxiosResponse<T>, D = any>(
589
- url: string,
590
- data?: D,
591
- config?: AxiosRequestConfig<D>
592
- ): Promise<R>;
593
- patch<T = any, R = AxiosResponse<T>, D = any>(
594
- url: string,
595
- data?: D,
596
- config?: AxiosRequestConfig<D>
597
- ): Promise<R>;
598
- postForm<T = any, R = AxiosResponse<T>, D = any>(
599
- url: string,
600
- data?: D,
601
- config?: AxiosRequestConfig<D>
602
- ): Promise<R>;
603
- putForm<T = any, R = AxiosResponse<T>, D = any>(
604
- url: string,
605
- data?: D,
606
- config?: AxiosRequestConfig<D>
607
- ): Promise<R>;
608
- patchForm<T = any, R = AxiosResponse<T>, D = any>(
609
- url: string,
610
- data?: D,
611
- config?: AxiosRequestConfig<D>
612
- ): Promise<R>;
613
- }
614
-
615
- interface AxiosInstance extends Axios {
616
- <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
617
- <T = any, R = AxiosResponse<T>, D = any>(
618
- url: string,
619
- config?: AxiosRequestConfig<D>
620
- ): Promise<R>;
621
-
622
- defaults: Omit<AxiosDefaults, 'headers'> & {
623
- headers: HeadersDefaults & {
624
- [key: string]: AxiosHeaderValue;
625
- };
626
- };
627
- }
628
-
629
- interface GenericFormData {
630
- append(name: string, value: any, options?: any): any;
35
+ // TypeScript Version: 4.7
36
+ type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
37
+
38
+ type CustomHeader = {
39
+ public?: boolean;
40
+ baseUrl?: string;
41
+ service?: IServiceApi;
42
+ token?: string;
43
+ noToast?: boolean;
44
+ noErrors?: boolean;
45
+ };
46
+
47
+ interface RawAxiosHeaders {
48
+ [key: string]: AxiosHeaderValue;
49
+ }
50
+
51
+ type MethodsHeaders = Partial<
52
+ {
53
+ [Key in Method as Lowercase<Key>]: AxiosHeaders;
54
+ } & { common: AxiosHeaders }
55
+ >;
56
+
57
+ type AxiosHeaderMatcher =
58
+ | string
59
+ | RegExp
60
+ | ((this: AxiosHeaders, value: string, name: string) => boolean);
61
+
62
+ type AxiosHeaderParser = (
63
+ this: AxiosHeaders,
64
+ value: AxiosHeaderValue,
65
+ header: string
66
+ ) => any;
67
+
68
+ declare class AxiosHeaders {
69
+ constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
70
+
71
+ [key: string]: any;
72
+
73
+ set(
74
+ headerName?: string,
75
+ value?: AxiosHeaderValue,
76
+ rewrite?: boolean | AxiosHeaderMatcher
77
+ ): AxiosHeaders;
78
+ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
79
+
80
+ get(headerName: string, parser: RegExp): RegExpExecArray | null;
81
+ get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
82
+
83
+ has(header: string, matcher?: AxiosHeaderMatcher): boolean;
84
+
85
+ delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
86
+
87
+ clear(matcher?: AxiosHeaderMatcher): boolean;
88
+
89
+ normalize(format: boolean): AxiosHeaders;
90
+
91
+ concat(
92
+ ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
93
+ ): AxiosHeaders;
94
+
95
+ toJSON(asStrings?: boolean): RawAxiosHeaders;
96
+
97
+ static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
98
+
99
+ static accessor(header: string | string[]): AxiosHeaders;
100
+
101
+ static concat(
102
+ ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
103
+ ): AxiosHeaders;
104
+
105
+ setContentType(
106
+ value: ContentType,
107
+ rewrite?: boolean | AxiosHeaderMatcher
108
+ ): AxiosHeaders;
109
+ getContentType(parser?: RegExp): RegExpExecArray | null;
110
+ getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
111
+ hasContentType(matcher?: AxiosHeaderMatcher): boolean;
112
+
113
+ setContentLength(
114
+ value: AxiosHeaderValue,
115
+ rewrite?: boolean | AxiosHeaderMatcher
116
+ ): AxiosHeaders;
117
+ getContentLength(parser?: RegExp): RegExpExecArray | null;
118
+ getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
119
+ hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
120
+
121
+ setAccept(
122
+ value: AxiosHeaderValue,
123
+ rewrite?: boolean | AxiosHeaderMatcher
124
+ ): AxiosHeaders;
125
+ getAccept(parser?: RegExp): RegExpExecArray | null;
126
+ getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
127
+ hasAccept(matcher?: AxiosHeaderMatcher): boolean;
128
+
129
+ setUserAgent(
130
+ value: AxiosHeaderValue,
131
+ rewrite?: boolean | AxiosHeaderMatcher
132
+ ): AxiosHeaders;
133
+ getUserAgent(parser?: RegExp): RegExpExecArray | null;
134
+ getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
135
+ hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
136
+
137
+ setContentEncoding(
138
+ value: AxiosHeaderValue,
139
+ rewrite?: boolean | AxiosHeaderMatcher
140
+ ): AxiosHeaders;
141
+ getContentEncoding(parser?: RegExp): RegExpExecArray | null;
142
+ getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
143
+ hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
144
+
145
+ setAuthorization(
146
+ value: AxiosHeaderValue,
147
+ rewrite?: boolean | AxiosHeaderMatcher
148
+ ): AxiosHeaders;
149
+ getAuthorization(parser?: RegExp): RegExpExecArray | null;
150
+ getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
151
+ hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
152
+
153
+ [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
154
+ }
155
+
156
+ type CommonRequestHeadersList =
157
+ | 'Accept'
158
+ | 'Content-Length'
159
+ | 'User-Agent'
160
+ | 'Content-Encoding'
161
+ | 'Authorization';
162
+
163
+ type ContentType =
164
+ | AxiosHeaderValue
165
+ | 'text/html'
166
+ | 'text/plain'
167
+ | 'multipart/form-data'
168
+ | 'application/json'
169
+ | 'application/x-www-form-urlencoded'
170
+ | 'application/octet-stream';
171
+
172
+ type RawAxiosRequestHeaders = Partial<
173
+ RawAxiosHeaders & {
174
+ [Key in CommonRequestHeadersList]: AxiosHeaderValue;
175
+ } & {
176
+ 'Content-Type': ContentType;
177
+ }
178
+ >;
179
+
180
+ type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
181
+
182
+ type CommonResponseHeadersList =
183
+ | 'Server'
184
+ | 'Content-Type'
185
+ | 'Content-Length'
186
+ | 'Cache-Control'
187
+ | 'Content-Encoding';
188
+
189
+ type RawCommonResponseHeaders = {
190
+ [Key in CommonResponseHeadersList]: AxiosHeaderValue;
191
+ } & {
192
+ 'set-cookie': string[];
193
+ };
194
+
195
+ type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
196
+
197
+ type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
198
+
199
+ interface AxiosRequestTransformer {
200
+ (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
201
+ }
202
+
203
+ interface AxiosResponseTransformer {
204
+ (
205
+ this: InternalAxiosRequestConfig,
206
+ data: any,
207
+ headers: AxiosResponseHeaders,
208
+ status?: number
209
+ ): any;
210
+ }
211
+
212
+ interface AxiosAdapter {
213
+ (config: InternalAxiosRequestConfig): AxiosPromise;
214
+ }
215
+
216
+ interface AxiosBasicCredentials {
217
+ username: string;
218
+ password: string;
219
+ }
220
+
221
+ interface AxiosProxyConfig {
222
+ host: string;
223
+ port: number;
224
+ auth?: AxiosBasicCredentials;
225
+ protocol?: string;
226
+ }
227
+
228
+ declare enum HttpStatusCode {
229
+ Continue = 100,
230
+ SwitchingProtocols = 101,
231
+ Processing = 102,
232
+ EarlyHints = 103,
233
+ Ok = 200,
234
+ Created = 201,
235
+ Accepted = 202,
236
+ NonAuthoritativeInformation = 203,
237
+ NoContent = 204,
238
+ ResetContent = 205,
239
+ PartialContent = 206,
240
+ MultiStatus = 207,
241
+ AlreadyReported = 208,
242
+ ImUsed = 226,
243
+ MultipleChoices = 300,
244
+ MovedPermanently = 301,
245
+ Found = 302,
246
+ SeeOther = 303,
247
+ NotModified = 304,
248
+ UseProxy = 305,
249
+ Unused = 306,
250
+ TemporaryRedirect = 307,
251
+ PermanentRedirect = 308,
252
+ BadRequest = 400,
253
+ Unauthorized = 401,
254
+ PaymentRequired = 402,
255
+ Forbidden = 403,
256
+ NotFound = 404,
257
+ MethodNotAllowed = 405,
258
+ NotAcceptable = 406,
259
+ ProxyAuthenticationRequired = 407,
260
+ RequestTimeout = 408,
261
+ Conflict = 409,
262
+ Gone = 410,
263
+ LengthRequired = 411,
264
+ PreconditionFailed = 412,
265
+ PayloadTooLarge = 413,
266
+ UriTooLong = 414,
267
+ UnsupportedMediaType = 415,
268
+ RangeNotSatisfiable = 416,
269
+ ExpectationFailed = 417,
270
+ ImATeapot = 418,
271
+ MisdirectedRequest = 421,
272
+ UnprocessableEntity = 422,
273
+ Locked = 423,
274
+ FailedDependency = 424,
275
+ TooEarly = 425,
276
+ UpgradeRequired = 426,
277
+ PreconditionRequired = 428,
278
+ TooManyRequests = 429,
279
+ RequestHeaderFieldsTooLarge = 431,
280
+ UnavailableForLegalReasons = 451,
281
+ InternalServerError = 500,
282
+ NotImplemented = 501,
283
+ BadGateway = 502,
284
+ ServiceUnavailable = 503,
285
+ GatewayTimeout = 504,
286
+ HttpVersionNotSupported = 505,
287
+ VariantAlsoNegotiates = 506,
288
+ InsufficientStorage = 507,
289
+ LoopDetected = 508,
290
+ NotExtended = 510,
291
+ NetworkAuthenticationRequired = 511,
292
+ }
293
+
294
+ type Method =
295
+ | 'get'
296
+ | 'GET'
297
+ | 'delete'
298
+ | 'DELETE'
299
+ | 'head'
300
+ | 'HEAD'
301
+ | 'options'
302
+ | 'OPTIONS'
303
+ | 'post'
304
+ | 'POST'
305
+ | 'put'
306
+ | 'PUT'
307
+ | 'patch'
308
+ | 'PATCH'
309
+ | 'purge'
310
+ | 'PURGE'
311
+ | 'link'
312
+ | 'LINK'
313
+ | 'unlink'
314
+ | 'UNLINK';
315
+
316
+ type ResponseType =
317
+ | 'arraybuffer'
318
+ | 'blob'
319
+ | 'document'
320
+ | 'json'
321
+ | 'text'
322
+ | 'stream'
323
+ | 'formdata';
324
+
325
+ type responseEncoding =
326
+ | 'ascii'
327
+ | 'ASCII'
328
+ | 'ansi'
329
+ | 'ANSI'
330
+ | 'binary'
331
+ | 'BINARY'
332
+ | 'base64'
333
+ | 'BASE64'
334
+ | 'base64url'
335
+ | 'BASE64URL'
336
+ | 'hex'
337
+ | 'HEX'
338
+ | 'latin1'
339
+ | 'LATIN1'
340
+ | 'ucs-2'
341
+ | 'UCS-2'
342
+ | 'ucs2'
343
+ | 'UCS2'
344
+ | 'utf-8'
345
+ | 'UTF-8'
346
+ | 'utf8'
347
+ | 'UTF8'
348
+ | 'utf16le'
349
+ | 'UTF16LE';
350
+
351
+ interface TransitionalOptions {
352
+ silentJSONParsing?: boolean;
353
+ forcedJSONParsing?: boolean;
354
+ clarifyTimeoutError?: boolean;
355
+ }
356
+
357
+ interface GenericAbortSignal {
358
+ readonly aborted: boolean;
359
+ onabort?: ((...args: any) => any) | null;
360
+ addEventListener?: (...args: any) => any;
361
+ removeEventListener?: (...args: any) => any;
362
+ }
363
+
364
+ interface FormDataVisitorHelpers {
365
+ defaultVisitor: SerializerVisitor;
366
+ convertValue: (value: any) => any;
367
+ isVisitable: (value: any) => boolean;
368
+ }
369
+
370
+ interface SerializerVisitor {
371
+ (
372
+ this: GenericFormData,
373
+ value: any,
374
+ key: string | number,
375
+ path: null | Array<string | number>,
376
+ helpers: FormDataVisitorHelpers
377
+ ): boolean;
378
+ }
379
+
380
+ interface SerializerOptions {
381
+ visitor?: SerializerVisitor;
382
+ dots?: boolean;
383
+ metaTokens?: boolean;
384
+ indexes?: boolean | null;
385
+ }
386
+
387
+ // tslint:disable-next-line
388
+ interface FormSerializerOptions extends SerializerOptions {}
389
+
390
+ interface ParamEncoder {
391
+ (value: any, defaultEncoder: (value: any) => any): any;
392
+ }
393
+
394
+ interface CustomParamsSerializer {
395
+ (params: Record<string, any>, options?: ParamsSerializerOptions): string;
396
+ }
397
+
398
+ interface ParamsSerializerOptions extends SerializerOptions {
399
+ encode?: ParamEncoder;
400
+ serialize?: CustomParamsSerializer;
401
+ }
402
+
403
+ type MaxUploadRate = number;
404
+
405
+ type MaxDownloadRate = number;
406
+
407
+ type BrowserProgressEvent = any;
408
+
409
+ interface AxiosProgressEvent {
410
+ loaded: number;
411
+ total?: number;
412
+ progress?: number;
413
+ bytes: number;
414
+ rate?: number;
415
+ estimated?: number;
416
+ upload?: boolean;
417
+ download?: boolean;
418
+ event?: BrowserProgressEvent;
419
+ lengthComputable: boolean;
420
+ }
421
+
422
+ type Milliseconds = number;
423
+
424
+ type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string;
425
+
426
+ type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
427
+
428
+ type AddressFamily = 4 | 6 | undefined;
429
+
430
+ interface LookupAddressEntry {
431
+ address: string;
432
+ family?: AddressFamily;
433
+ }
434
+
435
+ type LookupAddress = string | LookupAddressEntry;
436
+
437
+ interface AxiosRequestConfig<D = any> {
438
+ url?: string;
439
+ method?: Method | string;
440
+ baseURL?: string;
441
+ transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
442
+ transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
443
+ headers?: ((RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders) & CustomHeader;
444
+ params?: any;
445
+ paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
446
+ data?: D;
447
+ timeout?: Milliseconds;
448
+ timeoutErrorMessage?: string;
449
+ withCredentials?: boolean;
450
+ adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
451
+ auth?: AxiosBasicCredentials;
452
+ responseType?: ResponseType;
453
+ responseEncoding?: responseEncoding | string;
454
+ xsrfCookieName?: string;
455
+ xsrfHeaderName?: string;
456
+ onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
457
+ onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
458
+ maxContentLength?: number;
459
+ validateStatus?: ((status: number) => boolean) | null;
460
+ maxBodyLength?: number;
461
+ maxRedirects?: number;
462
+ maxRate?: number | [MaxUploadRate, MaxDownloadRate];
463
+ beforeRedirect?: (
464
+ options: Record<string, any>,
465
+ responseDetails: { headers: Record<string, string>; statusCode: HttpStatusCode }
466
+ ) => void;
467
+ socketPath?: string | null;
468
+ transport?: any;
469
+ httpAgent?: any;
470
+ httpsAgent?: any;
471
+ proxy?: AxiosProxyConfig | false;
472
+ cancelToken?: CancelToken;
473
+ decompress?: boolean;
474
+ transitional?: TransitionalOptions;
475
+ signal?: GenericAbortSignal;
476
+ insecureHTTPParser?: boolean;
477
+ env?: {
478
+ FormData?: new (...args: any[]) => object;
479
+ };
480
+ formSerializer?: FormSerializerOptions;
481
+ family?: AddressFamily;
482
+ lookup?:
483
+ | ((
484
+ hostname: string,
485
+ options: object,
486
+ cb: (
487
+ err: Error | null,
488
+ address: LookupAddress | LookupAddress[],
489
+ family?: AddressFamily
490
+ ) => void
491
+ ) => void)
492
+ | ((
493
+ hostname: string,
494
+ options: object
495
+ ) => Promise<
496
+ | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]
497
+ | LookupAddress
498
+ >);
499
+ withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
500
+ fetchOptions?: Record<string, any>;
501
+ }
502
+
503
+ interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
504
+ headers: AxiosRequestHeaders;
505
+ }
506
+
507
+ interface HeadersDefaults {
508
+ common: RawAxiosRequestHeaders;
509
+ delete: RawAxiosRequestHeaders;
510
+ get: RawAxiosRequestHeaders;
511
+ head: RawAxiosRequestHeaders;
512
+ post: RawAxiosRequestHeaders;
513
+ put: RawAxiosRequestHeaders;
514
+ patch: RawAxiosRequestHeaders;
515
+ options?: RawAxiosRequestHeaders;
516
+ purge?: RawAxiosRequestHeaders;
517
+ link?: RawAxiosRequestHeaders;
518
+ unlink?: RawAxiosRequestHeaders;
519
+ }
520
+
521
+ interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
522
+ headers: HeadersDefaults;
523
+ }
524
+
525
+ interface AxiosResponse<T = any, D = any> {
526
+ data: T;
527
+ status: number;
528
+ statusText: string;
529
+ headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
530
+ config: InternalAxiosRequestConfig<D>;
531
+ request?: any;
532
+ }
533
+
534
+ type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
535
+
536
+ interface Cancel {
537
+ message: string | undefined;
538
+ }
539
+
540
+ interface CancelToken {
541
+ promise: Promise<Cancel>;
542
+ reason?: Cancel;
543
+ throwIfRequested(): void;
544
+ }
545
+
546
+ interface AxiosInterceptorOptions {
547
+ synchronous?: boolean;
548
+ runWhen?: (config: InternalAxiosRequestConfig) => boolean;
549
+ }
550
+
551
+ interface AxiosInterceptorManager<V> {
552
+ use(
553
+ onFulfilled?: ((value: V) => V | Promise<V>) | null,
554
+ onRejected?: ((error: any) => any) | null,
555
+ options?: AxiosInterceptorOptions
556
+ ): number;
557
+ eject(id: number): void;
558
+ clear(): void;
559
+ }
560
+
561
+ declare class Axios {
562
+ constructor(config?: AxiosRequestConfig);
563
+ defaults: AxiosDefaults;
564
+ interceptors: {
565
+ request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
566
+ response: AxiosInterceptorManager<AxiosResponse>;
567
+ };
568
+ getUri(config?: AxiosRequestConfig): string;
569
+ request<T = any, R = AxiosResponse<T>, D = any>(
570
+ config: AxiosRequestConfig<D>
571
+ ): Promise<R>;
572
+ get<T = any, R = AxiosResponse<T>, D = any>(
573
+ url: string,
574
+ config?: AxiosRequestConfig<D>
575
+ ): Promise<R>;
576
+ delete<T = any, R = AxiosResponse<T>, D = any>(
577
+ url: string,
578
+ config?: AxiosRequestConfig<D>
579
+ ): Promise<R>;
580
+ head<T = any, R = AxiosResponse<T>, D = any>(
581
+ url: string,
582
+ config?: AxiosRequestConfig<D>
583
+ ): Promise<R>;
584
+ options<T = any, R = AxiosResponse<T>, D = any>(
585
+ url: string,
586
+ config?: AxiosRequestConfig<D>
587
+ ): Promise<R>;
588
+ post<T = any, R = AxiosResponse<T>, D = any>(
589
+ url: string,
590
+ data?: D,
591
+ config?: AxiosRequestConfig<D>
592
+ ): Promise<R>;
593
+ put<T = any, R = AxiosResponse<T>, D = any>(
594
+ url: string,
595
+ data?: D,
596
+ config?: AxiosRequestConfig<D>
597
+ ): Promise<R>;
598
+ patch<T = any, R = AxiosResponse<T>, D = any>(
599
+ url: string,
600
+ data?: D,
601
+ config?: AxiosRequestConfig<D>
602
+ ): Promise<R>;
603
+ postForm<T = any, R = AxiosResponse<T>, D = any>(
604
+ url: string,
605
+ data?: D,
606
+ config?: AxiosRequestConfig<D>
607
+ ): Promise<R>;
608
+ putForm<T = any, R = AxiosResponse<T>, D = any>(
609
+ url: string,
610
+ data?: D,
611
+ config?: AxiosRequestConfig<D>
612
+ ): Promise<R>;
613
+ patchForm<T = any, R = AxiosResponse<T>, D = any>(
614
+ url: string,
615
+ data?: D,
616
+ config?: AxiosRequestConfig<D>
617
+ ): Promise<R>;
618
+ }
619
+
620
+ interface AxiosInstance extends Axios {
621
+ <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
622
+ <T = any, R = AxiosResponse<T>, D = any>(
623
+ url: string,
624
+ config?: AxiosRequestConfig<D>
625
+ ): Promise<R>;
626
+
627
+ defaults: Omit<AxiosDefaults, 'headers'> & {
628
+ headers: HeadersDefaults & {
629
+ [key: string]: AxiosHeaderValue;
630
+ };
631
+ };
632
+ }
633
+
634
+ interface GenericFormData {
635
+ append(name: string, value: any, options?: any): any;
631
636
  }
632
637
 
633
- declare global {
634
- var environment: IEnv;
635
- var moduleId: IModuleId | null;
636
- var moduleUrls: {
637
- [id in IModuleId]?: string;
638
- };
639
- var axiosInstance: AxiosInstance;
640
- var useNavigate: () => NavigateFunction;
641
- var useLocation: () => Location;
642
- var Link: React.ForwardRefExoticComponent<
643
- LinkProps & React.RefAttributes<HTMLAnchorElement>
644
- >;
645
- var appVersion: string | undefined;
646
- var api: {
647
- apiUrl: string;
648
- clientId: string;
649
- authScope?: string;
650
- additionalScopes?: string[];
651
- redirectUrl?: string;
652
- };
653
- var zE: {
654
- show: () => void;
655
- hide: () => void;
656
- activate: () => void;
657
- setLocale: (locale: string) => void;
658
- };
638
+ declare global {
639
+ var environment: IEnv;
640
+ var moduleId: IModuleId | null;
641
+ var moduleUrls: {
642
+ [id in IModuleId]?: string;
643
+ };
644
+ var axiosInstance: AxiosInstance;
645
+ var useNavigate: () => NavigateFunction;
646
+ var useLocation: () => Location;
647
+ var Link: React.ForwardRefExoticComponent<
648
+ LinkProps & React.RefAttributes<HTMLAnchorElement>
649
+ >;
650
+ var appVersion: string | undefined;
651
+ var api: {
652
+ apiUrl: string;
653
+ clientId: string;
654
+ authScope?: string;
655
+ additionalScopes?: string[];
656
+ redirectUrl?: string;
657
+ };
658
+ var zE: {
659
+ show: () => void;
660
+ hide: () => void;
661
+ activate: () => void;
662
+ setLocale: (locale: string) => void;
663
+ };
659
664
  }