agrs-sequelize-sdk 1.3.45 → 1.3.48

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.
@@ -79,6 +79,12 @@ module.exports = (sequelize, DataTypes) => {
79
79
  field: "preset_id",
80
80
  comment: "Preset ID",
81
81
  },
82
+ article_creation_payload: {
83
+ type: DataTypes.JSONB,
84
+ allowNull: true,
85
+ field: "article_creation_payload",
86
+ comment: "Payload sent for article creation (Mine/Predicto/Mobitech specific parameters)",
87
+ },
82
88
  },
83
89
  {
84
90
  tableName: "ai_campaign_queue",
@@ -90,6 +90,7 @@ module.exports = (sequelize, DataTypes) => {
90
90
  allowNull: true,
91
91
  comment: "User who created this rule",
92
92
  },
93
+ <<<<<<< Updated upstream
93
94
  updatedBy: {
94
95
  type: DataTypes.STRING(255),
95
96
  allowNull: true,
@@ -134,6 +135,40 @@ module.exports = (sequelize, DataTypes) => {
134
135
  defaultValue: [],
135
136
  comment: "Array of media buyer codes that this rule can be assigned to",
136
137
  },
138
+ =======
139
+ updatedBy: {
140
+ type: DataTypes.STRING(255),
141
+ allowNull: true,
142
+ comment: "User who last updated this rule",
143
+ },
144
+ mediaBuyer: {
145
+ type: DataTypes.STRING(255),
146
+ allowNull: true,
147
+ comment: "Media buyer assigned to this rule for permissions",
148
+ },
149
+ dateRangeType: {
150
+ type: DataTypes.ENUM("LAST_N_DAYS", "CUSTOM_RANGE", "CURRENT_MONTH", "LAST_MONTH"),
151
+ allowNull: true,
152
+ defaultValue: "LAST_N_DAYS",
153
+ comment: "Type of date range for rule evaluation",
154
+ },
155
+ dateRangeValue: {
156
+ type: DataTypes.INTEGER,
157
+ allowNull: true,
158
+ defaultValue: 7,
159
+ comment: "Number of days for LAST_N_DAYS type",
160
+ },
161
+ customStartDate: {
162
+ type: DataTypes.DATEONLY,
163
+ allowNull: true,
164
+ comment: "Custom start date for CUSTOM_RANGE type",
165
+ },
166
+ customEndDate: {
167
+ type: DataTypes.DATEONLY,
168
+ allowNull: true,
169
+ comment: "Custom end date for CUSTOM_RANGE type",
170
+ },
171
+ >>>>>>> Stashed changes
137
172
  },
138
173
  {
139
174
  tableName: "AutomationRules", // New table name
@@ -4,9 +4,7 @@
4
4
  * Used for advanced filtering, sorting, and template library management
5
5
  */
6
6
 
7
- const { DataTypes } = require("sequelize");
8
-
9
- module.exports = (sequelize) => {
7
+ module.exports = (sequelize, DataTypes) => {
10
8
  const TemplateMetadata = sequelize.define(
11
9
  "TemplateMetadata",
12
10
  {
@@ -18,10 +16,10 @@ module.exports = (sequelize) => {
18
16
  },
19
17
  templateId: {
20
18
  type: DataTypes.INTEGER,
21
- allowNull: false,
19
+ allowNull: true, // ✅ Made nullable - user-uploaded templates won't have a template_id
22
20
  unique: true,
23
21
  field: "template_id",
24
- comment: "Reference to templateConfig.json ID (1-59)",
22
+ comment: "Reference to templateConfig.json ID (1-59), null for user-uploaded templates",
25
23
  },
26
24
  name: {
27
25
  type: DataTypes.STRING(255),
@@ -165,6 +163,35 @@ module.exports = (sequelize) => {
165
163
  comment: "Array of sample image URLs",
166
164
  },
167
165
 
166
+ // ===== User Uploaded Original Image =====
167
+ userUploadedImageUrl: {
168
+ type: DataTypes.TEXT,
169
+ allowNull: true,
170
+ field: "user_uploaded_image_url",
171
+ comment: "URL of the original banner image uploaded by user (stored in GCP)",
172
+ },
173
+ uploadedBy: {
174
+ type: DataTypes.STRING(100),
175
+ allowNull: true,
176
+ field: "uploaded_by",
177
+ comment: "Username of the user who uploaded this template",
178
+ },
179
+ isUserGenerated: {
180
+ type: DataTypes.BOOLEAN,
181
+ allowNull: false,
182
+ defaultValue: true,
183
+ field: "is_user_generated",
184
+ comment: "True if template was uploaded/analyzed by user, false if system template",
185
+ },
186
+
187
+ // ===== Preview =====
188
+ layoutPreview: {
189
+ type: DataTypes.TEXT,
190
+ allowNull: true,
191
+ field: "layout_preview",
192
+ comment: "HTML/CSS preview generated by Gemini AI",
193
+ },
194
+
168
195
  // ===== Legacy Grid Config (for backward compatibility) =====
169
196
  legacyGridConfig: {
170
197
  type: DataTypes.JSON,
@@ -223,6 +250,10 @@ module.exports = (sequelize) => {
223
250
  name: "idx_template_metadata_image_count",
224
251
  fields: ["image_count"],
225
252
  },
253
+ {
254
+ name: "idx_template_metadata_is_user_generated",
255
+ fields: ["is_user_generated"],
256
+ },
226
257
  ],
227
258
  }
228
259
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.3.45",
3
+ "version": "1.3.48",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",