@memberjunction/sqlserver-dataprovider 0.9.1

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.
@@ -0,0 +1,89 @@
1
+ /**************************************************************************************************************
2
+ * The SQLServerDataProvider provides a data provider for the entities framework that uses SQL Server directly
3
+ * In practice - this FILE will NOT exist in the entities library, we need to move to its own separate project
4
+ * so it is only included by the consumer of the entities library if they want to use it.
5
+ **************************************************************************************************************/
6
+ import { BaseEntity, IEntityDataProvider, IMetadataProvider, IRunViewProvider, ProviderConfigDataBase, RunViewResult, EntityInfo, ApplicationInfo, RunViewParams, ProviderBase, EntityDataProviderType, UserInfo, RoleInfo, RecordChange, UserRoleInfo, ILocalStorageProvider, RowLevelSecurityFilterInfo, AuditLogTypeInfo, AuthorizationInfo, TransactionGroupBase, EntitySaveOptions, UserViewEntityBase, RunReportParams, DatasetItemFilterType, DatasetResultType, DatasetStatusResultType, EntityRecordNameInput, EntityRecordNameResult, IRunReportProvider, RunReportResult } from "@memberjunction/core";
7
+ export declare class SQLServerProviderConfigData extends ProviderConfigDataBase {
8
+ get DataSource(): any;
9
+ get CurrentUserEmail(): string;
10
+ get CheckRefreshIntervalSeconds(): number;
11
+ constructor(dataSource: any, currentUserEmail: string, MJCoreSchemaName?: string, checkRefreshIntervalSeconds?: number, includeSchemas?: string[], excludeSchemas?: string[]);
12
+ }
13
+ export declare class SQLServerDataProvider extends ProviderBase implements IEntityDataProvider, IMetadataProvider, IRunViewProvider, IRunReportProvider {
14
+ private _dataSource;
15
+ private _currentUserEmail;
16
+ private _localStorageProvider;
17
+ private _bAllowRefresh;
18
+ get ConfigData(): SQLServerProviderConfigData;
19
+ Config(configData: SQLServerProviderConfigData): Promise<boolean>;
20
+ protected AllowRefresh(): boolean;
21
+ /**************************************************************************/
22
+ /**************************************************************************/
23
+ RunReport(params: RunReportParams, contextUser?: UserInfo): Promise<RunReportResult>;
24
+ /**************************************************************************/
25
+ /**************************************************************************/
26
+ /**************************************************************************/
27
+ /**************************************************************************/
28
+ RunView(params: RunViewParams, contextUser?: UserInfo): Promise<RunViewResult>;
29
+ protected validateUserProvidedSQLClause(clause: string): boolean;
30
+ protected getRunTimeViewFieldString(params: RunViewParams, viewEntity: UserViewEntityBase): string;
31
+ protected getRunTimeViewFieldArray(params: RunViewParams, viewEntity: UserViewEntityBase): string[];
32
+ protected executeSQLForUserViewRunLogging(viewId: number, entityBaseView: string, whereSQL: string, orderBySQL: string, user: UserInfo): Promise<{
33
+ executeViewSQL: string;
34
+ runID: number;
35
+ }>;
36
+ protected createViewUserSearchSQL(entityInfo: EntityInfo, userSearchString: string): string;
37
+ createAuditLogRecord(user: UserInfo, authorizationName: string | null, auditLogTypeName: string, status: string, details: string | null, entityId: number, recordId: number | null, auditLogDescription: string | null): Promise<any>;
38
+ protected CheckUserReadPermissions(entityName: string, contextUser: UserInfo): void;
39
+ /**************************************************************************/
40
+ /**************************************************************************/
41
+ /**************************************************************************/
42
+ /**************************************************************************/
43
+ get ProviderType(): EntityDataProviderType;
44
+ GetRecordFavoriteStatus(userId: number, entityName: string, recordId: number): Promise<boolean>;
45
+ GetRecordFavoriteID(userId: number, entityName: string, recordId: number): Promise<number | null>;
46
+ SetRecordFavoriteStatus(userId: number, entityName: string, recordId: number, isFavorite: boolean, contextUser: UserInfo): Promise<void>;
47
+ GetRecordChanges(entityName: string, recordId: number): Promise<RecordChange[]>;
48
+ protected GetSaveSQL(entity: BaseEntity, bNewRecord: boolean, spName: string, user: UserInfo): string;
49
+ protected GetEntityAIActions(entityInfo: EntityInfo, before: boolean): any;
50
+ protected HandleEntityAIActions(entity: BaseEntity, before: boolean, user: UserInfo): Promise<void>;
51
+ Save(entity: BaseEntity, user: UserInfo, options: EntitySaveOptions): Promise<{}>;
52
+ private getAllEntityColumnsSQL;
53
+ private generateSPParams;
54
+ private generateSingleSPParam;
55
+ protected packageSPParam(paramValue: any, quoteString: string): string;
56
+ protected GetLogRecordChangeSQL(newData: any, oldData: any, entityName: string, recordID: string, entityInfo: EntityInfo, user: UserInfo): string;
57
+ protected LogRecordChange(newData: any, oldData: any, entityName: string, recordID: number, entityInfo: EntityInfo, user: UserInfo): Promise<any>;
58
+ protected CreateUserDescription(changesObject: any, maxValueLength?: number): string;
59
+ protected trimString(value: any, maxLength: number, trailingChars: string): any;
60
+ protected escapeQuotesInProperties(obj: any, quoteToEscape: string): any;
61
+ protected DiffObjects(oldData: any, newData: any, entityInfo: EntityInfo, quoteToEscape: string): any;
62
+ Load(entity: BaseEntity, RecordID: number, EntityRelationshipsToLoad: string[], user: UserInfo): Promise<{}>;
63
+ protected GetDeleteSQL(entity: BaseEntity, user: UserInfo): string;
64
+ Delete(entity: BaseEntity, user: UserInfo): Promise<boolean>;
65
+ /**************************************************************************/
66
+ /**************************************************************************/
67
+ /**************************************************************************/
68
+ /**************************************************************************/
69
+ GetDatasetByName(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetResultType>;
70
+ GetDatasetStatusByName(datasetName: string, itemFilters?: DatasetItemFilterType[]): Promise<DatasetStatusResultType>;
71
+ protected GetApplicationMetadata(): Promise<ApplicationInfo[]>;
72
+ protected GetAuditLogTypeMetadata(): Promise<AuditLogTypeInfo[]>;
73
+ protected GetUserMetadata(): Promise<UserInfo[]>;
74
+ protected GetAuthorizationMetadata(): Promise<AuthorizationInfo[]>;
75
+ protected GetCurrentUser(): Promise<UserInfo>;
76
+ protected GetCurrentUserMetadata(): Promise<UserInfo>;
77
+ protected GetRoleMetadata(): Promise<RoleInfo[]>;
78
+ protected GetUserRoleMetadata(): Promise<UserRoleInfo[]>;
79
+ protected GetRowLevelSecurityFilterMetadata(): Promise<RowLevelSecurityFilterInfo[]>;
80
+ protected ExecuteSQL(query: string, parameters?: any): Promise<any>;
81
+ get LocalStorageProvider(): ILocalStorageProvider;
82
+ GetEntityRecordNames(info: EntityRecordNameInput[]): Promise<EntityRecordNameResult[]>;
83
+ GetEntityRecordName(entityName: string, recordId: number): Promise<string>;
84
+ protected GetEntityRecordNameSQL(entityName: string, recordId: number): string;
85
+ CreateTransactionGroup(): Promise<TransactionGroupBase>;
86
+ /**************************************************************************/
87
+ /**************************************************************************/
88
+ protected get Metadata(): IMetadataProvider;
89
+ }