@inceptionbg/main 2.0.60 → 2.0.63

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,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
@@ -21,15 +39,19 @@ type MethodsHeaders = Partial<
21
39
  } & { common: AxiosHeaders }
22
40
  >;
23
41
 
24
- type AxiosHeaderMatcher = (
42
+ type AxiosHeaderMatcher =
43
+ | string
44
+ | RegExp
45
+ | ((this: AxiosHeaders, value: string, name: string) => boolean);
46
+
47
+ type AxiosHeaderParser = (
25
48
  this: AxiosHeaders,
26
- value: string,
27
- name: string,
28
- headers: RawAxiosHeaders
29
- ) => boolean;
49
+ value: AxiosHeaderValue,
50
+ header: string
51
+ ) => any;
30
52
 
31
53
  declare class AxiosHeaders {
32
- constructor(headers?: RawAxiosHeaders | AxiosHeaders);
54
+ constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
33
55
 
34
56
  [key: string]: any;
35
57
 
@@ -38,12 +60,12 @@ declare class AxiosHeaders {
38
60
  value?: AxiosHeaderValue,
39
61
  rewrite?: boolean | AxiosHeaderMatcher
40
62
  ): AxiosHeaders;
41
- set(headers?: RawAxiosHeaders | AxiosHeaders, rewrite?: boolean): AxiosHeaders;
63
+ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
42
64
 
43
65
  get(headerName: string, parser: RegExp): RegExpExecArray | null;
44
- get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue;
66
+ get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
45
67
 
46
- has(header: string, matcher?: true | AxiosHeaderMatcher): boolean;
68
+ has(header: string, matcher?: AxiosHeaderMatcher): boolean;
47
69
 
48
70
  delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
49
71
 
@@ -184,79 +206,10 @@ interface AxiosBasicCredentials {
184
206
  interface AxiosProxyConfig {
185
207
  host: string;
186
208
  port: number;
187
- auth?: {
188
- username: string;
189
- password: string;
190
- };
209
+ auth?: AxiosBasicCredentials;
191
210
  protocol?: string;
192
211
  }
193
212
 
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
213
  type Method =
261
214
  | 'get'
262
215
  | 'GET'
@@ -389,6 +342,15 @@ type AxiosAdapterName = 'xhr' | 'http' | string;
389
342
 
390
343
  type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
391
344
 
345
+ type AddressFamily = 4 | 6 | undefined;
346
+
347
+ interface LookupAddressEntry {
348
+ address: string;
349
+ family?: AddressFamily;
350
+ }
351
+
352
+ type LookupAddress = string | LookupAddressEntry;
353
+
392
354
  interface AxiosRequestConfig<D = any> {
393
355
  url?: string;
394
356
  method?: Method | string;
@@ -433,22 +395,26 @@ interface AxiosRequestConfig<D = any> {
433
395
  FormData?: new (...args: any[]) => object;
434
396
  };
435
397
  formSerializer?: FormSerializerOptions;
436
- family?: 4 | 6 | undefined;
398
+ family?: AddressFamily;
437
399
  lookup?:
438
400
  | ((
439
401
  hostname: string,
440
402
  options: object,
441
- cb: (err: Error | null, address: string, family: number) => void
403
+ cb: (
404
+ err: Error | null,
405
+ address: LookupAddress | LookupAddress[],
406
+ family?: AddressFamily
407
+ ) => void
442
408
  ) => void)
443
409
  | ((
444
410
  hostname: string,
445
411
  options: object
446
- ) => Promise<[address: string, family: number] | string>);
412
+ ) => Promise<
413
+ | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]
414
+ | LookupAddress
415
+ >);
447
416
  }
448
417
 
449
- // Alias
450
- type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
451
-
452
418
  interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
453
419
  headers: AxiosRequestHeaders;
454
420
  }
@@ -471,11 +437,6 @@ interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'>
471
437
  headers: HeadersDefaults;
472
438
  }
473
439
 
474
- interface CreateAxiosDefaults<D = any>
475
- extends Omit<AxiosRequestConfig<D>, 'headers'> {
476
- headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
477
- }
478
-
479
440
  interface AxiosResponse<T = any, D = any> {
480
441
  data: T;
481
442
  status: number;
@@ -485,77 +446,18 @@ interface AxiosResponse<T = any, D = any> {
485
446
  request?: any;
486
447
  }
487
448
 
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
449
  type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
530
450
 
531
- interface CancelStatic {
532
- new (message?: string): Cancel;
533
- }
534
-
535
451
  interface Cancel {
536
452
  message: string | undefined;
537
453
  }
538
454
 
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
455
  interface CancelToken {
549
456
  promise: Promise<Cancel>;
550
457
  reason?: Cancel;
551
458
  throwIfRequested(): void;
552
459
  }
553
460
 
554
- interface CancelTokenSource {
555
- token: CancelToken;
556
- cancel: Canceler;
557
- }
558
-
559
461
  interface AxiosInterceptorOptions {
560
462
  synchronous?: boolean;
561
463
  runWhen?: (config: InternalAxiosRequestConfig) => boolean;
@@ -646,48 +548,27 @@ interface AxiosInstance extends Axios {
646
548
 
647
549
  interface GenericFormData {
648
550
  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;
551
+ }
692
552
 
693
- export { Axios, AxiosAdapter, AxiosBasicCredentials, AxiosDefaults, AxiosError, AxiosHeaderValue, AxiosHeaders, AxiosInstance, AxiosInterceptorManager, AxiosInterceptorOptions, AxiosProgressEvent, AxiosPromise, AxiosProxyConfig, AxiosRequestConfig, AxiosRequestHeaders, AxiosRequestTransformer, AxiosResponse, AxiosResponseHeaders, AxiosResponseTransformer, AxiosStatic, Cancel, CancelStatic, CancelToken, CancelTokenSource, CancelTokenStatic, CanceledError, Canceler, CreateAxiosDefaults, CustomHeader, CustomParamsSerializer, FormDataVisitorHelpers, FormSerializerOptions, GenericAbortSignal, GenericFormData, GenericHTMLFormElement, HeadersDefaults, HttpStatusCode, InternalAxiosRequestConfig, Method, ParamEncoder, ParamsSerializerOptions, RawAxiosRequestConfig, RawAxiosRequestHeaders, RawAxiosResponseHeaders, ResponseType, SerializerOptions, SerializerVisitor, TransitionalOptions, all, axios as default, formToJSON, isAxiosError, isCancel, responseEncoding, spread, toFormData };
553
+ declare global {
554
+ var environment: IEnv;
555
+ var moduleId: IModuleId | null;
556
+ var moduleUrls: {
557
+ [id in IModuleId]?: string;
558
+ };
559
+ var axiosInstance: AxiosInstance;
560
+ var useNavigate: () => NavigateFunction;
561
+ var useLocation: () => Location;
562
+ var Link: React.ForwardRefExoticComponent<
563
+ LinkProps & React.RefAttributes<HTMLAnchorElement>
564
+ >;
565
+ var appVersion: string | undefined;
566
+ var api: {
567
+ apiUrl: string;
568
+ clientId: string;
569
+ authApiUrl?: string;
570
+ authScope?: string;
571
+ additionalScopes?: string[];
572
+ redirectUrl?: string;
573
+ };
574
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inceptionbg/main",
3
- "version": "2.0.60",
3
+ "version": "2.0.63",
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": "^8.0.2",
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.158",
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
  }