@etsoo/appscript 1.4.82 → 1.4.84

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ETSOO
3
+ Copyright (c) 2004-2024 ETSOO® (亿速思维 ®), https://www.etsoo.com
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
- import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
3
+ import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
5
  import { EntityStatus } from '../business/EntityStatus';
6
6
  import { InitCallDto } from '../erp/dto/InitCallDto';
@@ -192,8 +192,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
192
192
  /**
193
193
  * Setup frontend logging
194
194
  * @param action Custom action
195
+ * @param preventDefault Is prevent default action
195
196
  */
196
- setupLogging(action?: (data: ErrorData) => void | Promise<void>): void;
197
+ setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
197
198
  /**
198
199
  * Api init call
199
200
  * @param data Data
@@ -329,8 +329,9 @@ class CoreApp {
329
329
  /**
330
330
  * Setup frontend logging
331
331
  * @param action Custom action
332
+ * @param preventDefault Is prevent default action
332
333
  */
333
- setupLogging(action) {
334
+ setupLogging(action, preventDefault) {
334
335
  action ?? (action = (data) => {
335
336
  this.api.post('Auth/LogFrontendError', data, {
336
337
  onError: (error) => {
@@ -341,7 +342,7 @@ class CoreApp {
341
342
  }
342
343
  });
343
344
  });
344
- shared_1.DomUtils.setupLogging(action);
345
+ shared_1.DomUtils.setupLogging(action, preventDefault);
345
346
  }
346
347
  /**
347
348
  * Api init call
@@ -1,6 +1,6 @@
1
1
  import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
- import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
3
+ import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
5
  import { IUser } from '../state/User';
6
6
  import { IAppSettings } from './AppSettings';
@@ -462,8 +462,9 @@ export interface IApp {
462
462
  /**
463
463
  * Setup frontend logging
464
464
  * @param action Custom action
465
+ * @param preventDefault Is prevent default action
465
466
  */
466
- setupLogging(action?: (data: ErrorData) => void | Promise<void>): void;
467
+ setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
467
468
  /**
468
469
  * Signout, with userLogout and toLoginPage
469
470
  */
@@ -1,6 +1,6 @@
1
1
  import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
- import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
3
+ import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
5
  import { EntityStatus } from '../business/EntityStatus';
6
6
  import { InitCallDto } from '../erp/dto/InitCallDto';
@@ -192,8 +192,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
192
192
  /**
193
193
  * Setup frontend logging
194
194
  * @param action Custom action
195
+ * @param preventDefault Is prevent default action
195
196
  */
196
- setupLogging(action?: (data: ErrorData) => void | Promise<void>): void;
197
+ setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
197
198
  /**
198
199
  * Api init call
199
200
  * @param data Data
@@ -326,8 +326,9 @@ export class CoreApp {
326
326
  /**
327
327
  * Setup frontend logging
328
328
  * @param action Custom action
329
+ * @param preventDefault Is prevent default action
329
330
  */
330
- setupLogging(action) {
331
+ setupLogging(action, preventDefault) {
331
332
  action ?? (action = (data) => {
332
333
  this.api.post('Auth/LogFrontendError', data, {
333
334
  onError: (error) => {
@@ -338,7 +339,7 @@ export class CoreApp {
338
339
  }
339
340
  });
340
341
  });
341
- DomUtils.setupLogging(action);
342
+ DomUtils.setupLogging(action, preventDefault);
342
343
  }
343
344
  /**
344
345
  * Api init call
@@ -1,6 +1,6 @@
1
1
  import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
- import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
3
+ import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
5
  import { IUser } from '../state/User';
6
6
  import { IAppSettings } from './AppSettings';
@@ -462,8 +462,9 @@ export interface IApp {
462
462
  /**
463
463
  * Setup frontend logging
464
464
  * @param action Custom action
465
+ * @param preventDefault Is prevent default action
465
466
  */
466
- setupLogging(action?: (data: ErrorData) => void | Promise<void>): void;
467
+ setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
467
468
  /**
468
469
  * Signout, with userLogout and toLoginPage
469
470
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.82",
3
+ "version": "1.4.84",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -52,22 +52,22 @@
52
52
  },
53
53
  "homepage": "https://github.com/ETSOO/AppScript#readme",
54
54
  "dependencies": {
55
- "@etsoo/notificationbase": "^1.1.41",
56
- "@etsoo/restclient": "^1.1.1",
57
- "@etsoo/shared": "^1.2.33",
55
+ "@etsoo/notificationbase": "^1.1.42",
56
+ "@etsoo/restclient": "^1.1.3",
57
+ "@etsoo/shared": "^1.2.37",
58
58
  "crypto-js": "^4.2.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/cli": "^7.23.9",
62
- "@babel/core": "^7.24.0",
63
- "@babel/plugin-transform-runtime": "^7.24.0",
64
- "@babel/preset-env": "^7.24.0",
65
- "@babel/runtime-corejs3": "^7.24.0",
61
+ "@babel/cli": "^7.24.1",
62
+ "@babel/core": "^7.24.4",
63
+ "@babel/plugin-transform-runtime": "^7.24.3",
64
+ "@babel/preset-env": "^7.24.4",
65
+ "@babel/runtime-corejs3": "^7.24.4",
66
66
  "@types/crypto-js": "^4.2.2",
67
67
  "@types/jest": "^29.5.12",
68
68
  "jest": "^29.7.0",
69
69
  "jest-environment-jsdom": "^29.7.0",
70
70
  "ts-jest": "^29.1.2",
71
- "typescript": "^5.3.3"
71
+ "typescript": "^5.4.5"
72
72
  }
73
73
  }
@@ -13,6 +13,7 @@ import {
13
13
  DateUtils,
14
14
  DomUtils,
15
15
  ErrorData,
16
+ ErrorType,
16
17
  IActionResult,
17
18
  IStorage,
18
19
  ListType,
@@ -522,8 +523,12 @@ export abstract class CoreApp<
522
523
  /**
523
524
  * Setup frontend logging
524
525
  * @param action Custom action
526
+ * @param preventDefault Is prevent default action
525
527
  */
526
- public setupLogging(action?: (data: ErrorData) => void | Promise<void>) {
528
+ public setupLogging(
529
+ action?: (data: ErrorData) => void | Promise<void>,
530
+ preventDefault?: ((type: ErrorType) => boolean) | boolean
531
+ ) {
527
532
  action ??= (data) => {
528
533
  this.api.post('Auth/LogFrontendError', data, {
529
534
  onError: (error) => {
@@ -535,7 +540,7 @@ export abstract class CoreApp<
535
540
  }
536
541
  });
537
542
  };
538
- DomUtils.setupLogging(action);
543
+ DomUtils.setupLogging(action, preventDefault);
539
544
  }
540
545
 
541
546
  /**
package/src/app/IApp.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  DataTypes,
11
11
  DateUtils,
12
12
  ErrorData,
13
+ ErrorType,
13
14
  IActionResult,
14
15
  IStorage,
15
16
  ListType,
@@ -627,8 +628,12 @@ export interface IApp {
627
628
  /**
628
629
  * Setup frontend logging
629
630
  * @param action Custom action
631
+ * @param preventDefault Is prevent default action
630
632
  */
631
- setupLogging(action?: (data: ErrorData) => void | Promise<void>): void;
633
+ setupLogging(
634
+ action?: (data: ErrorData) => void | Promise<void>,
635
+ preventDefault?: ((type: ErrorType) => boolean) | boolean
636
+ ): void;
632
637
 
633
638
  /**
634
639
  * Signout, with userLogout and toLoginPage