dataset-types 3.0.0 → 3.0.2

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.
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "dataset-types",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "scripts": {
5
- "pretty": "prettier src --write"
5
+ "build": "tsc --rootDir '.' --outDir './dist'",
6
+ "tsc": "tsc",
7
+ "pretty": "prettier --write"
6
8
  },
7
9
  "eslintConfig": {
8
10
  "extends": [
@@ -0,0 +1,140 @@
1
+ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
2
+ export interface ICommandResult {
3
+ status: string;
4
+ msg: string;
5
+ entity?: any;
6
+ log?: any[];
7
+ }
8
+ export interface IContext {
9
+ context: string;
10
+ }
11
+ export interface IName {
12
+ name: string;
13
+ }
14
+ export interface IDataRow {
15
+ id: string;
16
+ }
17
+ export interface IEntity extends IDataRow {
18
+ type: string;
19
+ delete?: string;
20
+ }
21
+ export interface INamedEntity extends IEntity, IName, IContext {
22
+ }
23
+ export interface ITimed {
24
+ createdBy: string;
25
+ createdAt: Date;
26
+ }
27
+ export interface IDocumentReference extends IDataRow {
28
+ filetype: string;
29
+ documenttype: string;
30
+ }
31
+ export interface IDocument extends INamedEntity, ITimed {
32
+ entity: string;
33
+ filetype: string;
34
+ documenttype: string;
35
+ }
36
+ export interface IDocumentEntityLink {
37
+ entity: string;
38
+ documentId: string;
39
+ }
40
+ export interface IConfigurationItem extends INamedEntity, ITimed {
41
+ itemtype: string;
42
+ active: boolean;
43
+ monitored: string;
44
+ baseline: string;
45
+ dimension: string;
46
+ datatypes: string;
47
+ }
48
+ export interface IPermission extends IEntity, IContext, ITimed {
49
+ permission: string;
50
+ role: string;
51
+ }
52
+ export interface IDataService {
53
+ }
54
+ export interface IModel {
55
+ close: any;
56
+ }
57
+ export interface IModelService {
58
+ model: IModel;
59
+ seed: any;
60
+ upsert: (type: string, entity: any[]) => Promise<IPersistResult>;
61
+ upsertBatch: (type: string, entity: any[]) => Promise<IPersistResult>;
62
+ }
63
+ export interface IFileService {
64
+ download2: (context: string, log: boolean, txmode: string, //production/development/test
65
+ filetype: string, reference: string, encoding: BufferEncoding) => Promise<String | null>;
66
+ downloadToFile: (localfilename: string, tenantid: string, log: boolean, filetype: string, reference: string, txmode: string) => Promise<any>;
67
+ sendBlock: (tenantid: string, log: boolean, txmode: string, //production/development/test
68
+ filetype: string, content: string, key: string, //blob id
69
+ sliceNumber: number, totalSlices: number, meta: any, //meta data
70
+ tags: any) => void;
71
+ copy: (sourceContainer: string, sourceFile: string, targetContainer: string, targetFile: string) => Promise<void>;
72
+ list: (tenantid: string, log: boolean, page: number, pageSize: number, term: string, mode: string, recordtype: string, enabled: boolean, order: string) => Promise<IDatasetFiles>;
73
+ remove: (tenantid: string, mode: string, name: string) => Promise<boolean>;
74
+ setMeta: (tenantid: string, mode: string, name: string, status: string) => Promise<boolean>;
75
+ }
76
+ export interface ILogService {
77
+ archive: (context: string, submissionid: string, username: string, log: ILog[], processingtype?: string) => Promise<string>;
78
+ list: () => Promise<string[]>;
79
+ }
80
+ export interface ISecurityMonitorService {
81
+ hasPermission: (permission: string, roles: string[], context: string) => Promise<boolean>;
82
+ }
83
+ export type IChannel = "Email" | "SMS" | "WHATSAPP";
84
+ export interface IProcessingConfig {
85
+ remove?: boolean;
86
+ record?: boolean;
87
+ modes?: IChannel[];
88
+ }
89
+ export interface IPersistResult {
90
+ data: any[] | any;
91
+ error?: string;
92
+ }
93
+ export interface ILogStatus {
94
+ archiveid: string;
95
+ error?: string;
96
+ }
97
+ export interface ILog {
98
+ processingType: "Monitoring" | "Submission";
99
+ processingConfig?: IProcessingConfig;
100
+ blobid?: string;
101
+ documentId?: string;
102
+ name?: string;
103
+ localfilename?: string;
104
+ createdAt?: string;
105
+ user?: string;
106
+ meta: {
107
+ documenttype: string;
108
+ context?: string;
109
+ entity?: string;
110
+ user?: string;
111
+ createdat?: string;
112
+ recordstatus?: string;
113
+ effective?: string;
114
+ };
115
+ document?: IDocument;
116
+ rawdata?: any[];
117
+ }
118
+ export interface IUser {
119
+ id: string;
120
+ name: string;
121
+ email: string;
122
+ mobile: string;
123
+ roles: string;
124
+ context: string;
125
+ }
126
+ export type IDatasetFile = {
127
+ context: string;
128
+ id: string;
129
+ filename: string;
130
+ lastModified: string;
131
+ filetype: string;
132
+ recordtype: string;
133
+ entity: string;
134
+ };
135
+ export type IDatasetFiles = {
136
+ count: number;
137
+ files: IDatasetFile[];
138
+ };
139
+ export type IDayRange = number[];
140
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,213 +1,225 @@
1
+ type BufferEncoding =
2
+ | "ascii"
3
+ | "utf8"
4
+ | "utf-8"
5
+ | "utf16le"
6
+ | "ucs2"
7
+ | "ucs-2"
8
+ | "base64"
9
+ | "latin1"
10
+ | "binary"
11
+ | "hex"
12
+
1
13
  export interface ICommandResult {
2
- status: string;
3
- msg: string;
4
- entity?: any;
5
- log?: any[];
14
+ status: string;
15
+ msg: string;
16
+ entity?: any;
17
+ log?: any[];
6
18
  }
7
19
 
8
20
  export interface IContext {
9
- context: string;
21
+ context: string;
10
22
  }
11
23
  export interface IName {
12
- name: string;
24
+ name: string;
13
25
  }
14
26
 
15
27
  export interface IDataRow {
16
- id: string;
28
+ id: string;
17
29
  }
18
30
  export interface IEntity extends IDataRow {
19
- type: string;
20
- delete?: string;
31
+ type: string;
32
+ delete?: string;
21
33
  }
22
34
 
23
- export interface INamedEntity extends IEntity, IName, IContext {}
35
+ export interface INamedEntity extends IEntity, IName, IContext { }
24
36
 
25
37
  export interface ITimed {
26
- createdBy: string;
27
- createdAt: Date;
38
+ createdBy: string;
39
+ createdAt: Date;
28
40
  }
29
41
 
30
42
  export interface IDocumentReference extends IDataRow {
31
- filetype: string;
32
- documenttype: string;
43
+ filetype: string;
44
+ documenttype: string;
33
45
  }
34
46
 
35
47
  export interface IDocument extends INamedEntity, ITimed {
36
- entity: string;
37
- filetype: string;
38
- documenttype: string;
48
+ entity: string;
49
+ filetype: string;
50
+ documenttype: string;
39
51
  }
40
52
 
41
53
  export interface IDocumentEntityLink {
42
- entity: string;
43
- documentId: string;
54
+ entity: string;
55
+ documentId: string;
44
56
  }
45
57
 
46
58
  export interface IConfigurationItem extends INamedEntity, ITimed {
47
- itemtype: string;
48
- active: boolean;
49
- monitored: string;
50
- baseline: string;
51
- dimension: string;
52
- datatypes: string;
59
+ itemtype: string;
60
+ active: boolean;
61
+ monitored: string;
62
+ baseline: string;
63
+ dimension: string;
64
+ datatypes: string;
53
65
  }
54
66
 
55
67
  export interface IPermission extends IEntity, IContext, ITimed {
56
- permission: string;
57
- role: string;
68
+ permission: string;
69
+ role: string;
58
70
  }
59
71
 
60
- export interface IDataService {}
72
+ export interface IDataService { }
61
73
 
62
74
  export interface IModel {
63
- close: any;
75
+ close: any;
64
76
  }
65
77
 
66
78
  export interface IModelService {
67
- model: IModel;
68
- seed: any;
69
- upsert: (type: string, entity: any[]) => Promise<IPersistResult>;
70
- upsertBatch: (type: string, entity: any[]) => Promise<IPersistResult>;
79
+ model: IModel;
80
+ seed: any;
81
+ upsert: (type: string, entity: any[]) => Promise<IPersistResult>;
82
+ upsertBatch: (type: string, entity: any[]) => Promise<IPersistResult>;
71
83
  }
72
84
 
73
85
  export interface IFileService {
74
- download2: (
75
- context: string,
76
- log: boolean,
77
- txmode: string, //production/development/test
78
- filetype: string,
79
- reference: string,
80
- encoding: BufferEncoding, //base64,utf-8
81
- ) => Promise<String | null>;
82
- downloadToFile: (
83
- localfilename: string,
84
- tenantid: string,
85
- log: boolean,
86
- filetype: string,
87
- reference: string,
88
- txmode: string, //production/development/test
89
- ) => Promise<any>;
90
- sendBlock: (
91
- tenantid: string,
92
- log: boolean,
93
- txmode: string, //production/development/test
94
- filetype: string,
95
- content: string,
96
- key: string, //blob id
97
- sliceNumber: number,
98
- totalSlices: number,
99
- meta: any, //meta data
100
- tags: any, //tags
101
- ) => void;
102
- copy: (
103
- sourceContainer: string,
104
- sourceFile: string,
105
- targetContainer: string,
106
- targetFile: string,
107
- ) => Promise<void>;
108
- list: (
109
- tenantid: string,
110
- log: boolean,
111
- page: number,
112
- pageSize: number,
113
- term: string,
114
- mode: string,
115
- recordtype: string,
116
- enabled: boolean,
117
- order: string,
118
- ) => Promise<IDatasetFiles>;
119
- remove: (tenantid: string, mode: string, name: string) => Promise<boolean>;
120
- setMeta: (
121
- tenantid: string,
122
- mode: string,
123
- name: string,
124
- status: string,
125
- ) => Promise<boolean>;
86
+ download2: (
87
+ context: string,
88
+ log: boolean,
89
+ txmode: string, //production/development/test
90
+ filetype: string,
91
+ reference: string,
92
+ encoding: BufferEncoding, //base64,utf-8
93
+ ) => Promise<String | null>;
94
+ downloadToFile: (
95
+ localfilename: string,
96
+ tenantid: string,
97
+ log: boolean,
98
+ filetype: string,
99
+ reference: string,
100
+ txmode: string, //production/development/test
101
+ ) => Promise<any>;
102
+ sendBlock: (
103
+ tenantid: string,
104
+ log: boolean,
105
+ txmode: string, //production/development/test
106
+ filetype: string,
107
+ content: string,
108
+ key: string, //blob id
109
+ sliceNumber: number,
110
+ totalSlices: number,
111
+ meta: any, //meta data
112
+ tags: any, //tags
113
+ ) => void;
114
+ copy: (
115
+ sourceContainer: string,
116
+ sourceFile: string,
117
+ targetContainer: string,
118
+ targetFile: string,
119
+ ) => Promise<void>;
120
+ list: (
121
+ tenantid: string,
122
+ log: boolean,
123
+ page: number,
124
+ pageSize: number,
125
+ term: string,
126
+ mode: string,
127
+ recordtype: string,
128
+ enabled: boolean,
129
+ order: string,
130
+ ) => Promise<IDatasetFiles>;
131
+ remove: (tenantid: string, mode: string, name: string) => Promise<boolean>;
132
+ setMeta: (
133
+ tenantid: string,
134
+ mode: string,
135
+ name: string,
136
+ status: string,
137
+ ) => Promise<boolean>;
126
138
  }
127
139
 
128
140
  export interface ILogService {
129
- archive: (
130
- context: string,
131
- submissionid: string,
132
- username: string,
133
- log: ILog[],
134
- processingtype?: string,
135
- ) => Promise<string>;
136
- list: () => Promise<string[]>;
141
+ archive: (
142
+ context: string,
143
+ submissionid: string,
144
+ username: string,
145
+ log: ILog[],
146
+ processingtype?: string,
147
+ ) => Promise<string>;
148
+ list: () => Promise<string[]>;
137
149
  }
138
150
 
139
151
  export interface ISecurityMonitorService {
140
- hasPermission: (
141
- permission: string,
142
- roles: string[],
143
- context: string,
144
- ) => Promise<boolean>;
152
+ hasPermission: (
153
+ permission: string,
154
+ roles: string[],
155
+ context: string,
156
+ ) => Promise<boolean>;
145
157
  }
146
158
 
147
159
  export type IChannel = "Email" | "SMS" | "WHATSAPP"; //How to refer to domain constants
148
160
 
149
161
  export interface IProcessingConfig {
150
- remove?: boolean; //controls if the file is to be processed as a delete
151
- record?: boolean; //Controls if files are uploaded to storage account. Used when replaying files. Used during unit tests to skip upload.
152
- modes?: IChannel[];
162
+ remove?: boolean; //controls if the file is to be processed as a delete
163
+ record?: boolean; //Controls if files are uploaded to storage account. Used when replaying files. Used during unit tests to skip upload.
164
+ modes?: IChannel[];
153
165
  }
154
166
 
155
167
  export interface IPersistResult {
156
- data: any[] | any;
157
- error?: string;
168
+ data: any[] | any;
169
+ error?: string;
158
170
  }
159
171
 
160
172
  export interface ILogStatus {
161
- archiveid: string;
162
- error?: string;
173
+ archiveid: string;
174
+ error?: string;
163
175
  }
164
176
 
165
177
  export interface ILog {
166
- processingType: "Monitoring" | "Submission";
167
- processingConfig?: IProcessingConfig;
168
- //An ILog represents the information collected while handling a file
169
- blobid?: string; //id in storage account
170
- documentId?: string; //when log is submitted from browser it can have a document id (TODO make this just id)
171
- name?: string; //Original name of the document when originally loaded
172
- localfilename?: string; //filename on node process
173
- createdAt?: string;
174
-
175
- user?: string; //upn of user
176
- meta: {
177
- documenttype: string; //Record or Data Type
178
- context?: string; //Tenant Id
179
- entity?: string; //Entity Id which contains this document
180
- user?: string;
181
- createdat?: string;
182
- recordstatus?: string;
183
- effective?: string;
184
- };
185
- document?: IDocument; //The document details
186
- rawdata?: any[];
178
+ processingType: "Monitoring" | "Submission";
179
+ processingConfig?: IProcessingConfig;
180
+ //An ILog represents the information collected while handling a file
181
+ blobid?: string; //id in storage account
182
+ documentId?: string; //when log is submitted from browser it can have a document id (TODO make this just id)
183
+ name?: string; //Original name of the document when originally loaded
184
+ localfilename?: string; //filename on node process
185
+ createdAt?: string;
186
+
187
+ user?: string; //upn of user
188
+ meta: {
189
+ documenttype: string; //Record or Data Type
190
+ context?: string; //Tenant Id
191
+ entity?: string; //Entity Id which contains this document
192
+ user?: string;
193
+ createdat?: string;
194
+ recordstatus?: string;
195
+ effective?: string;
196
+ };
197
+ document?: IDocument; //The document details
198
+ rawdata?: any[];
187
199
  }
188
200
 
189
201
  export interface IUser {
190
- id: string;
191
- name: string;
192
- email: string;
193
- mobile: string;
194
- roles: string;
195
- context: string;
202
+ id: string;
203
+ name: string;
204
+ email: string;
205
+ mobile: string;
206
+ roles: string;
207
+ context: string;
196
208
  }
197
209
 
198
210
  export type IDatasetFile = {
199
- context: string;
200
- id: string;
201
- filename: string;
202
- lastModified: string;
203
- filetype: string;
204
- recordtype: string;
205
- entity: string;
211
+ context: string;
212
+ id: string;
213
+ filename: string;
214
+ lastModified: string;
215
+ filetype: string;
216
+ recordtype: string;
217
+ entity: string;
206
218
  };
207
219
 
208
220
  export type IDatasetFiles = {
209
- count: number;
210
- files: IDatasetFile[];
221
+ count: number;
222
+ files: IDatasetFile[];
211
223
  };
212
224
 
213
225
  export type IDayRange = number[];
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "lib": [
5
+ "es2019",
6
+ "es2020.promise",
7
+ "es2020.bigint",
8
+ "es2020.string"
9
+ ],
10
+ "module": "commonjs",
11
+ "target": "es2019",
12
+ "strict": true,
13
+ "esModuleInterop": true,
14
+ "skipLibCheck": true,
15
+ "forceConsistentCasingInFileNames": true,
16
+ },
17
+ "include": [
18
+ "src/**/*",
19
+ "test/**/*"
20
+ ],
21
+ "exclude": [
22
+ "node_modules",
23
+ "**/*.spec.ts"
24
+ ]
25
+ }
Binary file