@inceptionbg/main 2.0.62 → 2.0.64
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{axios.d.ts → types/global.d.ts} +75 -193
- package/package.json +3 -4
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import { NavigateFunction, Location, LinkProps } from 'react-router-dom';
|
|
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
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
type IModuleId = (typeof ModuleIds)[number];
|
|
17
|
+
|
|
18
|
+
type IEnv = 'DEV' | 'TEST' | 'PROD' | 'LOCAL' | 'UAT';
|
|
1
19
|
type IServiceApi = 'idm' | 'codebook' | 'auditLog' | 'notifications' | 'indexData';
|
|
2
20
|
|
|
3
21
|
// TypeScript Version: 4.7
|
|
@@ -9,6 +27,7 @@ type CustomHeader = {
|
|
|
9
27
|
service?: IServiceApi;
|
|
10
28
|
token?: string;
|
|
11
29
|
noToast?: boolean;
|
|
30
|
+
noErrors?: boolean;
|
|
12
31
|
};
|
|
13
32
|
|
|
14
33
|
interface RawAxiosHeaders {
|
|
@@ -21,15 +40,19 @@ type MethodsHeaders = Partial<
|
|
|
21
40
|
} & { common: AxiosHeaders }
|
|
22
41
|
>;
|
|
23
42
|
|
|
24
|
-
type AxiosHeaderMatcher =
|
|
43
|
+
type AxiosHeaderMatcher =
|
|
44
|
+
| string
|
|
45
|
+
| RegExp
|
|
46
|
+
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
47
|
+
|
|
48
|
+
type AxiosHeaderParser = (
|
|
25
49
|
this: AxiosHeaders,
|
|
26
|
-
value:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
) => boolean;
|
|
50
|
+
value: AxiosHeaderValue,
|
|
51
|
+
header: string
|
|
52
|
+
) => any;
|
|
30
53
|
|
|
31
54
|
declare class AxiosHeaders {
|
|
32
|
-
constructor(headers?: RawAxiosHeaders | AxiosHeaders);
|
|
55
|
+
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
|
33
56
|
|
|
34
57
|
[key: string]: any;
|
|
35
58
|
|
|
@@ -38,12 +61,12 @@ declare class AxiosHeaders {
|
|
|
38
61
|
value?: AxiosHeaderValue,
|
|
39
62
|
rewrite?: boolean | AxiosHeaderMatcher
|
|
40
63
|
): AxiosHeaders;
|
|
41
|
-
set(headers?: RawAxiosHeaders | AxiosHeaders, rewrite?: boolean): AxiosHeaders;
|
|
64
|
+
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
|
42
65
|
|
|
43
66
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
44
|
-
get(headerName: string, matcher?: true |
|
|
67
|
+
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
45
68
|
|
|
46
|
-
has(header: string, matcher?:
|
|
69
|
+
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
|
47
70
|
|
|
48
71
|
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
|
49
72
|
|
|
@@ -184,79 +207,10 @@ interface AxiosBasicCredentials {
|
|
|
184
207
|
interface AxiosProxyConfig {
|
|
185
208
|
host: string;
|
|
186
209
|
port: number;
|
|
187
|
-
auth?:
|
|
188
|
-
username: string;
|
|
189
|
-
password: string;
|
|
190
|
-
};
|
|
210
|
+
auth?: AxiosBasicCredentials;
|
|
191
211
|
protocol?: string;
|
|
192
212
|
}
|
|
193
213
|
|
|
194
|
-
declare enum HttpStatusCode {
|
|
195
|
-
Continue = 100,
|
|
196
|
-
SwitchingProtocols = 101,
|
|
197
|
-
Processing = 102,
|
|
198
|
-
EarlyHints = 103,
|
|
199
|
-
Ok = 200,
|
|
200
|
-
Created = 201,
|
|
201
|
-
Accepted = 202,
|
|
202
|
-
NonAuthoritativeInformation = 203,
|
|
203
|
-
NoContent = 204,
|
|
204
|
-
ResetContent = 205,
|
|
205
|
-
PartialContent = 206,
|
|
206
|
-
MultiStatus = 207,
|
|
207
|
-
AlreadyReported = 208,
|
|
208
|
-
ImUsed = 226,
|
|
209
|
-
MultipleChoices = 300,
|
|
210
|
-
MovedPermanently = 301,
|
|
211
|
-
Found = 302,
|
|
212
|
-
SeeOther = 303,
|
|
213
|
-
NotModified = 304,
|
|
214
|
-
UseProxy = 305,
|
|
215
|
-
Unused = 306,
|
|
216
|
-
TemporaryRedirect = 307,
|
|
217
|
-
PermanentRedirect = 308,
|
|
218
|
-
BadRequest = 400,
|
|
219
|
-
Unauthorized = 401,
|
|
220
|
-
PaymentRequired = 402,
|
|
221
|
-
Forbidden = 403,
|
|
222
|
-
NotFound = 404,
|
|
223
|
-
MethodNotAllowed = 405,
|
|
224
|
-
NotAcceptable = 406,
|
|
225
|
-
ProxyAuthenticationRequired = 407,
|
|
226
|
-
RequestTimeout = 408,
|
|
227
|
-
Conflict = 409,
|
|
228
|
-
Gone = 410,
|
|
229
|
-
LengthRequired = 411,
|
|
230
|
-
PreconditionFailed = 412,
|
|
231
|
-
PayloadTooLarge = 413,
|
|
232
|
-
UriTooLong = 414,
|
|
233
|
-
UnsupportedMediaType = 415,
|
|
234
|
-
RangeNotSatisfiable = 416,
|
|
235
|
-
ExpectationFailed = 417,
|
|
236
|
-
ImATeapot = 418,
|
|
237
|
-
MisdirectedRequest = 421,
|
|
238
|
-
UnprocessableEntity = 422,
|
|
239
|
-
Locked = 423,
|
|
240
|
-
FailedDependency = 424,
|
|
241
|
-
TooEarly = 425,
|
|
242
|
-
UpgradeRequired = 426,
|
|
243
|
-
PreconditionRequired = 428,
|
|
244
|
-
TooManyRequests = 429,
|
|
245
|
-
RequestHeaderFieldsTooLarge = 431,
|
|
246
|
-
UnavailableForLegalReasons = 451,
|
|
247
|
-
InternalServerError = 500,
|
|
248
|
-
NotImplemented = 501,
|
|
249
|
-
BadGateway = 502,
|
|
250
|
-
ServiceUnavailable = 503,
|
|
251
|
-
GatewayTimeout = 504,
|
|
252
|
-
HttpVersionNotSupported = 505,
|
|
253
|
-
VariantAlsoNegotiates = 506,
|
|
254
|
-
InsufficientStorage = 507,
|
|
255
|
-
LoopDetected = 508,
|
|
256
|
-
NotExtended = 510,
|
|
257
|
-
NetworkAuthenticationRequired = 511,
|
|
258
|
-
}
|
|
259
|
-
|
|
260
214
|
type Method =
|
|
261
215
|
| 'get'
|
|
262
216
|
| 'GET'
|
|
@@ -389,6 +343,15 @@ type AxiosAdapterName = 'xhr' | 'http' | string;
|
|
|
389
343
|
|
|
390
344
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
391
345
|
|
|
346
|
+
type AddressFamily = 4 | 6 | undefined;
|
|
347
|
+
|
|
348
|
+
interface LookupAddressEntry {
|
|
349
|
+
address: string;
|
|
350
|
+
family?: AddressFamily;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
type LookupAddress = string | LookupAddressEntry;
|
|
354
|
+
|
|
392
355
|
interface AxiosRequestConfig<D = any> {
|
|
393
356
|
url?: string;
|
|
394
357
|
method?: Method | string;
|
|
@@ -433,22 +396,26 @@ interface AxiosRequestConfig<D = any> {
|
|
|
433
396
|
FormData?: new (...args: any[]) => object;
|
|
434
397
|
};
|
|
435
398
|
formSerializer?: FormSerializerOptions;
|
|
436
|
-
family?:
|
|
399
|
+
family?: AddressFamily;
|
|
437
400
|
lookup?:
|
|
438
401
|
| ((
|
|
439
402
|
hostname: string,
|
|
440
403
|
options: object,
|
|
441
|
-
cb: (
|
|
404
|
+
cb: (
|
|
405
|
+
err: Error | null,
|
|
406
|
+
address: LookupAddress | LookupAddress[],
|
|
407
|
+
family?: AddressFamily
|
|
408
|
+
) => void
|
|
442
409
|
) => void)
|
|
443
410
|
| ((
|
|
444
411
|
hostname: string,
|
|
445
412
|
options: object
|
|
446
|
-
) => Promise<
|
|
413
|
+
) => Promise<
|
|
414
|
+
| [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]
|
|
415
|
+
| LookupAddress
|
|
416
|
+
>);
|
|
447
417
|
}
|
|
448
418
|
|
|
449
|
-
// Alias
|
|
450
|
-
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
|
451
|
-
|
|
452
419
|
interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
|
453
420
|
headers: AxiosRequestHeaders;
|
|
454
421
|
}
|
|
@@ -471,11 +438,6 @@ interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'>
|
|
|
471
438
|
headers: HeadersDefaults;
|
|
472
439
|
}
|
|
473
440
|
|
|
474
|
-
interface CreateAxiosDefaults<D = any>
|
|
475
|
-
extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
|
476
|
-
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
441
|
interface AxiosResponse<T = any, D = any> {
|
|
480
442
|
data: T;
|
|
481
443
|
status: number;
|
|
@@ -485,77 +447,18 @@ interface AxiosResponse<T = any, D = any> {
|
|
|
485
447
|
request?: any;
|
|
486
448
|
}
|
|
487
449
|
|
|
488
|
-
declare class AxiosError<T = unknown, D = any> extends Error {
|
|
489
|
-
constructor(
|
|
490
|
-
message?: string,
|
|
491
|
-
code?: string,
|
|
492
|
-
config?: InternalAxiosRequestConfig<D>,
|
|
493
|
-
request?: any,
|
|
494
|
-
response?: AxiosResponse<T, D>
|
|
495
|
-
);
|
|
496
|
-
|
|
497
|
-
config?: InternalAxiosRequestConfig<D>;
|
|
498
|
-
code?: string;
|
|
499
|
-
request?: any;
|
|
500
|
-
response?: AxiosResponse<T, D>;
|
|
501
|
-
isAxiosError: boolean;
|
|
502
|
-
status?: number;
|
|
503
|
-
toJSON: () => object;
|
|
504
|
-
cause?: Error;
|
|
505
|
-
static from<T = unknown, D = any>(
|
|
506
|
-
error: Error | unknown,
|
|
507
|
-
code?: string,
|
|
508
|
-
config?: InternalAxiosRequestConfig<D>,
|
|
509
|
-
request?: any,
|
|
510
|
-
response?: AxiosResponse<T, D>,
|
|
511
|
-
customProps?: object
|
|
512
|
-
): AxiosError<T, D>;
|
|
513
|
-
static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
514
|
-
static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
515
|
-
static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
516
|
-
static readonly ERR_NETWORK = 'ERR_NETWORK';
|
|
517
|
-
static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
518
|
-
static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
519
|
-
static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
520
|
-
static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
521
|
-
static readonly ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
522
|
-
static readonly ERR_CANCELED = 'ERR_CANCELED';
|
|
523
|
-
static readonly ECONNABORTED = 'ECONNABORTED';
|
|
524
|
-
static readonly ETIMEDOUT = 'ETIMEDOUT';
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
declare class CanceledError<T> extends AxiosError<T> {}
|
|
528
|
-
|
|
529
450
|
type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
|
530
451
|
|
|
531
|
-
interface CancelStatic {
|
|
532
|
-
new (message?: string): Cancel;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
452
|
interface Cancel {
|
|
536
453
|
message: string | undefined;
|
|
537
454
|
}
|
|
538
455
|
|
|
539
|
-
interface Canceler {
|
|
540
|
-
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
interface CancelTokenStatic {
|
|
544
|
-
new (executor: (cancel: Canceler) => void): CancelToken;
|
|
545
|
-
source(): CancelTokenSource;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
456
|
interface CancelToken {
|
|
549
457
|
promise: Promise<Cancel>;
|
|
550
458
|
reason?: Cancel;
|
|
551
459
|
throwIfRequested(): void;
|
|
552
460
|
}
|
|
553
461
|
|
|
554
|
-
interface CancelTokenSource {
|
|
555
|
-
token: CancelToken;
|
|
556
|
-
cancel: Canceler;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
462
|
interface AxiosInterceptorOptions {
|
|
560
463
|
synchronous?: boolean;
|
|
561
464
|
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
|
@@ -646,48 +549,27 @@ interface AxiosInstance extends Axios {
|
|
|
646
549
|
|
|
647
550
|
interface GenericFormData {
|
|
648
551
|
append(name: string, value: any, options?: any): any;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
interface GenericHTMLFormElement {
|
|
652
|
-
name: string;
|
|
653
|
-
method: string;
|
|
654
|
-
submit(): void;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
declare function toFormData(
|
|
658
|
-
sourceObj: object,
|
|
659
|
-
targetFormData?: GenericFormData,
|
|
660
|
-
options?: FormSerializerOptions
|
|
661
|
-
): GenericFormData;
|
|
662
|
-
|
|
663
|
-
declare function formToJSON(form: GenericFormData | GenericHTMLFormElement): object;
|
|
664
|
-
|
|
665
|
-
declare function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
|
666
|
-
|
|
667
|
-
declare function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
|
668
|
-
|
|
669
|
-
declare function isCancel(value: any): value is Cancel;
|
|
670
|
-
|
|
671
|
-
declare function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
|
672
|
-
|
|
673
|
-
interface AxiosStatic extends AxiosInstance {
|
|
674
|
-
create(config?: CreateAxiosDefaults): AxiosInstance;
|
|
675
|
-
Cancel: CancelStatic;
|
|
676
|
-
CancelToken: CancelTokenStatic;
|
|
677
|
-
Axios: typeof Axios;
|
|
678
|
-
AxiosError: typeof AxiosError;
|
|
679
|
-
HttpStatusCode: typeof HttpStatusCode;
|
|
680
|
-
readonly VERSION: string;
|
|
681
|
-
isCancel: typeof isCancel;
|
|
682
|
-
all: typeof all;
|
|
683
|
-
spread: typeof spread;
|
|
684
|
-
isAxiosError: typeof isAxiosError;
|
|
685
|
-
toFormData: typeof toFormData;
|
|
686
|
-
formToJSON: typeof formToJSON;
|
|
687
|
-
CanceledError: typeof CanceledError;
|
|
688
|
-
AxiosHeaders: typeof AxiosHeaders;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
declare const axios: AxiosStatic;
|
|
552
|
+
}
|
|
692
553
|
|
|
693
|
-
|
|
554
|
+
declare global {
|
|
555
|
+
var environment: IEnv;
|
|
556
|
+
var moduleId: IModuleId | null;
|
|
557
|
+
var moduleUrls: {
|
|
558
|
+
[id in IModuleId]?: string;
|
|
559
|
+
};
|
|
560
|
+
var axiosInstance: AxiosInstance;
|
|
561
|
+
var useNavigate: () => NavigateFunction;
|
|
562
|
+
var useLocation: () => Location;
|
|
563
|
+
var Link: React.ForwardRefExoticComponent<
|
|
564
|
+
LinkProps & React.RefAttributes<HTMLAnchorElement>
|
|
565
|
+
>;
|
|
566
|
+
var appVersion: string | undefined;
|
|
567
|
+
var api: {
|
|
568
|
+
apiUrl: string;
|
|
569
|
+
clientId: string;
|
|
570
|
+
authApiUrl?: string;
|
|
571
|
+
authScope?: string;
|
|
572
|
+
additionalScopes?: string[];
|
|
573
|
+
redirectUrl?: string;
|
|
574
|
+
};
|
|
575
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inceptionbg/main",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.64",
|
|
4
4
|
"description": "Main app wrapper for Inception ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"crypto-js": "^4.1.1",
|
|
21
21
|
"jwt-decode": "^3.1.2",
|
|
22
22
|
"react-dropzone": "^14.2.3",
|
|
23
|
-
"react-pdf": "^
|
|
23
|
+
"react-pdf": "^9.0.0",
|
|
24
24
|
"react-qr-code": "^2.0.12"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
"tslib": "^2.6.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@inceptionbg/iui": "^1.0.
|
|
45
|
+
"@inceptionbg/iui": "^1.0.170",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-dom": "^18.2.0",
|
|
48
|
-
"react-i18next": "^13.0.1",
|
|
49
48
|
"sass": "^1.63.6"
|
|
50
49
|
}
|
|
51
50
|
}
|