@steedos/objectql 2.2.51-beta.1 → 2.2.51-beta.2
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/package.json +10 -10
- package/src/actions/field_updates.ts +0 -118
- package/src/actions/index.ts +0 -3
- package/src/actions/types/field_update_target.ts +0 -7
- package/src/actions/types/workflow_notification.ts +0 -9
- package/src/actions/types/workflow_rule.ts +0 -11
- package/src/actions/workflow_notifications.ts +0 -81
- package/src/actions/workflow_rule.ts +0 -136
- package/src/driver/driver.ts +0 -102
- package/src/driver/field-encrytion/index.ts +0 -8
- package/src/driver/field-encrytion/sharedconst.ts +0 -34
- package/src/driver/fieldDBType.ts +0 -14
- package/src/driver/format.ts +0 -36
- package/src/driver/index.ts +0 -20
- package/src/driver/metadata.ts +0 -226
- package/src/driver/meteorMongo.ts +0 -639
- package/src/driver/mongo.ts +0 -416
- package/src/driver/mysql.ts +0 -47
- package/src/driver/oracle.ts +0 -60
- package/src/driver/postgres.ts +0 -46
- package/src/driver/sqlite3.ts +0 -40
- package/src/driver/sqlserver.ts +0 -52
- package/src/dynamic-load/actions.ts +0 -146
- package/src/dynamic-load/approval_process.ts +0 -73
- package/src/dynamic-load/button.ts +0 -75
- package/src/dynamic-load/chart.ts +0 -22
- package/src/dynamic-load/client_script.ts +0 -65
- package/src/dynamic-load/field.ts +0 -77
- package/src/dynamic-load/flow_role.ts +0 -46
- package/src/dynamic-load/index.ts +0 -21
- package/src/dynamic-load/layout.ts +0 -53
- package/src/dynamic-load/listview.ts +0 -57
- package/src/dynamic-load/method.ts +0 -63
- package/src/dynamic-load/object_translations.ts +0 -61
- package/src/dynamic-load/originalObject.ts +0 -8
- package/src/dynamic-load/package.ts +0 -312
- package/src/dynamic-load/page.ts +0 -23
- package/src/dynamic-load/permission.ts +0 -71
- package/src/dynamic-load/permissionset.ts +0 -78
- package/src/dynamic-load/preload_data.ts +0 -104
- package/src/dynamic-load/profile.ts +0 -90
- package/src/dynamic-load/query.ts +0 -22
- package/src/dynamic-load/restrictionRules.ts +0 -23
- package/src/dynamic-load/role.ts +0 -46
- package/src/dynamic-load/shareRules.ts +0 -23
- package/src/dynamic-load/tab.ts +0 -17
- package/src/dynamic-load/tabs.ts +0 -13
- package/src/dynamic-load/translations.ts +0 -54
- package/src/dynamic-load/trigger.ts +0 -236
- package/src/dynamic-load/validation_rule.ts +0 -77
- package/src/dynamic-load/workflow.ts +0 -114
- package/src/errors/index.ts +0 -111
- package/src/formula/core.ts +0 -490
- package/src/formula/field_formula.ts +0 -107
- package/src/formula/index.ts +0 -81
- package/src/formula/params.ts +0 -197
- package/src/formula/recompute.ts +0 -65
- package/src/formula/simple_params.ts +0 -92
- package/src/formula/type.ts +0 -107
- package/src/formula/util.ts +0 -207
- package/src/index.ts +0 -24
- package/src/metadata-register/_base.ts +0 -85
- package/src/metadata-register/app.ts +0 -30
- package/src/metadata-register/chart.ts +0 -9
- package/src/metadata-register/index.ts +0 -123
- package/src/metadata-register/layout.ts +0 -38
- package/src/metadata-register/object.ts +0 -68
- package/src/metadata-register/page.ts +0 -9
- package/src/metadata-register/permissionFields.ts +0 -13
- package/src/metadata-register/permissionset.ts +0 -25
- package/src/metadata-register/process.ts +0 -16
- package/src/metadata-register/processTrigger.ts +0 -24
- package/src/metadata-register/profile.ts +0 -25
- package/src/metadata-register/query.ts +0 -9
- package/src/metadata-register/restrictionRules.ts +0 -12
- package/src/metadata-register/shareRules.ts +0 -13
- package/src/metadata-register/tab.ts +0 -9
- package/src/metadata-register/tabs.ts +0 -43
- package/src/services/datasourceServiceFactory.ts +0 -55
- package/src/services/helpers/graphql/consts.ts +0 -25
- package/src/services/helpers/graphql/getPrimaryFieldType.ts +0 -48
- package/src/services/helpers/graphql/getQueryFields.ts +0 -51
- package/src/services/helpers/graphql/index.ts +0 -666
- package/src/services/helpers/rest.ts +0 -57
- package/src/services/index.ts +0 -13
- package/src/services/objectService.ts +0 -846
- package/src/services/objectServiceDispatcher.ts +0 -209
- package/src/services/objectServiceFactory.ts +0 -29
- package/src/summary/core.ts +0 -263
- package/src/summary/field_summary.ts +0 -71
- package/src/summary/index.ts +0 -96
- package/src/summary/recompute.ts +0 -31
- package/src/summary/type.ts +0 -60
- package/src/ts-types/index.ts +0 -3
- package/src/ts-types/permissionset.ts +0 -8
- package/src/ts-types/profile.ts +0 -11
- package/src/ts-types/triggerActionParams.ts +0 -22
- package/src/typeorm/driver.ts +0 -379
- package/src/typeorm/index.ts +0 -3
- package/src/typeorm/util.ts +0 -147
- package/src/types/action.ts +0 -52
- package/src/types/app.ts +0 -280
- package/src/types/config.ts +0 -152
- package/src/types/connection.ts +0 -87
- package/src/types/dashboard.ts +0 -91
- package/src/types/datasource.ts +0 -570
- package/src/types/field.ts +0 -370
- package/src/types/field_permission.ts +0 -42
- package/src/types/field_types.ts +0 -1
- package/src/types/index.ts +0 -21
- package/src/types/list_view.ts +0 -56
- package/src/types/listeners.ts +0 -18
- package/src/types/object.ts +0 -2076
- package/src/types/object_dynamic_load.ts +0 -426
- package/src/types/object_events.ts +0 -43
- package/src/types/object_layouts.ts +0 -20
- package/src/types/object_permission.ts +0 -134
- package/src/types/query.ts +0 -28
- package/src/types/report.ts +0 -128
- package/src/types/restrictionRule.ts +0 -57
- package/src/types/schema.ts +0 -273
- package/src/types/shareRule.ts +0 -57
- package/src/types/trigger.ts +0 -88
- package/src/types/userSession.ts +0 -45
- package/src/types/validation_rules.ts +0 -29
- package/src/util/convert.ts +0 -131
- package/src/util/field.ts +0 -93
- package/src/util/function_expression.ts +0 -63
- package/src/util/index.ts +0 -1066
- package/src/util/locale.ts +0 -24
- package/src/util/permission_shares.ts +0 -25
- package/src/util/suffix.ts +0 -78
- package/src/util/transform.ts +0 -239
- package/src/validators/index.ts +0 -36
package/src/driver/metadata.ts
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from "@salesforce/ts-types";
|
|
2
|
-
import { SteedosDriver } from ".";
|
|
3
|
-
import { SteedosQueryOptions, SteedosIDType, SteedosObjectType } from "../types";
|
|
4
|
-
import { SteedosDriverConfig } from "./driver";
|
|
5
|
-
import { SteedosFieldDBType } from "./fieldDBType";
|
|
6
|
-
import mingo = require('mingo');
|
|
7
|
-
import steedosFilters = require('@steedos/filters');
|
|
8
|
-
import odataV4Mongodb = require('odata-v4-mongodb');
|
|
9
|
-
import clone = require("clone");
|
|
10
|
-
import _ = require('underscore');
|
|
11
|
-
|
|
12
|
-
export class MetadataDriver implements SteedosDriver {
|
|
13
|
-
databaseVersion?: string;
|
|
14
|
-
config?: SteedosDriverConfig;
|
|
15
|
-
connect() {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
close() {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
formatFiltersToMongoQuery(filters) {
|
|
23
|
-
let emptyFilters = {};
|
|
24
|
-
let odataQuery = "";
|
|
25
|
-
if (_.isString(filters)) {
|
|
26
|
-
odataQuery = filters;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
odataQuery = steedosFilters.formatFiltersToODataQuery(filters)
|
|
30
|
-
}
|
|
31
|
-
if(!odataQuery){
|
|
32
|
-
return emptyFilters;
|
|
33
|
-
}
|
|
34
|
-
let query = odataV4Mongodb.createFilter(odataQuery);
|
|
35
|
-
return query;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
getMongoFilters(filters) {
|
|
39
|
-
let emptyFilters = {};
|
|
40
|
-
if (_.isUndefined(filters)) {
|
|
41
|
-
return emptyFilters;
|
|
42
|
-
}
|
|
43
|
-
if (_.isString(filters) && !filters.length) {
|
|
44
|
-
return emptyFilters
|
|
45
|
-
}
|
|
46
|
-
if (_.isArray(filters) && !filters.length) {
|
|
47
|
-
return emptyFilters
|
|
48
|
-
}
|
|
49
|
-
let mongoFilters = this.formatFiltersToMongoQuery(filters);
|
|
50
|
-
return mongoFilters
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
getMongoFieldsOptions(fields) {
|
|
54
|
-
if (typeof fields == "string") {
|
|
55
|
-
fields = (fields).split(",").map((n) => { return n.trim(); });
|
|
56
|
-
}
|
|
57
|
-
if (!(fields && fields.length)) {
|
|
58
|
-
return {}
|
|
59
|
-
}
|
|
60
|
-
let projection = {
|
|
61
|
-
record_permissions: 1,
|
|
62
|
-
is_system: 1,
|
|
63
|
-
};
|
|
64
|
-
(fields).forEach((field) => {
|
|
65
|
-
if (field) {
|
|
66
|
-
projection[field] = 1;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return projection;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
getMongoOptions(options) {
|
|
73
|
-
if (_.isUndefined(options)) {
|
|
74
|
-
return {};
|
|
75
|
-
}
|
|
76
|
-
let result: any = {};
|
|
77
|
-
let projection = this.getMongoFieldsOptions(options.fields);
|
|
78
|
-
let sort = this.getMongoSortOptions(options.sort);
|
|
79
|
-
result.projection = projection;
|
|
80
|
-
result.sort = sort;
|
|
81
|
-
result.limit = options.top;
|
|
82
|
-
result.skip = options.skip;
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
getMongoSortOptions(sort) {
|
|
87
|
-
let result = undefined;
|
|
88
|
-
if (sort && typeof sort === "string") {
|
|
89
|
-
let arraySort= sort.split(",").map((n) => { return n.trim(); });
|
|
90
|
-
let stringSort = "";
|
|
91
|
-
arraySort.forEach((n) => {
|
|
92
|
-
if (n) {
|
|
93
|
-
stringSort += `${n},`
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
stringSort = stringSort.replace(/,$/g, "");
|
|
97
|
-
result = odataV4Mongodb.createQuery(`$orderby=${stringSort}`).sort;
|
|
98
|
-
}
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
getAggregateOptions(options){
|
|
103
|
-
if (_.isUndefined(options)) {
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
let result = [];
|
|
107
|
-
let projection = this.getMongoFieldsOptions(options.fields);
|
|
108
|
-
let sort = this.getMongoSortOptions(options.sort);
|
|
109
|
-
if (!_.isEmpty(projection)) {
|
|
110
|
-
result.push({ $project: projection });
|
|
111
|
-
}
|
|
112
|
-
if (!_.isEmpty(sort)) {
|
|
113
|
-
result.push({ $sort: sort });
|
|
114
|
-
}
|
|
115
|
-
if (options.skip) {
|
|
116
|
-
result.push({ $skip: options.skip });
|
|
117
|
-
}
|
|
118
|
-
if (options.top) {
|
|
119
|
-
result.push({ $limit: options.top });
|
|
120
|
-
}
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
queryMetadata(collection, queryOptions, spaceId){
|
|
125
|
-
const _collection = clone(collection);
|
|
126
|
-
_.each(_collection, function(item) {
|
|
127
|
-
try {
|
|
128
|
-
item.space = spaceId;
|
|
129
|
-
} catch (error) {
|
|
130
|
-
console.error(`metadata driver queryMetadata: ${item} is not json data`);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
let mongoFilters = this.getMongoFilters(queryOptions.filters);
|
|
134
|
-
let mongoOptions = this.getMongoOptions(queryOptions);
|
|
135
|
-
// console.log(`mongoFilters`, JSON.stringify(mongoFilters));
|
|
136
|
-
// console.log(`mongoOptions`, mongoOptions);
|
|
137
|
-
let query = new mingo.Query(mongoFilters)
|
|
138
|
-
let projection = queryOptions.projection ? Object.assign({}, queryOptions.projection, {
|
|
139
|
-
record_permissions: 1,
|
|
140
|
-
is_system: 1,
|
|
141
|
-
}) : null;
|
|
142
|
-
let cursor = query.find(_collection, projection); //, mongoOptions.projection
|
|
143
|
-
if(mongoOptions.sort){
|
|
144
|
-
cursor.sort(mongoOptions.sort)
|
|
145
|
-
}
|
|
146
|
-
// if(mongoOptions.skip){
|
|
147
|
-
// cursor.skip(mongoOptions.skip)
|
|
148
|
-
// }
|
|
149
|
-
// if(mongoOptions.limit){
|
|
150
|
-
// cursor.limit(mongoOptions.limit)
|
|
151
|
-
// }
|
|
152
|
-
return cursor;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
getSupportedColumnTypes(): SteedosFieldDBType[] {
|
|
157
|
-
throw new Error("Method not implemented.");
|
|
158
|
-
}
|
|
159
|
-
find(collection: any, query: SteedosQueryOptions, spaceId?: SteedosIDType) {
|
|
160
|
-
const result = this.queryMetadata(collection, query, spaceId).all();
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
aggregate(collection: any, query: SteedosQueryOptions, externalPipeline: any, spaceId?: SteedosIDType) {
|
|
164
|
-
const result = this.queryMetadata(collection, query, spaceId).all();
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
findOne(collection: any, id: SteedosIDType, query: SteedosQueryOptions, spaceId?: SteedosIDType) {
|
|
168
|
-
throw new Error("Method not implemented.");
|
|
169
|
-
}
|
|
170
|
-
insert(collection: any, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
171
|
-
throw new Error("Method not implemented.");
|
|
172
|
-
}
|
|
173
|
-
update(collection: any, id: SteedosQueryOptions | SteedosIDType, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
174
|
-
throw new Error("Method not implemented.");
|
|
175
|
-
}
|
|
176
|
-
updateOne(collection: any, id: SteedosQueryOptions | SteedosIDType, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
177
|
-
throw new Error("Method not implemented.");
|
|
178
|
-
}
|
|
179
|
-
updateMany?(collection: any, queryFilters: any, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
180
|
-
throw new Error("Method not implemented.");
|
|
181
|
-
}
|
|
182
|
-
delete(collection: any, id: SteedosQueryOptions | SteedosIDType, spaceId?: SteedosIDType) {
|
|
183
|
-
throw new Error("Method not implemented.");
|
|
184
|
-
}
|
|
185
|
-
directUpdate(collection: any, id: SteedosQueryOptions | SteedosIDType, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
186
|
-
throw new Error("Method not implemented.");
|
|
187
|
-
}
|
|
188
|
-
directFind(collection: any, query: SteedosQueryOptions, spaceId?: SteedosIDType) {
|
|
189
|
-
throw new Error("Method not implemented.");
|
|
190
|
-
}
|
|
191
|
-
directInsert(collection: any, doc: Dictionary<any>, spaceId?: SteedosIDType) {
|
|
192
|
-
throw new Error("Method not implemented.");
|
|
193
|
-
}
|
|
194
|
-
directDelete(collection: any, id: SteedosQueryOptions | SteedosIDType, spaceId?: SteedosIDType) {
|
|
195
|
-
throw new Error("Method not implemented.");
|
|
196
|
-
}
|
|
197
|
-
directAggregate?(collection: any, query: SteedosQueryOptions, externalPipeline: any, spaceId?: SteedosIDType) {
|
|
198
|
-
throw new Error("Method not implemented.");
|
|
199
|
-
}
|
|
200
|
-
directAggregatePrefixalPipeline?(collection: any, query: SteedosQueryOptions, prefixalPipeline: any, spaceId?: SteedosIDType) {
|
|
201
|
-
throw new Error("Method not implemented.");
|
|
202
|
-
}
|
|
203
|
-
count(collection: any, query: SteedosQueryOptions, spaceId?: SteedosIDType) {
|
|
204
|
-
const result = this.queryMetadata(collection, query, spaceId).count();
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
dropEntities?() {
|
|
208
|
-
throw new Error("Method not implemented.");
|
|
209
|
-
}
|
|
210
|
-
registerEntities?(objects: Dictionary<SteedosObjectType>) {
|
|
211
|
-
throw new Error("Method not implemented.");
|
|
212
|
-
}
|
|
213
|
-
dropTables?() {
|
|
214
|
-
throw new Error("Method not implemented.");
|
|
215
|
-
}
|
|
216
|
-
createTables?(objects: Dictionary<SteedosObjectType>) {
|
|
217
|
-
throw new Error("Method not implemented.");
|
|
218
|
-
}
|
|
219
|
-
init(objects: Dictionary<SteedosObjectType>) {
|
|
220
|
-
throw new Error("Method not implemented.");
|
|
221
|
-
}
|
|
222
|
-
_makeNewID?(tableName?: string) {
|
|
223
|
-
throw new Error("Method not implemented.");
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
}
|