agrs-sequelize-sdk 1.2.39 → 1.2.42

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,90 +1,90 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const DynamicFeed = sequelize.define(
3
- "DynamicFeed",
4
- {
5
- id: {
6
- type: DataTypes.INTEGER,
7
- primaryKey: true,
8
- autoIncrement: true,
9
- },
10
- // Feed Details
11
- feed_type: {
12
- type: DataTypes.ENUM('N2S', 'Type-In', 'AFD', 'RSOC'),
13
- allowNull: true,
14
- },
15
- feed: {
16
- type: DataTypes.ENUM('Direct', 'Partner', '3rd Party'),
17
- allowNull: true,
18
- },
19
- feed_name: {
20
- type: DataTypes.STRING,
21
- allowNull: false,
22
- },
23
- feed_short_name: {
24
- type: DataTypes.STRING,
25
- allowNull: true,
26
- },
27
- feed_logo: {
28
- type: DataTypes.TEXT,
29
- allowNull: true,
30
- },
31
- // Targeting Rules
32
- accepted_devices: {
33
- type: DataTypes.JSON,
34
- allowNull: true,
35
- },
36
- search_engine: {
37
- type: DataTypes.JSON,
38
- allowNull: true,
39
- },
40
- country: {
41
- type: DataTypes.STRING,
42
- allowNull: true,
43
- },
44
- generated_url: {
45
- type: DataTypes.STRING,
46
- allowNull: false,
47
- },
48
- token: {
49
- type: DataTypes.STRING,
50
- allowNull: true,
51
- },
52
- is_active: {
53
- type: DataTypes.BOOLEAN,
54
- defaultValue: true,
55
- allowNull: true,
56
- },
57
- },
58
- {
59
- tableName: "dynamic_feeds",
60
- indexes: [
61
- {
62
- fields: ["token"],
63
- },
64
- {
65
- fields: ["generated_url"],
66
- },
67
- {
68
- fields: ["is_active"],
69
- },
70
- {
71
- fields: ["feed_type"],
72
- },
73
- {
74
- fields: ["country"],
75
- },
76
- ],
77
- }
78
- );
79
-
80
- DynamicFeed.associate = (models) => {
81
- // Add associations here when needed
82
- // Example:
83
- // DynamicFeed.hasMany(models.FeedLogs, {
84
- // foreignKey: "feed_id",
85
- // as: "Logs",
86
- // });
87
- };
88
-
89
- return DynamicFeed;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const DynamicFeed = sequelize.define(
3
+ "DynamicFeed",
4
+ {
5
+ id: {
6
+ type: DataTypes.INTEGER,
7
+ primaryKey: true,
8
+ autoIncrement: true,
9
+ },
10
+ // Feed Details
11
+ feed_type: {
12
+ type: DataTypes.ENUM('N2S', 'Type-In', 'AFD', 'RSOC'),
13
+ allowNull: true,
14
+ },
15
+ feed: {
16
+ type: DataTypes.ENUM('Direct', 'Partner', '3rd Party'),
17
+ allowNull: true,
18
+ },
19
+ feed_name: {
20
+ type: DataTypes.STRING,
21
+ allowNull: false,
22
+ },
23
+ feed_short_name: {
24
+ type: DataTypes.STRING,
25
+ allowNull: true,
26
+ },
27
+ feed_logo: {
28
+ type: DataTypes.TEXT,
29
+ allowNull: true,
30
+ },
31
+ // Targeting Rules
32
+ accepted_devices: {
33
+ type: DataTypes.JSON,
34
+ allowNull: true,
35
+ },
36
+ search_engine: {
37
+ type: DataTypes.JSON,
38
+ allowNull: true,
39
+ },
40
+ country: {
41
+ type: DataTypes.STRING,
42
+ allowNull: true,
43
+ },
44
+ generated_url: {
45
+ type: DataTypes.STRING,
46
+ allowNull: false,
47
+ },
48
+ token: {
49
+ type: DataTypes.STRING,
50
+ allowNull: true,
51
+ },
52
+ is_active: {
53
+ type: DataTypes.BOOLEAN,
54
+ defaultValue: true,
55
+ allowNull: true,
56
+ },
57
+ },
58
+ {
59
+ tableName: "dynamic_feeds",
60
+ indexes: [
61
+ {
62
+ fields: ["token"],
63
+ },
64
+ {
65
+ fields: ["generated_url"],
66
+ },
67
+ {
68
+ fields: ["is_active"],
69
+ },
70
+ {
71
+ fields: ["feed_type"],
72
+ },
73
+ {
74
+ fields: ["country"],
75
+ },
76
+ ],
77
+ }
78
+ );
79
+
80
+ DynamicFeed.associate = (models) => {
81
+ // Add associations here when needed
82
+ // Example:
83
+ // DynamicFeed.hasMany(models.FeedLogs, {
84
+ // foreignKey: "feed_id",
85
+ // as: "Logs",
86
+ // });
87
+ };
88
+
89
+ return DynamicFeed;
90
90
  };
@@ -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
+ };
package/models/Presets.js CHANGED
@@ -1,34 +1,34 @@
1
- // models/Presets.js
2
- module.exports = (sequelize, DataTypes) => {
3
- const Presets = sequelize.define("Presets", {
4
- id: {
5
- type: DataTypes.UUID,
6
- defaultValue: DataTypes.UUIDV4,
7
- primaryKey: true,
8
- },
9
- name: {
10
- type: DataTypes.STRING,
11
- allowNull: false,
12
- },
13
- feeds: {
14
- type: DataTypes.JSONB,
15
- allowNull: true,
16
- },
17
- userId: {
18
- type: DataTypes.UUID,
19
- allowNull: false,
20
- references: {
21
- model: 'Users',
22
- key: 'id',
23
- },
24
- },
25
- }, {
26
- tableName: "Presets",
27
- });
28
-
29
- Presets.associate = (models) => {
30
- Presets.belongsTo(models.Users, { foreignKey: 'userId', as: 'user' });
31
- };
32
-
33
- return Presets;
34
- };
1
+ // models/Presets.js
2
+ module.exports = (sequelize, DataTypes) => {
3
+ const Presets = sequelize.define("Presets", {
4
+ id: {
5
+ type: DataTypes.UUID,
6
+ defaultValue: DataTypes.UUIDV4,
7
+ primaryKey: true,
8
+ },
9
+ name: {
10
+ type: DataTypes.STRING,
11
+ allowNull: false,
12
+ },
13
+ feeds: {
14
+ type: DataTypes.JSONB,
15
+ allowNull: true,
16
+ },
17
+ userId: {
18
+ type: DataTypes.UUID,
19
+ allowNull: false,
20
+ references: {
21
+ model: 'Users',
22
+ key: 'id',
23
+ },
24
+ },
25
+ }, {
26
+ tableName: "Presets",
27
+ });
28
+
29
+ Presets.associate = (models) => {
30
+ Presets.belongsTo(models.Users, { foreignKey: 'userId', as: 'user' });
31
+ };
32
+
33
+ return Presets;
34
+ };