dbgate-datalib 5.5.4-alpha.8 → 5.5.5
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/lib/ChangeSet.d.ts +53 -0
- package/lib/ChangeSet.js +5 -1
- package/lib/GridDisplay.js +2 -2
- package/lib/JslGridDisplay.d.ts +2 -1
- package/lib/JslGridDisplay.js +2 -2
- package/package.json +5 -5
package/lib/ChangeSet.d.ts
CHANGED
|
@@ -54,3 +54,56 @@ export declare function changeSetInsertNewRow(changeSet: ChangeSet, name?: Named
|
|
|
54
54
|
export declare function changeSetInsertDocuments(changeSet: ChangeSet, documents: any[], name?: NamedObjectInfo, insertIfNotExistsFieldNames?: string[]): ChangeSet;
|
|
55
55
|
export declare function changeSetContainsChanges(changeSet: ChangeSet): boolean;
|
|
56
56
|
export declare function changeSetChangedCount(changeSet: ChangeSet): number;
|
|
57
|
+
export declare function removeSchemaFromChangeSet(changeSet: ChangeSet): {
|
|
58
|
+
inserts: {
|
|
59
|
+
schemaName: any;
|
|
60
|
+
pureName: string;
|
|
61
|
+
insertedRowIndex?: number;
|
|
62
|
+
existingRowIndex?: number;
|
|
63
|
+
document?: any;
|
|
64
|
+
condition?: {
|
|
65
|
+
[column: string]: string;
|
|
66
|
+
};
|
|
67
|
+
fields?: {
|
|
68
|
+
[column: string]: string;
|
|
69
|
+
};
|
|
70
|
+
insertIfNotExistsFields?: {
|
|
71
|
+
[column: string]: string;
|
|
72
|
+
};
|
|
73
|
+
}[];
|
|
74
|
+
updates: {
|
|
75
|
+
schemaName: any;
|
|
76
|
+
pureName: string;
|
|
77
|
+
insertedRowIndex?: number;
|
|
78
|
+
existingRowIndex?: number;
|
|
79
|
+
document?: any;
|
|
80
|
+
condition?: {
|
|
81
|
+
[column: string]: string;
|
|
82
|
+
};
|
|
83
|
+
fields?: {
|
|
84
|
+
[column: string]: string;
|
|
85
|
+
};
|
|
86
|
+
insertIfNotExistsFields?: {
|
|
87
|
+
[column: string]: string;
|
|
88
|
+
};
|
|
89
|
+
}[];
|
|
90
|
+
deletes: {
|
|
91
|
+
schemaName: any;
|
|
92
|
+
pureName: string;
|
|
93
|
+
insertedRowIndex?: number;
|
|
94
|
+
existingRowIndex?: number;
|
|
95
|
+
document?: any;
|
|
96
|
+
condition?: {
|
|
97
|
+
[column: string]: string;
|
|
98
|
+
};
|
|
99
|
+
fields?: {
|
|
100
|
+
[column: string]: string;
|
|
101
|
+
};
|
|
102
|
+
insertIfNotExistsFields?: {
|
|
103
|
+
[column: string]: string;
|
|
104
|
+
};
|
|
105
|
+
}[];
|
|
106
|
+
structure?: TableInfo;
|
|
107
|
+
dataUpdateCommands?: JsonDataObjectUpdateCommand[];
|
|
108
|
+
setColumnMode?: "fixed" | "variable";
|
|
109
|
+
};
|
package/lib/ChangeSet.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.changeSetChangedCount = exports.changeSetContainsChanges = exports.changeSetInsertDocuments = exports.changeSetInsertNewRow = exports.getChangeSetInsertedRows = exports.deleteChangeSetRows = exports.revertChangeSetRowChanges = exports.changeSetToSql = exports.extractChangeSetCondition = exports.batchUpdateChangeSet = exports.setChangeSetRowData = exports.setChangeSetValue = exports.findExistingChangeSetItem = exports.createChangeSet = void 0;
|
|
6
|
+
exports.removeSchemaFromChangeSet = exports.changeSetChangedCount = exports.changeSetContainsChanges = exports.changeSetInsertDocuments = exports.changeSetInsertNewRow = exports.getChangeSetInsertedRows = exports.deleteChangeSetRows = exports.revertChangeSetRowChanges = exports.changeSetToSql = exports.extractChangeSetCondition = exports.batchUpdateChangeSet = exports.setChangeSetRowData = exports.setChangeSetValue = exports.findExistingChangeSetItem = exports.createChangeSet = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
function createChangeSet() {
|
|
9
9
|
return {
|
|
@@ -392,3 +392,7 @@ function changeSetChangedCount(changeSet) {
|
|
|
392
392
|
return changeSet.deletes.length + changeSet.updates.length + changeSet.inserts.length;
|
|
393
393
|
}
|
|
394
394
|
exports.changeSetChangedCount = changeSetChangedCount;
|
|
395
|
+
function removeSchemaFromChangeSet(changeSet) {
|
|
396
|
+
return Object.assign(Object.assign({}, changeSet), { inserts: changeSet.inserts.map(x => (Object.assign(Object.assign({}, x), { schemaName: undefined }))), updates: changeSet.updates.map(x => (Object.assign(Object.assign({}, x), { schemaName: undefined }))), deletes: changeSet.deletes.map(x => (Object.assign(Object.assign({}, x), { schemaName: undefined }))) });
|
|
397
|
+
}
|
|
398
|
+
exports.removeSchemaFromChangeSet = removeSchemaFromChangeSet;
|
package/lib/GridDisplay.js
CHANGED
|
@@ -95,10 +95,10 @@ class GridDisplay {
|
|
|
95
95
|
}
|
|
96
96
|
const { field, uniqueName, isIncluded } = modification;
|
|
97
97
|
if (isIncluded) {
|
|
98
|
-
res = Object.assign(Object.assign({}, res), { [field]: [...(cfg[field] || []), uniqueName] });
|
|
98
|
+
res = Object.assign(Object.assign({}, res), { [field]: lodash_1.default.uniq([...(cfg[field] || []), uniqueName]) });
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
|
-
res = Object.assign(Object.assign({}, res), { [field]: (cfg[field] || []).filter(x => x != uniqueName) });
|
|
101
|
+
res = Object.assign(Object.assign({}, res), { [field]: lodash_1.default.uniq((cfg[field] || []).filter(x => x != uniqueName)) });
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return res;
|
package/lib/JslGridDisplay.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
|
|
2
2
|
import { GridConfig, GridCache } from './GridConfig';
|
|
3
|
+
import { EngineDriver } from 'dbgate-types';
|
|
3
4
|
export declare class JslGridDisplay extends GridDisplay {
|
|
4
|
-
constructor(jslid: any, structure: any, config: GridConfig, setConfig: ChangeConfigFunc, cache: GridCache, setCache: ChangeCacheFunc, rows: any, isDynamicStructure: boolean, supportsReload: boolean, editable?: boolean);
|
|
5
|
+
constructor(jslid: any, structure: any, config: GridConfig, setConfig: ChangeConfigFunc, cache: GridCache, setCache: ChangeCacheFunc, rows: any, isDynamicStructure: boolean, supportsReload: boolean, editable?: boolean, driver?: EngineDriver);
|
|
5
6
|
}
|
package/lib/JslGridDisplay.js
CHANGED
|
@@ -9,9 +9,9 @@ const GridDisplay_1 = require("./GridDisplay");
|
|
|
9
9
|
const CollectionGridDisplay_1 = require("./CollectionGridDisplay");
|
|
10
10
|
const dbgate_tools_1 = require("dbgate-tools");
|
|
11
11
|
class JslGridDisplay extends GridDisplay_1.GridDisplay {
|
|
12
|
-
constructor(jslid, structure, config, setConfig, cache, setCache, rows, isDynamicStructure, supportsReload, editable = false) {
|
|
12
|
+
constructor(jslid, structure, config, setConfig, cache, setCache, rows, isDynamicStructure, supportsReload, editable = false, driver = null) {
|
|
13
13
|
var _a;
|
|
14
|
-
super(config, setConfig, cache, setCache,
|
|
14
|
+
super(config, setConfig, cache, setCache, driver);
|
|
15
15
|
this.filterable = true;
|
|
16
16
|
this.sortable = true;
|
|
17
17
|
this.supportsReload = supportsReload;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.5.
|
|
2
|
+
"version": "5.5.5",
|
|
3
3
|
"name": "dbgate-datalib",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"lib"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"dbgate-sqltree": "^5.5.
|
|
17
|
-
"dbgate-tools": "^5.5.
|
|
18
|
-
"dbgate-filterparser": "^5.5.
|
|
16
|
+
"dbgate-sqltree": "^5.5.5",
|
|
17
|
+
"dbgate-tools": "^5.5.5",
|
|
18
|
+
"dbgate-filterparser": "^5.5.5",
|
|
19
19
|
"uuid": "^3.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"dbgate-types": "^5.5.
|
|
22
|
+
"dbgate-types": "^5.5.5",
|
|
23
23
|
"@types/node": "^13.7.0",
|
|
24
24
|
"jest": "^28.1.3",
|
|
25
25
|
"ts-jest": "^28.0.7",
|