@memberjunction/core 2.53.0 → 2.54.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/databaseProviderBase.d.ts +46 -0
- package/dist/generic/databaseProviderBase.d.ts.map +1 -0
- package/dist/generic/databaseProviderBase.js +14 -0
- package/dist/generic/databaseProviderBase.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ProviderBase } from "./providerBase";
|
|
2
|
+
import { UserInfo } from "./securityInfo";
|
|
3
|
+
/**
|
|
4
|
+
* This class is a generic server-side provider class to abstract database operations
|
|
5
|
+
* on any database system and therefore be usable by server-side components that need to
|
|
6
|
+
* do database operations but do not want close coupling with a specific database provider
|
|
7
|
+
* like @see @memberjunction/sqlserver-dataprovider
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
10
|
+
/**
|
|
11
|
+
* Executes a SQL query with optional parameters and options.
|
|
12
|
+
* @param query
|
|
13
|
+
* @param parameters
|
|
14
|
+
* @param options
|
|
15
|
+
* @param contextUser
|
|
16
|
+
* @param T - The type of the result set
|
|
17
|
+
* @returns A promise that resolves to an array of results of type T
|
|
18
|
+
*/
|
|
19
|
+
abstract ExecuteSQL<T>(query: string, parameters?: any[], options?: ExecuteSQLOptions, contextUser?: UserInfo): Promise<Array<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Begins a transaction for the current database connection.
|
|
22
|
+
*/
|
|
23
|
+
abstract BeginTransaction(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Commits the current transaction.
|
|
26
|
+
*/
|
|
27
|
+
abstract CommitTransaction(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Rolls back the current transaction.
|
|
30
|
+
*/
|
|
31
|
+
abstract RollbackTransaction(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Configuration options for SQL execution with logging support
|
|
35
|
+
*/
|
|
36
|
+
export interface ExecuteSQLOptions {
|
|
37
|
+
/** Optional description for this SQL operation, used by logging, if logging is supported by the underlying provider */
|
|
38
|
+
description?: string;
|
|
39
|
+
/** If true, this statement will not be logged to any logging session */
|
|
40
|
+
ignoreLogging?: boolean;
|
|
41
|
+
/** Whether this is a data mutation operation (INSERT/UPDATE/DELETE or SP call that results in any data change) */
|
|
42
|
+
isMutation?: boolean;
|
|
43
|
+
/** Simple SQL fallback for loggers to emit logging of a simpler SQL statement that doesn't have extra functionality that isn't important for migrations or other logging purposes. */
|
|
44
|
+
simpleSQLFallback?: string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=databaseProviderBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseProviderBase.d.ts","sourceRoot":"","sources":["../../src/generic/databaseProviderBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;GAKG;AACH,8BAAsB,oBAAqB,SAAQ,YAAY;IAC3D;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjI;;OAEG;IACH,QAAQ,CAAC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,uHAAuH;IACvH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kHAAkH;IAClH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sLAAsL;IACtL,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseProviderBase = void 0;
|
|
4
|
+
const providerBase_1 = require("./providerBase");
|
|
5
|
+
/**
|
|
6
|
+
* This class is a generic server-side provider class to abstract database operations
|
|
7
|
+
* on any database system and therefore be usable by server-side components that need to
|
|
8
|
+
* do database operations but do not want close coupling with a specific database provider
|
|
9
|
+
* like @see @memberjunction/sqlserver-dataprovider
|
|
10
|
+
*/
|
|
11
|
+
class DatabaseProviderBase extends providerBase_1.ProviderBase {
|
|
12
|
+
}
|
|
13
|
+
exports.DatabaseProviderBase = DatabaseProviderBase;
|
|
14
|
+
//# sourceMappingURL=databaseProviderBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseProviderBase.js","sourceRoot":"","sources":["../../src/generic/databaseProviderBase.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAG9C;;;;;GAKG;AACH,MAAsB,oBAAqB,SAAQ,2BAAY;CA0B9D;AA1BD,oDA0BC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,5 +17,6 @@ export * from "./generic/queryInfo";
|
|
|
17
17
|
export * from "./generic/compositeKey";
|
|
18
18
|
export * from "./generic/authEvaluator";
|
|
19
19
|
export * from "./generic/metadataUtil";
|
|
20
|
+
export * from "./generic/databaseProviderBase";
|
|
20
21
|
export declare function SetProvider(provider: any): void;
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AAEvC,wBAAgB,WAAW,CAAC,QAAQ,KAAA,QAMnC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gCAAgC,CAAC;AAE/C,wBAAgB,WAAW,CAAC,QAAQ,KAAA,QAMnC"}
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __exportStar(require("./generic/queryInfo"), exports);
|
|
|
39
39
|
__exportStar(require("./generic/compositeKey"), exports);
|
|
40
40
|
__exportStar(require("./generic/authEvaluator"), exports);
|
|
41
41
|
__exportStar(require("./generic/metadataUtil"), exports);
|
|
42
|
+
__exportStar(require("./generic/databaseProviderBase"), exports);
|
|
42
43
|
function SetProvider(provider) {
|
|
43
44
|
metadata_1.Metadata.Provider = provider;
|
|
44
45
|
baseEntity_1.BaseEntity.Provider = provider;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,iDAA8C;AAC9C,iDAA8C;AAC9C,mDAAgD;AAChD,6CAA0C;AAE1C,qDAAmC;AACnC,qDAAmC;AACnC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,uDAAqC;AACrC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,yDAAuC;AACvC,6DAA2C;AAC3C,iDAA+B;AAC/B,oDAAkC;AAClC,sDAAoC;AACpC,yDAAuC;AACvC,0DAAwC;AACxC,yDAAuC;AAEvC,SAAgB,WAAW,CAAC,QAAQ;IAChC,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,uBAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,iBAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,qBAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,CAAC;AAND,kCAMC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,iDAA8C;AAC9C,iDAA8C;AAC9C,mDAAgD;AAChD,6CAA0C;AAE1C,qDAAmC;AACnC,qDAAmC;AACnC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,uDAAqC;AACrC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,yDAAuC;AACvC,6DAA2C;AAC3C,iDAA+B;AAC/B,oDAAkC;AAClC,sDAAoC;AACpC,yDAAuC;AACvC,0DAAwC;AACxC,yDAAuC;AAEvC,iEAA+C;AAE/C,SAAgB,WAAW,CAAC,QAAQ;IAChC,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,uBAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,iBAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,qBAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,CAAC;AAND,kCAMC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.54.0",
|
|
4
4
|
"description": "MemberJunction: Core Library including Metadata, Application, Entity Retrieval and Manipulation, and Utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/debug": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@memberjunction/global": "2.
|
|
23
|
+
"@memberjunction/global": "2.54.0",
|
|
24
24
|
"rxjs": "^7.8.1",
|
|
25
25
|
"zod": "^3.23.8",
|
|
26
26
|
"debug": "^4.4.0"
|