agrs-sequelize-sdk 1.3.6 → 1.3.8
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,81 @@
|
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const FeedArticleConfiguration = sequelize.define(
|
|
3
|
+
"FeedArticleConfiguration",
|
|
4
|
+
{
|
|
5
|
+
id: {
|
|
6
|
+
type: DataTypes.INTEGER,
|
|
7
|
+
primaryKey: true,
|
|
8
|
+
autoIncrement: true,
|
|
9
|
+
},
|
|
10
|
+
feedProvider: {
|
|
11
|
+
type: DataTypes.STRING(100),
|
|
12
|
+
allowNull: false,
|
|
13
|
+
unique: true,
|
|
14
|
+
field: "feed_provider",
|
|
15
|
+
},
|
|
16
|
+
requiredFields: {
|
|
17
|
+
type: DataTypes.JSONB,
|
|
18
|
+
allowNull: false,
|
|
19
|
+
defaultValue: [],
|
|
20
|
+
field: "required_fields",
|
|
21
|
+
comment: "Array of field configs: [{ name, description, allowedValues }]"
|
|
22
|
+
},
|
|
23
|
+
model: {
|
|
24
|
+
type: DataTypes.STRING(50),
|
|
25
|
+
allowNull: false,
|
|
26
|
+
defaultValue: "gpt-4o-mini",
|
|
27
|
+
comment: "OpenAI model to use for this feed"
|
|
28
|
+
},
|
|
29
|
+
temperature: {
|
|
30
|
+
type: DataTypes.FLOAT,
|
|
31
|
+
allowNull: false,
|
|
32
|
+
defaultValue: 0.7,
|
|
33
|
+
comment: "Temperature for AI generation (0.0-1.0)"
|
|
34
|
+
},
|
|
35
|
+
baseUrl: {
|
|
36
|
+
type: DataTypes.STRING(500),
|
|
37
|
+
allowNull: true,
|
|
38
|
+
field: "base_url",
|
|
39
|
+
},
|
|
40
|
+
isActive: {
|
|
41
|
+
type: DataTypes.BOOLEAN,
|
|
42
|
+
allowNull: false,
|
|
43
|
+
defaultValue: true,
|
|
44
|
+
field: "is_active",
|
|
45
|
+
},
|
|
46
|
+
createdAt: {
|
|
47
|
+
type: DataTypes.DATE,
|
|
48
|
+
allowNull: false,
|
|
49
|
+
defaultValue: DataTypes.NOW,
|
|
50
|
+
field: "created_at",
|
|
51
|
+
},
|
|
52
|
+
updatedAt: {
|
|
53
|
+
type: DataTypes.DATE,
|
|
54
|
+
allowNull: false,
|
|
55
|
+
defaultValue: DataTypes.NOW,
|
|
56
|
+
field: "updated_at",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
tableName: "feed_article_configurations",
|
|
61
|
+
timestamps: true,
|
|
62
|
+
createdAt: "created_at",
|
|
63
|
+
updatedAt: "updated_at",
|
|
64
|
+
indexes: [
|
|
65
|
+
{
|
|
66
|
+
unique: true,
|
|
67
|
+
fields: ["feed_provider"],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
fields: ["is_active"],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
FeedArticleConfiguration.associate = (models) => {
|
|
77
|
+
// Future: Add associations if needed
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return FeedArticleConfiguration;
|
|
81
|
+
};
|
package/models/RuleCondition.js
CHANGED
|
@@ -27,12 +27,13 @@ module.exports = (sequelize) => {
|
|
|
27
27
|
type: DataTypes.ENUM("DIMENSION", "METRIC"),
|
|
28
28
|
allowNull: false,
|
|
29
29
|
defaultValue: "DIMENSION",
|
|
30
|
-
comment:
|
|
30
|
+
comment:
|
|
31
|
+
"Type of field - DIMENSION for filtering, METRIC for calculations",
|
|
31
32
|
},
|
|
32
33
|
operator: {
|
|
33
34
|
type: DataTypes.ENUM(
|
|
34
35
|
"EQUALS",
|
|
35
|
-
"NOT_EQUALS",
|
|
36
|
+
"NOT_EQUALS",
|
|
36
37
|
"GREATER_THAN",
|
|
37
38
|
"LESS_THAN",
|
|
38
39
|
"GREATER_THAN_OR_EQUAL",
|
|
@@ -78,6 +79,44 @@ module.exports = (sequelize) => {
|
|
|
78
79
|
allowNull: false,
|
|
79
80
|
comment: "Whether this condition is active",
|
|
80
81
|
},
|
|
82
|
+
groupId: {
|
|
83
|
+
type: DataTypes.STRING(50),
|
|
84
|
+
allowNull: true,
|
|
85
|
+
comment: "ID to group conditions together (e.g., group1, group2)",
|
|
86
|
+
},
|
|
87
|
+
groupOperator: {
|
|
88
|
+
type: DataTypes.ENUM("AND", "OR"),
|
|
89
|
+
allowNull: false,
|
|
90
|
+
defaultValue: "AND",
|
|
91
|
+
comment: "Operator within the group (AND/OR)",
|
|
92
|
+
},
|
|
93
|
+
betweenGroupsOperator: {
|
|
94
|
+
type: DataTypes.ENUM("AND", "OR"),
|
|
95
|
+
allowNull: true,
|
|
96
|
+
comment:
|
|
97
|
+
"Operator between different groups (AND/OR) - only for first condition in group",
|
|
98
|
+
},
|
|
99
|
+
dateRangeType: {
|
|
100
|
+
type: DataTypes.STRING(50),
|
|
101
|
+
allowNull: true,
|
|
102
|
+
comment:
|
|
103
|
+
"Type of date range (last_7_days, yesterday, today, custom, etc.)",
|
|
104
|
+
},
|
|
105
|
+
dateRangeValue: {
|
|
106
|
+
type: DataTypes.INTEGER,
|
|
107
|
+
allowNull: true,
|
|
108
|
+
comment: "Number of days for relative date ranges",
|
|
109
|
+
},
|
|
110
|
+
customStartDate: {
|
|
111
|
+
type: DataTypes.DATE,
|
|
112
|
+
allowNull: true,
|
|
113
|
+
comment: "Custom start date if dateRangeType is custom",
|
|
114
|
+
},
|
|
115
|
+
customEndDate: {
|
|
116
|
+
type: DataTypes.DATE,
|
|
117
|
+
allowNull: true,
|
|
118
|
+
comment: "Custom end date if dateRangeType is custom",
|
|
119
|
+
},
|
|
81
120
|
},
|
|
82
121
|
{
|
|
83
122
|
tableName: "RuleConditions",
|