agrs-sequelize-sdk 1.2.39 → 1.2.41
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/AdAccountValues.js +25 -25
- package/models/AdHistory.js +30 -30
- package/models/AdPerformance.js +89 -89
- package/models/AdSet.js +284 -284
- package/models/AdSetHistory.js +30 -30
- package/models/AdsetPerformance.js +126 -126
- package/models/Article.js +179 -174
- package/models/Buyers.js +25 -25
- package/models/Campaign.js +135 -135
- package/models/CampaignCreationLog.js +92 -92
- package/models/CampaignHistory.js +33 -33
- package/models/Channel.js +55 -55
- package/models/Domain.js +25 -25
- package/models/ExplorAdsChannel.js +61 -61
- package/models/Feed.js +33 -33
- package/models/Pages.js +73 -73
- package/models/PipelineExecution.js +46 -46
- package/models/Presets.js +34 -34
- package/models/RSOCFeedCampaign.js +347 -347
- package/models/RsocKeywordPerformance.js +110 -110
- package/models/RulesValues.js +56 -56
- package/models/SupportedLocale.js +23 -23
- package/models/Vertical.js +25 -25
- package/models/newFiles.js +68 -105
- package/package.json +19 -21
- package/run.sh +214 -214
- package/services/sequelizeService.js +63 -0
- package/models/DynamicFeed.js +0 -90
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
module.exports = (sequelize, DataTypes) => {
|
|
2
|
-
const RsocKeywordPerformance = sequelize.define('RsocKeywordPerformance', {
|
|
3
|
-
id: {
|
|
4
|
-
type: DataTypes.INTEGER,
|
|
5
|
-
primaryKey: true,
|
|
6
|
-
autoIncrement: true,
|
|
7
|
-
allowNull: false
|
|
8
|
-
},
|
|
9
|
-
ts: {
|
|
10
|
-
type: DataTypes.DATE,
|
|
11
|
-
allowNull: false,
|
|
12
|
-
comment: 'Timestamp of the record'
|
|
13
|
-
},
|
|
14
|
-
channel_id: {
|
|
15
|
-
type: DataTypes.STRING,
|
|
16
|
-
allowNull: false,
|
|
17
|
-
comment: 'Channel identifier'
|
|
18
|
-
},
|
|
19
|
-
style_id: {
|
|
20
|
-
type: DataTypes.STRING,
|
|
21
|
-
allowNull: true,
|
|
22
|
-
comment: 'Style identifier'
|
|
23
|
-
},
|
|
24
|
-
country_code: {
|
|
25
|
-
type: DataTypes.STRING(2),
|
|
26
|
-
allowNull: true,
|
|
27
|
-
comment: 'Country code (ISO 2-letter)'
|
|
28
|
-
},
|
|
29
|
-
custom_query: {
|
|
30
|
-
type: DataTypes.TEXT,
|
|
31
|
-
allowNull: true,
|
|
32
|
-
comment: 'Custom search query'
|
|
33
|
-
},
|
|
34
|
-
query: {
|
|
35
|
-
type: DataTypes.TEXT,
|
|
36
|
-
allowNull: true,
|
|
37
|
-
comment: 'Standard search query'
|
|
38
|
-
},
|
|
39
|
-
funnel_page_views: {
|
|
40
|
-
type: DataTypes.INTEGER,
|
|
41
|
-
allowNull: true,
|
|
42
|
-
defaultValue: 0,
|
|
43
|
-
comment: 'Number of funnel page views'
|
|
44
|
-
},
|
|
45
|
-
funnel_impressions: {
|
|
46
|
-
type: DataTypes.INTEGER,
|
|
47
|
-
allowNull: true,
|
|
48
|
-
defaultValue: 0,
|
|
49
|
-
comment: 'Number of funnel impressions'
|
|
50
|
-
},
|
|
51
|
-
funnel_clicks: {
|
|
52
|
-
type: DataTypes.INTEGER,
|
|
53
|
-
allowNull: true,
|
|
54
|
-
defaultValue: 0,
|
|
55
|
-
comment: 'Number of funnel clicks'
|
|
56
|
-
},
|
|
57
|
-
page_views: {
|
|
58
|
-
type: DataTypes.INTEGER,
|
|
59
|
-
allowNull: true,
|
|
60
|
-
defaultValue: 0,
|
|
61
|
-
comment: 'Number of page views'
|
|
62
|
-
},
|
|
63
|
-
impressions: {
|
|
64
|
-
type: DataTypes.INTEGER,
|
|
65
|
-
allowNull: true,
|
|
66
|
-
defaultValue: 0,
|
|
67
|
-
comment: 'Number of impressions'
|
|
68
|
-
},
|
|
69
|
-
clicks: {
|
|
70
|
-
type: DataTypes.INTEGER,
|
|
71
|
-
allowNull: true,
|
|
72
|
-
defaultValue: 0,
|
|
73
|
-
comment: 'Number of clicks'
|
|
74
|
-
},
|
|
75
|
-
agrs_cid: {
|
|
76
|
-
type: DataTypes.STRING,
|
|
77
|
-
allowNull: true,
|
|
78
|
-
comment: 'AGRS campaign identifier linking to campaign data'
|
|
79
|
-
}
|
|
80
|
-
}, {
|
|
81
|
-
tableName: 'rsoc_keyword_performance',
|
|
82
|
-
timestamps: true, // Adds createdAt and updatedAt columns
|
|
83
|
-
indexes: [
|
|
84
|
-
{
|
|
85
|
-
fields: ['channel_id', 'ts'],
|
|
86
|
-
name: 'idx_rsoc_keyword_channel_time'
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
fields: ['style_id'],
|
|
90
|
-
name: 'idx_rsoc_keyword_style'
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
fields: ['country_code'],
|
|
94
|
-
name: 'idx_rsoc_keyword_country'
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
fields: ['agrs_cid'],
|
|
98
|
-
name: 'idx_rsoc_keyword_agrs_cid'
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// Define associations if needed
|
|
104
|
-
RsocKeywordPerformance.associate = (models) => {
|
|
105
|
-
// Add associations here if your table needs to reference other tables
|
|
106
|
-
// For example:
|
|
107
|
-
// RsocKeywordPerformance.belongsTo(models.Channel, { foreignKey: 'channel_id' });
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return RsocKeywordPerformance;
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const RsocKeywordPerformance = sequelize.define('RsocKeywordPerformance', {
|
|
3
|
+
id: {
|
|
4
|
+
type: DataTypes.INTEGER,
|
|
5
|
+
primaryKey: true,
|
|
6
|
+
autoIncrement: true,
|
|
7
|
+
allowNull: false
|
|
8
|
+
},
|
|
9
|
+
ts: {
|
|
10
|
+
type: DataTypes.DATE,
|
|
11
|
+
allowNull: false,
|
|
12
|
+
comment: 'Timestamp of the record'
|
|
13
|
+
},
|
|
14
|
+
channel_id: {
|
|
15
|
+
type: DataTypes.STRING,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
comment: 'Channel identifier'
|
|
18
|
+
},
|
|
19
|
+
style_id: {
|
|
20
|
+
type: DataTypes.STRING,
|
|
21
|
+
allowNull: true,
|
|
22
|
+
comment: 'Style identifier'
|
|
23
|
+
},
|
|
24
|
+
country_code: {
|
|
25
|
+
type: DataTypes.STRING(2),
|
|
26
|
+
allowNull: true,
|
|
27
|
+
comment: 'Country code (ISO 2-letter)'
|
|
28
|
+
},
|
|
29
|
+
custom_query: {
|
|
30
|
+
type: DataTypes.TEXT,
|
|
31
|
+
allowNull: true,
|
|
32
|
+
comment: 'Custom search query'
|
|
33
|
+
},
|
|
34
|
+
query: {
|
|
35
|
+
type: DataTypes.TEXT,
|
|
36
|
+
allowNull: true,
|
|
37
|
+
comment: 'Standard search query'
|
|
38
|
+
},
|
|
39
|
+
funnel_page_views: {
|
|
40
|
+
type: DataTypes.INTEGER,
|
|
41
|
+
allowNull: true,
|
|
42
|
+
defaultValue: 0,
|
|
43
|
+
comment: 'Number of funnel page views'
|
|
44
|
+
},
|
|
45
|
+
funnel_impressions: {
|
|
46
|
+
type: DataTypes.INTEGER,
|
|
47
|
+
allowNull: true,
|
|
48
|
+
defaultValue: 0,
|
|
49
|
+
comment: 'Number of funnel impressions'
|
|
50
|
+
},
|
|
51
|
+
funnel_clicks: {
|
|
52
|
+
type: DataTypes.INTEGER,
|
|
53
|
+
allowNull: true,
|
|
54
|
+
defaultValue: 0,
|
|
55
|
+
comment: 'Number of funnel clicks'
|
|
56
|
+
},
|
|
57
|
+
page_views: {
|
|
58
|
+
type: DataTypes.INTEGER,
|
|
59
|
+
allowNull: true,
|
|
60
|
+
defaultValue: 0,
|
|
61
|
+
comment: 'Number of page views'
|
|
62
|
+
},
|
|
63
|
+
impressions: {
|
|
64
|
+
type: DataTypes.INTEGER,
|
|
65
|
+
allowNull: true,
|
|
66
|
+
defaultValue: 0,
|
|
67
|
+
comment: 'Number of impressions'
|
|
68
|
+
},
|
|
69
|
+
clicks: {
|
|
70
|
+
type: DataTypes.INTEGER,
|
|
71
|
+
allowNull: true,
|
|
72
|
+
defaultValue: 0,
|
|
73
|
+
comment: 'Number of clicks'
|
|
74
|
+
},
|
|
75
|
+
agrs_cid: {
|
|
76
|
+
type: DataTypes.STRING,
|
|
77
|
+
allowNull: true,
|
|
78
|
+
comment: 'AGRS campaign identifier linking to campaign data'
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
tableName: 'rsoc_keyword_performance',
|
|
82
|
+
timestamps: true, // Adds createdAt and updatedAt columns
|
|
83
|
+
indexes: [
|
|
84
|
+
{
|
|
85
|
+
fields: ['channel_id', 'ts'],
|
|
86
|
+
name: 'idx_rsoc_keyword_channel_time'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
fields: ['style_id'],
|
|
90
|
+
name: 'idx_rsoc_keyword_style'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
fields: ['country_code'],
|
|
94
|
+
name: 'idx_rsoc_keyword_country'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
fields: ['agrs_cid'],
|
|
98
|
+
name: 'idx_rsoc_keyword_agrs_cid'
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Define associations if needed
|
|
104
|
+
RsocKeywordPerformance.associate = (models) => {
|
|
105
|
+
// Add associations here if your table needs to reference other tables
|
|
106
|
+
// For example:
|
|
107
|
+
// RsocKeywordPerformance.belongsTo(models.Channel, { foreignKey: 'channel_id' });
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return RsocKeywordPerformance;
|
|
111
111
|
};
|
package/models/RulesValues.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
module.exports = (sequelize, DataTypes) => {
|
|
2
|
-
const RulesValues = sequelize.define(
|
|
3
|
-
"RulesValues",
|
|
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
|
-
permissions: {
|
|
20
|
-
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
21
|
-
allowNull: false,
|
|
22
|
-
defaultValue: [],
|
|
23
|
-
},
|
|
24
|
-
feature: {
|
|
25
|
-
type: DataTypes.STRING,
|
|
26
|
-
allowNull: true,
|
|
27
|
-
},
|
|
28
|
-
parentId: {
|
|
29
|
-
type: DataTypes.UUID,
|
|
30
|
-
allowNull: true,
|
|
31
|
-
references: {
|
|
32
|
-
model: "RulesValues",
|
|
33
|
-
key: "id",
|
|
34
|
-
},
|
|
35
|
-
onDelete: "CASCADE",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
tableName: "RulesValues",
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// Self-referential association to define sub-rules
|
|
44
|
-
RulesValues.hasMany(RulesValues, {
|
|
45
|
-
as: "subRules",
|
|
46
|
-
foreignKey: "parentId",
|
|
47
|
-
onDelete: "CASCADE",
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
RulesValues.belongsTo(RulesValues, {
|
|
51
|
-
as: "parentRule",
|
|
52
|
-
foreignKey: "parentId",
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
return RulesValues;
|
|
56
|
-
};
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const RulesValues = sequelize.define(
|
|
3
|
+
"RulesValues",
|
|
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
|
+
permissions: {
|
|
20
|
+
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
21
|
+
allowNull: false,
|
|
22
|
+
defaultValue: [],
|
|
23
|
+
},
|
|
24
|
+
feature: {
|
|
25
|
+
type: DataTypes.STRING,
|
|
26
|
+
allowNull: true,
|
|
27
|
+
},
|
|
28
|
+
parentId: {
|
|
29
|
+
type: DataTypes.UUID,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
references: {
|
|
32
|
+
model: "RulesValues",
|
|
33
|
+
key: "id",
|
|
34
|
+
},
|
|
35
|
+
onDelete: "CASCADE",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
tableName: "RulesValues",
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Self-referential association to define sub-rules
|
|
44
|
+
RulesValues.hasMany(RulesValues, {
|
|
45
|
+
as: "subRules",
|
|
46
|
+
foreignKey: "parentId",
|
|
47
|
+
onDelete: "CASCADE",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
RulesValues.belongsTo(RulesValues, {
|
|
51
|
+
as: "parentRule",
|
|
52
|
+
foreignKey: "parentId",
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return RulesValues;
|
|
56
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
module.exports = (sequelize, DataTypes) => {
|
|
2
|
-
const SupportedLocale = sequelize.define('SupportedLocale', {
|
|
3
|
-
country: {
|
|
4
|
-
type: DataTypes.STRING,
|
|
5
|
-
allowNull: false,
|
|
6
|
-
},
|
|
7
|
-
locale: {
|
|
8
|
-
type: DataTypes.STRING,
|
|
9
|
-
allowNull: false,
|
|
10
|
-
},
|
|
11
|
-
language: {
|
|
12
|
-
type: DataTypes.STRING,
|
|
13
|
-
allowNull: true,
|
|
14
|
-
comment: 'Language code (e.g., en, es, fr)'
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Define associations if needed in the future
|
|
19
|
-
// SupportedLocale.associate = (models) => {
|
|
20
|
-
// // e.g., SupportedLocale.hasMany(models.OtherModel);
|
|
21
|
-
// };
|
|
22
|
-
|
|
23
|
-
return SupportedLocale;
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const SupportedLocale = sequelize.define('SupportedLocale', {
|
|
3
|
+
country: {
|
|
4
|
+
type: DataTypes.STRING,
|
|
5
|
+
allowNull: false,
|
|
6
|
+
},
|
|
7
|
+
locale: {
|
|
8
|
+
type: DataTypes.STRING,
|
|
9
|
+
allowNull: false,
|
|
10
|
+
},
|
|
11
|
+
language: {
|
|
12
|
+
type: DataTypes.STRING,
|
|
13
|
+
allowNull: true,
|
|
14
|
+
comment: 'Language code (e.g., en, es, fr)'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Define associations if needed in the future
|
|
19
|
+
// SupportedLocale.associate = (models) => {
|
|
20
|
+
// // e.g., SupportedLocale.hasMany(models.OtherModel);
|
|
21
|
+
// };
|
|
22
|
+
|
|
23
|
+
return SupportedLocale;
|
|
24
24
|
};
|
package/models/Vertical.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
module.exports = (sequelize, DataTypes) => {
|
|
2
|
-
const Vertical = sequelize.define(
|
|
3
|
-
"Vertical",
|
|
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
|
-
},
|
|
20
|
-
{
|
|
21
|
-
tableName: "Vertical",
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return Vertical;
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const Vertical = sequelize.define(
|
|
3
|
+
"Vertical",
|
|
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
|
+
},
|
|
20
|
+
{
|
|
21
|
+
tableName: "Vertical",
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return Vertical;
|
|
26
26
|
};
|
package/models/newFiles.js
CHANGED
|
@@ -1,105 +1,68 @@
|
|
|
1
|
-
module.exports = (sequelize, DataTypes) => {
|
|
2
|
-
const NewFiles = sequelize.define("NewFiles", {
|
|
3
|
-
id: {
|
|
4
|
-
type: DataTypes.STRING,
|
|
5
|
-
primaryKey: true,
|
|
6
|
-
},
|
|
7
|
-
accounts: {
|
|
8
|
-
type: DataTypes.JSONB(),
|
|
9
|
-
allowNull: true,
|
|
10
|
-
},
|
|
11
|
-
name: {
|
|
12
|
-
type: DataTypes.STRING,
|
|
13
|
-
allowNull: false,
|
|
14
|
-
},
|
|
15
|
-
// need to add a field of the name in the gcp bucket
|
|
16
|
-
gcpFileName: {
|
|
17
|
-
type: DataTypes.STRING,
|
|
18
|
-
allowNull: true,
|
|
19
|
-
},
|
|
20
|
-
type: {
|
|
21
|
-
type: DataTypes.STRING, // Can be "image" or "video"
|
|
22
|
-
allowNull: false,
|
|
23
|
-
},
|
|
24
|
-
URL: {
|
|
25
|
-
type: DataTypes.STRING, // URL for the file
|
|
26
|
-
allowNull: false,
|
|
27
|
-
},
|
|
28
|
-
FileType: {
|
|
29
|
-
type: DataTypes.STRING,
|
|
30
|
-
allowNull: true,
|
|
31
|
-
defaultValue: "image",
|
|
32
|
-
},
|
|
33
|
-
Size: {
|
|
34
|
-
type: DataTypes.STRING,
|
|
35
|
-
allowNull: true,
|
|
36
|
-
},
|
|
37
|
-
Language: {
|
|
38
|
-
type: DataTypes.STRING,
|
|
39
|
-
allowNull: true,
|
|
40
|
-
},
|
|
41
|
-
Vertical: {
|
|
42
|
-
type: DataTypes.STRING,
|
|
43
|
-
allowNull: true,
|
|
44
|
-
},
|
|
45
|
-
// want to add length ( duration of the video) if the file is a video.
|
|
46
|
-
// maybe call it duration
|
|
47
|
-
Duration: {
|
|
48
|
-
type: DataTypes.STRING,
|
|
49
|
-
allowNull: true,
|
|
50
|
-
},
|
|
51
|
-
// Thumbnail URL
|
|
52
|
-
Thumbnail: {
|
|
53
|
-
type: DataTypes.TEXT,
|
|
54
|
-
allowNull: true,
|
|
55
|
-
},
|
|
56
|
-
Thumbnai2: {
|
|
57
|
-
type: DataTypes.TEXT,
|
|
58
|
-
allowNull: true,
|
|
59
|
-
},
|
|
60
|
-
// ImageHash
|
|
61
|
-
ImageHash: {
|
|
62
|
-
type: DataTypes.STRING,
|
|
63
|
-
allowNull: true,
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
freeText: {
|
|
71
|
-
type: DataTypes.STRING,
|
|
72
|
-
allowNull: true,
|
|
73
|
-
},
|
|
74
|
-
style: {
|
|
75
|
-
type: DataTypes.STRING,
|
|
76
|
-
allowNull: true,
|
|
77
|
-
},
|
|
78
|
-
ratio: {
|
|
79
|
-
type: DataTypes.STRING,
|
|
80
|
-
allowNull: true,
|
|
81
|
-
},
|
|
82
|
-
notes: {
|
|
83
|
-
type: DataTypes.STRING(1000),
|
|
84
|
-
allowNull: true,
|
|
85
|
-
},
|
|
86
|
-
headline: {
|
|
87
|
-
type: DataTypes.STRING(1000),
|
|
88
|
-
allowNull: true,
|
|
89
|
-
},
|
|
90
|
-
subtext: {
|
|
91
|
-
type: DataTypes.STRING(1000),
|
|
92
|
-
allowNull: true,
|
|
93
|
-
},
|
|
94
|
-
cta: {
|
|
95
|
-
type: DataTypes.STRING(1000),
|
|
96
|
-
allowNull: true,
|
|
97
|
-
},
|
|
98
|
-
script: {
|
|
99
|
-
type: DataTypes.STRING(1000),
|
|
100
|
-
allowNull: true,
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
return NewFiles;
|
|
105
|
-
};
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const NewFiles = sequelize.define("NewFiles", {
|
|
3
|
+
id: {
|
|
4
|
+
type: DataTypes.STRING,
|
|
5
|
+
primaryKey: true,
|
|
6
|
+
},
|
|
7
|
+
accounts: {
|
|
8
|
+
type: DataTypes.JSONB(),
|
|
9
|
+
allowNull: true,
|
|
10
|
+
},
|
|
11
|
+
name: {
|
|
12
|
+
type: DataTypes.STRING,
|
|
13
|
+
allowNull: false,
|
|
14
|
+
},
|
|
15
|
+
// need to add a field of the name in the gcp bucket
|
|
16
|
+
gcpFileName: {
|
|
17
|
+
type: DataTypes.STRING,
|
|
18
|
+
allowNull: true,
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: DataTypes.STRING, // Can be "image" or "video"
|
|
22
|
+
allowNull: false,
|
|
23
|
+
},
|
|
24
|
+
URL: {
|
|
25
|
+
type: DataTypes.STRING, // URL for the file
|
|
26
|
+
allowNull: false,
|
|
27
|
+
},
|
|
28
|
+
FileType: {
|
|
29
|
+
type: DataTypes.STRING,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
defaultValue: "image",
|
|
32
|
+
},
|
|
33
|
+
Size: {
|
|
34
|
+
type: DataTypes.STRING,
|
|
35
|
+
allowNull: true,
|
|
36
|
+
},
|
|
37
|
+
Language: {
|
|
38
|
+
type: DataTypes.STRING,
|
|
39
|
+
allowNull: true,
|
|
40
|
+
},
|
|
41
|
+
Vertical: {
|
|
42
|
+
type: DataTypes.STRING,
|
|
43
|
+
allowNull: true,
|
|
44
|
+
},
|
|
45
|
+
// want to add length ( duration of the video) if the file is a video.
|
|
46
|
+
// maybe call it duration
|
|
47
|
+
Duration: {
|
|
48
|
+
type: DataTypes.STRING,
|
|
49
|
+
allowNull: true,
|
|
50
|
+
},
|
|
51
|
+
// Thumbnail URL
|
|
52
|
+
Thumbnail: {
|
|
53
|
+
type: DataTypes.TEXT,
|
|
54
|
+
allowNull: true,
|
|
55
|
+
},
|
|
56
|
+
Thumbnai2: {
|
|
57
|
+
type: DataTypes.TEXT,
|
|
58
|
+
allowNull: true,
|
|
59
|
+
},
|
|
60
|
+
// ImageHash
|
|
61
|
+
ImageHash: {
|
|
62
|
+
type: DataTypes.STRING,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return NewFiles;
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "agrs-sequelize-sdk",
|
|
3
|
+
"version": "1.2.41",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "node index.js",
|
|
7
|
+
"sync": "node services/sequelizeService.js",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"description": "",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"pg": "^8.13.0",
|
|
16
|
+
"pg-hstore": "^2.3.4",
|
|
17
|
+
"sequelize": "^6.37.4"
|
|
18
|
+
}
|
|
19
|
+
}
|