agrs-sequelize-sdk 1.3.18 → 1.3.23

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.
@@ -0,0 +1,129 @@
1
+ /**
2
+ * BannerTemplate Model
3
+ * Stores banner template specifications for creative generation
4
+ */
5
+
6
+ const { DataTypes } = require("sequelize");
7
+
8
+ module.exports = (sequelize) => {
9
+ const BannerTemplate = sequelize.define(
10
+ "BannerTemplate",
11
+ {
12
+ id: {
13
+ type: DataTypes.STRING(50),
14
+ primaryKey: true,
15
+ allowNull: false,
16
+ comment: "Template ID (A-Z for built-in, UUID for custom)",
17
+ },
18
+ name: {
19
+ type: DataTypes.STRING(255),
20
+ allowNull: false,
21
+ comment: "Template name (e.g., 'Photo Overlay Headline')",
22
+ },
23
+ imageType: {
24
+ type: DataTypes.ENUM(
25
+ "photo",
26
+ "illustration",
27
+ "render3d",
28
+ "collage",
29
+ "solid",
30
+ "cartoon"
31
+ ),
32
+ allowNull: false,
33
+ field: "image_type",
34
+ comment: "Visual style category",
35
+ },
36
+ description: {
37
+ type: DataTypes.TEXT,
38
+ allowNull: true,
39
+ comment: "Short description of template",
40
+ },
41
+ detailedDescription: {
42
+ type: DataTypes.TEXT,
43
+ allowNull: true,
44
+ field: "detailed_description",
45
+ comment: "Full template description with layout details",
46
+ },
47
+ elements: {
48
+ type: DataTypes.JSON,
49
+ allowNull: true,
50
+ defaultValue: [],
51
+ comment: "Array of element names (e.g., ['Photo', 'Intro', 'CTA'])",
52
+ },
53
+ sampleImageUrl: {
54
+ type: DataTypes.STRING(500),
55
+ allowNull: true,
56
+ field: "sample_image_url",
57
+ comment: "URL to sample image in GCP",
58
+ },
59
+ layoutPreview: {
60
+ type: DataTypes.TEXT,
61
+ allowNull: true,
62
+ field: "layout_preview",
63
+ comment: "HTML string for preview rendering",
64
+ },
65
+ isCustom: {
66
+ type: DataTypes.BOOLEAN,
67
+ allowNull: false,
68
+ defaultValue: true,
69
+ field: "is_custom",
70
+ comment: "True for user-created, false for built-in templates",
71
+ },
72
+ prompt: {
73
+ type: DataTypes.JSON,
74
+ allowNull: true,
75
+ comment: "Full template specification object",
76
+ },
77
+ tags: {
78
+ type: DataTypes.JSON,
79
+ allowNull: true,
80
+ defaultValue: [],
81
+ comment: "Array of tags for filtering",
82
+ },
83
+ userId: {
84
+ type: DataTypes.STRING(255),
85
+ allowNull: true,
86
+ field: "user_id",
87
+ comment: "User who created this template",
88
+ },
89
+ createdAt: {
90
+ type: DataTypes.DATE,
91
+ allowNull: false,
92
+ defaultValue: DataTypes.NOW,
93
+ field: "created_at",
94
+ },
95
+ updatedAt: {
96
+ type: DataTypes.DATE,
97
+ allowNull: false,
98
+ defaultValue: DataTypes.NOW,
99
+ field: "updated_at",
100
+ },
101
+ },
102
+ {
103
+ tableName: "banner_templates",
104
+ timestamps: true,
105
+ underscored: true,
106
+ indexes: [
107
+ {
108
+ name: "idx_image_type",
109
+ fields: ["image_type"],
110
+ },
111
+ {
112
+ name: "idx_is_custom",
113
+ fields: ["is_custom"],
114
+ },
115
+ {
116
+ name: "idx_created_at",
117
+ fields: ["created_at"],
118
+ },
119
+ {
120
+ name: "idx_user_id",
121
+ fields: ["user_id"],
122
+ },
123
+ ],
124
+ }
125
+ );
126
+
127
+ return BannerTemplate;
128
+ };
129
+
@@ -59,16 +59,16 @@ module.exports = (sequelize, DataTypes) => {
59
59
  allowNull: true,
60
60
  field: "AGRS_CID",
61
61
  },
62
- process_id: {
63
- type: DataTypes.UUID,
64
- allowNull: true,
65
- field: "process_id",
66
- },
67
- parent_request_id: {
68
- type: DataTypes.UUID,
69
- allowNull: true,
70
- field: "parent_request_id",
71
- },
62
+ process_id: {
63
+ type: DataTypes.STRING,
64
+ allowNull: true,
65
+ field: "process_id",
66
+ },
67
+ parent_request_id: {
68
+ type: DataTypes.STRING,
69
+ allowNull: true,
70
+ field: "parent_request_id",
71
+ },
72
72
  related_request_ids: {
73
73
  type: DataTypes.JSONB,
74
74
  allowNull: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.3.18",
3
+ "version": "1.3.23",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",