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.
- package/dataset-types-3.0.1.tgz +0 -0
- package/dataset-types-3.0.2.tgz +0 -0
- package/dist/src/types/index.js +2 -0
- package/package.json +4 -2
- package/src/types/index.d.ts +140 -0
- package/src/types/index.js +2 -0
- package/src/types/index.ts +153 -141
- package/tsconfig.json +25 -0
- package/dataset-types-3.0.0.tgz +0 -0
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataset-types",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"
|
|
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 {};
|
package/src/types/index.ts
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
14
|
+
status: string;
|
|
15
|
+
msg: string;
|
|
16
|
+
entity?: any;
|
|
17
|
+
log?: any[];
|
|
6
18
|
}
|
|
7
19
|
|
|
8
20
|
export interface IContext {
|
|
9
|
-
|
|
21
|
+
context: string;
|
|
10
22
|
}
|
|
11
23
|
export interface IName {
|
|
12
|
-
|
|
24
|
+
name: string;
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
export interface IDataRow {
|
|
16
|
-
|
|
28
|
+
id: string;
|
|
17
29
|
}
|
|
18
30
|
export interface IEntity extends IDataRow {
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
27
|
-
|
|
38
|
+
createdBy: string;
|
|
39
|
+
createdAt: Date;
|
|
28
40
|
}
|
|
29
41
|
|
|
30
42
|
export interface IDocumentReference extends IDataRow {
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
filetype: string;
|
|
44
|
+
documenttype: string;
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
export interface IDocument extends INamedEntity, ITimed {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
entity: string;
|
|
49
|
+
filetype: string;
|
|
50
|
+
documenttype: string;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
export interface IDocumentEntityLink {
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
entity: string;
|
|
55
|
+
documentId: string;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
export interface IConfigurationItem extends INamedEntity, ITimed {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
75
|
+
close: any;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export interface IModelService {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
157
|
-
|
|
168
|
+
data: any[] | any;
|
|
169
|
+
error?: string;
|
|
158
170
|
}
|
|
159
171
|
|
|
160
172
|
export interface ILogStatus {
|
|
161
|
-
|
|
162
|
-
|
|
173
|
+
archiveid: string;
|
|
174
|
+
error?: string;
|
|
163
175
|
}
|
|
164
176
|
|
|
165
177
|
export interface ILog {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
210
|
-
|
|
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
|
+
}
|
package/dataset-types-3.0.0.tgz
DELETED
|
Binary file
|