pristine-member-nest-api-database 1.0.59 → 1.0.61
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/dist/index.js +1 -1
- package/dist/models/Editor.FieldMaster.model.js +3 -5
- package/dist/models/Editor.FieldTypeMaster.model.js +93 -0
- package/dist/models/FieldTypes.model.js +0 -4
- package/index.ts +1 -1
- package/models/Editor.FieldMaster.model.ts +89 -12
- package/models/{FieldTypes.model.ts → Editor.FieldTypeMaster.model.ts} +0 -82
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ __exportStar(require("./models/PrivacyPolicies.model"), exports);
|
|
|
46
46
|
//new
|
|
47
47
|
__exportStar(require("./models/Containers.model"), exports);
|
|
48
48
|
__exportStar(require("./models/FieldCategory.model"), exports);
|
|
49
|
-
__exportStar(require("./models/
|
|
49
|
+
__exportStar(require("./models/Editor.FieldTypeMaster.model"), exports);
|
|
50
50
|
__exportStar(require("./models/Editor.FieldMaster.model"), exports);
|
|
51
51
|
__exportStar(require("./models/MainProductOrServices.model"), exports);
|
|
52
52
|
__exportStar(require("./models/Editor.BPCompany.Types"), exports);
|
|
@@ -30,7 +30,7 @@ const fieldSchema = new mongoose_1.Schema({
|
|
|
30
30
|
fieldName: { type: String },
|
|
31
31
|
FieldTypeId: {
|
|
32
32
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
33
|
-
ref: "Field.Types", // Reference to the '
|
|
33
|
+
ref: "Field.Types", // Reference to the 'field Types' model
|
|
34
34
|
required: false,
|
|
35
35
|
default: null,
|
|
36
36
|
},
|
|
@@ -38,10 +38,8 @@ const fieldSchema = new mongoose_1.Schema({
|
|
|
38
38
|
MemberEdit: { type: Boolean, default: false },
|
|
39
39
|
SapSync: { type: Boolean, default: false },
|
|
40
40
|
fieldConfig: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
maxLength: { type: Number, default: null },
|
|
44
|
-
pattern: { type: String, default: null },
|
|
41
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
42
|
+
default: {},
|
|
45
43
|
},
|
|
46
44
|
isSystemDefined: { type: Boolean, default: false },
|
|
47
45
|
isActive: { type: Boolean, default: true },
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.mongoEditorFieldType = exports.FieldTypeEnum = void 0;
|
|
27
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
28
|
+
/* =========================
|
|
29
|
+
FIELD TYPE ENUM
|
|
30
|
+
========================= */
|
|
31
|
+
var FieldTypeEnum;
|
|
32
|
+
(function (FieldTypeEnum) {
|
|
33
|
+
FieldTypeEnum["TEXT"] = "TEXT";
|
|
34
|
+
FieldTypeEnum["WHOLENUMBER"] = "WHOLENUMBER";
|
|
35
|
+
FieldTypeEnum["DECIMALNUMBER"] = "DECIMALNUMBER";
|
|
36
|
+
FieldTypeEnum["EMAIL"] = "EMAIL";
|
|
37
|
+
FieldTypeEnum["DATE"] = "DATE";
|
|
38
|
+
FieldTypeEnum["CHECKBOX"] = "CHECKBOX";
|
|
39
|
+
FieldTypeEnum["DROPDOWN"] = "DROPDOWN";
|
|
40
|
+
FieldTypeEnum["MULTISELECT"] = "MULTISELECT";
|
|
41
|
+
FieldTypeEnum["SINGLECOUNTRYFLAG"] = "SINGLECOUNTRYFLAG";
|
|
42
|
+
FieldTypeEnum["MULTIPLECOUNTRYFLAG"] = "MULTIPLECOUNTRYFLAG";
|
|
43
|
+
FieldTypeEnum["SINGLEATTACHMENT"] = "SINGLEATTACHMENT";
|
|
44
|
+
FieldTypeEnum["MULTIPLEATTACHMENT"] = "MULTIPLEATTACHMENT";
|
|
45
|
+
FieldTypeEnum["TABLE"] = "TABLE";
|
|
46
|
+
FieldTypeEnum["MATRIX"] = "MATRIX";
|
|
47
|
+
FieldTypeEnum["SCHEMA"] = "SCHEMA";
|
|
48
|
+
})(FieldTypeEnum || (exports.FieldTypeEnum = FieldTypeEnum = {}));
|
|
49
|
+
/* =========================
|
|
50
|
+
SCHEMA
|
|
51
|
+
========================= */
|
|
52
|
+
const fieldTypeSchema = new mongoose_1.Schema({
|
|
53
|
+
fieldTypeCode: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: true,
|
|
56
|
+
trim: true,
|
|
57
|
+
},
|
|
58
|
+
fieldEnum: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: true,
|
|
61
|
+
enum: Object.values(FieldTypeEnum), // store only enum values
|
|
62
|
+
},
|
|
63
|
+
fieldTypeName: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: true,
|
|
66
|
+
trim: true,
|
|
67
|
+
},
|
|
68
|
+
fieldTypeDescription: {
|
|
69
|
+
type: String,
|
|
70
|
+
trim: true,
|
|
71
|
+
},
|
|
72
|
+
isSystemDefined: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
isActive: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: true,
|
|
79
|
+
},
|
|
80
|
+
audit: [
|
|
81
|
+
{
|
|
82
|
+
userId: { type: String },
|
|
83
|
+
auditedOn: { type: Date, default: null },
|
|
84
|
+
actionType: { type: String },
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
}, {
|
|
88
|
+
timestamps: true,
|
|
89
|
+
});
|
|
90
|
+
/* =========================
|
|
91
|
+
MODEL
|
|
92
|
+
========================= */
|
|
93
|
+
exports.mongoEditorFieldType = mongoose_1.default.model("Editor.FieldType", fieldTypeSchema);
|
package/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ export * from "./models/PrivacyPolicies.model";
|
|
|
32
32
|
//new
|
|
33
33
|
export * from "./models/Containers.model";
|
|
34
34
|
export * from "./models/FieldCategory.model";
|
|
35
|
-
export * from "./models/
|
|
35
|
+
export * from "./models/Editor.FieldTypeMaster.model";
|
|
36
36
|
export * from "./models/Editor.FieldMaster.model";
|
|
37
37
|
export * from "./models/MainProductOrServices.model";
|
|
38
38
|
export * from "./models/Editor.BPCompany.Types";
|
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
import mongoose, { Document, Schema } from "mongoose";
|
|
2
2
|
import { Audit } from "../interface/Audit.interface";
|
|
3
|
+
import { FieldTypeEnum } from "./Editor.FieldTypeMaster.model";
|
|
4
|
+
|
|
5
|
+
// TEXT
|
|
6
|
+
export interface TextFieldConfig {
|
|
7
|
+
pattern?: string | null; // regex pattern for validation
|
|
8
|
+
minLength?: number | null;
|
|
9
|
+
maxLength?: number | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//decimal ```NUMBER
|
|
13
|
+
export interface DecimalNumberFieldConfig {
|
|
14
|
+
step?: number; // for decimals
|
|
15
|
+
pattern?: string; // regex pattern for validation
|
|
16
|
+
minLength?: number | null;
|
|
17
|
+
maxLength?: number | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//whole number ```NUMBER
|
|
21
|
+
export interface WholeNumberFieldConfig {
|
|
22
|
+
pattern?: string; // regex pattern for validation
|
|
23
|
+
minLength?: number | null;
|
|
24
|
+
maxLength?: number | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// OPTIONS (checkbox / dropdown)
|
|
28
|
+
export interface OptionConfig {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface OptionFieldConfig {
|
|
34
|
+
options?: OptionConfig[];
|
|
35
|
+
allowMultiple?: boolean;
|
|
36
|
+
referenceCollection?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// TABLE
|
|
40
|
+
export interface TableColumn {
|
|
41
|
+
columnId: string;
|
|
42
|
+
label: string;
|
|
43
|
+
type: FieldTypeEnum;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
referenceCollection?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MATRIX
|
|
49
|
+
export interface MatrixRow {
|
|
50
|
+
rowId: string;
|
|
51
|
+
label: string;
|
|
52
|
+
type: FieldTypeEnum;
|
|
53
|
+
required?: boolean;
|
|
54
|
+
referenceCollection?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface MatrixColumn {
|
|
58
|
+
columnId: string;
|
|
59
|
+
label: string;
|
|
60
|
+
type: FieldTypeEnum;
|
|
61
|
+
required?: boolean;
|
|
62
|
+
referenceCollection?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TableFieldConfig {
|
|
66
|
+
columns: TableColumn[];
|
|
67
|
+
minRows?: number;
|
|
68
|
+
maxRows?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MatrixFieldConfig {
|
|
72
|
+
rows: MatrixRow[];
|
|
73
|
+
columns: MatrixColumn[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* =========================
|
|
77
|
+
UNION CONFIG TYPE
|
|
78
|
+
========================= */
|
|
79
|
+
export type FieldConfig =
|
|
80
|
+
| TextFieldConfig
|
|
81
|
+
| WholeNumberFieldConfig
|
|
82
|
+
| DecimalNumberFieldConfig
|
|
83
|
+
| OptionFieldConfig
|
|
84
|
+
| TableFieldConfig
|
|
85
|
+
| MatrixFieldConfig
|
|
86
|
+
| null;
|
|
3
87
|
|
|
4
88
|
interface EditorField extends Document {
|
|
5
89
|
fieldCode: string;
|
|
@@ -9,13 +93,8 @@ interface EditorField extends Document {
|
|
|
9
93
|
SapSync: boolean;
|
|
10
94
|
MemberEdit: boolean;
|
|
11
95
|
ManagerEdit: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
minLength?: number | null;
|
|
15
|
-
maxLength?: number | null;
|
|
16
|
-
pattern?: string | null;
|
|
17
|
-
};
|
|
18
|
-
|
|
96
|
+
mandatory: boolean;
|
|
97
|
+
fieldConfig: FieldConfig;
|
|
19
98
|
isActive: boolean;
|
|
20
99
|
audit: Audit[];
|
|
21
100
|
}
|
|
@@ -25,7 +104,7 @@ const fieldSchema = new Schema<EditorField>({
|
|
|
25
104
|
fieldName: { type: String },
|
|
26
105
|
FieldTypeId: {
|
|
27
106
|
type: Schema.Types.ObjectId,
|
|
28
|
-
ref: "Field.Types", // Reference to the '
|
|
107
|
+
ref: "Field.Types", // Reference to the 'field Types' model
|
|
29
108
|
required: false,
|
|
30
109
|
default: null,
|
|
31
110
|
},
|
|
@@ -33,10 +112,8 @@ const fieldSchema = new Schema<EditorField>({
|
|
|
33
112
|
MemberEdit: { type: Boolean, default: false },
|
|
34
113
|
SapSync: { type: Boolean, default: false },
|
|
35
114
|
fieldConfig: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
maxLength: { type: Number, default: null },
|
|
39
|
-
pattern: { type: String, default: null },
|
|
115
|
+
type: Schema.Types.Mixed,
|
|
116
|
+
default: {},
|
|
40
117
|
},
|
|
41
118
|
isSystemDefined: { type: Boolean, default: false },
|
|
42
119
|
isActive: { type: Boolean, default: true },
|
|
@@ -26,82 +26,6 @@ export enum FieldTypeEnum {
|
|
|
26
26
|
CONFIG INTERFACES
|
|
27
27
|
========================= */
|
|
28
28
|
|
|
29
|
-
// TEXT
|
|
30
|
-
export interface TextFieldConfig {
|
|
31
|
-
pattern?: string | null; // regex pattern for validation
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//decimal ```NUMBER
|
|
35
|
-
export interface DecimalNumberFieldConfig {
|
|
36
|
-
step?: number; // for decimals
|
|
37
|
-
pattern?: string; // regex pattern for validation
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//whole number ```NUMBER
|
|
41
|
-
export interface WholeNumberFieldConfig {
|
|
42
|
-
pattern?: string; // regex pattern for validation
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// OPTIONS (checkbox / dropdown)
|
|
46
|
-
export interface OptionConfig {
|
|
47
|
-
value: string;
|
|
48
|
-
label: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface OptionFieldConfig {
|
|
52
|
-
options: OptionConfig[];
|
|
53
|
-
allowMultiple?: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// TABLE
|
|
57
|
-
export interface TableColumn {
|
|
58
|
-
columnId: string;
|
|
59
|
-
label: string;
|
|
60
|
-
type: FieldTypeEnum;
|
|
61
|
-
required?: boolean;
|
|
62
|
-
referenceCollection?: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// MATRIX
|
|
66
|
-
export interface MatrixRow {
|
|
67
|
-
rowId: string;
|
|
68
|
-
label: string;
|
|
69
|
-
type: FieldTypeEnum;
|
|
70
|
-
required?: boolean;
|
|
71
|
-
referenceCollection?: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface MatrixColumn {
|
|
75
|
-
columnId: string;
|
|
76
|
-
label: string;
|
|
77
|
-
type: FieldTypeEnum;
|
|
78
|
-
required?: boolean;
|
|
79
|
-
referenceCollection?: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface TableFieldConfig {
|
|
83
|
-
columns: TableColumn[];
|
|
84
|
-
minRows?: number;
|
|
85
|
-
maxRows?: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface MatrixFieldConfig {
|
|
89
|
-
rows: MatrixRow[];
|
|
90
|
-
columns: MatrixColumn[];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* =========================
|
|
94
|
-
UNION CONFIG TYPE
|
|
95
|
-
========================= */
|
|
96
|
-
export type FieldConfig =
|
|
97
|
-
| TextFieldConfig
|
|
98
|
-
| WholeNumberFieldConfig
|
|
99
|
-
| DecimalNumberFieldConfig
|
|
100
|
-
| OptionFieldConfig
|
|
101
|
-
| TableFieldConfig
|
|
102
|
-
| MatrixFieldConfig
|
|
103
|
-
| null;
|
|
104
|
-
|
|
105
29
|
/* =========================
|
|
106
30
|
MAIN DOCUMENT INTERFACE
|
|
107
31
|
========================= */
|
|
@@ -110,7 +34,6 @@ export interface EditorFieldType extends Document {
|
|
|
110
34
|
fieldEnum: FieldTypeEnum; // holds enum value
|
|
111
35
|
fieldTypeName: string;
|
|
112
36
|
fieldTypeDescription?: string;
|
|
113
|
-
config: FieldConfig;
|
|
114
37
|
isSystemDefined: boolean;
|
|
115
38
|
isActive: boolean;
|
|
116
39
|
audit: Audit[];
|
|
@@ -144,11 +67,6 @@ const fieldTypeSchema = new Schema<EditorFieldType>(
|
|
|
144
67
|
trim: true,
|
|
145
68
|
},
|
|
146
69
|
|
|
147
|
-
config: {
|
|
148
|
-
type: Schema.Types.Mixed,
|
|
149
|
-
default: {},
|
|
150
|
-
},
|
|
151
|
-
|
|
152
70
|
isSystemDefined: {
|
|
153
71
|
type: Boolean,
|
|
154
72
|
default: false,
|