agrs-sequelize-sdk 1.2.76 → 1.2.78
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/models/AutomationRule.js +10 -5
- package/models/RuleAction.js +21 -18
- package/models/RuleCondition.js +19 -13
- package/package.json +1 -1
package/models/AutomationRule.js
CHANGED
|
@@ -83,11 +83,16 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
83
83
|
allowNull: true,
|
|
84
84
|
comment: "User who created this rule",
|
|
85
85
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
updatedBy: {
|
|
87
|
+
type: DataTypes.STRING(255),
|
|
88
|
+
allowNull: true,
|
|
89
|
+
comment: "User who last updated this rule",
|
|
90
|
+
},
|
|
91
|
+
mediaBuyer: {
|
|
92
|
+
type: DataTypes.STRING(255),
|
|
93
|
+
allowNull: true,
|
|
94
|
+
comment: "Media buyer assigned to this rule for permissions",
|
|
95
|
+
},
|
|
91
96
|
},
|
|
92
97
|
{
|
|
93
98
|
tableName: "AutomationRules", // New table name
|
package/models/RuleAction.js
CHANGED
|
@@ -20,29 +20,32 @@ module.exports = (sequelize) => {
|
|
|
20
20
|
},
|
|
21
21
|
actionType: {
|
|
22
22
|
type: DataTypes.ENUM(
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
// AdSet level actions
|
|
30
|
-
"PAUSE_ADSET",
|
|
31
|
-
"ACTIVATE_ADSET",
|
|
32
|
-
"CHANGE_ADSET_BUDGET",
|
|
33
|
-
"CHANGE_ADSET_BID",
|
|
34
|
-
"CHANGE_ADSET_BID_STRATEGY",
|
|
35
|
-
|
|
36
|
-
// Ad level actions
|
|
37
|
-
"PAUSE_AD",
|
|
38
|
-
"ACTIVATE_AD",
|
|
39
|
-
|
|
40
|
-
// Custom actions
|
|
23
|
+
"PAUSE",
|
|
24
|
+
"ACTIVATE",
|
|
25
|
+
"CHANGE_BUDGET",
|
|
26
|
+
"CHANGE_BID",
|
|
27
|
+
"CHANGE_BID_STRATEGY",
|
|
41
28
|
"CUSTOM_ACTION"
|
|
42
29
|
),
|
|
43
30
|
allowNull: false,
|
|
44
31
|
comment: "Type of action to perform",
|
|
45
32
|
},
|
|
33
|
+
targetLevel: {
|
|
34
|
+
type: DataTypes.ENUM("CAMPAIGN", "ADSET", "AD"),
|
|
35
|
+
allowNull: false,
|
|
36
|
+
comment: "Level at which the action operates",
|
|
37
|
+
},
|
|
38
|
+
value: {
|
|
39
|
+
type: DataTypes.STRING(255),
|
|
40
|
+
allowNull: true,
|
|
41
|
+
comment: "Value for the action (budget amount, bid amount, etc.)",
|
|
42
|
+
},
|
|
43
|
+
valueType: {
|
|
44
|
+
type: DataTypes.ENUM("STRING", "NUMBER", "ARRAY"),
|
|
45
|
+
allowNull: true,
|
|
46
|
+
defaultValue: "STRING",
|
|
47
|
+
comment: "Type of the value field",
|
|
48
|
+
},
|
|
46
49
|
actionConfig: {
|
|
47
50
|
type: DataTypes.JSONB,
|
|
48
51
|
allowNull: true,
|
package/models/RuleCondition.js
CHANGED
|
@@ -25,19 +25,19 @@ module.exports = (sequelize) => {
|
|
|
25
25
|
},
|
|
26
26
|
operator: {
|
|
27
27
|
type: DataTypes.ENUM(
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
28
|
+
"eq",
|
|
29
|
+
"ne",
|
|
30
|
+
"gt",
|
|
31
|
+
"lt",
|
|
32
|
+
"gte",
|
|
33
|
+
"lte",
|
|
34
|
+
"between",
|
|
35
|
+
"in",
|
|
36
|
+
"not_in",
|
|
37
|
+
"contains",
|
|
38
|
+
"not_contains",
|
|
39
|
+
"is_null",
|
|
40
|
+
"is_not_null"
|
|
41
41
|
),
|
|
42
42
|
allowNull: false,
|
|
43
43
|
comment: "Comparison operator",
|
|
@@ -48,6 +48,12 @@ module.exports = (sequelize) => {
|
|
|
48
48
|
comment:
|
|
49
49
|
"Value(s) to compare against (can be array for BETWEEN, IN, etc.)",
|
|
50
50
|
},
|
|
51
|
+
valueType: {
|
|
52
|
+
type: DataTypes.ENUM("STRING", "NUMBER", "ARRAY"),
|
|
53
|
+
allowNull: true,
|
|
54
|
+
defaultValue: "STRING",
|
|
55
|
+
comment: "Type of the value field",
|
|
56
|
+
},
|
|
51
57
|
logicalOperator: {
|
|
52
58
|
type: DataTypes.ENUM("AND", "OR"),
|
|
53
59
|
allowNull: false,
|