@resolveio/server-lib 8.1.1 → 8.1.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/collections/report-builder-dashboard-builder.collection.d.ts +7 -0
- package/collections/report-builder-dashboard-builder.collection.js +102 -0
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
- package/models/report-builder-dashboard-builder.model.d.ts +17 -0
- package/models/report-builder-dashboard-builder.model.js +4 -0
- package/models/report-builder-dashboard-builder.model.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Model, Document } from 'mongoose';
|
|
2
|
+
import { ReportBuilderReportModel } from '../models/report-builder-report.model';
|
|
3
|
+
interface ResolveIOModel extends ReportBuilderReportModel, Document {
|
|
4
|
+
}
|
|
5
|
+
export declare let ReportBuilderReports: Model<ResolveIOModel>;
|
|
6
|
+
export declare let ReportBuilderReportVersions: Model<ResolveIOModel>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ReportBuilderReportVersions = exports.ReportBuilderReports = void 0;
|
|
15
|
+
var mongoose_1 = require("mongoose");
|
|
16
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
17
|
+
var index_1 = require("../index");
|
|
18
|
+
var schema = {
|
|
19
|
+
_id: {
|
|
20
|
+
type: String,
|
|
21
|
+
optional: true
|
|
22
|
+
},
|
|
23
|
+
__v: {
|
|
24
|
+
type: Number,
|
|
25
|
+
optional: true
|
|
26
|
+
},
|
|
27
|
+
updatedAt: {
|
|
28
|
+
type: Date,
|
|
29
|
+
optional: true
|
|
30
|
+
},
|
|
31
|
+
createdAt: {
|
|
32
|
+
type: Date,
|
|
33
|
+
optional: true
|
|
34
|
+
},
|
|
35
|
+
name: {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
date_created: {
|
|
39
|
+
type: Date
|
|
40
|
+
},
|
|
41
|
+
user_created: {
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
num_rows: {
|
|
45
|
+
type: Number
|
|
46
|
+
},
|
|
47
|
+
num_columns: {
|
|
48
|
+
type: Number
|
|
49
|
+
},
|
|
50
|
+
reports: {
|
|
51
|
+
type: Array
|
|
52
|
+
},
|
|
53
|
+
'reports.$': {
|
|
54
|
+
type: Object
|
|
55
|
+
},
|
|
56
|
+
'reports.$.id_report': {
|
|
57
|
+
type: String
|
|
58
|
+
},
|
|
59
|
+
'reports.$.report_name': {
|
|
60
|
+
type: String
|
|
61
|
+
},
|
|
62
|
+
'reports.$.report_type': {
|
|
63
|
+
type: String
|
|
64
|
+
},
|
|
65
|
+
'reports.$.display_type': {
|
|
66
|
+
type: String
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var DefaultSchema = new mongoose_1.Schema(schema, {
|
|
70
|
+
skipVersioning: true,
|
|
71
|
+
versionKey: false,
|
|
72
|
+
timestamps: true
|
|
73
|
+
});
|
|
74
|
+
DefaultSchema.index({ name: 1 });
|
|
75
|
+
DefaultSchema.index({ date_created: 1 });
|
|
76
|
+
exports.ReportBuilderReports = null;
|
|
77
|
+
exports.ReportBuilderReportVersions = null;
|
|
78
|
+
initializeCollection();
|
|
79
|
+
function initializeCollection() {
|
|
80
|
+
if (index_1.ResolveIOServer.getMainDB()) {
|
|
81
|
+
exports.ReportBuilderReports = index_1.ResolveIOServer.getMainDB().model('report-builder-dashboard-builders', DefaultSchema);
|
|
82
|
+
var vSchema = __assign({}, schema);
|
|
83
|
+
vSchema._id = {
|
|
84
|
+
type: mongoose_1.Schema.Types.Mixed
|
|
85
|
+
};
|
|
86
|
+
var VersionSchema = new mongoose_1.Schema(vSchema, {
|
|
87
|
+
skipVersioning: true,
|
|
88
|
+
versionKey: false,
|
|
89
|
+
timestamps: true
|
|
90
|
+
});
|
|
91
|
+
exports.ReportBuilderReports['versionCollection'] = 'report-builder-dashboard-builders.versions';
|
|
92
|
+
exports.ReportBuilderReportVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderReports['versionCollection'], VersionSchema);
|
|
93
|
+
exports.ReportBuilderReports['simplschema'] = new simpl_schema_1.default(schema);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setTimeout(function () {
|
|
97
|
+
initializeCollection();
|
|
98
|
+
}, 0);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=report-builder-dashboard-builder.collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/report-builder-dashboard-builder.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,YAAY,EAAE;QACb,IAAI,EAAE,IAAI;KACV;IACD,YAAY,EAAE;QACb,IAAI,EAAE,MA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B,CAAC,CAAC;QAEH,4BAAoB,CAAC,mBAAmB,CAAC,GAAG,4CAA4C,CAAC;QAEzF,mCAA2B,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,4BAAoB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE1H,4BAAoB,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KAC/D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-dashboard-builder.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { ReportBuilderReportModel } from '../models/report-builder-report.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tdate_created: {\n\t\ttype: Date\n\t},\n\tuser_created: {\n\t\ttype: String\n\t},\n\tnum_rows: {\n\t\ttype: Number\n\t},\n\tnum_columns: {\n\t\ttype: Number\n\t},\n\treports: {\n\t\ttype: Array\n\t},\n\t'reports.$': {\n\t\ttype: Object\n\t},\n\t'reports.$.id_report': {\n\t\ttype: String\n\t},\n\t'reports.$.report_name': {\n\t\ttype: String\n\t},\n\t'reports.$.report_type': {\n\t\ttype: String\n\t},\n\t'reports.$.display_type': {\n\t\ttype: String\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({name: 1});\nDefaultSchema.index({date_created: 1});\n\ninterface ResolveIOModel extends ReportBuilderReportModel, Document {}\n\nexport let ReportBuilderReports: Model<ResolveIOModel> = null;\nexport let ReportBuilderReportVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tReportBuilderReports = ResolveIOServer.getMainDB().model('report-builder-dashboard-builders', DefaultSchema);\n\n\t\tlet vSchema = { ...schema };\n\t\tvSchema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(vSchema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tReportBuilderReports['versionCollection'] = 'report-builder-dashboard-builders.versions';\n\n\t\tReportBuilderReportVersions = ResolveIOServer.getMainDB().model(ReportBuilderReports['versionCollection'], VersionSchema);\n\n\t\tReportBuilderReports['simplschema'] = new SimpleSchema(schema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CollectionDocument } from './collection-document.model';
|
|
2
|
+
import { ReportBuilderReportType } from './report-builder-report.model';
|
|
3
|
+
export interface ReportBuilderDashboardBuilder extends CollectionDocument {
|
|
4
|
+
name: string;
|
|
5
|
+
date_created: Date;
|
|
6
|
+
user_created: string;
|
|
7
|
+
num_rows: number;
|
|
8
|
+
num_columns: number;
|
|
9
|
+
reports: ReportBuilderDashboardBuilderReportModel[];
|
|
10
|
+
}
|
|
11
|
+
export interface ReportBuilderDashboardBuilderReportModel {
|
|
12
|
+
id_report: string;
|
|
13
|
+
report_name: string;
|
|
14
|
+
report_type: ReportBuilderReportType;
|
|
15
|
+
display_type: ReportBuilderDashboardBuilderReportDisplayType;
|
|
16
|
+
}
|
|
17
|
+
export declare type ReportBuilderDashboardBuilderReportDisplayType = 'Data' | 'Bar' | 'Line' | 'Pie';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/report-builder-dashboard-builder.model.ts"],"names":[],"mappings":"","file":"report-builder-dashboard-builder.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\nimport { ReportBuilderReportType } from './report-builder-report.model';\n\nexport interface ReportBuilderDashboardBuilder extends CollectionDocument {\n\tname: string;\n\tdate_created: Date;\n\tuser_created: string;\n\tnum_rows: number;\n\tnum_columns: number;\n\treports: ReportBuilderDashboardBuilderReportModel[];\n}\n\nexport interface ReportBuilderDashboardBuilderReportModel {\n\tid_report: string;\n\treport_name: string;\n\treport_type: ReportBuilderReportType;\n\tdisplay_type: ReportBuilderDashboardBuilderReportDisplayType;\n}\n\nexport type ReportBuilderDashboardBuilderReportDisplayType = 'Data' | 'Bar' | 'Line' | 'Pie';"]}
|