@resolveio/server-lib 22.2.3 → 22.2.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.
@@ -0,0 +1,3 @@
1
+ import { MongoManagerCollection } from '../managers/mongo.manager';
2
+ import { AppSettingModel } from '../models/app-setting.model';
3
+ export declare let AppSettings: MongoManagerCollection<AppSettingModel>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppSettings = void 0;
4
+ var mongo_manager_1 = require("../managers/mongo.manager");
5
+ var resolveio_server_app_1 = require("../resolveio-server-app");
6
+ var schema = {
7
+ _id: {
8
+ type: String,
9
+ optional: true
10
+ },
11
+ __v: {
12
+ type: Number,
13
+ optional: true
14
+ },
15
+ updatedAt: {
16
+ type: Date,
17
+ optional: true
18
+ },
19
+ createdAt: {
20
+ type: Date,
21
+ optional: true
22
+ },
23
+ company_name: {
24
+ type: String,
25
+ optional: true
26
+ },
27
+ timezone: {
28
+ type: String,
29
+ optional: true
30
+ },
31
+ currency: {
32
+ type: String,
33
+ optional: true
34
+ },
35
+ invoice_prefix: {
36
+ type: String,
37
+ optional: true
38
+ },
39
+ support_email: {
40
+ type: String,
41
+ optional: true
42
+ },
43
+ support_phone: {
44
+ type: String,
45
+ optional: true
46
+ },
47
+ support_address: {
48
+ type: String,
49
+ optional: true
50
+ },
51
+ notes: {
52
+ type: String,
53
+ optional: true
54
+ },
55
+ enable_ai: {
56
+ type: Boolean,
57
+ optional: true
58
+ },
59
+ enable_auto_fix: {
60
+ type: Boolean,
61
+ optional: true
62
+ },
63
+ enable_slow_query_optimizer: {
64
+ type: Boolean,
65
+ optional: true
66
+ },
67
+ custom_settings: {
68
+ type: Object,
69
+ optional: true,
70
+ blackbox: true
71
+ },
72
+ is_active: {
73
+ type: Boolean,
74
+ optional: true
75
+ }
76
+ };
77
+ exports.AppSettings = null;
78
+ initializeCollection();
79
+ function initializeCollection() {
80
+ if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
81
+ var model = mongo_manager_1.MongoManagerModel.create({
82
+ collectionName: 'app-settings',
83
+ schema: schema,
84
+ useVersionCollection: true,
85
+ useReportBuilder: false,
86
+ reportBuilderLookupTables: [],
87
+ timestamps: true,
88
+ createLogs: true,
89
+ checkSchema: true,
90
+ collectionOptions: null
91
+ });
92
+ exports.AppSettings = model.collection_main;
93
+ exports.AppSettings.createIndex({ company_name: 1 });
94
+ exports.AppSettings.createIndex({ is_active: 1 });
95
+ }
96
+ else {
97
+ setImmediate(function () {
98
+ initializeCollection();
99
+ });
100
+ }
101
+ }
102
+
103
+ //# sourceMappingURL=app-setting.collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/collections/app-setting.collection.ts"],"names":[],"mappings":";;;AAAA,2DAAsF;AAEtF,gEAA0D;AAE1D,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,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,cAAc,EAAE;QACf,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,aAAa,EAAE;QACd,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KAC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C,EAAE,CAAC,CAAC;IAC3C,CAAC;SACI,CAAC;QACL,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","file":"app-setting.collection.js","sourcesContent":["import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { AppSettingModel } from '../models/app-setting.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\tcompany_name: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\ttimezone: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcurrency: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tinvoice_prefix: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tsupport_email: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tsupport_phone: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tsupport_address: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tnotes: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tenable_ai: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tenable_auto_fix: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tenable_slow_query_optimizer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tcustom_settings: {\n\t\ttype: Object,\n\t\toptional: true,\n\t\tblackbox: true\n\t},\n\tis_active: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let AppSettings: MongoManagerCollection<AppSettingModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<AppSettingModel>({\n\t\t\tcollectionName: 'app-settings',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\n\t\tAppSettings = model.collection_main;\n\t\tAppSettings.createIndex({ company_name: 1 });\n\t\tAppSettings.createIndex({ is_active: 1 });\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}\n"]}
@@ -97,6 +97,7 @@ var log_collection_1 = require("../collections/log.collection");
97
97
  var cron_jobs_1 = require("../fixtures/cron-jobs");
98
98
  var init_1 = require("../fixtures/init");
99
99
  var accounts_1 = require("../methods/accounts");
100
+ var app_settings_1 = require("../methods/app-settings");
100
101
  var aws_1 = require("../methods/aws");
101
102
  var ai_terminal_1 = require("../methods/ai-terminal");
102
103
  var collections_1 = require("../methods/collections");
@@ -344,6 +345,7 @@ var MethodManager = /** @class */ (function () {
344
345
  // Methods
345
346
  _a.sent();
346
347
  (0, accounts_1.loadAccountMethods)(this);
348
+ (0, app_settings_1.loadAppSettingsMethods)(this);
347
349
  (0, aws_1.loadAWSMethods)(this);
348
350
  (0, ai_terminal_1.loadAiTerminalMethods)(this);
349
351
  (0, collections_1.loadCollectionMethods)(this);
@@ -786,7 +788,7 @@ var MethodManager = /** @class */ (function () {
786
788
  messageId: 0,
787
789
  route: '',
788
790
  client: 'ResolveIO',
789
- instance: 'backend.resolveio.com',
791
+ instance: resolveio_server_app_1.ResolveIOServer.getInstanceHost(),
790
792
  instance_index: process.env.NODE_APP_INSTANCE || '0',
791
793
  correlationId: correlationId
792
794
  })];