agrs-sequelize-sdk 1.1.43 → 1.1.45

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/Article.js CHANGED
@@ -2,10 +2,11 @@ module.exports = (sequelize, DataTypes) => {
2
2
  const Article = sequelize.define(
3
3
  "Article",
4
4
  {
5
- id: {
6
- type: DataTypes.INTEGER,
7
- primaryKey: true,
8
- autoIncrement: true,
5
+ providerId: {
6
+ // Renamed from externalId to providerId
7
+ type: DataTypes.STRING,
8
+ allowNull: true,
9
+ unique: true, // Ensure uniqueness for provider IDs
9
10
  },
10
11
  AGRSAID: {
11
12
  type: DataTypes.STRING,
@@ -15,17 +16,14 @@ module.exports = (sequelize, DataTypes) => {
15
16
  articleUrl: {
16
17
  type: DataTypes.STRING(1024),
17
18
  allowNull: true,
18
- comment: "Generated URL for the article",
19
19
  },
20
20
  feed: {
21
21
  type: DataTypes.STRING,
22
22
  allowNull: false,
23
- comment: "e.g., RSOC, Tonic, Explorer, InMobi",
24
23
  },
25
24
  feedName: {
26
25
  type: DataTypes.STRING,
27
26
  allowNull: false,
28
- comment: "e.g., TNC, SDO, RSOC",
29
27
  },
30
28
  vertical: {
31
29
  type: DataTypes.STRING,
@@ -43,18 +41,15 @@ module.exports = (sequelize, DataTypes) => {
43
41
  topics: {
44
42
  type: DataTypes.ARRAY(DataTypes.STRING),
45
43
  allowNull: true,
46
- comment: "List of topics (3-5 mandatory in UI)",
47
44
  },
48
45
  keywords: {
49
46
  type: DataTypes.ARRAY(DataTypes.STRING),
50
47
  allowNull: true,
51
- comment: "Main keyword and related terms",
52
48
  },
53
49
  date: {
54
50
  type: DataTypes.DATE,
55
51
  allowNull: true,
56
52
  defaultValue: DataTypes.NOW,
57
- comment: "Creation date of the article",
58
53
  },
59
54
  nativeKeyword: {
60
55
  type: DataTypes.STRING,
@@ -63,7 +58,6 @@ module.exports = (sequelize, DataTypes) => {
63
58
  suggestedKeywords: {
64
59
  type: DataTypes.STRING,
65
60
  allowNull: true,
66
- comment: "Comma-separated list of related terms",
67
61
  },
68
62
  articleExcerpt: {
69
63
  type: DataTypes.TEXT,
@@ -79,8 +73,8 @@ module.exports = (sequelize, DataTypes) => {
79
73
  },
80
74
  status: {
81
75
  type: DataTypes.STRING,
76
+ allowNull: false,
82
77
  defaultValue: "pending",
83
- comment: "e.g., pending, approved, rejected",
84
78
  },
85
79
  createdAt: {
86
80
  type: DataTypes.DATE,
@@ -90,6 +84,14 @@ module.exports = (sequelize, DataTypes) => {
90
84
  type: DataTypes.DATE,
91
85
  defaultValue: DataTypes.NOW,
92
86
  },
87
+ buyer: {
88
+ type: DataTypes.STRING,
89
+ allowNull: true,
90
+ },
91
+ country: {
92
+ type: DataTypes.STRING,
93
+ allowNull: true,
94
+ },
93
95
  },
94
96
  {
95
97
  tableName: "articles",
@@ -106,5 +108,9 @@ module.exports = (sequelize, DataTypes) => {
106
108
  });
107
109
  };
108
110
 
111
+ Article.prototype.isAvailableForCampaign = function () {
112
+ return this.status === "approved";
113
+ };
114
+
109
115
  return Article;
110
116
  };
package/models/Channel.js CHANGED
@@ -8,9 +8,9 @@ module.exports = (sequelize, DataTypes) => {
8
8
  autoIncrement: true,
9
9
  },
10
10
  channelId: {
11
- type: DataTypes.STRING(255), // הגדרה מפורשת של VARCHAR(255)
11
+ type: DataTypes.STRING(255),
12
12
  allowNull: false,
13
- unique: true, // הגדרת unique בשדה
13
+ unique: true,
14
14
  },
15
15
  styleId: {
16
16
  type: DataTypes.STRING,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",