@memberjunction/core 0.9.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/dist/generic/applicationInfo.d.ts +26 -0
- package/dist/generic/applicationInfo.js +57 -0
- package/dist/generic/applicationInfo.js.map +1 -0
- package/dist/generic/baseEntity.d.ts +88 -0
- package/dist/generic/baseEntity.js +450 -0
- package/dist/generic/baseEntity.js.map +1 -0
- package/dist/generic/baseInfo.d.ts +8 -0
- package/dist/generic/baseInfo.js +38 -0
- package/dist/generic/baseInfo.js.map +1 -0
- package/dist/generic/entityInfo.d.ts +340 -0
- package/dist/generic/entityInfo.js +647 -0
- package/dist/generic/entityInfo.js.map +1 -0
- package/dist/generic/interfaces.d.ts +235 -0
- package/dist/generic/interfaces.js +51 -0
- package/dist/generic/interfaces.js.map +1 -0
- package/dist/generic/logging.d.ts +4 -0
- package/dist/generic/logging.js +69 -0
- package/dist/generic/logging.js.map +1 -0
- package/dist/generic/metadata.d.ts +155 -0
- package/dist/generic/metadata.js +227 -0
- package/dist/generic/metadata.js.map +1 -0
- package/dist/generic/providerBase.d.ts +134 -0
- package/dist/generic/providerBase.js +517 -0
- package/dist/generic/providerBase.js.map +1 -0
- package/dist/generic/runReport.d.ts +11 -0
- package/dist/generic/runReport.js +27 -0
- package/dist/generic/runReport.js.map +1 -0
- package/dist/generic/runView.d.ts +106 -0
- package/dist/generic/runView.js +36 -0
- package/dist/generic/runView.js.map +1 -0
- package/dist/generic/securityInfo.d.ts +99 -0
- package/dist/generic/securityInfo.js +195 -0
- package/dist/generic/securityInfo.js.map +1 -0
- package/dist/generic/transactionGroup.d.ts +24 -0
- package/dist/generic/transactionGroup.js +79 -0
- package/dist/generic/transactionGroup.js.map +1 -0
- package/dist/generic/util.d.ts +4 -0
- package/dist/generic/util.js +100 -0
- package/dist/generic/util.js.map +1 -0
- package/dist/generic/viewInfo.d.ts +57 -0
- package/dist/generic/viewInfo.js +121 -0
- package/dist/generic/viewInfo.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/views/UserViewEntityBase.d.ts +171 -0
- package/dist/views/UserViewEntityBase.js +466 -0
- package/dist/views/UserViewEntityBase.js.map +1 -0
- package/dist/views/runView.d.ts +106 -0
- package/dist/views/runView.js +36 -0
- package/dist/views/runView.js.map +1 -0
- package/dist/views/viewInfo.d.ts +0 -0
- package/dist/views/viewInfo.js +118 -0
- package/dist/views/viewInfo.js.map +1 -0
- package/package.json +24 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ProviderBase = void 0;
|
|
5
|
+
const baseEntity_1 = require("./baseEntity");
|
|
6
|
+
const entityInfo_1 = require("./entityInfo");
|
|
7
|
+
const applicationInfo_1 = require("../generic/applicationInfo");
|
|
8
|
+
const securityInfo_1 = require("./securityInfo");
|
|
9
|
+
const mj_global_1 = require("mj_global");
|
|
10
|
+
const logging_1 = require("./logging");
|
|
11
|
+
const _rootPath = '../';
|
|
12
|
+
class ProviderBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
this._entities = [];
|
|
15
|
+
this._applications = [];
|
|
16
|
+
this._roles = [];
|
|
17
|
+
this._rowLevelSecurityFilters = [];
|
|
18
|
+
this._auditLogTypes = [];
|
|
19
|
+
this._authorizations = [];
|
|
20
|
+
this._refresh = false;
|
|
21
|
+
}
|
|
22
|
+
/******** END - ABSTRACT SECTION ****************************************************************** */
|
|
23
|
+
async Config(data) {
|
|
24
|
+
this._ConfigData = data;
|
|
25
|
+
this._entities = []; // make sure to clear the array first - we could get this from a hard refresh
|
|
26
|
+
this._applications = []; // make sure to clear the array first - we could get this from a hard refresh
|
|
27
|
+
if (this._refresh || await this.IsRefreshNeeded()) {
|
|
28
|
+
// either a hard refresh flag was set within Refresh(), or LocalMetadata is Obsolete
|
|
29
|
+
// first, make sure we reset the flag to false so that if another call to this function happens
|
|
30
|
+
// while we are waiting for the async call to finish, we dont do it again
|
|
31
|
+
this._refresh = false;
|
|
32
|
+
const start = new Date().getTime();
|
|
33
|
+
const res = await this.GetAllMetadata();
|
|
34
|
+
const end = new Date().getTime();
|
|
35
|
+
console.log(`GetAllMetadata() took ${end - start} ms`);
|
|
36
|
+
if (res) {
|
|
37
|
+
this.UpdateLocalMetadata(res);
|
|
38
|
+
this._latestLocalMetadataTimestamps = this._latestRemoteMetadataTimestamps; // update this since we just used server to get all the stuff
|
|
39
|
+
this.SaveLocalMetadataToStorage();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
BuildDatasetFilterFromConfig() {
|
|
45
|
+
// setup the schema filters as needed
|
|
46
|
+
const f = [];
|
|
47
|
+
// make sure that the MJ Core schema is always included if includeSchemas are provided because if the user doesn't include them stuff will break
|
|
48
|
+
const includeSchemaList = this.ConfigData.IncludeSchemas;
|
|
49
|
+
const excludeSchemaList = this.ConfigData.ExcludeSchemas;
|
|
50
|
+
const mjcSchema = this.ConfigData.MJCoreSchemaName;
|
|
51
|
+
// check to see if the MJ Core schema is already in the list, if not add it
|
|
52
|
+
if (includeSchemaList && includeSchemaList.length > 0 && includeSchemaList.indexOf(mjcSchema) === -1)
|
|
53
|
+
includeSchemaList.push(mjcSchema);
|
|
54
|
+
// check to make sure that if exclude schemas are provided, the list DOES NOT include the MJ Core schema, if it does, remove it
|
|
55
|
+
if (excludeSchemaList && excludeSchemaList.length > 0 && excludeSchemaList.indexOf(mjcSchema) !== -1) {
|
|
56
|
+
const index = excludeSchemaList.indexOf(mjcSchema);
|
|
57
|
+
excludeSchemaList.splice(index, 1);
|
|
58
|
+
(0, logging_1.LogStatus)(`Removed MJ Core schema (${mjcSchema}) from ExcludeSchemas list because it is required for the API to function correctly`);
|
|
59
|
+
}
|
|
60
|
+
let schemaFilter = '';
|
|
61
|
+
if (includeSchemaList && includeSchemaList.length > 0) {
|
|
62
|
+
schemaFilter = 'SchemaName IN (' + includeSchemaList.map(s => `'${s}'`).join(',') + ')';
|
|
63
|
+
}
|
|
64
|
+
if (excludeSchemaList && excludeSchemaList.length > 0) {
|
|
65
|
+
schemaFilter = (schemaFilter.length > 0 ? ' AND ' : '') + 'SchemaName NOT IN (' + excludeSchemaList.map(s => `'${s}'`).join(',') + ')';
|
|
66
|
+
}
|
|
67
|
+
if (schemaFilter.length > 0) {
|
|
68
|
+
f.push({ ItemCode: 'Entities', Filter: schemaFilter });
|
|
69
|
+
f.push({ ItemCode: 'EntityFields', Filter: schemaFilter });
|
|
70
|
+
}
|
|
71
|
+
return f;
|
|
72
|
+
}
|
|
73
|
+
async GetAllMetadata() {
|
|
74
|
+
try {
|
|
75
|
+
// we are now using datasets instead of the custom metadata to GraphQL to simplify GraphQL's work as it was very slow preivously
|
|
76
|
+
const start1 = new Date().getTime();
|
|
77
|
+
const f = this.BuildDatasetFilterFromConfig();
|
|
78
|
+
const d = await this.GetDatasetByName(ProviderBase._mjMetadataDatasetName, f.length > 0 ? f : null);
|
|
79
|
+
const end1 = new Date().getTime();
|
|
80
|
+
console.log(`GetAllMetadata - GetDatasetByName took ${end1 - start1}ms`);
|
|
81
|
+
const start2 = new Date().getTime();
|
|
82
|
+
const u = await this.GetCurrentUser();
|
|
83
|
+
const end2 = new Date().getTime();
|
|
84
|
+
console.log(`GetAllMetadata - GetCurrentUser took ${end2 - start2}ms`);
|
|
85
|
+
if (d && d.Success) {
|
|
86
|
+
// got the results, let's build our response in the format we need
|
|
87
|
+
const allMetadata = {};
|
|
88
|
+
for (let r of d.Results) {
|
|
89
|
+
allMetadata[r.Code] = r.Results;
|
|
90
|
+
}
|
|
91
|
+
// update the entities to include the fields, permissions and relationships
|
|
92
|
+
allMetadata.AllEntities = this.PostProcessEntityMetadata(allMetadata.Entities, allMetadata.EntityFields, allMetadata.EntityFieldValues, allMetadata.EntityPermissions, allMetadata.EntityRelationships);
|
|
93
|
+
// update the applications to include applicationentities
|
|
94
|
+
allMetadata.AllApplications = allMetadata.Applications.map((a) => {
|
|
95
|
+
a.ApplicationEntities = allMetadata.ApplicationEntities.filter((ae) => ae.ApplicationName.trim().toLowerCase() === a.Name.trim().toLowerCase());
|
|
96
|
+
return new applicationInfo_1.ApplicationInfo(this, a);
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
AllEntities: allMetadata.AllEntities,
|
|
100
|
+
AllApplications: allMetadata.AllApplications,
|
|
101
|
+
AllRoles: allMetadata.Roles.map((r) => new securityInfo_1.RoleInfo(r)),
|
|
102
|
+
CurrentUser: u,
|
|
103
|
+
AllRowLevelSecurityFilters: allMetadata.RowLevelSecurityFilters.map((r) => new securityInfo_1.RowLevelSecurityFilterInfo(r)),
|
|
104
|
+
AllAuditLogTypes: allMetadata.AuditLogTypes.map((a) => new securityInfo_1.AuditLogTypeInfo(a)),
|
|
105
|
+
AllAuthorizations: allMetadata.Authorizations.map((a) => new securityInfo_1.AuthorizationInfo(a))
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
(0, logging_1.LogError)(e);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
PostProcessEntityMetadata(entities, fields, fieldValues, permissions, relationships) {
|
|
114
|
+
const result = [];
|
|
115
|
+
if (fieldValues && fieldValues.length > 0)
|
|
116
|
+
for (let f of fields) {
|
|
117
|
+
// populate the field values for each field, if we have them
|
|
118
|
+
f.EntityFieldValues = fieldValues.filter(fv => fv.EntityID === f.EntityID && fv.EntityFieldName.trim().toLowerCase() === f.Name.trim().toLowerCase());
|
|
119
|
+
}
|
|
120
|
+
for (let e of entities) {
|
|
121
|
+
e.EntityFields = fields.filter(f => f.EntityID === e.ID).sort((a, b) => a.Sequence - b.Sequence);
|
|
122
|
+
e.EntityPermissions = permissions.filter(p => p.EntityID === e.ID);
|
|
123
|
+
e.EntityRelationships = relationships.filter(r => r.EntityID === e.ID);
|
|
124
|
+
result.push(new entityInfo_1.EntityInfo(e));
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
get ConfigData() {
|
|
129
|
+
return this._ConfigData;
|
|
130
|
+
}
|
|
131
|
+
get Entities() {
|
|
132
|
+
return this._entities;
|
|
133
|
+
}
|
|
134
|
+
get Applications() {
|
|
135
|
+
return this._applications;
|
|
136
|
+
}
|
|
137
|
+
get CurrentUser() {
|
|
138
|
+
return this._currentUser;
|
|
139
|
+
}
|
|
140
|
+
get Roles() {
|
|
141
|
+
return this._roles;
|
|
142
|
+
}
|
|
143
|
+
get RowLevelSecurityFilters() {
|
|
144
|
+
return this._rowLevelSecurityFilters;
|
|
145
|
+
}
|
|
146
|
+
get AuditLogTypes() {
|
|
147
|
+
return this._auditLogTypes;
|
|
148
|
+
}
|
|
149
|
+
get Authorizations() {
|
|
150
|
+
return this._authorizations;
|
|
151
|
+
}
|
|
152
|
+
async Refresh() {
|
|
153
|
+
// do nothing here, but set a _refresh flag for next time things are requested
|
|
154
|
+
if (this.AllowRefresh) {
|
|
155
|
+
this._refresh = true;
|
|
156
|
+
return this.Config(this._ConfigData);
|
|
157
|
+
}
|
|
158
|
+
else
|
|
159
|
+
return true; // subclass is telling us not to do any refresh ops right now
|
|
160
|
+
}
|
|
161
|
+
async IsRefreshNeeded() {
|
|
162
|
+
if (this.AllowRefresh) {
|
|
163
|
+
await this.RefreshRemoteMetadataTimestamps(); // get the latest timestamps from the server first
|
|
164
|
+
await this.LoadLocalMetadataFromStorage(); // then, attempt to load before we check to see if it is obsolete
|
|
165
|
+
return this.LocalMetadataObsolete();
|
|
166
|
+
}
|
|
167
|
+
else //subclass is telling us not to do any refresh ops right now
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
async RefreshIfNeeded() {
|
|
171
|
+
if (await this.IsRefreshNeeded())
|
|
172
|
+
return this.Refresh();
|
|
173
|
+
else
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
async GetEntityObject(entityName, contextUser = null) {
|
|
177
|
+
try {
|
|
178
|
+
const entity = this.Metadata.Entities.find(e => e.Name == entityName);
|
|
179
|
+
if (entity) {
|
|
180
|
+
// Use the MJGlobal Class Factory to do our object instantiation - we do NOT use metadata for this anymore, doesn't work well to have file paths with node dynamically at runtime
|
|
181
|
+
// type reference registration by any module via MJ Global is the way to go as it is reliable across all platforms.
|
|
182
|
+
try {
|
|
183
|
+
const newObject = mj_global_1.MJGlobal.Instance.ClassFactory.CreateInstance(baseEntity_1.BaseEntity, entityName, entity);
|
|
184
|
+
if (contextUser)
|
|
185
|
+
newObject.ContextCurrentUser = contextUser;
|
|
186
|
+
return newObject;
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
(0, logging_1.LogError)(e);
|
|
190
|
+
throw new Error(`Entity ${entityName} could not be instantiated via MJGlobal Class Factory. Make sure you have registered the class reference with MJGlobal.Instance.ClassFactory.Register(). ALSO, make sure you call LoadGeneratedEntities() from the GeneratedEntities project within your project as tree-shaking sometimes removes subclasses and could be causing this error!`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else
|
|
194
|
+
throw new Error(`Entity ${entityName} not found in metadata`);
|
|
195
|
+
}
|
|
196
|
+
catch (ex) {
|
|
197
|
+
(0, logging_1.LogError)(ex);
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Gets a database by name, if required, and caches it in a format available to the client (e.g. IndexedDB, LocalStorage, File, etc). The cache method is Provider specific
|
|
203
|
+
* If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache
|
|
204
|
+
* @param datasetName
|
|
205
|
+
* @param itemFilters
|
|
206
|
+
*/
|
|
207
|
+
async GetAndCacheDatasetByName(datasetName, itemFilters) {
|
|
208
|
+
// first see if we have anything in cache at all, no reason to check server dates if we dont
|
|
209
|
+
if (await this.IsDatasetCached(datasetName, itemFilters)) {
|
|
210
|
+
// compare the local version, if exists to the server version dates
|
|
211
|
+
if (await this.IsDatasetCacheUpToDate(datasetName, itemFilters)) {
|
|
212
|
+
// we're up to date, all we need to do is get the local cache and return it
|
|
213
|
+
return this.GetCachedDataset(datasetName, itemFilters);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
// we're out of date, so get the dataset from the server
|
|
217
|
+
const dataset = await this.GetDatasetByName(datasetName, itemFilters);
|
|
218
|
+
// cache it
|
|
219
|
+
await this.CacheDataset(datasetName, itemFilters, dataset);
|
|
220
|
+
return dataset;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
// get the dataset from the server
|
|
225
|
+
const dataset = await this.GetDatasetByName(datasetName, itemFilters);
|
|
226
|
+
// cache it
|
|
227
|
+
await this.CacheDataset(datasetName, itemFilters, dataset);
|
|
228
|
+
return dataset;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* This routine checks to see if the local cache version of a given datasetName/itemFilters combination is up to date with the server or not
|
|
233
|
+
* @param datasetName
|
|
234
|
+
* @param itemFilters
|
|
235
|
+
* @returns
|
|
236
|
+
*/
|
|
237
|
+
async IsDatasetCacheUpToDate(datasetName, itemFilters) {
|
|
238
|
+
const ls = this.LocalStorageProvider;
|
|
239
|
+
if (ls) {
|
|
240
|
+
const key = this.GetDatasetCacheKey(datasetName, itemFilters);
|
|
241
|
+
const dateKey = key + '_date';
|
|
242
|
+
const val = await ls.getItem(dateKey);
|
|
243
|
+
if (val) {
|
|
244
|
+
// we have a local cached timestamp, so compare it to the server timestamp
|
|
245
|
+
const status = await this.GetDatasetStatusByName(datasetName, itemFilters);
|
|
246
|
+
if (status) {
|
|
247
|
+
const serverTimestamp = status.LatestUpdateDate.getTime();
|
|
248
|
+
const localTimestamp = new Date(val);
|
|
249
|
+
return localTimestamp.getTime() >= serverTimestamp;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* This routine gets the local cached version of a given datasetName/itemFilters combination, it does NOT check the server status first and does not fall back on the server if there isn't a local cache version of this dataset/itemFilters combination
|
|
262
|
+
* @param datasetName
|
|
263
|
+
* @param itemFilters
|
|
264
|
+
* @returns
|
|
265
|
+
*/
|
|
266
|
+
async GetCachedDataset(datasetName, itemFilters) {
|
|
267
|
+
const ls = this.LocalStorageProvider;
|
|
268
|
+
if (ls) {
|
|
269
|
+
const key = this.GetDatasetCacheKey(datasetName, itemFilters);
|
|
270
|
+
const val = await ls.getItem(key);
|
|
271
|
+
if (val) {
|
|
272
|
+
const dataset = JSON.parse(val);
|
|
273
|
+
return dataset;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Stores a dataset in the local cache. If itemFilters are provided, the combination of datasetName and the filters are used to build a key and determine a match in the cache
|
|
279
|
+
* @param datasetName
|
|
280
|
+
* @param itemFilters
|
|
281
|
+
* @param dataset
|
|
282
|
+
*/
|
|
283
|
+
async CacheDataset(datasetName, itemFilters, dataset) {
|
|
284
|
+
const ls = this.LocalStorageProvider;
|
|
285
|
+
if (ls) {
|
|
286
|
+
const key = this.GetDatasetCacheKey(datasetName, itemFilters);
|
|
287
|
+
const val = JSON.stringify(dataset);
|
|
288
|
+
await ls.setItem(key, val);
|
|
289
|
+
const dateKey = key + '_date';
|
|
290
|
+
const dateVal = dataset.LatestUpdateDate.toISOString();
|
|
291
|
+
await ls.setItem(dateKey, dateVal);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Determines if a given datasetName/itemFilters combination is cached locally or not
|
|
296
|
+
* @param datasetName
|
|
297
|
+
* @param itemFilters
|
|
298
|
+
* @returns
|
|
299
|
+
*/
|
|
300
|
+
async IsDatasetCached(datasetName, itemFilters) {
|
|
301
|
+
const ls = this.LocalStorageProvider;
|
|
302
|
+
if (ls) {
|
|
303
|
+
const key = this.GetDatasetCacheKey(datasetName, itemFilters);
|
|
304
|
+
const val = await ls.getItem(key);
|
|
305
|
+
return val !== null && val !== undefined;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Creates a key for the given datasetName and itemFilters combination
|
|
310
|
+
* @param datasetName
|
|
311
|
+
* @param itemFilters
|
|
312
|
+
* @returns
|
|
313
|
+
*/
|
|
314
|
+
GetDatasetCacheKey(datasetName, itemFilters) {
|
|
315
|
+
return ProviderBase.localStorageRootKey + '__DATASET__' + datasetName + this.ConvertItemFiltersToUniqueKey(itemFilters);
|
|
316
|
+
}
|
|
317
|
+
ConvertItemFiltersToUniqueKey(itemFilters) {
|
|
318
|
+
if (itemFilters) {
|
|
319
|
+
const key = '{' + itemFilters.map(f => `"${f.ItemCode}":"${f.Filter}"`).join(',') + '}'; // this is a unique key for the item filters
|
|
320
|
+
return key;
|
|
321
|
+
}
|
|
322
|
+
else
|
|
323
|
+
return '';
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* If the specified datasetName is cached, this method will clear the cache. If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache
|
|
327
|
+
* @param datasetName
|
|
328
|
+
* @param itemFilters
|
|
329
|
+
*/
|
|
330
|
+
async ClearDatasetCache(datasetName, itemFilters) {
|
|
331
|
+
const ls = this.LocalStorageProvider;
|
|
332
|
+
if (ls) {
|
|
333
|
+
const key = this.GetDatasetCacheKey(datasetName, itemFilters);
|
|
334
|
+
await ls.remove(key);
|
|
335
|
+
const dateKey = key + '_date';
|
|
336
|
+
await ls.remove(dateKey);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
get LatestRemoteMetadata() {
|
|
340
|
+
return this._latestRemoteMetadataTimestamps;
|
|
341
|
+
}
|
|
342
|
+
get LatestLocalMetadata() {
|
|
343
|
+
return this._latestLocalMetadataTimestamps;
|
|
344
|
+
}
|
|
345
|
+
async GetLatestMetadataUpdates() {
|
|
346
|
+
const f = this.BuildDatasetFilterFromConfig();
|
|
347
|
+
const d = await this.GetDatasetStatusByName(ProviderBase._mjMetadataDatasetName, f.length > 0 ? f : null);
|
|
348
|
+
if (d && d.Success) {
|
|
349
|
+
const ret = d.EntityUpdateDates.map(e => {
|
|
350
|
+
return {
|
|
351
|
+
ID: e.EntityID,
|
|
352
|
+
Type: e.EntityName,
|
|
353
|
+
UpdatedAt: e.UpdateDate
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
// combine the entityupdate dates with a single top level entry for the dataset itself
|
|
357
|
+
ret.push({
|
|
358
|
+
ID: -1,
|
|
359
|
+
Type: 'All Entity Metadata',
|
|
360
|
+
UpdatedAt: d.LatestUpdateDate
|
|
361
|
+
});
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async RefreshRemoteMetadataTimestamps() {
|
|
366
|
+
const mdTimeStamps = await this.GetLatestMetadataUpdates(); // sub-class implements this
|
|
367
|
+
if (mdTimeStamps) {
|
|
368
|
+
this._latestRemoteMetadataTimestamps = mdTimeStamps;
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
else
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
LocalMetadataObsolete(type) {
|
|
375
|
+
const mdLocal = this.LatestLocalMetadata;
|
|
376
|
+
const mdRemote = this.LatestRemoteMetadata;
|
|
377
|
+
if (!mdLocal || !mdRemote || !mdLocal.length || !mdRemote.length || mdLocal.length === 0 || mdRemote.length === 0)
|
|
378
|
+
return true;
|
|
379
|
+
for (let i = 0; i < mdRemote.length; ++i) {
|
|
380
|
+
let bProcess = true;
|
|
381
|
+
if (type && type.length > 0)
|
|
382
|
+
bProcess = mdRemote[i].Type.toLowerCase().trim() === type.trim().toLowerCase();
|
|
383
|
+
if (bProcess) {
|
|
384
|
+
const l = mdLocal.find(md => md.Type.trim().toLowerCase() === mdRemote[i].Type.trim().toLowerCase());
|
|
385
|
+
if (!l)
|
|
386
|
+
return true; // no match, obsolete in this case
|
|
387
|
+
else {
|
|
388
|
+
// we have a match, now test various things
|
|
389
|
+
if (!l.UpdatedAt && !mdRemote[i].UpdatedAt) {
|
|
390
|
+
// both are null, so we're good
|
|
391
|
+
// do nothing, keep on truckin'
|
|
392
|
+
// console.log('TEST: both are null, so we\'re good')
|
|
393
|
+
}
|
|
394
|
+
else if (l.UpdatedAt && mdRemote[i].UpdatedAt) {
|
|
395
|
+
// both are not null, so we need to compare them
|
|
396
|
+
const localTime = new Date(l.UpdatedAt);
|
|
397
|
+
const remoteTime = new Date(mdRemote[i].UpdatedAt);
|
|
398
|
+
if (localTime.getTime() !== remoteTime.getTime()) {
|
|
399
|
+
return true; // we can short circuit the entire rest of the function
|
|
400
|
+
// as one obsolete is good enough to obsolete the entire local metadata
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
else
|
|
404
|
+
return true; // one is null and the other is not, so we're obsolete without even comparing
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
// if we get here, we're not obsolete!!
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
UpdateLocalMetadata(res) {
|
|
412
|
+
if (res.AllEntities) {
|
|
413
|
+
this._entities = [];
|
|
414
|
+
for (let i = 0; i < res.AllEntities.length; i++) {
|
|
415
|
+
this._entities.push(new entityInfo_1.EntityInfo(res.AllEntities[i]));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (res.AllApplications) {
|
|
419
|
+
this._applications = [];
|
|
420
|
+
for (let i = 0; i < res.AllApplications.length; i++) {
|
|
421
|
+
const a = new applicationInfo_1.ApplicationInfo(this, res.AllApplications[i]);
|
|
422
|
+
this._applications.push(a);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (res.AllRoles) {
|
|
426
|
+
this._roles = [];
|
|
427
|
+
for (let i = 0; i < res.AllRoles.length; i++) {
|
|
428
|
+
const r = new securityInfo_1.RoleInfo(res.AllRoles[i]);
|
|
429
|
+
this._roles.push(r);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (res.AllRowLevelSecurityFilters) {
|
|
433
|
+
this._rowLevelSecurityFilters = [];
|
|
434
|
+
for (let i = 0; i < res.AllRowLevelSecurityFilters.length; i++) {
|
|
435
|
+
const rls = new securityInfo_1.RowLevelSecurityFilterInfo(res.AllRowLevelSecurityFilters[i]);
|
|
436
|
+
this._rowLevelSecurityFilters.push(rls);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (res.AllAuditLogTypes) {
|
|
440
|
+
this._auditLogTypes = [];
|
|
441
|
+
for (let i = 0; i < res.AllAuditLogTypes.length; i++) {
|
|
442
|
+
const alt = new securityInfo_1.AuditLogTypeInfo(res.AllAuditLogTypes[i]);
|
|
443
|
+
this._auditLogTypes.push(alt);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
if (res.AllAuthorizations) {
|
|
447
|
+
this._authorizations = [];
|
|
448
|
+
for (let i = 0; i < res.AllAuthorizations.length; i++) {
|
|
449
|
+
const ai = new securityInfo_1.AuthorizationInfo(this, res.AllAuthorizations[i]);
|
|
450
|
+
this._authorizations.push(ai);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (res.CurrentUser)
|
|
454
|
+
this._currentUser = new securityInfo_1.UserInfo(this, res.CurrentUser);
|
|
455
|
+
}
|
|
456
|
+
async LoadLocalMetadataFromStorage() {
|
|
457
|
+
try {
|
|
458
|
+
const ls = this.LocalStorageProvider;
|
|
459
|
+
if (ls) {
|
|
460
|
+
// execution environment supports local storage, use it
|
|
461
|
+
this._latestLocalMetadataTimestamps = JSON.parse(await ls.getItem(ProviderBase.localStorageTimestampsKey));
|
|
462
|
+
const e = JSON.parse(await ls.getItem(ProviderBase.localStorageEntitiesKey));
|
|
463
|
+
const a = JSON.parse(await ls.getItem(ProviderBase.localStorageApplicationsKey));
|
|
464
|
+
const cu = JSON.parse(await ls.getItem(ProviderBase.localStorageCurrentUserKey));
|
|
465
|
+
const r = JSON.parse(await ls.getItem(ProviderBase.localStorageRolesKey));
|
|
466
|
+
const rls = JSON.parse(await ls.getItem(ProviderBase.localStorageRowLevelSecurityFiltersKey));
|
|
467
|
+
const alt = JSON.parse(await ls.getItem(ProviderBase.localStorageAuditLogTypesKey));
|
|
468
|
+
const ai = JSON.parse(await ls.getItem(ProviderBase.localStorageAuthorizationsKey));
|
|
469
|
+
this.UpdateLocalMetadata({
|
|
470
|
+
AllEntities: e,
|
|
471
|
+
AllApplications: a,
|
|
472
|
+
CurrentUser: cu,
|
|
473
|
+
AllRoles: r,
|
|
474
|
+
AllRowLevelSecurityFilters: rls,
|
|
475
|
+
AllAuditLogTypes: alt,
|
|
476
|
+
AllAuthorizations: ai
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
catch (e) {
|
|
481
|
+
// some enviroments don't support local storage
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async SaveLocalMetadataToStorage() {
|
|
485
|
+
try {
|
|
486
|
+
const ls = this.LocalStorageProvider;
|
|
487
|
+
if (ls) {
|
|
488
|
+
// execution environment supports local storage, use it
|
|
489
|
+
await ls.setItem(ProviderBase.localStorageTimestampsKey, JSON.stringify(this._latestLocalMetadataTimestamps));
|
|
490
|
+
await ls.setItem(ProviderBase.localStorageEntitiesKey, JSON.stringify(this._entities));
|
|
491
|
+
await ls.setItem(ProviderBase.localStorageApplicationsKey, JSON.stringify(this._applications));
|
|
492
|
+
await ls.setItem(ProviderBase.localStorageCurrentUserKey, JSON.stringify(this._currentUser));
|
|
493
|
+
await ls.setItem(ProviderBase.localStorageRolesKey, JSON.stringify(this._roles));
|
|
494
|
+
await ls.setItem(ProviderBase.localStorageRowLevelSecurityFiltersKey, JSON.stringify(this._rowLevelSecurityFilters));
|
|
495
|
+
await ls.setItem(ProviderBase.localStorageAuditLogTypesKey, JSON.stringify(this._auditLogTypes));
|
|
496
|
+
await ls.setItem(ProviderBase.localStorageAuthorizationsKey, JSON.stringify(this._authorizations));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
catch (e) {
|
|
500
|
+
// some enviroments don't support local storage
|
|
501
|
+
(0, logging_1.LogError)(e);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
_a = ProviderBase;
|
|
506
|
+
ProviderBase._mjMetadataDatasetName = 'MJ_Metadata';
|
|
507
|
+
ProviderBase.localStorageRootKey = '___MJCore_Metadata';
|
|
508
|
+
ProviderBase.localStorageTimestampsKey = _a.localStorageRootKey + '_Timestamps';
|
|
509
|
+
ProviderBase.localStorageEntitiesKey = _a.localStorageRootKey + '_Entities';
|
|
510
|
+
ProviderBase.localStorageApplicationsKey = _a.localStorageRootKey + '_Applications';
|
|
511
|
+
ProviderBase.localStorageCurrentUserKey = _a.localStorageRootKey + '_CurrentUser';
|
|
512
|
+
ProviderBase.localStorageRolesKey = _a.localStorageRootKey + '_Roles';
|
|
513
|
+
ProviderBase.localStorageRowLevelSecurityFiltersKey = _a.localStorageRootKey + '_RowLevelSecurityFilters';
|
|
514
|
+
ProviderBase.localStorageAuditLogTypesKey = _a.localStorageRootKey + '_AuditLogTypes';
|
|
515
|
+
ProviderBase.localStorageAuthorizationsKey = _a.localStorageRootKey + '_Authorizations';
|
|
516
|
+
exports.ProviderBase = ProviderBase;
|
|
517
|
+
//# sourceMappingURL=providerBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providerBase.js","sourceRoot":"","sources":["../../src/generic/providerBase.ts"],"names":[],"mappings":";;;;AAAA,6CAA0C;AAC1C,6CAA0C;AAE1C,gEAA6D;AAC7D,iDAAmI;AAEnI,yCAAqC;AACrC,uCAAgD;AAChD,MAAM,SAAS,GAAG,KAAK,CAAA;AAavB,MAAsB,YAAY;IAAlC;QAIY,cAAS,GAAiB,E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AO,CAAC,YAAY,CAAC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;aACrG;SACJ;QACD,OAAO,CAAC,EAAE;YACN,+CAA+C;YAC/C,IAAA,kBAAQ,EAAC,CAAC,CAAC,CAAA;SACd;IACL,CAAC;;;AAzfgB,mCAAsB,GAAW,aAAa,AAAxB,CAAyB;AA6djD,gCAAmB,GAAE,oBAAoB,AAAtB,CAAsB;AACzC,sCAAyB,GAAG,EAAI,CAAC,mBAAmB,GAAG,aAAa,AAA3C,CAA2C;AACpE,oCAAuB,GAAG,EAAI,CAAC,mBAAmB,GAAG,WAAW,AAAzC,CAAyC;AAChE,wCAA2B,GAAG,EAAI,CAAC,mBAAmB,GAAG,eAAe,AAA7C,CAA6C;AACxE,uCAA0B,GAAG,EAAI,CAAC,mBAAmB,GAAG,cAAc,AAA5C,CAA4C;AACtE,iCAAoB,GAAG,EAAI,CAAC,mBAAmB,GAAG,QAAQ,AAAtC,CAAsC;AAC1D,mDAAsC,GAAG,EAAI,CAAC,mBAAmB,GAAG,0BAA0B,AAAxD,CAAwD;AAC9F,yCAA4B,GAAG,EAAI,CAAC,mBAAmB,GAAG,gBAAgB,AAA9C,CAA8C;AAC1E,0CAA6B,GAAG,EAAI,CAAC,mBAAmB,GAAG,iBAAiB,AAA/C,CAA+C;AA7jBzE,oCAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IRunReportProvider, RunReportResult } from './interfaces';
|
|
2
|
+
import { UserInfo } from './securityInfo';
|
|
3
|
+
export type RunReportParams = {
|
|
4
|
+
ReportID: number;
|
|
5
|
+
};
|
|
6
|
+
export declare class RunReport {
|
|
7
|
+
RunReport(params: RunReportParams, contextUser?: UserInfo): Promise<RunReportResult>;
|
|
8
|
+
private static _globalProviderKey;
|
|
9
|
+
static get Provider(): IRunReportProvider;
|
|
10
|
+
static set Provider(value: IRunReportProvider);
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunReport = void 0;
|
|
4
|
+
const mj_global_1 = require("mj_global");
|
|
5
|
+
class RunReport {
|
|
6
|
+
//private static _Provider: IRunViewProvider;
|
|
7
|
+
async RunReport(params, contextUser) {
|
|
8
|
+
return RunReport.Provider.RunReport(params, contextUser);
|
|
9
|
+
}
|
|
10
|
+
static get Provider() {
|
|
11
|
+
const g = mj_global_1.MJGlobal.Instance.GetGlobalObjectStore();
|
|
12
|
+
if (g)
|
|
13
|
+
return g[RunReport._globalProviderKey];
|
|
14
|
+
else
|
|
15
|
+
throw new Error('No global object store, so we cant get the static provider');
|
|
16
|
+
}
|
|
17
|
+
static set Provider(value) {
|
|
18
|
+
const g = mj_global_1.MJGlobal.Instance.GetGlobalObjectStore();
|
|
19
|
+
if (g)
|
|
20
|
+
g[RunReport._globalProviderKey] = value;
|
|
21
|
+
else
|
|
22
|
+
throw new Error('No global object store, so we cant set the static provider');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
RunReport._globalProviderKey = 'MJ_RunReportProvider';
|
|
26
|
+
exports.RunReport = RunReport;
|
|
27
|
+
//# sourceMappingURL=runReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runReport.js","sourceRoot":"","sources":["../../src/generic/runReport.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAQrC,MAAa,SAAS;IAClB,6CAA6C;IAEtC,KAAK,CAAC,SAAS,CAAC,MAAuB,EAAE,WAAsB;QAClE,OAAO,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC7D,CAAC;IAGM,MAAM,KAAK,QAAQ;QACtB,MAAM,CAAC,GAAG,oBAAQ,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;QACnD,IAAI,CAAC;YACD,OAAO,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;;YAEvC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IACtF,CAAC;IACM,MAAM,KAAK,QAAQ,CAAC,KAAyB;QAChD,MAAM,CAAC,GAAG,oBAAQ,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;QACnD,IAAI,CAAC;YACD,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC;;YAExC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IACtF,CAAC;;AAdc,4BAAkB,GAAW,sBAAsB,CAAC;AAP1D,8BAAS"}
|