@memberjunction/core 0.9.166 → 0.9.167
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/interfaces.d.ts +0 -2
- package/dist/generic/interfaces.js.map +1 -1
- package/dist/generic/providerBase.d.ts +0 -7
- package/dist/generic/providerBase.js +1 -11
- package/dist/generic/providerBase.js.map +1 -1
- package/package.json +1 -1
- package/dist/MJCore/src/generic/applicationInfo.d.ts +0 -26
- package/dist/MJCore/src/generic/applicationInfo.js +0 -57
- package/dist/MJCore/src/generic/applicationInfo.js.map +0 -1
- package/dist/MJCore/src/generic/baseEntity.d.ts +0 -195
- package/dist/MJCore/src/generic/baseEntity.js +0 -674
- package/dist/MJCore/src/generic/baseEntity.js.map +0 -1
- package/dist/MJCore/src/generic/baseInfo.d.ts +0 -8
- package/dist/MJCore/src/generic/baseInfo.js +0 -38
- package/dist/MJCore/src/generic/baseInfo.js.map +0 -1
- package/dist/MJCore/src/generic/entityInfo.d.ts +0 -520
- package/dist/MJCore/src/generic/entityInfo.js +0 -801
- package/dist/MJCore/src/generic/entityInfo.js.map +0 -1
- package/dist/MJCore/src/generic/interfaces.d.ts +0 -288
- package/dist/MJCore/src/generic/interfaces.js +0 -50
- package/dist/MJCore/src/generic/interfaces.js.map +0 -1
- package/dist/MJCore/src/generic/logging.d.ts +0 -4
- package/dist/MJCore/src/generic/logging.js +0 -69
- package/dist/MJCore/src/generic/logging.js.map +0 -1
- package/dist/MJCore/src/generic/metadata.d.ts +0 -201
- package/dist/MJCore/src/generic/metadata.js +0 -312
- package/dist/MJCore/src/generic/metadata.js.map +0 -1
- package/dist/MJCore/src/generic/providerBase.d.ts +0 -183
- package/dist/MJCore/src/generic/providerBase.js +0 -640
- package/dist/MJCore/src/generic/providerBase.js.map +0 -1
- package/dist/MJCore/src/generic/queryInfo.d.ts +0 -64
- package/dist/MJCore/src/generic/queryInfo.js +0 -124
- package/dist/MJCore/src/generic/queryInfo.js.map +0 -1
- package/dist/MJCore/src/generic/runQuery.d.ts +0 -11
- package/dist/MJCore/src/generic/runQuery.js +0 -26
- package/dist/MJCore/src/generic/runQuery.js.map +0 -1
- package/dist/MJCore/src/generic/runReport.d.ts +0 -11
- package/dist/MJCore/src/generic/runReport.js +0 -27
- package/dist/MJCore/src/generic/runReport.js.map +0 -1
- package/dist/MJCore/src/generic/securityInfo.d.ts +0 -100
- package/dist/MJCore/src/generic/securityInfo.js +0 -194
- package/dist/MJCore/src/generic/securityInfo.js.map +0 -1
- package/dist/MJCore/src/generic/transactionGroup.d.ts +0 -24
- package/dist/MJCore/src/generic/transactionGroup.js +0 -79
- package/dist/MJCore/src/generic/transactionGroup.js.map +0 -1
- package/dist/MJCore/src/generic/util.d.ts +0 -16
- package/dist/MJCore/src/generic/util.js +0 -151
- package/dist/MJCore/src/generic/util.js.map +0 -1
- package/dist/MJCore/src/index.d.ts +0 -16
- package/dist/MJCore/src/index.js +0 -44
- package/dist/MJCore/src/index.js.map +0 -1
- package/dist/MJCore/src/views/runView.d.ts +0 -112
- package/dist/MJCore/src/views/runView.js +0 -63
- package/dist/MJCore/src/views/runView.js.map +0 -1
- package/dist/MJCore/src/views/viewInfo.d.ts +0 -59
- package/dist/MJCore/src/views/viewInfo.js +0 -121
- package/dist/MJCore/src/views/viewInfo.js.map +0 -1
- package/dist/MJGlobal/src/ObjectCache.d.ts +0 -26
- package/dist/MJGlobal/src/ObjectCache.js +0 -55
- package/dist/MJGlobal/src/ObjectCache.js.map +0 -1
- package/dist/generic/objectCache.d.ts +0 -26
- package/dist/generic/objectCache.js +0 -55
- package/dist/generic/objectCache.js.map +0 -1
- package/dist/generic/viewInfo.d.ts +0 -59
- package/dist/generic/viewInfo.js +0 -121
- package/dist/generic/viewInfo.js.map +0 -1
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { BaseEntity } from "./baseEntity";
|
|
2
|
-
import { EntityDependency, EntityInfo, PrimaryKeyValue, RecordDependency, RecordMergeRequest, RecordMergeResult } from "./entityInfo";
|
|
3
|
-
import { IMetadataProvider, ProviderConfigDataBase, MetadataInfo, ILocalStorageProvider, DatasetResultType, DatasetStatusResultType, DatasetItemFilterType, EntityRecordNameInput, EntityRecordNameResult, ProviderType } from "./interfaces";
|
|
4
|
-
import { ApplicationInfo } from "../generic/applicationInfo";
|
|
5
|
-
import { AuditLogTypeInfo, AuthorizationInfo, RoleInfo, RowLevelSecurityFilterInfo, UserInfo } from "./securityInfo";
|
|
6
|
-
import { TransactionGroupBase } from "./transactionGroup";
|
|
7
|
-
import { QueryCategoryInfo, QueryFieldInfo, QueryInfo, QueryPermissionInfo } from "./queryInfo";
|
|
8
|
-
export type AllMetadata = {
|
|
9
|
-
AllEntities: EntityInfo[];
|
|
10
|
-
AllApplications: ApplicationInfo[];
|
|
11
|
-
CurrentUser: UserInfo;
|
|
12
|
-
AllRoles: RoleInfo[];
|
|
13
|
-
AllRowLevelSecurityFilters: RowLevelSecurityFilterInfo[];
|
|
14
|
-
AllAuditLogTypes: AuditLogTypeInfo[];
|
|
15
|
-
AllAuthorizations: AuthorizationInfo[];
|
|
16
|
-
AllQueryCategories: QueryCategoryInfo[];
|
|
17
|
-
AllQueries: QueryInfo[];
|
|
18
|
-
AllQueryFields: QueryFieldInfo[];
|
|
19
|
-
AllQueryPermissions: QueryPermissionInfo[];
|
|
20
|
-
};
|
|
21
|
-
export declare abstract class ProviderBase implements IMetadataProvider {
|
|
22
|
-
private _ConfigData;
|
|
23
|
-
private _latestLocalMetadataTimestamps;
|
|
24
|
-
private _latestRemoteMetadataTimestamps;
|
|
25
|
-
private _entities;
|
|
26
|
-
private _applications;
|
|
27
|
-
private _currentUser;
|
|
28
|
-
private _roles;
|
|
29
|
-
private _rowLevelSecurityFilters;
|
|
30
|
-
private _auditLogTypes;
|
|
31
|
-
private _authorizations;
|
|
32
|
-
private _queries;
|
|
33
|
-
private _queryCategories;
|
|
34
|
-
private _queryFields;
|
|
35
|
-
private _queryPermissions;
|
|
36
|
-
private _refresh;
|
|
37
|
-
/******** ABSTRACT SECTION ****************************************************************** */
|
|
38
|
-
protected abstract AllowRefresh(): boolean;
|
|
39
|
-
abstract get ProviderType(): ProviderType;
|
|
40
|
-
abstract GetEntityRecordName(entityName: string, primaryKeyValues: PrimaryKeyValue[]): Promise<string>;
|
|
41
|
-
abstract GetEntityRecordNames(info: EntityRecordNameInput[]): Promise<EntityRecordNameResult[]>;
|
|
42
|
-
abstract GetRecordFavoriteStatus(userId: number, entityName: string, primaryKeyValues: PrimaryKeyValue[]): Promise<boolean>;
|
|
43
|
-
abstract SetRecordFavoriteStatus(userId: number, entityName: string, primaryKeyValues: PrimaryKeyValue[], isFavorite: boolean, contextUser: UserInfo): Promise<void>;
|
|
44
|
-
/******** END - ABSTRACT SECTION ****************************************************************** */
|
|
45
|
-
Config(data: ProviderConfigDataBase): Promise<boolean>;
|
|
46
|
-
protected BuildDatasetFilterFromConfig(): DatasetItemFilterType[];
|
|
47
|
-
protected static _mjMetadataDatasetName: string;
|
|
48
|
-
protected GetAllMetadata(): Promise<AllMetadata>;
|
|
49
|
-
protected abstract GetCurrentUser(): Promise<UserInfo>;
|
|
50
|
-
protected PostProcessEntityMetadata(entities: any[], fields: any[], fieldValues: any[], permissions: any[], relationships: any[]): any[];
|
|
51
|
-
get ConfigData(): ProviderConfigDataBase;
|
|
52
|
-
get Entities(): EntityInfo[];
|
|
53
|
-
get Applications(): ApplicationInfo[];
|
|
54
|
-
get CurrentUser(): UserInfo;
|
|
55
|
-
get Roles(): RoleInfo[];
|
|
56
|
-
get RowLevelSecurityFilters(): RowLevelSecurityFilterInfo[];
|
|
57
|
-
get AuditLogTypes(): AuditLogTypeInfo[];
|
|
58
|
-
get Authorizations(): AuthorizationInfo[];
|
|
59
|
-
get Queries(): QueryInfo[];
|
|
60
|
-
get QueryCategories(): QueryCategoryInfo[];
|
|
61
|
-
get QueryFields(): QueryFieldInfo[];
|
|
62
|
-
get QueryPermissions(): QueryPermissionInfo[];
|
|
63
|
-
Refresh(): Promise<boolean>;
|
|
64
|
-
IsRefreshNeeded(): Promise<boolean>;
|
|
65
|
-
RefreshIfNeeded(): Promise<boolean>;
|
|
66
|
-
GetEntityObject<T extends BaseEntity>(entityName: string, contextUser?: UserInfo): Promise<T>;
|
|
67
|
-
/**
|
|
68
|
-
* Returns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
|
|
69
|
-
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
|
|
70
|
-
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
|
|
71
|
-
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
|
|
72
|
-
* @param entityName the name of the entity to check
|
|
73
|
-
* @param primaryKeyValues the values of the primary key of the record to check
|
|
74
|
-
*/
|
|
75
|
-
abstract GetRecordDependencies(entityName: string, primaryKeyValues: PrimaryKeyValue[]): Promise<RecordDependency[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
|
|
78
|
-
* @param entityName
|
|
79
|
-
* @returns
|
|
80
|
-
*/
|
|
81
|
-
GetEntityDependencies(entityName: string): Promise<EntityDependency[]>;
|
|
82
|
-
/**
|
|
83
|
-
* This method will merge two or more records based on the request provided. The RecordMergeRequest type you pass in specifies the record that will survive the merge, the records to merge into the surviving record, and an optional field map that can update values in the surviving record, if desired. The process followed is:
|
|
84
|
-
* 1. A transaction is started
|
|
85
|
-
* 2. The surviving record is loaded and fields are updated from the field map, if provided, and the record is saved. If a FieldMap not provided within the request object, this step is skipped.
|
|
86
|
-
* 3. For each of the records that will be merged INTO the surviving record, we call the GetEntityDependencies() method and get a list of all other records in the database are linked to the record to be deleted. We then go through each of those dependencies and update the link to point to the SurvivingRecordID and save the record.
|
|
87
|
-
* 4. The record to be deleted is then deleted.
|
|
88
|
-
* 5. The transaction is committed if all of the above steps are succesful, otherwise it is rolled back.
|
|
89
|
-
*
|
|
90
|
-
* The return value from this method contains detailed information about the execution of the process. In addition, all attempted merges are logged in the RecordMergeLog and RecordMergeDeletionLog tables.
|
|
91
|
-
*
|
|
92
|
-
* @param request
|
|
93
|
-
* @returns
|
|
94
|
-
*/
|
|
95
|
-
abstract MergeRecords(request: RecordMergeRequest): Promise<RecordMergeResult>;
|
|
96
|
-
/**
|
|
97
|
-
* Always retrieves data from the server - this method does NOT check cache. To use cached local values if available, call GetAndCacheDatasetByName() instead
|
|
98
|
-
* @param datasetName
|
|
99
|
-
* @param itemFilters
|
|
100
|
-
*/
|
|
101
|
-
abstract GetDatasetByName(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetResultType>;
|
|
102
|
-
/**
|
|
103
|
-
* Retrieves the date status information for a dataset and all its items from the server. This method will match the datasetName and itemFilters to the server's dataset and item filters to determine a match
|
|
104
|
-
* @param datasetName
|
|
105
|
-
* @param itemFilters
|
|
106
|
-
*/
|
|
107
|
-
abstract GetDatasetStatusByName(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetStatusResultType>;
|
|
108
|
-
/**
|
|
109
|
-
* 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
|
|
110
|
-
* If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache
|
|
111
|
-
* @param datasetName
|
|
112
|
-
* @param itemFilters
|
|
113
|
-
*/
|
|
114
|
-
GetAndCacheDatasetByName(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetResultType>;
|
|
115
|
-
/**
|
|
116
|
-
* 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
|
|
117
|
-
* @param datasetName
|
|
118
|
-
* @param itemFilters
|
|
119
|
-
* @returns
|
|
120
|
-
*/
|
|
121
|
-
IsDatasetCacheUpToDate(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<boolean>;
|
|
122
|
-
/**
|
|
123
|
-
* 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
|
|
124
|
-
* @param datasetName
|
|
125
|
-
* @param itemFilters
|
|
126
|
-
* @returns
|
|
127
|
-
*/
|
|
128
|
-
GetCachedDataset(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetResultType>;
|
|
129
|
-
/**
|
|
130
|
-
* 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
|
|
131
|
-
* @param datasetName
|
|
132
|
-
* @param itemFilters
|
|
133
|
-
* @param dataset
|
|
134
|
-
*/
|
|
135
|
-
CacheDataset(datasetName: string, itemFilters: DatasetItemFilterType[], dataset: DatasetResultType): Promise<void>;
|
|
136
|
-
/**
|
|
137
|
-
* Determines if a given datasetName/itemFilters combination is cached locally or not
|
|
138
|
-
* @param datasetName
|
|
139
|
-
* @param itemFilters
|
|
140
|
-
* @returns
|
|
141
|
-
*/
|
|
142
|
-
IsDatasetCached(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<boolean>;
|
|
143
|
-
/**
|
|
144
|
-
* Creates a key for the given datasetName and itemFilters combination
|
|
145
|
-
* @param datasetName
|
|
146
|
-
* @param itemFilters
|
|
147
|
-
* @returns
|
|
148
|
-
*/
|
|
149
|
-
GetDatasetCacheKey(datasetName: string, itemFilters?: DatasetItemFilterType[]): string;
|
|
150
|
-
protected ConvertItemFiltersToUniqueKey(itemFilters: DatasetItemFilterType[]): string;
|
|
151
|
-
/**
|
|
152
|
-
* 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
|
|
153
|
-
* @param datasetName
|
|
154
|
-
* @param itemFilters
|
|
155
|
-
*/
|
|
156
|
-
ClearDatasetCache(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<void>;
|
|
157
|
-
abstract CreateTransactionGroup(): Promise<TransactionGroupBase>;
|
|
158
|
-
get LatestRemoteMetadata(): MetadataInfo[];
|
|
159
|
-
get LatestLocalMetadata(): MetadataInfo[];
|
|
160
|
-
protected GetLatestMetadataUpdates(): Promise<MetadataInfo[]>;
|
|
161
|
-
RefreshRemoteMetadataTimestamps(): Promise<boolean>;
|
|
162
|
-
LocalMetadataObsolete(type?: string): boolean;
|
|
163
|
-
protected UpdateLocalMetadata(res: AllMetadata): void;
|
|
164
|
-
abstract get LocalStorageProvider(): ILocalStorageProvider;
|
|
165
|
-
protected LoadLocalMetadataFromStorage(): Promise<void>;
|
|
166
|
-
private static localStorageRootKey;
|
|
167
|
-
private static localStorageTimestampsKey;
|
|
168
|
-
private static localStorageEntitiesKey;
|
|
169
|
-
private static localStorageApplicationsKey;
|
|
170
|
-
private static localStorageCurrentUserKey;
|
|
171
|
-
private static localStorageRolesKey;
|
|
172
|
-
private static localStorageRowLevelSecurityFiltersKey;
|
|
173
|
-
private static localStorageAuditLogTypesKey;
|
|
174
|
-
private static localStorageAuthorizationsKey;
|
|
175
|
-
private static localStorageQueriesKey;
|
|
176
|
-
private static localStorageQueryCategoriesKey;
|
|
177
|
-
private static localStorageQueryFieldsKey;
|
|
178
|
-
private static localStorageQueryPermissionsKey;
|
|
179
|
-
private static localStorageKeys;
|
|
180
|
-
SaveLocalMetadataToStorage(): Promise<void>;
|
|
181
|
-
RemoveLocalMetadataFromStorage(): Promise<void>;
|
|
182
|
-
protected abstract get Metadata(): IMetadataProvider;
|
|
183
|
-
}
|