agrs-sequelize-sdk 1.2.13 → 1.2.15

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.
@@ -1,62 +1,62 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const ExplorAdsChannel = sequelize.define(
3
- "ExplorAdsChannel",
4
- {
5
- channelId: {
6
- type: DataTypes.STRING,
7
- allowNull: false,
8
- validate: {
9
- // Validate channel format (br_vt_ch1401 to br_vt_ch1500)
10
- is: /^br_vt_ch(14[0-9][0-9]|1500)$/
11
- }
12
- },
13
- status: {
14
- type: DataTypes.STRING,
15
- allowNull: false,
16
- defaultValue: "free",
17
- validate: {
18
- isIn: [["free", "used", "archived"]],
19
- },
20
- },
21
- domain: {
22
- type: DataTypes.STRING,
23
- allowNull: false,
24
- defaultValue: "nexoreach.com"
25
- },
26
- connectedCampaigns: {
27
- type: DataTypes.JSONB,
28
- allowNull: false,
29
- defaultValue: [],
30
- },
31
- lastUsed: {
32
- type: DataTypes.DATE,
33
- allowNull: true
34
- }
35
- },
36
- {
37
- tableName: "explorads_channels",
38
- timestamps: true,
39
- indexes: [
40
- {
41
- unique: true,
42
- fields: ["channelId"],
43
- name: "unique_explorads_channel"
44
- },
45
- ],
46
- }
47
- );
48
-
49
- // Define associations
50
- ExplorAdsChannel.associate = (models) => {
51
- if (models.RSOCFeedCampaign) {
52
- ExplorAdsChannel.hasMany(models.RSOCFeedCampaign, {
53
- foreignKey: "channelId",
54
- sourceKey: "channelId",
55
- as: "RSOCFeedCampaigns",
56
- constraints: false, // Disable FK constraint
57
- });
58
- }
59
- };
60
-
61
- return ExplorAdsChannel;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const ExplorAdsChannel = sequelize.define(
3
+ "ExplorAdsChannel",
4
+ {
5
+ channelId: {
6
+ type: DataTypes.STRING,
7
+ allowNull: false,
8
+ validate: {
9
+ // Validate channel format (br_vt_ch1401 to br_vt_ch1500)
10
+ is: /^br_vt_ch(14[0-9][0-9]|1500)$/
11
+ }
12
+ },
13
+ status: {
14
+ type: DataTypes.STRING,
15
+ allowNull: false,
16
+ defaultValue: "free",
17
+ validate: {
18
+ isIn: [["free", "used", "archived"]],
19
+ },
20
+ },
21
+ domain: {
22
+ type: DataTypes.STRING,
23
+ allowNull: false,
24
+ defaultValue: "nexoreach.com"
25
+ },
26
+ connectedCampaigns: {
27
+ type: DataTypes.JSONB,
28
+ allowNull: false,
29
+ defaultValue: [],
30
+ },
31
+ lastUsed: {
32
+ type: DataTypes.DATE,
33
+ allowNull: true
34
+ }
35
+ },
36
+ {
37
+ tableName: "explorads_channels",
38
+ timestamps: true,
39
+ indexes: [
40
+ {
41
+ unique: true,
42
+ fields: ["channelId"],
43
+ name: "unique_explorads_channel"
44
+ },
45
+ ],
46
+ }
47
+ );
48
+
49
+ // Define associations
50
+ ExplorAdsChannel.associate = (models) => {
51
+ if (models.RSOCFeedCampaign) {
52
+ ExplorAdsChannel.hasMany(models.RSOCFeedCampaign, {
53
+ foreignKey: "channelId",
54
+ sourceKey: "channelId",
55
+ as: "RSOCFeedCampaigns",
56
+ constraints: false, // Disable FK constraint
57
+ });
58
+ }
59
+ };
60
+
61
+ return ExplorAdsChannel;
62
62
  };
package/models/Feed.js CHANGED
@@ -1,34 +1,34 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const Feed = sequelize.define(
3
- "Feed",
4
- {
5
- id: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- label: {
11
- type: DataTypes.STRING,
12
- allowNull: false,
13
- },
14
- code: {
15
- type: DataTypes.STRING,
16
- allowNull: false,
17
- unique: true,
18
- },
19
- sheet: {
20
- type: DataTypes.STRING,
21
- allowNull: false,
22
- },
23
- feedProvider: {
24
- type: DataTypes.STRING,
25
- allowNull: false,
26
- },
27
- },
28
- {
29
- tableName: "Feed",
30
- }
31
- );
32
-
33
- return Feed;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const Feed = sequelize.define(
3
+ "Feed",
4
+ {
5
+ id: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ label: {
11
+ type: DataTypes.STRING,
12
+ allowNull: false,
13
+ },
14
+ code: {
15
+ type: DataTypes.STRING,
16
+ allowNull: false,
17
+ unique: true,
18
+ },
19
+ sheet: {
20
+ type: DataTypes.STRING,
21
+ allowNull: false,
22
+ },
23
+ feedProvider: {
24
+ type: DataTypes.STRING,
25
+ allowNull: false,
26
+ },
27
+ },
28
+ {
29
+ tableName: "Feed",
30
+ }
31
+ );
32
+
33
+ return Feed;
34
34
  };
package/models/Pages.js CHANGED
@@ -1,74 +1,74 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const Pages = sequelize.define(
3
- "Pages",
4
- {
5
- id: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- name: {
11
- type: DataTypes.STRING,
12
- allowNull: false,
13
- },
14
- code: {
15
- type: DataTypes.STRING,
16
- allowNull: false,
17
- unique: true,
18
- },
19
- link: {
20
- type: DataTypes.STRING,
21
- allowNull: true,
22
- },
23
- feedProvider: {
24
- type: DataTypes.ARRAY(DataTypes.STRING),
25
- allowNull: false,
26
- defaultValue: [], // Default value is an empty array
27
- },
28
- tasks: {
29
- type: DataTypes.ARRAY(DataTypes.STRING),
30
- allowNull: false,
31
- defaultValue: [], // Default value is an empty array
32
- },
33
- is_published:{
34
- type: DataTypes.BOOLEAN,
35
- allowNull: false,
36
- defaultValue: true,
37
- },
38
- Category: {
39
- type: DataTypes.STRING,
40
- allowNull: true,
41
- },
42
- Owner: {
43
- type: DataTypes.STRING,
44
- allowNull: true,
45
- },
46
- Status:{
47
- type: DataTypes.STRING,
48
- allowNull: true,
49
- },
50
- AdLibrary:{
51
- type: DataTypes.STRING,
52
- allowNull: true,
53
- },
54
- BusinessManager: {
55
- type: DataTypes.STRING,
56
- allowNull: true,
57
- },
58
- Users: {
59
- type: DataTypes.ARRAY(DataTypes.STRING),
60
- allowNull: false,
61
- defaultValue: [],
62
- },
63
- Archived: {
64
- type: DataTypes.BOOLEAN,
65
- allowNull: true,
66
- },
67
- },
68
- {
69
- tableName: "Pages",
70
- }
71
- );
72
-
73
- return Pages;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const Pages = sequelize.define(
3
+ "Pages",
4
+ {
5
+ id: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ name: {
11
+ type: DataTypes.STRING,
12
+ allowNull: false,
13
+ },
14
+ code: {
15
+ type: DataTypes.STRING,
16
+ allowNull: false,
17
+ unique: true,
18
+ },
19
+ link: {
20
+ type: DataTypes.STRING,
21
+ allowNull: true,
22
+ },
23
+ feedProvider: {
24
+ type: DataTypes.ARRAY(DataTypes.STRING),
25
+ allowNull: false,
26
+ defaultValue: [], // Default value is an empty array
27
+ },
28
+ tasks: {
29
+ type: DataTypes.ARRAY(DataTypes.STRING),
30
+ allowNull: false,
31
+ defaultValue: [], // Default value is an empty array
32
+ },
33
+ is_published:{
34
+ type: DataTypes.BOOLEAN,
35
+ allowNull: false,
36
+ defaultValue: true,
37
+ },
38
+ Category: {
39
+ type: DataTypes.STRING,
40
+ allowNull: true,
41
+ },
42
+ Owner: {
43
+ type: DataTypes.STRING,
44
+ allowNull: true,
45
+ },
46
+ Status:{
47
+ type: DataTypes.STRING,
48
+ allowNull: true,
49
+ },
50
+ AdLibrary:{
51
+ type: DataTypes.STRING,
52
+ allowNull: true,
53
+ },
54
+ BusinessManager: {
55
+ type: DataTypes.STRING,
56
+ allowNull: true,
57
+ },
58
+ Users: {
59
+ type: DataTypes.ARRAY(DataTypes.STRING),
60
+ allowNull: false,
61
+ defaultValue: [],
62
+ },
63
+ Archived: {
64
+ type: DataTypes.BOOLEAN,
65
+ allowNull: true,
66
+ },
67
+ },
68
+ {
69
+ tableName: "Pages",
70
+ }
71
+ );
72
+
73
+ return Pages;
74
74
  };
@@ -1,46 +1,46 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const PipelineExecution = sequelize.define(
3
- "PipelineExecution",
4
- {
5
- id: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- startTime: {
11
- type: DataTypes.DATE,
12
- allowNull: false,
13
- },
14
- endTime: {
15
- type: DataTypes.DATE,
16
- allowNull: false,
17
- },
18
- status: {
19
- type: DataTypes.ENUM("success", "failed"),
20
- allowNull: false,
21
- },
22
- fbDaysBack: {
23
- type: DataTypes.INTEGER,
24
- allowNull: true,
25
- },
26
- codeFuelDaysBack: {
27
- type: DataTypes.INTEGER,
28
- allowNull: true,
29
- },
30
- tonicDaysBack: {
31
- type: DataTypes.INTEGER,
32
- allowNull: true,
33
- },
34
- error: {
35
- type: DataTypes.TEXT,
36
- allowNull: true,
37
- },
38
- },
39
- {
40
- tableName: "pipeline_executions",
41
- timestamps: true,
42
- }
43
- );
44
-
45
- return PipelineExecution;
46
- };
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const PipelineExecution = sequelize.define(
3
+ "PipelineExecution",
4
+ {
5
+ id: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ startTime: {
11
+ type: DataTypes.DATE,
12
+ allowNull: false,
13
+ },
14
+ endTime: {
15
+ type: DataTypes.DATE,
16
+ allowNull: false,
17
+ },
18
+ status: {
19
+ type: DataTypes.ENUM("success", "failed"),
20
+ allowNull: false,
21
+ },
22
+ fbDaysBack: {
23
+ type: DataTypes.INTEGER,
24
+ allowNull: true,
25
+ },
26
+ codeFuelDaysBack: {
27
+ type: DataTypes.INTEGER,
28
+ allowNull: true,
29
+ },
30
+ tonicDaysBack: {
31
+ type: DataTypes.INTEGER,
32
+ allowNull: true,
33
+ },
34
+ error: {
35
+ type: DataTypes.TEXT,
36
+ allowNull: true,
37
+ },
38
+ },
39
+ {
40
+ tableName: "pipeline_executions",
41
+ timestamps: true,
42
+ }
43
+ );
44
+
45
+ return PipelineExecution;
46
+ };