onecore 0.0.40 → 0.0.41

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/README.md CHANGED
@@ -1 +1 @@
1
- # core
1
+ # onecore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onecore",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "onecore",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -67,6 +67,19 @@ import { ViewService } from './service/ViewService';
67
67
  export type Search<T, F> = (s: F, limit?: number, offset?: number | string, fields?: string[]) => Promise<SearchResult<T>>;
68
68
  export type SearchFunc<T, F> = Search<T, F>;
69
69
 
70
+ export interface ExceptionHandler {
71
+ handleException(rs: string, err: any, i?: number, filename?: string): void;
72
+ }
73
+ export interface ImportResult {
74
+ total: number;
75
+ success: number;
76
+ }
77
+ export interface ImportService {
78
+ import(): Promise<ImportResult>;
79
+ }
80
+ export interface Importer {
81
+ import(): Promise<ImportResult>;
82
+ }
70
83
  export class ViewManager<T, ID> implements ViewService<T, ID> {
71
84
  constructor(private r: ViewRepository<T, ID>) {
72
85
  this.metadata = this.metadata.bind(this);
package/src/model.ts CHANGED
@@ -115,6 +115,10 @@ export interface ErrorMessage {
115
115
  param?: string|number|Date;
116
116
  message?: string;
117
117
  }
118
+ export interface ErrorHandler<T> {
119
+ handleError(rs: T, errors: ErrorMessage[], i?: number, filename?: string): void;
120
+ }
121
+
118
122
  export interface ResultInfo<T> {
119
123
  status: number|string;
120
124
  errors?: ErrorMessage[];