cloud-ide-model-schema 1.1.108 → 1.1.109
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/schema/index.d.ts +1 -0
- package/lib/schema/index.js +1 -0
- package/lib/schema/system/api_keys.d.ts +26 -0
- package/lib/schema/system/api_keys.js +75 -0
- package/lib/schema/system/backup_jobs.d.ts +39 -0
- package/lib/schema/system/backup_jobs.js +114 -0
- package/lib/schema/system/backup_policies.d.ts +23 -0
- package/lib/schema/system/backup_policies.js +68 -0
- package/lib/schema/system/backup_records.d.ts +29 -0
- package/lib/schema/system/backup_records.js +78 -0
- package/lib/schema/system/index.d.ts +12 -0
- package/lib/schema/system/index.js +28 -0
- package/lib/schema/system/integration_logs.d.ts +21 -0
- package/lib/schema/system/integration_logs.js +62 -0
- package/lib/schema/system/integrations.d.ts +31 -0
- package/lib/schema/system/integrations.js +80 -0
- package/lib/schema/system/recovery_operations.d.ts +23 -0
- package/lib/schema/system/recovery_operations.js +66 -0
- package/lib/schema/system/subscription_features.d.ts +19 -0
- package/lib/schema/system/subscription_features.js +54 -0
- package/lib/schema/system/subscription_payments.d.ts +25 -0
- package/lib/schema/system/subscription_payments.js +83 -0
- package/lib/schema/system/subscription_plans.d.ts +27 -0
- package/lib/schema/system/subscription_plans.js +93 -0
- package/lib/schema/system/subscriptions.d.ts +26 -0
- package/lib/schema/system/subscriptions.js +79 -0
- package/lib/schema/system/webhooks.d.ts +28 -0
- package/lib/schema/system/webhooks.js +87 -0
- package/package.json +1 -1
package/lib/schema/index.d.ts
CHANGED
package/lib/schema/index.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IApiKey {
|
|
3
|
+
_id?: string;
|
|
4
|
+
akey_name: string;
|
|
5
|
+
akey_api_key: string;
|
|
6
|
+
akey_api_secret?: string;
|
|
7
|
+
akey_permissions: string[];
|
|
8
|
+
akey_rate_limit?: {
|
|
9
|
+
requests_per_minute?: number;
|
|
10
|
+
requests_per_hour?: number;
|
|
11
|
+
requests_per_day?: number;
|
|
12
|
+
};
|
|
13
|
+
akey_expiry_date?: Date;
|
|
14
|
+
akey_last_used?: Date;
|
|
15
|
+
akey_status: 'active' | 'revoked' | 'expired';
|
|
16
|
+
akey_created_by?: string;
|
|
17
|
+
akey_created_at?: Date;
|
|
18
|
+
akey_updated_at?: Date;
|
|
19
|
+
akey_isactive?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const CApiKey: mongoose.Model<IApiKey, {}, {}, {}, mongoose.Document<unknown, {}, IApiKey, {}> & IApiKey & Required<{
|
|
22
|
+
_id: string;
|
|
23
|
+
}> & {
|
|
24
|
+
__v: number;
|
|
25
|
+
}, any>;
|
|
26
|
+
export { CApiKey };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CApiKey = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var api_keys = new mongoose_1.Schema({
|
|
6
|
+
akey_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true
|
|
11
|
+
},
|
|
12
|
+
akey_api_key: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
maxlength: 500,
|
|
16
|
+
unique: true
|
|
17
|
+
},
|
|
18
|
+
akey_api_secret: {
|
|
19
|
+
type: String,
|
|
20
|
+
maxlength: 500
|
|
21
|
+
},
|
|
22
|
+
akey_permissions: {
|
|
23
|
+
type: [String],
|
|
24
|
+
default: []
|
|
25
|
+
},
|
|
26
|
+
akey_rate_limit: {
|
|
27
|
+
requests_per_minute: {
|
|
28
|
+
type: Number,
|
|
29
|
+
min: 0
|
|
30
|
+
},
|
|
31
|
+
requests_per_hour: {
|
|
32
|
+
type: Number,
|
|
33
|
+
min: 0
|
|
34
|
+
},
|
|
35
|
+
requests_per_day: {
|
|
36
|
+
type: Number,
|
|
37
|
+
min: 0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
akey_expiry_date: {
|
|
41
|
+
type: Date
|
|
42
|
+
},
|
|
43
|
+
akey_last_used: {
|
|
44
|
+
type: Date
|
|
45
|
+
},
|
|
46
|
+
akey_status: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
enum: ['active', 'revoked', 'expired'],
|
|
50
|
+
default: 'active',
|
|
51
|
+
index: true
|
|
52
|
+
},
|
|
53
|
+
akey_created_by: {
|
|
54
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
55
|
+
ref: "auth_user_mst"
|
|
56
|
+
},
|
|
57
|
+
akey_created_at: {
|
|
58
|
+
type: Date,
|
|
59
|
+
default: Date.now
|
|
60
|
+
},
|
|
61
|
+
akey_updated_at: {
|
|
62
|
+
type: Date,
|
|
63
|
+
default: Date.now
|
|
64
|
+
},
|
|
65
|
+
akey_isactive: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
68
|
+
}
|
|
69
|
+
}, { collection: 'api_keys', timestamps: { createdAt: 'akey_created_at', updatedAt: 'akey_updated_at' } });
|
|
70
|
+
// Indexes
|
|
71
|
+
api_keys.index({ akey_name: 1 });
|
|
72
|
+
api_keys.index({ akey_status: 1 });
|
|
73
|
+
api_keys.index({ akey_api_key: 1 });
|
|
74
|
+
var CApiKey = mongoose_1.default.model("api_keys", api_keys);
|
|
75
|
+
exports.CApiKey = CApiKey;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IBackupJob {
|
|
3
|
+
_id?: string;
|
|
4
|
+
bjob_name: string;
|
|
5
|
+
bjob_backup_type: 'full' | 'incremental' | 'differential' | 'file';
|
|
6
|
+
bjob_schedule: {
|
|
7
|
+
frequency: 'daily' | 'weekly' | 'monthly' | 'hourly' | 'manual';
|
|
8
|
+
time?: string;
|
|
9
|
+
day_of_week?: number;
|
|
10
|
+
day_of_month?: number;
|
|
11
|
+
};
|
|
12
|
+
bjob_status: 'active' | 'paused' | 'disabled';
|
|
13
|
+
bjob_last_run?: Date;
|
|
14
|
+
bjob_next_run?: Date;
|
|
15
|
+
bjob_retention_days: number;
|
|
16
|
+
bjob_encryption_enabled: boolean;
|
|
17
|
+
bjob_compression_enabled: boolean;
|
|
18
|
+
bjob_storage_location: 'local' | 'cloud' | 'both';
|
|
19
|
+
bjob_cloud_provider?: 'aws' | 'azure' | 'gcp';
|
|
20
|
+
bjob_cloud_config?: {
|
|
21
|
+
bucket_name?: string;
|
|
22
|
+
region?: string;
|
|
23
|
+
access_key?: string;
|
|
24
|
+
};
|
|
25
|
+
bjob_include_collections?: string[];
|
|
26
|
+
bjob_exclude_collections?: string[];
|
|
27
|
+
bjob_include_files?: boolean;
|
|
28
|
+
bjob_file_paths?: string[];
|
|
29
|
+
bjob_created_by?: string;
|
|
30
|
+
bjob_created_at?: Date;
|
|
31
|
+
bjob_updated_at?: Date;
|
|
32
|
+
bjob_isactive?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const CBackupJob: mongoose.Model<IBackupJob, {}, {}, {}, mongoose.Document<unknown, {}, IBackupJob, {}> & IBackupJob & Required<{
|
|
35
|
+
_id: string;
|
|
36
|
+
}> & {
|
|
37
|
+
__v: number;
|
|
38
|
+
}, any>;
|
|
39
|
+
export { CBackupJob };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CBackupJob = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var backup_jobs = new mongoose_1.Schema({
|
|
6
|
+
bjob_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true,
|
|
11
|
+
unique: true
|
|
12
|
+
},
|
|
13
|
+
bjob_backup_type: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
enum: ['full', 'incremental', 'differential', 'file'],
|
|
17
|
+
trim: true
|
|
18
|
+
},
|
|
19
|
+
bjob_schedule: {
|
|
20
|
+
frequency: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
enum: ['daily', 'weekly', 'monthly', 'hourly', 'manual']
|
|
24
|
+
},
|
|
25
|
+
time: {
|
|
26
|
+
type: String,
|
|
27
|
+
maxlength: 5
|
|
28
|
+
},
|
|
29
|
+
day_of_week: {
|
|
30
|
+
type: Number,
|
|
31
|
+
min: 0,
|
|
32
|
+
max: 6
|
|
33
|
+
},
|
|
34
|
+
day_of_month: {
|
|
35
|
+
type: Number,
|
|
36
|
+
min: 1,
|
|
37
|
+
max: 31
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
bjob_status: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
enum: ['active', 'paused', 'disabled'],
|
|
44
|
+
default: 'active'
|
|
45
|
+
},
|
|
46
|
+
bjob_last_run: {
|
|
47
|
+
type: Date
|
|
48
|
+
},
|
|
49
|
+
bjob_next_run: {
|
|
50
|
+
type: Date
|
|
51
|
+
},
|
|
52
|
+
bjob_retention_days: {
|
|
53
|
+
type: Number,
|
|
54
|
+
required: true,
|
|
55
|
+
default: 30,
|
|
56
|
+
min: 1
|
|
57
|
+
},
|
|
58
|
+
bjob_encryption_enabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
bjob_compression_enabled: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: true
|
|
65
|
+
},
|
|
66
|
+
bjob_storage_location: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: true,
|
|
69
|
+
enum: ['local', 'cloud', 'both'],
|
|
70
|
+
default: 'local'
|
|
71
|
+
},
|
|
72
|
+
bjob_cloud_provider: {
|
|
73
|
+
type: String,
|
|
74
|
+
enum: ['aws', 'azure', 'gcp']
|
|
75
|
+
},
|
|
76
|
+
bjob_cloud_config: {
|
|
77
|
+
type: Object
|
|
78
|
+
},
|
|
79
|
+
bjob_include_collections: {
|
|
80
|
+
type: [String]
|
|
81
|
+
},
|
|
82
|
+
bjob_exclude_collections: {
|
|
83
|
+
type: [String]
|
|
84
|
+
},
|
|
85
|
+
bjob_include_files: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
bjob_file_paths: {
|
|
90
|
+
type: [String]
|
|
91
|
+
},
|
|
92
|
+
bjob_created_by: {
|
|
93
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
94
|
+
ref: "auth_user_mst"
|
|
95
|
+
},
|
|
96
|
+
bjob_created_at: {
|
|
97
|
+
type: Date,
|
|
98
|
+
default: Date.now
|
|
99
|
+
},
|
|
100
|
+
bjob_updated_at: {
|
|
101
|
+
type: Date,
|
|
102
|
+
default: Date.now
|
|
103
|
+
},
|
|
104
|
+
bjob_isactive: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: true
|
|
107
|
+
}
|
|
108
|
+
}, { collection: 'backup_jobs', timestamps: { createdAt: 'bjob_created_at', updatedAt: 'bjob_updated_at' } });
|
|
109
|
+
// Indexes
|
|
110
|
+
backup_jobs.index({ bjob_name: 1 });
|
|
111
|
+
backup_jobs.index({ bjob_status: 1 });
|
|
112
|
+
backup_jobs.index({ bjob_next_run: 1 });
|
|
113
|
+
var CBackupJob = mongoose_1.default.model("backup_jobs", backup_jobs);
|
|
114
|
+
exports.CBackupJob = CBackupJob;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IBackupPolicy {
|
|
3
|
+
_id?: string;
|
|
4
|
+
bpol_name: string;
|
|
5
|
+
bpol_retention_days: number;
|
|
6
|
+
bpol_backup_frequency: 'hourly' | 'daily' | 'weekly' | 'monthly';
|
|
7
|
+
bpol_encryption_enabled: boolean;
|
|
8
|
+
bpol_compression_enabled: boolean;
|
|
9
|
+
bpol_auto_cleanup: boolean;
|
|
10
|
+
bpol_notification_enabled: boolean;
|
|
11
|
+
bpol_notification_emails?: string[];
|
|
12
|
+
bpol_description?: string;
|
|
13
|
+
bpol_created_by?: string;
|
|
14
|
+
bpol_created_at?: Date;
|
|
15
|
+
bpol_updated_at?: Date;
|
|
16
|
+
bpol_isactive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const CBackupPolicy: mongoose.Model<IBackupPolicy, {}, {}, {}, mongoose.Document<unknown, {}, IBackupPolicy, {}> & IBackupPolicy & Required<{
|
|
19
|
+
_id: string;
|
|
20
|
+
}> & {
|
|
21
|
+
__v: number;
|
|
22
|
+
}, any>;
|
|
23
|
+
export { CBackupPolicy };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CBackupPolicy = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var backup_policies = new mongoose_1.Schema({
|
|
6
|
+
bpol_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true,
|
|
11
|
+
unique: true
|
|
12
|
+
},
|
|
13
|
+
bpol_retention_days: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true,
|
|
16
|
+
default: 30,
|
|
17
|
+
min: 1
|
|
18
|
+
},
|
|
19
|
+
bpol_backup_frequency: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
enum: ['hourly', 'daily', 'weekly', 'monthly']
|
|
23
|
+
},
|
|
24
|
+
bpol_encryption_enabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
bpol_compression_enabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
32
|
+
bpol_auto_cleanup: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
35
|
+
},
|
|
36
|
+
bpol_notification_enabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
bpol_notification_emails: {
|
|
41
|
+
type: [String]
|
|
42
|
+
},
|
|
43
|
+
bpol_description: {
|
|
44
|
+
type: String,
|
|
45
|
+
maxlength: 500
|
|
46
|
+
},
|
|
47
|
+
bpol_created_by: {
|
|
48
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
49
|
+
ref: "auth_user_mst"
|
|
50
|
+
},
|
|
51
|
+
bpol_created_at: {
|
|
52
|
+
type: Date,
|
|
53
|
+
default: Date.now
|
|
54
|
+
},
|
|
55
|
+
bpol_updated_at: {
|
|
56
|
+
type: Date,
|
|
57
|
+
default: Date.now
|
|
58
|
+
},
|
|
59
|
+
bpol_isactive: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
}
|
|
63
|
+
}, { collection: 'backup_policies', timestamps: { createdAt: 'bpol_created_at', updatedAt: 'bpol_updated_at' } });
|
|
64
|
+
// Indexes
|
|
65
|
+
backup_policies.index({ bpol_name: 1 });
|
|
66
|
+
backup_policies.index({ bpol_isactive: 1 });
|
|
67
|
+
var CBackupPolicy = mongoose_1.default.model("backup_policies", backup_policies);
|
|
68
|
+
exports.CBackupPolicy = CBackupPolicy;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IBackupRecord {
|
|
3
|
+
_id?: string;
|
|
4
|
+
brec_backup_job_id: string;
|
|
5
|
+
brec_backup_type: 'full' | 'incremental' | 'differential' | 'file';
|
|
6
|
+
brec_backup_path: string;
|
|
7
|
+
brec_file_name: string;
|
|
8
|
+
brec_size: number;
|
|
9
|
+
brec_status: 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
10
|
+
brec_verification_status: 'pending' | 'verified' | 'failed';
|
|
11
|
+
brec_started_at?: Date;
|
|
12
|
+
brec_completed_at?: Date;
|
|
13
|
+
brec_duration?: number;
|
|
14
|
+
brec_error_message?: string;
|
|
15
|
+
brec_metadata?: {
|
|
16
|
+
collections_backed_up?: string[];
|
|
17
|
+
collections_count?: number;
|
|
18
|
+
files_backed_up?: number;
|
|
19
|
+
compression_ratio?: number;
|
|
20
|
+
};
|
|
21
|
+
brec_created_at?: Date;
|
|
22
|
+
brec_isactive?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const CBackupRecord: mongoose.Model<IBackupRecord, {}, {}, {}, mongoose.Document<unknown, {}, IBackupRecord, {}> & IBackupRecord & Required<{
|
|
25
|
+
_id: string;
|
|
26
|
+
}> & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, any>;
|
|
29
|
+
export { CBackupRecord };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CBackupRecord = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var backup_records = new mongoose_1.Schema({
|
|
6
|
+
brec_backup_job_id: {
|
|
7
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
8
|
+
ref: "backup_jobs",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true
|
|
11
|
+
},
|
|
12
|
+
brec_backup_type: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
enum: ['full', 'incremental', 'differential', 'file']
|
|
16
|
+
},
|
|
17
|
+
brec_backup_path: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
maxlength: 500
|
|
21
|
+
},
|
|
22
|
+
brec_file_name: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
maxlength: 255
|
|
26
|
+
},
|
|
27
|
+
brec_size: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: true,
|
|
30
|
+
min: 0
|
|
31
|
+
},
|
|
32
|
+
brec_status: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
enum: ['in_progress', 'completed', 'failed', 'cancelled'],
|
|
36
|
+
default: 'in_progress',
|
|
37
|
+
index: true
|
|
38
|
+
},
|
|
39
|
+
brec_verification_status: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
enum: ['pending', 'verified', 'failed'],
|
|
43
|
+
default: 'pending'
|
|
44
|
+
},
|
|
45
|
+
brec_started_at: {
|
|
46
|
+
type: Date,
|
|
47
|
+
default: Date.now
|
|
48
|
+
},
|
|
49
|
+
brec_completed_at: {
|
|
50
|
+
type: Date
|
|
51
|
+
},
|
|
52
|
+
brec_duration: {
|
|
53
|
+
type: Number,
|
|
54
|
+
min: 0
|
|
55
|
+
},
|
|
56
|
+
brec_error_message: {
|
|
57
|
+
type: String,
|
|
58
|
+
maxlength: 1000
|
|
59
|
+
},
|
|
60
|
+
brec_metadata: {
|
|
61
|
+
type: Object
|
|
62
|
+
},
|
|
63
|
+
brec_created_at: {
|
|
64
|
+
type: Date,
|
|
65
|
+
default: Date.now,
|
|
66
|
+
index: true
|
|
67
|
+
},
|
|
68
|
+
brec_isactive: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
}
|
|
72
|
+
}, { collection: 'backup_records', timestamps: { createdAt: 'brec_created_at' } });
|
|
73
|
+
// Indexes
|
|
74
|
+
backup_records.index({ brec_backup_job_id: 1, brec_created_at: -1 });
|
|
75
|
+
backup_records.index({ brec_status: 1 });
|
|
76
|
+
backup_records.index({ brec_verification_status: 1 });
|
|
77
|
+
var CBackupRecord = mongoose_1.default.model("backup_records", backup_records);
|
|
78
|
+
exports.CBackupRecord = CBackupRecord;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { CBackupJob, IBackupJob } from './backup_jobs';
|
|
2
|
+
export { CBackupRecord, IBackupRecord } from './backup_records';
|
|
3
|
+
export { CRecoveryOperation, IRecoveryOperation } from './recovery_operations';
|
|
4
|
+
export { CBackupPolicy, IBackupPolicy } from './backup_policies';
|
|
5
|
+
export { CIntegration, IIntegration } from './integrations';
|
|
6
|
+
export { CApiKey, IApiKey } from './api_keys';
|
|
7
|
+
export { CWebhook, IWebhook } from './webhooks';
|
|
8
|
+
export { CIntegrationLog, IIntegrationLog } from './integration_logs';
|
|
9
|
+
export { CSubscriptionPlan, ISubscriptionPlan } from './subscription_plans';
|
|
10
|
+
export { CSubscriptionFeature, ISubscriptionFeature } from './subscription_features';
|
|
11
|
+
export { CSubscription, ISubscription } from './subscriptions';
|
|
12
|
+
export { CSubscriptionPayment, ISubscriptionPayment } from './subscription_payments';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CSubscriptionPayment = exports.CSubscription = exports.CSubscriptionFeature = exports.CSubscriptionPlan = exports.CIntegrationLog = exports.CWebhook = exports.CApiKey = exports.CIntegration = exports.CBackupPolicy = exports.CRecoveryOperation = exports.CBackupRecord = exports.CBackupJob = void 0;
|
|
4
|
+
// System Module Schemas
|
|
5
|
+
var backup_jobs_1 = require("./backup_jobs");
|
|
6
|
+
Object.defineProperty(exports, "CBackupJob", { enumerable: true, get: function () { return backup_jobs_1.CBackupJob; } });
|
|
7
|
+
var backup_records_1 = require("./backup_records");
|
|
8
|
+
Object.defineProperty(exports, "CBackupRecord", { enumerable: true, get: function () { return backup_records_1.CBackupRecord; } });
|
|
9
|
+
var recovery_operations_1 = require("./recovery_operations");
|
|
10
|
+
Object.defineProperty(exports, "CRecoveryOperation", { enumerable: true, get: function () { return recovery_operations_1.CRecoveryOperation; } });
|
|
11
|
+
var backup_policies_1 = require("./backup_policies");
|
|
12
|
+
Object.defineProperty(exports, "CBackupPolicy", { enumerable: true, get: function () { return backup_policies_1.CBackupPolicy; } });
|
|
13
|
+
var integrations_1 = require("./integrations");
|
|
14
|
+
Object.defineProperty(exports, "CIntegration", { enumerable: true, get: function () { return integrations_1.CIntegration; } });
|
|
15
|
+
var api_keys_1 = require("./api_keys");
|
|
16
|
+
Object.defineProperty(exports, "CApiKey", { enumerable: true, get: function () { return api_keys_1.CApiKey; } });
|
|
17
|
+
var webhooks_1 = require("./webhooks");
|
|
18
|
+
Object.defineProperty(exports, "CWebhook", { enumerable: true, get: function () { return webhooks_1.CWebhook; } });
|
|
19
|
+
var integration_logs_1 = require("./integration_logs");
|
|
20
|
+
Object.defineProperty(exports, "CIntegrationLog", { enumerable: true, get: function () { return integration_logs_1.CIntegrationLog; } });
|
|
21
|
+
var subscription_plans_1 = require("./subscription_plans");
|
|
22
|
+
Object.defineProperty(exports, "CSubscriptionPlan", { enumerable: true, get: function () { return subscription_plans_1.CSubscriptionPlan; } });
|
|
23
|
+
var subscription_features_1 = require("./subscription_features");
|
|
24
|
+
Object.defineProperty(exports, "CSubscriptionFeature", { enumerable: true, get: function () { return subscription_features_1.CSubscriptionFeature; } });
|
|
25
|
+
var subscriptions_1 = require("./subscriptions");
|
|
26
|
+
Object.defineProperty(exports, "CSubscription", { enumerable: true, get: function () { return subscriptions_1.CSubscription; } });
|
|
27
|
+
var subscription_payments_1 = require("./subscription_payments");
|
|
28
|
+
Object.defineProperty(exports, "CSubscriptionPayment", { enumerable: true, get: function () { return subscription_payments_1.CSubscriptionPayment; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IIntegrationLog {
|
|
3
|
+
_id?: string;
|
|
4
|
+
ilog_integration_id?: string;
|
|
5
|
+
ilog_operation: string;
|
|
6
|
+
ilog_status: 'success' | 'failed' | 'pending';
|
|
7
|
+
ilog_request_data?: any;
|
|
8
|
+
ilog_response_data?: any;
|
|
9
|
+
ilog_error_message?: string;
|
|
10
|
+
ilog_error_code?: string;
|
|
11
|
+
ilog_duration?: number;
|
|
12
|
+
ilog_retry_count?: number;
|
|
13
|
+
ilog_created_at?: Date;
|
|
14
|
+
ilog_isactive?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const CIntegrationLog: mongoose.Model<IIntegrationLog, {}, {}, {}, mongoose.Document<unknown, {}, IIntegrationLog, {}> & IIntegrationLog & Required<{
|
|
17
|
+
_id: string;
|
|
18
|
+
}> & {
|
|
19
|
+
__v: number;
|
|
20
|
+
}, any>;
|
|
21
|
+
export { CIntegrationLog };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CIntegrationLog = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var integration_logs = new mongoose_1.Schema({
|
|
6
|
+
ilog_integration_id: {
|
|
7
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
8
|
+
ref: "integrations",
|
|
9
|
+
index: true
|
|
10
|
+
},
|
|
11
|
+
ilog_operation: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
maxlength: 100,
|
|
15
|
+
index: true
|
|
16
|
+
},
|
|
17
|
+
ilog_status: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
enum: ['success', 'failed', 'pending'],
|
|
21
|
+
default: 'pending',
|
|
22
|
+
index: true
|
|
23
|
+
},
|
|
24
|
+
ilog_request_data: {
|
|
25
|
+
type: Object
|
|
26
|
+
},
|
|
27
|
+
ilog_response_data: {
|
|
28
|
+
type: Object
|
|
29
|
+
},
|
|
30
|
+
ilog_error_message: {
|
|
31
|
+
type: String,
|
|
32
|
+
maxlength: 1000
|
|
33
|
+
},
|
|
34
|
+
ilog_error_code: {
|
|
35
|
+
type: String,
|
|
36
|
+
maxlength: 50
|
|
37
|
+
},
|
|
38
|
+
ilog_duration: {
|
|
39
|
+
type: Number,
|
|
40
|
+
min: 0
|
|
41
|
+
},
|
|
42
|
+
ilog_retry_count: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 0,
|
|
45
|
+
min: 0
|
|
46
|
+
},
|
|
47
|
+
ilog_created_at: {
|
|
48
|
+
type: Date,
|
|
49
|
+
default: Date.now,
|
|
50
|
+
index: true
|
|
51
|
+
},
|
|
52
|
+
ilog_isactive: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
}
|
|
56
|
+
}, { collection: 'integration_logs', timestamps: { createdAt: 'ilog_created_at' } });
|
|
57
|
+
// Indexes
|
|
58
|
+
integration_logs.index({ ilog_integration_id: 1, ilog_created_at: -1 });
|
|
59
|
+
integration_logs.index({ ilog_status: 1 });
|
|
60
|
+
integration_logs.index({ ilog_operation: 1 });
|
|
61
|
+
var CIntegrationLog = mongoose_1.default.model("integration_logs", integration_logs);
|
|
62
|
+
exports.CIntegrationLog = CIntegrationLog;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IIntegration {
|
|
3
|
+
_id?: string;
|
|
4
|
+
intg_name: string;
|
|
5
|
+
intg_type: 'payment_gateway' | 'shipping_carrier' | 'accounting_software' | 'ecommerce_platform' | 'sms_gateway' | 'email_service' | 'bank' | 'tax_service' | 'custom';
|
|
6
|
+
intg_provider: string;
|
|
7
|
+
intg_api_key?: string;
|
|
8
|
+
intg_api_secret?: string;
|
|
9
|
+
intg_merchant_id?: string;
|
|
10
|
+
intg_status: 'active' | 'inactive' | 'testing';
|
|
11
|
+
intg_configuration?: {
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
webhook_url?: string;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
retry_count?: number;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
intg_test_mode: boolean;
|
|
19
|
+
intg_last_sync?: Date;
|
|
20
|
+
intg_sync_frequency?: 'realtime' | 'hourly' | 'daily' | 'manual';
|
|
21
|
+
intg_created_by?: string;
|
|
22
|
+
intg_created_at?: Date;
|
|
23
|
+
intg_updated_at?: Date;
|
|
24
|
+
intg_isactive?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const CIntegration: mongoose.Model<IIntegration, {}, {}, {}, mongoose.Document<unknown, {}, IIntegration, {}> & IIntegration & Required<{
|
|
27
|
+
_id: string;
|
|
28
|
+
}> & {
|
|
29
|
+
__v: number;
|
|
30
|
+
}, any>;
|
|
31
|
+
export { CIntegration };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CIntegration = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var integrations = new mongoose_1.Schema({
|
|
6
|
+
intg_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true
|
|
11
|
+
},
|
|
12
|
+
intg_type: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
enum: ['payment_gateway', 'shipping_carrier', 'accounting_software', 'ecommerce_platform', 'sms_gateway', 'email_service', 'bank', 'tax_service', 'custom'],
|
|
16
|
+
index: true
|
|
17
|
+
},
|
|
18
|
+
intg_provider: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
maxlength: 100,
|
|
22
|
+
trim: true
|
|
23
|
+
},
|
|
24
|
+
intg_api_key: {
|
|
25
|
+
type: String,
|
|
26
|
+
maxlength: 500
|
|
27
|
+
},
|
|
28
|
+
intg_api_secret: {
|
|
29
|
+
type: String,
|
|
30
|
+
maxlength: 500
|
|
31
|
+
},
|
|
32
|
+
intg_merchant_id: {
|
|
33
|
+
type: String,
|
|
34
|
+
maxlength: 100
|
|
35
|
+
},
|
|
36
|
+
intg_status: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
enum: ['active', 'inactive', 'testing'],
|
|
40
|
+
default: 'testing',
|
|
41
|
+
index: true
|
|
42
|
+
},
|
|
43
|
+
intg_configuration: {
|
|
44
|
+
type: Object
|
|
45
|
+
},
|
|
46
|
+
intg_test_mode: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
intg_last_sync: {
|
|
51
|
+
type: Date
|
|
52
|
+
},
|
|
53
|
+
intg_sync_frequency: {
|
|
54
|
+
type: String,
|
|
55
|
+
enum: ['realtime', 'hourly', 'daily', 'manual'],
|
|
56
|
+
default: 'manual'
|
|
57
|
+
},
|
|
58
|
+
intg_created_by: {
|
|
59
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
60
|
+
ref: "auth_user_mst"
|
|
61
|
+
},
|
|
62
|
+
intg_created_at: {
|
|
63
|
+
type: Date,
|
|
64
|
+
default: Date.now
|
|
65
|
+
},
|
|
66
|
+
intg_updated_at: {
|
|
67
|
+
type: Date,
|
|
68
|
+
default: Date.now
|
|
69
|
+
},
|
|
70
|
+
intg_isactive: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true
|
|
73
|
+
}
|
|
74
|
+
}, { collection: 'integrations', timestamps: { createdAt: 'intg_created_at', updatedAt: 'intg_updated_at' } });
|
|
75
|
+
// Indexes
|
|
76
|
+
integrations.index({ intg_name: 1 });
|
|
77
|
+
integrations.index({ intg_type: 1, intg_status: 1 });
|
|
78
|
+
integrations.index({ intg_provider: 1 });
|
|
79
|
+
var CIntegration = mongoose_1.default.model("integrations", integrations);
|
|
80
|
+
exports.CIntegration = CIntegration;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IRecoveryOperation {
|
|
3
|
+
_id?: string;
|
|
4
|
+
recv_backup_record_id: string;
|
|
5
|
+
recv_recovery_type: 'full' | 'partial' | 'point_in_time' | 'file';
|
|
6
|
+
recv_status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
+
recv_target_date?: Date;
|
|
8
|
+
recv_collections_to_restore?: string[];
|
|
9
|
+
recv_files_to_restore?: string[];
|
|
10
|
+
recv_started_at?: Date;
|
|
11
|
+
recv_completed_at?: Date;
|
|
12
|
+
recv_duration?: number;
|
|
13
|
+
recv_error_message?: string;
|
|
14
|
+
recv_created_by?: string;
|
|
15
|
+
recv_created_at?: Date;
|
|
16
|
+
recv_isactive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const CRecoveryOperation: mongoose.Model<IRecoveryOperation, {}, {}, {}, mongoose.Document<unknown, {}, IRecoveryOperation, {}> & IRecoveryOperation & Required<{
|
|
19
|
+
_id: string;
|
|
20
|
+
}> & {
|
|
21
|
+
__v: number;
|
|
22
|
+
}, any>;
|
|
23
|
+
export { CRecoveryOperation };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CRecoveryOperation = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var recovery_operations = new mongoose_1.Schema({
|
|
6
|
+
recv_backup_record_id: {
|
|
7
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
8
|
+
ref: "backup_records",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true
|
|
11
|
+
},
|
|
12
|
+
recv_recovery_type: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
enum: ['full', 'partial', 'point_in_time', 'file']
|
|
16
|
+
},
|
|
17
|
+
recv_status: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
enum: ['pending', 'in_progress', 'completed', 'failed', 'cancelled'],
|
|
21
|
+
default: 'pending',
|
|
22
|
+
index: true
|
|
23
|
+
},
|
|
24
|
+
recv_target_date: {
|
|
25
|
+
type: Date
|
|
26
|
+
},
|
|
27
|
+
recv_collections_to_restore: {
|
|
28
|
+
type: [String]
|
|
29
|
+
},
|
|
30
|
+
recv_files_to_restore: {
|
|
31
|
+
type: [String]
|
|
32
|
+
},
|
|
33
|
+
recv_started_at: {
|
|
34
|
+
type: Date
|
|
35
|
+
},
|
|
36
|
+
recv_completed_at: {
|
|
37
|
+
type: Date
|
|
38
|
+
},
|
|
39
|
+
recv_duration: {
|
|
40
|
+
type: Number,
|
|
41
|
+
min: 0
|
|
42
|
+
},
|
|
43
|
+
recv_error_message: {
|
|
44
|
+
type: String,
|
|
45
|
+
maxlength: 1000
|
|
46
|
+
},
|
|
47
|
+
recv_created_by: {
|
|
48
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
49
|
+
ref: "auth_user_mst"
|
|
50
|
+
},
|
|
51
|
+
recv_created_at: {
|
|
52
|
+
type: Date,
|
|
53
|
+
default: Date.now,
|
|
54
|
+
index: true
|
|
55
|
+
},
|
|
56
|
+
recv_isactive: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
}
|
|
60
|
+
}, { collection: 'recovery_operations', timestamps: { createdAt: 'recv_created_at' } });
|
|
61
|
+
// Indexes
|
|
62
|
+
recovery_operations.index({ recv_backup_record_id: 1 });
|
|
63
|
+
recovery_operations.index({ recv_status: 1 });
|
|
64
|
+
recovery_operations.index({ recv_created_at: -1 });
|
|
65
|
+
var CRecoveryOperation = mongoose_1.default.model("recovery_operations", recovery_operations);
|
|
66
|
+
exports.CRecoveryOperation = CRecoveryOperation;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface ISubscriptionFeature {
|
|
3
|
+
_id?: string;
|
|
4
|
+
sfea_name: string;
|
|
5
|
+
sfea_code: string;
|
|
6
|
+
sfea_description?: string;
|
|
7
|
+
sfea_category: 'users' | 'storage' | 'api' | 'features' | 'support' | 'custom';
|
|
8
|
+
sfea_value?: string | number;
|
|
9
|
+
sfea_unit?: string;
|
|
10
|
+
sfea_created_at?: Date;
|
|
11
|
+
sfea_updated_at?: Date;
|
|
12
|
+
sfea_isactive?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const CSubscriptionFeature: mongoose.Model<ISubscriptionFeature, {}, {}, {}, mongoose.Document<unknown, {}, ISubscriptionFeature, {}> & ISubscriptionFeature & Required<{
|
|
15
|
+
_id: string;
|
|
16
|
+
}> & {
|
|
17
|
+
__v: number;
|
|
18
|
+
}, any>;
|
|
19
|
+
export { CSubscriptionFeature };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CSubscriptionFeature = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var subscription_features = new mongoose_1.Schema({
|
|
6
|
+
sfea_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true
|
|
11
|
+
},
|
|
12
|
+
sfea_code: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
maxlength: 50,
|
|
16
|
+
trim: true,
|
|
17
|
+
unique: true,
|
|
18
|
+
uppercase: true
|
|
19
|
+
},
|
|
20
|
+
sfea_description: {
|
|
21
|
+
type: String,
|
|
22
|
+
maxlength: 500
|
|
23
|
+
},
|
|
24
|
+
sfea_category: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
enum: ['users', 'storage', 'api', 'features', 'support', 'custom'],
|
|
28
|
+
index: true
|
|
29
|
+
},
|
|
30
|
+
sfea_value: {
|
|
31
|
+
type: mongoose_1.Schema.Types.Mixed
|
|
32
|
+
},
|
|
33
|
+
sfea_unit: {
|
|
34
|
+
type: String,
|
|
35
|
+
maxlength: 20
|
|
36
|
+
},
|
|
37
|
+
sfea_created_at: {
|
|
38
|
+
type: Date,
|
|
39
|
+
default: Date.now
|
|
40
|
+
},
|
|
41
|
+
sfea_updated_at: {
|
|
42
|
+
type: Date,
|
|
43
|
+
default: Date.now
|
|
44
|
+
},
|
|
45
|
+
sfea_isactive: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
}
|
|
49
|
+
}, { collection: 'subscription_features', timestamps: { createdAt: 'sfea_created_at', updatedAt: 'sfea_updated_at' } });
|
|
50
|
+
// Indexes
|
|
51
|
+
subscription_features.index({ sfea_code: 1 });
|
|
52
|
+
subscription_features.index({ sfea_category: 1 });
|
|
53
|
+
var CSubscriptionFeature = mongoose_1.default.model("subscription_features", subscription_features);
|
|
54
|
+
exports.CSubscriptionFeature = CSubscriptionFeature;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface ISubscriptionPayment {
|
|
3
|
+
_id?: string;
|
|
4
|
+
spay_subscription_id: string;
|
|
5
|
+
spay_amount: number;
|
|
6
|
+
spay_currency: string;
|
|
7
|
+
spay_payment_method: string;
|
|
8
|
+
spay_transaction_id?: string;
|
|
9
|
+
spay_payment_gateway?: string;
|
|
10
|
+
spay_status: 'pending' | 'completed' | 'failed' | 'refunded';
|
|
11
|
+
spay_billing_period_start: Date;
|
|
12
|
+
spay_billing_period_end: Date;
|
|
13
|
+
spay_paid_at?: Date;
|
|
14
|
+
spay_failure_reason?: string;
|
|
15
|
+
spay_invoice_url?: string;
|
|
16
|
+
spay_receipt_url?: string;
|
|
17
|
+
spay_created_at?: Date;
|
|
18
|
+
spay_isactive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const CSubscriptionPayment: mongoose.Model<ISubscriptionPayment, {}, {}, {}, mongoose.Document<unknown, {}, ISubscriptionPayment, {}> & ISubscriptionPayment & Required<{
|
|
21
|
+
_id: string;
|
|
22
|
+
}> & {
|
|
23
|
+
__v: number;
|
|
24
|
+
}, any>;
|
|
25
|
+
export { CSubscriptionPayment };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CSubscriptionPayment = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var subscription_payments = new mongoose_1.Schema({
|
|
6
|
+
spay_subscription_id: {
|
|
7
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
8
|
+
ref: "subscriptions",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true
|
|
11
|
+
},
|
|
12
|
+
spay_amount: {
|
|
13
|
+
type: Number,
|
|
14
|
+
required: true,
|
|
15
|
+
min: 0
|
|
16
|
+
},
|
|
17
|
+
spay_currency: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
maxlength: 3,
|
|
21
|
+
default: 'USD',
|
|
22
|
+
uppercase: true
|
|
23
|
+
},
|
|
24
|
+
spay_payment_method: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
maxlength: 50
|
|
28
|
+
},
|
|
29
|
+
spay_transaction_id: {
|
|
30
|
+
type: String,
|
|
31
|
+
maxlength: 200,
|
|
32
|
+
index: true
|
|
33
|
+
},
|
|
34
|
+
spay_payment_gateway: {
|
|
35
|
+
type: String,
|
|
36
|
+
maxlength: 100
|
|
37
|
+
},
|
|
38
|
+
spay_status: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
enum: ['pending', 'completed', 'failed', 'refunded'],
|
|
42
|
+
default: 'pending',
|
|
43
|
+
index: true
|
|
44
|
+
},
|
|
45
|
+
spay_billing_period_start: {
|
|
46
|
+
type: Date,
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
spay_billing_period_end: {
|
|
50
|
+
type: Date,
|
|
51
|
+
required: true
|
|
52
|
+
},
|
|
53
|
+
spay_paid_at: {
|
|
54
|
+
type: Date
|
|
55
|
+
},
|
|
56
|
+
spay_failure_reason: {
|
|
57
|
+
type: String,
|
|
58
|
+
maxlength: 500
|
|
59
|
+
},
|
|
60
|
+
spay_invoice_url: {
|
|
61
|
+
type: String,
|
|
62
|
+
maxlength: 500
|
|
63
|
+
},
|
|
64
|
+
spay_receipt_url: {
|
|
65
|
+
type: String,
|
|
66
|
+
maxlength: 500
|
|
67
|
+
},
|
|
68
|
+
spay_created_at: {
|
|
69
|
+
type: Date,
|
|
70
|
+
default: Date.now,
|
|
71
|
+
index: true
|
|
72
|
+
},
|
|
73
|
+
spay_isactive: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: true
|
|
76
|
+
}
|
|
77
|
+
}, { collection: 'subscription_payments', timestamps: { createdAt: 'spay_created_at' } });
|
|
78
|
+
// Indexes
|
|
79
|
+
subscription_payments.index({ spay_subscription_id: 1, spay_created_at: -1 });
|
|
80
|
+
subscription_payments.index({ spay_status: 1 });
|
|
81
|
+
subscription_payments.index({ spay_transaction_id: 1 });
|
|
82
|
+
var CSubscriptionPayment = mongoose_1.default.model("subscription_payments", subscription_payments);
|
|
83
|
+
exports.CSubscriptionPayment = CSubscriptionPayment;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface ISubscriptionPlan {
|
|
3
|
+
_id?: string;
|
|
4
|
+
spln_name: string;
|
|
5
|
+
spln_code: string;
|
|
6
|
+
spln_description?: string;
|
|
7
|
+
spln_price: number;
|
|
8
|
+
spln_currency: string;
|
|
9
|
+
spln_billing_cycle: 'monthly' | 'quarterly' | 'yearly' | 'lifetime';
|
|
10
|
+
spln_features: string[];
|
|
11
|
+
spln_max_users?: number;
|
|
12
|
+
spln_max_storage?: number;
|
|
13
|
+
spln_max_api_calls?: number;
|
|
14
|
+
spln_trial_days?: number;
|
|
15
|
+
spln_is_popular?: boolean;
|
|
16
|
+
spln_is_active: boolean;
|
|
17
|
+
spln_created_by?: string;
|
|
18
|
+
spln_created_at?: Date;
|
|
19
|
+
spln_updated_at?: Date;
|
|
20
|
+
spln_isactive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const CSubscriptionPlan: mongoose.Model<ISubscriptionPlan, {}, {}, {}, mongoose.Document<unknown, {}, ISubscriptionPlan, {}> & ISubscriptionPlan & Required<{
|
|
23
|
+
_id: string;
|
|
24
|
+
}> & {
|
|
25
|
+
__v: number;
|
|
26
|
+
}, any>;
|
|
27
|
+
export { CSubscriptionPlan };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CSubscriptionPlan = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var subscription_plans = new mongoose_1.Schema({
|
|
6
|
+
spln_name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 100,
|
|
10
|
+
trim: true
|
|
11
|
+
},
|
|
12
|
+
spln_code: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
maxlength: 50,
|
|
16
|
+
trim: true,
|
|
17
|
+
unique: true,
|
|
18
|
+
uppercase: true
|
|
19
|
+
},
|
|
20
|
+
spln_description: {
|
|
21
|
+
type: String,
|
|
22
|
+
maxlength: 500
|
|
23
|
+
},
|
|
24
|
+
spln_price: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
min: 0
|
|
28
|
+
},
|
|
29
|
+
spln_currency: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
maxlength: 3,
|
|
33
|
+
default: 'USD',
|
|
34
|
+
uppercase: true
|
|
35
|
+
},
|
|
36
|
+
spln_billing_cycle: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
enum: ['monthly', 'quarterly', 'yearly', 'lifetime'],
|
|
40
|
+
default: 'monthly'
|
|
41
|
+
},
|
|
42
|
+
spln_features: {
|
|
43
|
+
type: [String],
|
|
44
|
+
default: []
|
|
45
|
+
},
|
|
46
|
+
spln_max_users: {
|
|
47
|
+
type: Number,
|
|
48
|
+
min: 0
|
|
49
|
+
},
|
|
50
|
+
spln_max_storage: {
|
|
51
|
+
type: Number,
|
|
52
|
+
min: 0
|
|
53
|
+
},
|
|
54
|
+
spln_max_api_calls: {
|
|
55
|
+
type: Number,
|
|
56
|
+
min: 0
|
|
57
|
+
},
|
|
58
|
+
spln_trial_days: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: 0,
|
|
61
|
+
min: 0
|
|
62
|
+
},
|
|
63
|
+
spln_is_popular: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
spln_is_active: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: true
|
|
70
|
+
},
|
|
71
|
+
spln_created_by: {
|
|
72
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
73
|
+
ref: "auth_user_mst"
|
|
74
|
+
},
|
|
75
|
+
spln_created_at: {
|
|
76
|
+
type: Date,
|
|
77
|
+
default: Date.now
|
|
78
|
+
},
|
|
79
|
+
spln_updated_at: {
|
|
80
|
+
type: Date,
|
|
81
|
+
default: Date.now
|
|
82
|
+
},
|
|
83
|
+
spln_isactive: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: true
|
|
86
|
+
}
|
|
87
|
+
}, { collection: 'subscription_plans', timestamps: { createdAt: 'spln_created_at', updatedAt: 'spln_updated_at' } });
|
|
88
|
+
// Indexes
|
|
89
|
+
subscription_plans.index({ spln_code: 1 });
|
|
90
|
+
subscription_plans.index({ spln_is_active: 1 });
|
|
91
|
+
subscription_plans.index({ spln_billing_cycle: 1 });
|
|
92
|
+
var CSubscriptionPlan = mongoose_1.default.model("subscription_plans", subscription_plans);
|
|
93
|
+
exports.CSubscriptionPlan = CSubscriptionPlan;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface ISubscription {
|
|
3
|
+
_id?: string;
|
|
4
|
+
subs_entity_id?: string;
|
|
5
|
+
subs_plan_id: string;
|
|
6
|
+
subs_status: 'active' | 'cancelled' | 'expired' | 'suspended' | 'trial';
|
|
7
|
+
subs_start_date: Date;
|
|
8
|
+
subs_end_date?: Date;
|
|
9
|
+
subs_trial_start_date?: Date;
|
|
10
|
+
subs_trial_end_date?: Date;
|
|
11
|
+
subs_auto_renew: boolean;
|
|
12
|
+
subs_next_billing_date?: Date;
|
|
13
|
+
subs_cancelled_at?: Date;
|
|
14
|
+
subs_cancellation_reason?: string;
|
|
15
|
+
subs_payment_method?: string;
|
|
16
|
+
subs_created_by?: string;
|
|
17
|
+
subs_created_at?: Date;
|
|
18
|
+
subs_updated_at?: Date;
|
|
19
|
+
subs_isactive?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const CSubscription: mongoose.Model<ISubscription, {}, {}, {}, mongoose.Document<unknown, {}, ISubscription, {}> & ISubscription & Required<{
|
|
22
|
+
_id: string;
|
|
23
|
+
}> & {
|
|
24
|
+
__v: number;
|
|
25
|
+
}, any>;
|
|
26
|
+
export { CSubscription };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CSubscription = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var subscriptions = new mongoose_1.Schema({
|
|
6
|
+
subs_entity_id: {
|
|
7
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
8
|
+
ref: "core_system_entity",
|
|
9
|
+
index: true
|
|
10
|
+
},
|
|
11
|
+
subs_plan_id: {
|
|
12
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
13
|
+
ref: "subscription_plans",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true
|
|
16
|
+
},
|
|
17
|
+
subs_status: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
enum: ['active', 'cancelled', 'expired', 'suspended', 'trial'],
|
|
21
|
+
default: 'trial',
|
|
22
|
+
index: true
|
|
23
|
+
},
|
|
24
|
+
subs_start_date: {
|
|
25
|
+
type: Date,
|
|
26
|
+
required: true,
|
|
27
|
+
default: Date.now
|
|
28
|
+
},
|
|
29
|
+
subs_end_date: {
|
|
30
|
+
type: Date
|
|
31
|
+
},
|
|
32
|
+
subs_trial_start_date: {
|
|
33
|
+
type: Date
|
|
34
|
+
},
|
|
35
|
+
subs_trial_end_date: {
|
|
36
|
+
type: Date
|
|
37
|
+
},
|
|
38
|
+
subs_auto_renew: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
subs_next_billing_date: {
|
|
43
|
+
type: Date
|
|
44
|
+
},
|
|
45
|
+
subs_cancelled_at: {
|
|
46
|
+
type: Date
|
|
47
|
+
},
|
|
48
|
+
subs_cancellation_reason: {
|
|
49
|
+
type: String,
|
|
50
|
+
maxlength: 500
|
|
51
|
+
},
|
|
52
|
+
subs_payment_method: {
|
|
53
|
+
type: String,
|
|
54
|
+
maxlength: 50
|
|
55
|
+
},
|
|
56
|
+
subs_created_by: {
|
|
57
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
58
|
+
ref: "auth_user_mst"
|
|
59
|
+
},
|
|
60
|
+
subs_created_at: {
|
|
61
|
+
type: Date,
|
|
62
|
+
default: Date.now
|
|
63
|
+
},
|
|
64
|
+
subs_updated_at: {
|
|
65
|
+
type: Date,
|
|
66
|
+
default: Date.now
|
|
67
|
+
},
|
|
68
|
+
subs_isactive: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
}
|
|
72
|
+
}, { collection: 'subscriptions', timestamps: { createdAt: 'subs_created_at', updatedAt: 'subs_updated_at' } });
|
|
73
|
+
// Indexes
|
|
74
|
+
subscriptions.index({ subs_entity_id: 1 });
|
|
75
|
+
subscriptions.index({ subs_plan_id: 1 });
|
|
76
|
+
subscriptions.index({ subs_status: 1 });
|
|
77
|
+
subscriptions.index({ subs_end_date: 1 });
|
|
78
|
+
var CSubscription = mongoose_1.default.model("subscriptions", subscriptions);
|
|
79
|
+
exports.CSubscription = CSubscription;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export interface IWebhook {
|
|
3
|
+
_id?: string;
|
|
4
|
+
whk_webhook_url: string;
|
|
5
|
+
whk_event_type: string;
|
|
6
|
+
whk_secret?: string;
|
|
7
|
+
whk_http_method: 'POST' | 'PUT' | 'PATCH';
|
|
8
|
+
whk_headers?: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
whk_status: 'active' | 'inactive' | 'failed';
|
|
12
|
+
whk_last_triggered?: Date;
|
|
13
|
+
whk_success_count: number;
|
|
14
|
+
whk_failure_count: number;
|
|
15
|
+
whk_retry_on_failure: boolean;
|
|
16
|
+
whk_max_retries?: number;
|
|
17
|
+
whk_timeout?: number;
|
|
18
|
+
whk_created_by?: string;
|
|
19
|
+
whk_created_at?: Date;
|
|
20
|
+
whk_updated_at?: Date;
|
|
21
|
+
whk_isactive?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const CWebhook: mongoose.Model<IWebhook, {}, {}, {}, mongoose.Document<unknown, {}, IWebhook, {}> & IWebhook & Required<{
|
|
24
|
+
_id: string;
|
|
25
|
+
}> & {
|
|
26
|
+
__v: number;
|
|
27
|
+
}, any>;
|
|
28
|
+
export { CWebhook };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CWebhook = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
var webhooks = new mongoose_1.Schema({
|
|
6
|
+
whk_webhook_url: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
maxlength: 500,
|
|
10
|
+
trim: true
|
|
11
|
+
},
|
|
12
|
+
whk_event_type: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
maxlength: 100,
|
|
16
|
+
index: true
|
|
17
|
+
},
|
|
18
|
+
whk_secret: {
|
|
19
|
+
type: String,
|
|
20
|
+
maxlength: 500
|
|
21
|
+
},
|
|
22
|
+
whk_http_method: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
enum: ['POST', 'PUT', 'PATCH'],
|
|
26
|
+
default: 'POST'
|
|
27
|
+
},
|
|
28
|
+
whk_headers: {
|
|
29
|
+
type: Object
|
|
30
|
+
},
|
|
31
|
+
whk_status: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
enum: ['active', 'inactive', 'failed'],
|
|
35
|
+
default: 'active',
|
|
36
|
+
index: true
|
|
37
|
+
},
|
|
38
|
+
whk_last_triggered: {
|
|
39
|
+
type: Date
|
|
40
|
+
},
|
|
41
|
+
whk_success_count: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 0,
|
|
44
|
+
min: 0
|
|
45
|
+
},
|
|
46
|
+
whk_failure_count: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 0,
|
|
49
|
+
min: 0
|
|
50
|
+
},
|
|
51
|
+
whk_retry_on_failure: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
whk_max_retries: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 3,
|
|
58
|
+
min: 0
|
|
59
|
+
},
|
|
60
|
+
whk_timeout: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 30000, // 30 seconds
|
|
63
|
+
min: 1000
|
|
64
|
+
},
|
|
65
|
+
whk_created_by: {
|
|
66
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
67
|
+
ref: "auth_user_mst"
|
|
68
|
+
},
|
|
69
|
+
whk_created_at: {
|
|
70
|
+
type: Date,
|
|
71
|
+
default: Date.now
|
|
72
|
+
},
|
|
73
|
+
whk_updated_at: {
|
|
74
|
+
type: Date,
|
|
75
|
+
default: Date.now
|
|
76
|
+
},
|
|
77
|
+
whk_isactive: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: true
|
|
80
|
+
}
|
|
81
|
+
}, { collection: 'webhooks', timestamps: { createdAt: 'whk_created_at', updatedAt: 'whk_updated_at' } });
|
|
82
|
+
// Indexes
|
|
83
|
+
webhooks.index({ whk_webhook_url: 1 });
|
|
84
|
+
webhooks.index({ whk_event_type: 1 });
|
|
85
|
+
webhooks.index({ whk_status: 1 });
|
|
86
|
+
var CWebhook = mongoose_1.default.model("webhooks", webhooks);
|
|
87
|
+
exports.CWebhook = CWebhook;
|
package/package.json
CHANGED