agrs-sequelize-sdk 1.4.52 → 1.4.53
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/migrations/2026-05-17-PIXELS-FOLLOWUP.md +85 -85
- package/migrations/2026-05-17-add-platform-to-ad.js +19 -19
- package/migrations/2026-05-17-add-platform-to-adaccount.js +19 -19
- package/migrations/2026-05-17-add-platform-to-adperformance.js +19 -19
- package/migrations/2026-05-17-add-platform-to-adset.js +19 -19
- package/migrations/2026-05-17-add-platform-to-adsetperformance.js +19 -19
- package/migrations/2026-05-17-add-platform-to-aiarticleretryqueue.js +19 -19
- package/migrations/2026-05-17-add-platform-to-aicampaignqueue.js +19 -19
- package/migrations/2026-05-17-add-platform-to-article.js +19 -19
- package/migrations/2026-05-17-add-platform-to-campaign.js +19 -19
- package/migrations/2026-05-17-add-platform-to-codefuelcampaign.js +19 -19
- package/migrations/2026-05-17-add-platform-to-dynamicfeed.js +19 -19
- package/migrations/2026-05-17-add-platform-to-facebookretryqueue.js +19 -19
- package/migrations/2026-05-17-add-platform-to-pages.js +19 -19
- package/migrations/2026-05-17-add-platform-to-presets.js +19 -19
- package/migrations/2026-05-18-add-group-id-to-ai-campaign-queue.js +18 -18
- package/migrations/2026-05-18-add-platform-code-to-creation-logs.js +65 -65
- package/migrations/2026-05-18-add-platform-code-to-pixels.js +55 -55
- package/migrations/2026-05-18-add-platform-code-to-rsoc-feed-campaigns.js +55 -55
- package/migrations/2026-05-18-add-platform-date-index-to-adperformance.js +16 -16
- package/migrations/2026-05-18-add-platform-date-index-to-adsetperformance.js +16 -16
- package/migrations/2026-05-18-add-review-status-to-ad.js +36 -36
- package/migrations/2026-05-18-create-canonical-insights.js +84 -84
- package/migrations/2026-05-18-create-snapchat-public-profiles.js +68 -68
- package/migrations/2026-05-18-create-tiktok-identities.js +71 -71
- package/migrations/2026-05-18-create-tiktok-snapchat-campaigns.js +143 -143
- package/migrations/2026-05-18-create-tt-snp-adset-ad-tables.js +309 -309
- package/migrations/RUN_ME_MANUALLY_2026-05-17.sql +99 -99
- package/migrations/add-requested-from-dashboard-to-articles.js +17 -17
- package/migrations/change-adset-name-to-text.js +79 -79
- package/models/AICampaignQueue.js +152 -152
- package/models/AIGenerationLog.js +85 -85
- package/models/AIGenerationRequest.js +212 -212
- package/models/AdAccountValues.js +25 -25
- package/models/AdHistory.js +30 -30
- package/models/AdPerformance.js +104 -104
- package/models/AdSet.js +295 -295
- package/models/AdSetHistory.js +30 -30
- package/models/AdsetPerformance.js +137 -137
- package/models/AiArticleRetryQueue.js +157 -157
- package/models/AiCreationRetryQueue.js +134 -134
- package/models/ApiAuditLog.js +127 -127
- package/models/ApiToken.js +67 -67
- package/models/Article.js +222 -222
- package/models/AutomationRule.js +179 -179
- package/models/BannerTemplate.js +129 -129
- package/models/Buyers.js +25 -25
- package/models/Campaign.js +168 -163
- package/models/CampaignActionHistory.js +101 -101
- package/models/CampaignCreationLog.js +340 -340
- package/models/CampaignCreationLogV2.js +392 -392
- package/models/CampaignHistory.js +33 -33
- package/models/CampaignTag.js +46 -0
- package/models/CampaignTagAssignment.js +48 -0
- package/models/CanonicalInsights.js +68 -68
- package/models/Channel.js +55 -55
- package/models/Domain.js +44 -44
- package/models/DynamicFeed.js +218 -218
- package/models/ExplorAdsChannel.js +61 -61
- package/models/FacebookRetryQueue.js +163 -163
- package/models/Feed.js +33 -33
- package/models/FeedArticleConfiguration.js +80 -80
- package/models/FrontStoryChannel.js +59 -59
- package/models/FrontStoryChannelV2.js +60 -60
- package/models/GenericFlowRequest.js +114 -114
- package/models/MidoWebChannel.js +47 -47
- package/models/MineBrandBlocklist.js +40 -40
- package/models/MineChannel.js +42 -42
- package/models/MineRedirectDomain.js +36 -36
- package/models/MineWebhookEvent.js +53 -53
- package/models/Pages.js +117 -117
- package/models/PipelineExecution.js +59 -59
- package/models/PolicyDogsCreativeCache.js +50 -50
- package/models/PolicyDogsImageCache.js +30 -30
- package/models/Presets.js +40 -40
- package/models/PublicApiBatch.js +155 -155
- package/models/PublicApiBatchItem.js +166 -166
- package/models/PublicApiIdempotencyCache.js +135 -135
- package/models/RSOCFeedCampaign.js +387 -387
- package/models/RsocKeywordPerformance.js +110 -110
- package/models/RuleAction.js +90 -90
- package/models/RuleCondition.js +137 -137
- package/models/RuleExecution.js +107 -107
- package/models/RulesValues.js +56 -56
- package/models/SingularChannel.js +31 -31
- package/models/SnapchatAd.js +69 -69
- package/models/SnapchatAdSquad.js +92 -92
- package/models/SnapchatCampaign.js +69 -69
- package/models/SnapchatChannel.js +31 -31
- package/models/SnapchatPublicProfiles.js +67 -67
- package/models/SupportedLocale.js +23 -23
- package/models/SyncHistory.js +249 -249
- package/models/TTQChannel.js +42 -42
- package/models/TemplateMetadata.js +260 -260
- package/models/Tier2_AdAccounts.js +110 -110
- package/models/Tier2_Assets.js +70 -70
- package/models/Tier2_BusinessManagers.js +105 -105
- package/models/Tier2_CreditLines.js +99 -99
- package/models/Tier2_Pages.js +91 -91
- package/models/Tier2_Pixels.js +82 -82
- package/models/Tier2_Tokens.js +64 -64
- package/models/Tier2_UserAdAccounts.js +83 -83
- package/models/TikTokAd.js +71 -71
- package/models/TikTokAdGroup.js +82 -82
- package/models/TikTokCampaign.js +71 -71
- package/models/TiktokChannel.js +31 -31
- package/models/TiktokIdentities.js +65 -65
- package/models/TokenRotationState.js +121 -121
- package/models/TonicRSOCKeywordPerformance.js +122 -122
- package/models/Users.js +190 -185
- package/models/Vertical.js +25 -25
- package/models/newFiles.js +137 -137
- package/package.json +21 -19
- package/run.sh +214 -214
- package/services/sequelizeService.js +110 -110
- package/tarzo-skalio-integration-docs.md +691 -691
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Additive migration — creates two new tables to mirror TikTok and Snapchat
|
|
4
|
-
// campaign state in the local DB. No FKs to existing tables; loose coupling
|
|
5
|
-
// keeps platform isolation. Reporting joins to canonical_insights at the MV
|
|
6
|
-
// layer (see dashboard migration 003-multi-platform-performance-view.sql).
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
up: async (queryInterface, Sequelize) => {
|
|
10
|
-
// ----- TikTok Campaigns -----
|
|
11
|
-
await queryInterface.createTable("tiktok_campaigns", {
|
|
12
|
-
campaign_id: {
|
|
13
|
-
type: Sequelize.BIGINT,
|
|
14
|
-
primaryKey: true,
|
|
15
|
-
allowNull: false,
|
|
16
|
-
},
|
|
17
|
-
campaign_name: {
|
|
18
|
-
type: Sequelize.STRING(255),
|
|
19
|
-
allowNull: false,
|
|
20
|
-
},
|
|
21
|
-
ad_account_id: {
|
|
22
|
-
type: Sequelize.STRING(64),
|
|
23
|
-
allowNull: false,
|
|
24
|
-
},
|
|
25
|
-
objective_type: {
|
|
26
|
-
type: Sequelize.STRING(50),
|
|
27
|
-
allowNull: true,
|
|
28
|
-
},
|
|
29
|
-
budget_mode: {
|
|
30
|
-
type: Sequelize.STRING(50),
|
|
31
|
-
allowNull: true,
|
|
32
|
-
comment: "BUDGET_MODE_DAY or BUDGET_MODE_LIFETIME (TikTok native)",
|
|
33
|
-
},
|
|
34
|
-
daily_budget_usd: {
|
|
35
|
-
type: Sequelize.DECIMAL(12, 6),
|
|
36
|
-
allowNull: true,
|
|
37
|
-
comment: "Normalized USD value (TikTok returns native USD float)",
|
|
38
|
-
},
|
|
39
|
-
operation_status: {
|
|
40
|
-
type: Sequelize.STRING(50),
|
|
41
|
-
allowNull: true,
|
|
42
|
-
comment: "ENABLE or DISABLE (TikTok native)",
|
|
43
|
-
},
|
|
44
|
-
special_industries: {
|
|
45
|
-
type: Sequelize.TEXT,
|
|
46
|
-
allowNull: true,
|
|
47
|
-
comment: "JSON-serialized array of special industry tags",
|
|
48
|
-
},
|
|
49
|
-
schedule_start_time: {
|
|
50
|
-
type: Sequelize.DATE,
|
|
51
|
-
allowNull: true,
|
|
52
|
-
},
|
|
53
|
-
schedule_end_time: {
|
|
54
|
-
type: Sequelize.DATE,
|
|
55
|
-
allowNull: true,
|
|
56
|
-
},
|
|
57
|
-
created_at: {
|
|
58
|
-
type: Sequelize.DATE,
|
|
59
|
-
allowNull: false,
|
|
60
|
-
},
|
|
61
|
-
updated_at: {
|
|
62
|
-
type: Sequelize.DATE,
|
|
63
|
-
allowNull: true,
|
|
64
|
-
},
|
|
65
|
-
synced_at: {
|
|
66
|
-
type: Sequelize.DATE,
|
|
67
|
-
allowNull: false,
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
await queryInterface.addIndex("tiktok_campaigns", ["ad_account_id"]);
|
|
72
|
-
await queryInterface.addIndex("tiktok_campaigns", ["created_at"]);
|
|
73
|
-
await queryInterface.addIndex("tiktok_campaigns", ["operation_status"]);
|
|
74
|
-
|
|
75
|
-
// ----- Snapchat Campaigns -----
|
|
76
|
-
await queryInterface.createTable("snapchat_campaigns", {
|
|
77
|
-
id: {
|
|
78
|
-
type: Sequelize.STRING(36),
|
|
79
|
-
primaryKey: true,
|
|
80
|
-
allowNull: false,
|
|
81
|
-
comment: "Snapchat UUID",
|
|
82
|
-
},
|
|
83
|
-
name: {
|
|
84
|
-
type: Sequelize.STRING(255),
|
|
85
|
-
allowNull: false,
|
|
86
|
-
},
|
|
87
|
-
ad_account_id: {
|
|
88
|
-
type: Sequelize.STRING(36),
|
|
89
|
-
allowNull: false,
|
|
90
|
-
},
|
|
91
|
-
status: {
|
|
92
|
-
type: Sequelize.STRING(50),
|
|
93
|
-
allowNull: false,
|
|
94
|
-
comment: "ACTIVE or PAUSED (Snap native)",
|
|
95
|
-
},
|
|
96
|
-
objective: {
|
|
97
|
-
type: Sequelize.STRING(255),
|
|
98
|
-
allowNull: true,
|
|
99
|
-
},
|
|
100
|
-
daily_budget_micro: {
|
|
101
|
-
type: Sequelize.BIGINT,
|
|
102
|
-
allowNull: true,
|
|
103
|
-
},
|
|
104
|
-
lifetime_spend_cap_micro: {
|
|
105
|
-
type: Sequelize.BIGINT,
|
|
106
|
-
allowNull: true,
|
|
107
|
-
},
|
|
108
|
-
timezone: {
|
|
109
|
-
type: Sequelize.STRING(50),
|
|
110
|
-
allowNull: true,
|
|
111
|
-
},
|
|
112
|
-
start_time: {
|
|
113
|
-
type: Sequelize.DATE,
|
|
114
|
-
allowNull: true,
|
|
115
|
-
},
|
|
116
|
-
end_time: {
|
|
117
|
-
type: Sequelize.DATE,
|
|
118
|
-
allowNull: true,
|
|
119
|
-
},
|
|
120
|
-
created_at: {
|
|
121
|
-
type: Sequelize.DATE,
|
|
122
|
-
allowNull: false,
|
|
123
|
-
},
|
|
124
|
-
updated_at: {
|
|
125
|
-
type: Sequelize.DATE,
|
|
126
|
-
allowNull: true,
|
|
127
|
-
},
|
|
128
|
-
synced_at: {
|
|
129
|
-
type: Sequelize.DATE,
|
|
130
|
-
allowNull: false,
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
await queryInterface.addIndex("snapchat_campaigns", ["ad_account_id"]);
|
|
135
|
-
await queryInterface.addIndex("snapchat_campaigns", ["created_at"]);
|
|
136
|
-
await queryInterface.addIndex("snapchat_campaigns", ["status"]);
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
down: async (queryInterface) => {
|
|
140
|
-
await queryInterface.dropTable("snapchat_campaigns");
|
|
141
|
-
await queryInterface.dropTable("tiktok_campaigns");
|
|
142
|
-
},
|
|
143
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Additive migration — creates two new tables to mirror TikTok and Snapchat
|
|
4
|
+
// campaign state in the local DB. No FKs to existing tables; loose coupling
|
|
5
|
+
// keeps platform isolation. Reporting joins to canonical_insights at the MV
|
|
6
|
+
// layer (see dashboard migration 003-multi-platform-performance-view.sql).
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
up: async (queryInterface, Sequelize) => {
|
|
10
|
+
// ----- TikTok Campaigns -----
|
|
11
|
+
await queryInterface.createTable("tiktok_campaigns", {
|
|
12
|
+
campaign_id: {
|
|
13
|
+
type: Sequelize.BIGINT,
|
|
14
|
+
primaryKey: true,
|
|
15
|
+
allowNull: false,
|
|
16
|
+
},
|
|
17
|
+
campaign_name: {
|
|
18
|
+
type: Sequelize.STRING(255),
|
|
19
|
+
allowNull: false,
|
|
20
|
+
},
|
|
21
|
+
ad_account_id: {
|
|
22
|
+
type: Sequelize.STRING(64),
|
|
23
|
+
allowNull: false,
|
|
24
|
+
},
|
|
25
|
+
objective_type: {
|
|
26
|
+
type: Sequelize.STRING(50),
|
|
27
|
+
allowNull: true,
|
|
28
|
+
},
|
|
29
|
+
budget_mode: {
|
|
30
|
+
type: Sequelize.STRING(50),
|
|
31
|
+
allowNull: true,
|
|
32
|
+
comment: "BUDGET_MODE_DAY or BUDGET_MODE_LIFETIME (TikTok native)",
|
|
33
|
+
},
|
|
34
|
+
daily_budget_usd: {
|
|
35
|
+
type: Sequelize.DECIMAL(12, 6),
|
|
36
|
+
allowNull: true,
|
|
37
|
+
comment: "Normalized USD value (TikTok returns native USD float)",
|
|
38
|
+
},
|
|
39
|
+
operation_status: {
|
|
40
|
+
type: Sequelize.STRING(50),
|
|
41
|
+
allowNull: true,
|
|
42
|
+
comment: "ENABLE or DISABLE (TikTok native)",
|
|
43
|
+
},
|
|
44
|
+
special_industries: {
|
|
45
|
+
type: Sequelize.TEXT,
|
|
46
|
+
allowNull: true,
|
|
47
|
+
comment: "JSON-serialized array of special industry tags",
|
|
48
|
+
},
|
|
49
|
+
schedule_start_time: {
|
|
50
|
+
type: Sequelize.DATE,
|
|
51
|
+
allowNull: true,
|
|
52
|
+
},
|
|
53
|
+
schedule_end_time: {
|
|
54
|
+
type: Sequelize.DATE,
|
|
55
|
+
allowNull: true,
|
|
56
|
+
},
|
|
57
|
+
created_at: {
|
|
58
|
+
type: Sequelize.DATE,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
},
|
|
61
|
+
updated_at: {
|
|
62
|
+
type: Sequelize.DATE,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
},
|
|
65
|
+
synced_at: {
|
|
66
|
+
type: Sequelize.DATE,
|
|
67
|
+
allowNull: false,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
await queryInterface.addIndex("tiktok_campaigns", ["ad_account_id"]);
|
|
72
|
+
await queryInterface.addIndex("tiktok_campaigns", ["created_at"]);
|
|
73
|
+
await queryInterface.addIndex("tiktok_campaigns", ["operation_status"]);
|
|
74
|
+
|
|
75
|
+
// ----- Snapchat Campaigns -----
|
|
76
|
+
await queryInterface.createTable("snapchat_campaigns", {
|
|
77
|
+
id: {
|
|
78
|
+
type: Sequelize.STRING(36),
|
|
79
|
+
primaryKey: true,
|
|
80
|
+
allowNull: false,
|
|
81
|
+
comment: "Snapchat UUID",
|
|
82
|
+
},
|
|
83
|
+
name: {
|
|
84
|
+
type: Sequelize.STRING(255),
|
|
85
|
+
allowNull: false,
|
|
86
|
+
},
|
|
87
|
+
ad_account_id: {
|
|
88
|
+
type: Sequelize.STRING(36),
|
|
89
|
+
allowNull: false,
|
|
90
|
+
},
|
|
91
|
+
status: {
|
|
92
|
+
type: Sequelize.STRING(50),
|
|
93
|
+
allowNull: false,
|
|
94
|
+
comment: "ACTIVE or PAUSED (Snap native)",
|
|
95
|
+
},
|
|
96
|
+
objective: {
|
|
97
|
+
type: Sequelize.STRING(255),
|
|
98
|
+
allowNull: true,
|
|
99
|
+
},
|
|
100
|
+
daily_budget_micro: {
|
|
101
|
+
type: Sequelize.BIGINT,
|
|
102
|
+
allowNull: true,
|
|
103
|
+
},
|
|
104
|
+
lifetime_spend_cap_micro: {
|
|
105
|
+
type: Sequelize.BIGINT,
|
|
106
|
+
allowNull: true,
|
|
107
|
+
},
|
|
108
|
+
timezone: {
|
|
109
|
+
type: Sequelize.STRING(50),
|
|
110
|
+
allowNull: true,
|
|
111
|
+
},
|
|
112
|
+
start_time: {
|
|
113
|
+
type: Sequelize.DATE,
|
|
114
|
+
allowNull: true,
|
|
115
|
+
},
|
|
116
|
+
end_time: {
|
|
117
|
+
type: Sequelize.DATE,
|
|
118
|
+
allowNull: true,
|
|
119
|
+
},
|
|
120
|
+
created_at: {
|
|
121
|
+
type: Sequelize.DATE,
|
|
122
|
+
allowNull: false,
|
|
123
|
+
},
|
|
124
|
+
updated_at: {
|
|
125
|
+
type: Sequelize.DATE,
|
|
126
|
+
allowNull: true,
|
|
127
|
+
},
|
|
128
|
+
synced_at: {
|
|
129
|
+
type: Sequelize.DATE,
|
|
130
|
+
allowNull: false,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
await queryInterface.addIndex("snapchat_campaigns", ["ad_account_id"]);
|
|
135
|
+
await queryInterface.addIndex("snapchat_campaigns", ["created_at"]);
|
|
136
|
+
await queryInterface.addIndex("snapchat_campaigns", ["status"]);
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
down: async (queryInterface) => {
|
|
140
|
+
await queryInterface.dropTable("snapchat_campaigns");
|
|
141
|
+
await queryInterface.dropTable("tiktok_campaigns");
|
|
142
|
+
},
|
|
143
|
+
};
|