dataset-types 3.0.0
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 +4 -0
- package/dataset-types-3.0.0.tgz +0 -0
- package/package.json +30 -0
- package/src/types/index.ts +213 -0
package/README.md
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dataset-types",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"pretty": "prettier src --write"
|
|
6
|
+
},
|
|
7
|
+
"eslintConfig": {
|
|
8
|
+
"extends": [
|
|
9
|
+
"react-app",
|
|
10
|
+
"react-app/jest"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"browserslist": {
|
|
14
|
+
"production": [
|
|
15
|
+
">0.2%",
|
|
16
|
+
"not dead",
|
|
17
|
+
"not op_mini all"
|
|
18
|
+
],
|
|
19
|
+
"development": [
|
|
20
|
+
"last 1 chrome version",
|
|
21
|
+
"last 1 firefox version",
|
|
22
|
+
"last 1 safari version"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"nodemon": "^3.1.9",
|
|
27
|
+
"prettier": "^3.4.2",
|
|
28
|
+
"typescript": "^5.7.2"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
export interface ICommandResult {
|
|
2
|
+
status: string;
|
|
3
|
+
msg: string;
|
|
4
|
+
entity?: any;
|
|
5
|
+
log?: any[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IContext {
|
|
9
|
+
context: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IName {
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IDataRow {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IEntity extends IDataRow {
|
|
19
|
+
type: string;
|
|
20
|
+
delete?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface INamedEntity extends IEntity, IName, IContext {}
|
|
24
|
+
|
|
25
|
+
export interface ITimed {
|
|
26
|
+
createdBy: string;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IDocumentReference extends IDataRow {
|
|
31
|
+
filetype: string;
|
|
32
|
+
documenttype: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IDocument extends INamedEntity, ITimed {
|
|
36
|
+
entity: string;
|
|
37
|
+
filetype: string;
|
|
38
|
+
documenttype: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IDocumentEntityLink {
|
|
42
|
+
entity: string;
|
|
43
|
+
documentId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IConfigurationItem extends INamedEntity, ITimed {
|
|
47
|
+
itemtype: string;
|
|
48
|
+
active: boolean;
|
|
49
|
+
monitored: string;
|
|
50
|
+
baseline: string;
|
|
51
|
+
dimension: string;
|
|
52
|
+
datatypes: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IPermission extends IEntity, IContext, ITimed {
|
|
56
|
+
permission: string;
|
|
57
|
+
role: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface IDataService {}
|
|
61
|
+
|
|
62
|
+
export interface IModel {
|
|
63
|
+
close: any;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
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>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
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>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
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[]>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface ISecurityMonitorService {
|
|
140
|
+
hasPermission: (
|
|
141
|
+
permission: string,
|
|
142
|
+
roles: string[],
|
|
143
|
+
context: string,
|
|
144
|
+
) => Promise<boolean>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type IChannel = "Email" | "SMS" | "WHATSAPP"; //How to refer to domain constants
|
|
148
|
+
|
|
149
|
+
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[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface IPersistResult {
|
|
156
|
+
data: any[] | any;
|
|
157
|
+
error?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface ILogStatus {
|
|
161
|
+
archiveid: string;
|
|
162
|
+
error?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
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[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface IUser {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
email: string;
|
|
193
|
+
mobile: string;
|
|
194
|
+
roles: string;
|
|
195
|
+
context: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export type IDatasetFile = {
|
|
199
|
+
context: string;
|
|
200
|
+
id: string;
|
|
201
|
+
filename: string;
|
|
202
|
+
lastModified: string;
|
|
203
|
+
filetype: string;
|
|
204
|
+
recordtype: string;
|
|
205
|
+
entity: string;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export type IDatasetFiles = {
|
|
209
|
+
count: number;
|
|
210
|
+
files: IDatasetFile[];
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export type IDayRange = number[];
|