@flamingo-stack/openframe-frontend-core 0.0.830 → 0.0.832
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/dist/build/export-map.json +1 -1
- package/dist/build/next-styles.cjs +93 -3
- package/dist/build/next-styles.d.ts +8 -0
- package/dist/build/route-styles-client.mjs +67 -0
- package/dist/build/route-styles-markers.cjs +18 -0
- package/dist/build/route-styles-server.mjs +102 -0
- package/dist/build/route-styles.cjs +415 -0
- package/dist/build/route-styles.d.ts +11 -0
- package/dist/build/style-sources.cjs +14 -1
- package/dist/build/style-sources.d.ts +3 -0
- package/dist/{case-study-card-QMFGPABF.cjs → case-study-card-TK7ZCNLM.cjs} +5 -5
- package/dist/{chunk-LKP5R3EQ.cjs → chunk-46LATWQR.cjs} +2 -2
- package/dist/{chunk-IBD2FPSX.cjs → chunk-4JHO2NVI.cjs} +2 -2
- package/dist/{chunk-QTLWU6FY.cjs → chunk-5L3UKDC6.cjs} +11 -11
- package/dist/{chunk-HYCMMECU.cjs → chunk-7COZUANC.cjs} +58 -67
- package/dist/{chunk-ULF4ZOUM.cjs → chunk-7WQD3R5J.cjs} +84 -84
- package/dist/{chunk-DAKGX2WF.cjs → chunk-APNONOHY.cjs} +2 -2
- package/dist/{chunk-KPGKTEEB.cjs → chunk-BUEEQD3G.cjs} +2 -2
- package/dist/{chunk-YMLRDVPO.cjs → chunk-C4OQIYGW.cjs} +11 -11
- package/dist/{chunk-WCCE4WF3.cjs → chunk-CP46CVUC.cjs} +91 -91
- package/dist/{chunk-5LED4QHZ.cjs → chunk-D6ZSRGH2.cjs} +237 -237
- package/dist/{chunk-HYGWRUEM.cjs → chunk-DAQMCWCK.cjs} +3 -3
- package/dist/{chunk-56EP4QM2.cjs → chunk-EYSIQORA.cjs} +94 -94
- package/dist/{chunk-2BGLALP5.cjs → chunk-FNNDGOR3.cjs} +19 -19
- package/dist/{chunk-OKTNRGM5.cjs → chunk-GPXKG34G.cjs} +54 -54
- package/dist/{chunk-FMSAN6SR.cjs → chunk-H3WTYAVR.cjs} +129 -129
- package/dist/{chunk-RRPID7Z7.cjs → chunk-HDLY6OMQ.cjs} +6 -6
- package/dist/{chunk-2VLPXUQK.cjs → chunk-HLJXCOMA.cjs} +4 -4
- package/dist/{chunk-PBHP3FHO.cjs → chunk-JBTH3O2C.cjs} +4 -4
- package/dist/{chunk-2HQNXX2K.cjs → chunk-JQCQCE6U.cjs} +2 -2
- package/dist/{chunk-AY6XJOIN.cjs → chunk-LWMWY3JO.cjs} +45 -45
- package/dist/{chunk-E6W4YDPS.cjs → chunk-OGPAVRNF.cjs} +17 -17
- package/dist/{chunk-D2LXFMZI.cjs → chunk-P5DWAVWK.cjs} +28 -28
- package/dist/{chunk-TUMSVFVS.cjs → chunk-QHBKZJ6A.cjs} +4 -4
- package/dist/{chunk-WZYBUJJG.cjs → chunk-R6QZHOJB.cjs} +46 -46
- package/dist/{chunk-F2J5WN6U.cjs → chunk-SOCCHWDK.cjs} +2 -2
- package/dist/{chunk-CAGQAMJ6.cjs → chunk-SRHHLDBP.cjs} +36 -36
- package/dist/{chunk-WWDNLMB7.cjs → chunk-SWMUW3RR.cjs} +11 -11
- package/dist/{chunk-6GPMVHJN.cjs → chunk-TD4CC4KV.cjs} +20 -20
- package/dist/{chunk-SAW7V7CU.cjs → chunk-UGM3YDCK.cjs} +25 -25
- package/dist/{chunk-FFFN4IY2.cjs → chunk-UQS2RI5Y.cjs} +12 -12
- package/dist/{chunk-5KSPG3TV.cjs → chunk-VBGBKRDO.cjs} +665 -642
- package/dist/{chunk-X425BGXS.cjs → chunk-VQG2A7GA.cjs} +2 -2
- package/dist/{chunk-S6UJEW4G.cjs → chunk-WCOSGDGA.cjs} +2 -2
- package/dist/{chunk-ENMPSEEQ.cjs → chunk-WVNUCKB7.cjs} +4 -4
- package/dist/{chunk-DUGOOTER.cjs → chunk-X76TZ5YR.cjs} +21 -21
- package/dist/{chunk-PUXYAHH3.cjs → chunk-X7VQM5TU.cjs} +6 -6
- package/dist/{chunk-W4VEDSAX.cjs → chunk-ZABZIM2Y.cjs} +6 -6
- package/dist/{chunk-M75723HD.cjs → chunk-ZJ5K6XHW.cjs} +21 -21
- package/dist/{cloud-tenants-4KQQPXPM.cjs → cloud-tenants-E2AC4WEJ.cjs} +19 -19
- package/dist/components/case-studies/index.cjs +35 -35
- package/dist/components/chat/index.cjs +14 -14
- package/dist/components/chat/utils/icon-registry.d.ts +2 -2
- package/dist/components/chat/utils/icon-registry.js +2 -2
- package/dist/components/contact/index.cjs +20 -20
- package/dist/components/docs/index.cjs +23 -23
- package/dist/components/embeds/index.cjs +20 -20
- package/dist/components/faq/index.cjs +21 -21
- package/dist/components/features/index.cjs +21 -19
- package/dist/components/features/notifications/index.d.ts +3 -1
- package/dist/components/features/notifications/index.d.ts.map +1 -1
- package/dist/components/features/notifications/index.js +2 -0
- package/dist/components/features/notifications/notification-category-icon.d.ts +7 -0
- package/dist/components/features/notifications/notification-category-icon.d.ts.map +1 -0
- package/dist/components/features/notifications/notification-category-icon.js +26 -0
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/types.d.ts +1 -1
- package/dist/components/features/notifications/types.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +124 -124
- package/dist/components/index.cjs +85 -81
- package/dist/components/meeting-scheduler/index.cjs +68 -68
- package/dist/components/navigation/index.cjs +22 -22
- package/dist/components/navigation/site-footer.d.ts.map +1 -1
- package/dist/components/navigation/site-footer.js +2 -12
- package/dist/components/onboarding-guides/index.cjs +22 -22
- package/dist/components/product-demo/index.cjs +30 -30
- package/dist/components/related-content/index.cjs +9 -9
- package/dist/components/social-icon-row.d.ts +6 -2
- package/dist/components/social-icon-row.d.ts.map +1 -1
- package/dist/components/social-icon-row.js +5 -6
- package/dist/components/tickets/index.cjs +26 -26
- package/dist/components/ui/index.cjs +19 -19
- package/dist/{devices-H6C4NMIY.cjs → devices-CAYUGD2N.cjs} +20 -20
- package/dist/{embeddable-chat-KUESE7P6.cjs → embeddable-chat-FYHMR66R.cjs} +91 -91
- package/dist/hooks/index.cjs +7 -7
- package/dist/index.cjs +26 -24
- package/dist/{knowledge-O6IBO5Y5.cjs → knowledge-OI4OPEVL.cjs} +20 -20
- package/dist/{logs-Y2UCF24Z.cjs → logs-B3XV2NHV.cjs} +26 -26
- package/dist/platform-domains.cjs +4 -0
- package/dist/platform-domains.d.ts +2 -0
- package/dist/platform-domains.d.ts.map +1 -1
- package/dist/platform-domains.js +4 -0
- package/dist/{policies-J6O3RLJT.cjs → policies-ZB4Z42DV.cjs} +23 -23
- package/dist/{remote-session-RVTFWSU4.cjs → remote-session-CN3G7JNR.cjs} +6 -6
- package/dist/{scripts-N67MM4T2.cjs → scripts-I4DNUOQC.cjs} +26 -26
- package/dist/{software-update-HB7F6KNG.cjs → software-update-AWH4WXOH.cjs} +23 -23
- package/dist/{tickets-board-2K3PBCNW.cjs → tickets-board-PLYD2NSY.cjs} +10 -10
- package/dist/types/marketing.d.ts +61 -216
- package/dist/types/marketing.d.ts.map +1 -1
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/notifications.cjs +55 -0
- package/dist/utils/notifications.d.ts +29 -0
- package/dist/utils/notifications.d.ts.map +1 -0
- package/dist/utils/notifications.js +53 -0
- package/dist/utils/social-platforms.d.ts +9 -9
- package/dist/utils/social-platforms.d.ts.map +1 -1
- package/package.json +12 -1
- package/src/components/chat/utils/icon-registry.ts +5 -5
- package/src/components/chat/utils/index.ts +1 -1
- package/src/components/features/notifications/index.ts +2 -1
- package/src/components/features/notifications/notification-category-icon.tsx +38 -0
- package/src/components/features/notifications/notification-tile.tsx +2 -1
- package/src/components/features/notifications/types.ts +1 -2
- package/src/components/navigation/site-footer.tsx +2 -11
- package/src/components/social-icon-row.tsx +11 -10
- package/src/platform-domains.ts +5 -0
- package/src/styles/index.css +2 -0
- package/src/types/marketing.ts +90 -268
- package/src/utils/index.ts +1 -1
- package/src/utils/notifications.ts +71 -0
- package/src/utils/social-platforms.ts +9 -9
package/src/types/marketing.ts
CHANGED
|
@@ -1,66 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Marketing Campaign Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The rows of the marketing tables as the database holds them (`marketing_campaigns`, `ai_content`, `ai_media`),
|
|
5
|
+
* column for column, and the vocabularies their check constraints allow. A type here names no column the table
|
|
6
|
+
* does not have.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
// =============================================================================
|
|
9
|
-
//
|
|
10
|
+
// Campaign Types
|
|
10
11
|
// =============================================================================
|
|
11
12
|
|
|
13
|
+
/** `marketing_campaigns.status` (its check constraint). */
|
|
14
|
+
export type CampaignStatus = 'draft' | 'active' | 'completed';
|
|
15
|
+
|
|
16
|
+
/** What a campaign is about (`marketing_campaigns.content_source`). */
|
|
17
|
+
export interface CampaignContentSource {
|
|
18
|
+
type: ContentSourceType | null;
|
|
19
|
+
/** The source record; absent for a campaign written from scratch. */
|
|
20
|
+
id?: number | string | null;
|
|
21
|
+
url?: string | null;
|
|
22
|
+
/** The blog a seed-blog campaign writes its article for. */
|
|
23
|
+
blog_account_id?: number | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
export interface MarketingCampaign {
|
|
13
27
|
id: number;
|
|
14
28
|
name: string;
|
|
15
|
-
description: string | null;
|
|
16
|
-
platform: string;
|
|
29
|
+
description: string | null;
|
|
17
30
|
start_date: string | null;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
goals: string[] | null;
|
|
32
|
+
status: CampaignStatus;
|
|
33
|
+
content_source: CampaignContentSource | null;
|
|
34
|
+
/** The accounts the campaign writes for, each with what to generate (the hub's own shape). */
|
|
35
|
+
selected_accounts: unknown[] | null;
|
|
36
|
+
settings: Record<string, unknown> | null;
|
|
37
|
+
strategy_settings: Record<string, unknown> | null;
|
|
38
|
+
copy_settings: Record<string, unknown> | null;
|
|
39
|
+
image_settings: Record<string, unknown> | null;
|
|
40
|
+
video_settings: Record<string, unknown> | null;
|
|
41
|
+
details_feedback: unknown;
|
|
42
|
+
copy_feedback: unknown;
|
|
43
|
+
image_feedback: unknown;
|
|
44
|
+
video_feedback: unknown;
|
|
45
|
+
designer_feedback: unknown;
|
|
46
|
+
strategy_feedback: unknown;
|
|
25
47
|
/** Editor-provided AI generation instructions (steers Generate Content / Image / Video / Workflow prompts) */
|
|
26
|
-
custom_instructions
|
|
48
|
+
custom_instructions: string | null;
|
|
49
|
+
ai_effort_score: number | null;
|
|
27
50
|
created_by: string;
|
|
28
51
|
created_at: string;
|
|
29
52
|
updated_at: string;
|
|
30
53
|
}
|
|
31
54
|
|
|
32
|
-
export interface CreateCampaignInput {
|
|
33
|
-
name: string;
|
|
34
|
-
description?: string; // Optional - ONLY for blog_post + new mode OR from_scratch
|
|
35
|
-
start_date?: string;
|
|
36
|
-
goals?: string[]; // Optional - ONLY for blog_post + new mode OR from_scratch
|
|
37
|
-
// NEW: Content seed fields
|
|
38
|
-
content_source_type?: 'product_release' | 'blog_post' | 'case_study' | 'from_scratch';
|
|
39
|
-
content_source_id?: number;
|
|
40
|
-
content_source_url?: string;
|
|
41
|
-
future_blog_social_account_id?: number; // For blog_post + new mode - target account for AI-generated blog
|
|
42
|
-
custom_instructions?: string | null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface UpdateCampaignInput {
|
|
46
|
-
name?: string;
|
|
47
|
-
description?: string; // Optional - ONLY for blog_post + new mode OR from_scratch
|
|
48
|
-
start_date?: string;
|
|
49
|
-
goals?: string[]; // Optional - ONLY for blog_post + new mode OR from_scratch
|
|
50
|
-
// NEW: Content seed fields
|
|
51
|
-
content_source_type?: 'product_release' | 'blog_post' | 'case_study' | 'from_scratch' | null;
|
|
52
|
-
content_source_id?: number | null;
|
|
53
|
-
content_source_url?: string | null;
|
|
54
|
-
future_blog_social_account_id?: number | null; // For blog_post + new mode - target account for AI-generated blog
|
|
55
|
-
custom_instructions?: string | null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
55
|
// =============================================================================
|
|
59
56
|
// AI Content Types
|
|
60
57
|
// =============================================================================
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
export type
|
|
59
|
+
/** `ai_content.content_type` (its check constraint). */
|
|
60
|
+
export type ContentType = 'blog_post' | 'channel_post' | 'ad_copy' | 'email' | 'video_script';
|
|
61
|
+
|
|
62
|
+
/** `ai_content.status` and `ai_media.status` (their check constraints). */
|
|
63
|
+
export type ContentStatus =
|
|
64
|
+
| 'generating'
|
|
65
|
+
| 'draft'
|
|
66
|
+
| 'pending_review'
|
|
67
|
+
| 'pending_approval'
|
|
68
|
+
| 'approved'
|
|
69
|
+
| 'rejected'
|
|
70
|
+
| 'revision_requested'
|
|
71
|
+
| 'published';
|
|
64
72
|
|
|
65
73
|
export interface AIContent {
|
|
66
74
|
id: number;
|
|
@@ -69,40 +77,23 @@ export interface AIContent {
|
|
|
69
77
|
title: string | null;
|
|
70
78
|
content: string;
|
|
71
79
|
prompt_used: string | null;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
cost_cents: number | null;
|
|
75
|
-
confidence_score: number | null;
|
|
80
|
+
ai_provider: 'anthropic' | 'openai' | null;
|
|
81
|
+
ai_model: string | null;
|
|
76
82
|
metadata: Record<string, unknown> | null;
|
|
77
83
|
status: ContentStatus;
|
|
78
|
-
reviewed_by: string | null;
|
|
79
|
-
reviewed_at: string | null;
|
|
80
|
-
platform?: string; // Optional - legacy field, use social_account_id instead
|
|
81
|
-
social_account_id: number | null; // FK to social_accounts table - primary source of truth
|
|
82
|
-
created_at: string;
|
|
83
|
-
updated_at: string;
|
|
84
|
-
// Publishing & Override fields
|
|
85
84
|
selected_for_publish: boolean;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
blog_post_id: number | null;
|
|
86
|
+
workflow_id: string | null;
|
|
87
|
+
/** The distribution channel the post is written for. */
|
|
88
|
+
distribution_channel_id: number | null;
|
|
89
|
+
published_at: string | null;
|
|
90
|
+
external_post_id: string | null;
|
|
91
|
+
external_post_url: string | null;
|
|
92
|
+
url_injection_preference?: URLInjectionPreference;
|
|
93
|
+
/** The comment that carries the link, when the link went `as_comment`. */
|
|
92
94
|
external_comment_id?: string | null;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
export interface CreateAIContentInput {
|
|
96
|
-
campaign_id?: number;
|
|
97
|
-
content_type: ContentType;
|
|
98
|
-
title?: string;
|
|
99
|
-
content: string;
|
|
100
|
-
prompt_used?: string;
|
|
101
|
-
ai_model: string;
|
|
102
|
-
generation_tokens?: number;
|
|
103
|
-
cost_cents?: number;
|
|
104
|
-
confidence_score?: number;
|
|
105
|
-
metadata?: Record<string, unknown>;
|
|
95
|
+
created_at: string;
|
|
96
|
+
updated_at: string;
|
|
106
97
|
}
|
|
107
98
|
|
|
108
99
|
// =============================================================================
|
|
@@ -111,6 +102,8 @@ export interface CreateAIContentInput {
|
|
|
111
102
|
|
|
112
103
|
/** Row union. Compare through `utils/media-type` (`isVideoMedia` / `isImageMedia` / `MEDIA_TYPE`), never a literal. */
|
|
113
104
|
export type MediaType = 'image' | 'video' | 'figma_export';
|
|
105
|
+
|
|
106
|
+
/** `ai_media.provider` (its check constraint). */
|
|
114
107
|
export type MediaProvider =
|
|
115
108
|
| 'dalle'
|
|
116
109
|
| 'dalle-3'
|
|
@@ -119,17 +112,31 @@ export type MediaProvider =
|
|
|
119
112
|
| 'figma'
|
|
120
113
|
| 'manual'
|
|
121
114
|
| 'midjourney'
|
|
115
|
+
| 'flux-2-pro'
|
|
122
116
|
| 'flux-pro'
|
|
123
117
|
| 'flux-dev'
|
|
118
|
+
| 'flux-schnell'
|
|
124
119
|
| 'ideogram-v2'
|
|
120
|
+
| 'ideogram-v3-turbo'
|
|
125
121
|
| 'recraft-v3'
|
|
122
|
+
| 'imagen-4'
|
|
123
|
+
| 'nano-banana-pro'
|
|
124
|
+
| 'seedream-4.5'
|
|
125
|
+
| 'sd-3.5-large'
|
|
126
|
+
| 'veo-3-fast'
|
|
127
|
+
| 'veo-3'
|
|
126
128
|
| 'kling-v2.5'
|
|
127
129
|
| 'luma-ray2'
|
|
130
|
+
| 'pixverse-v5'
|
|
131
|
+
| 'mochi-1'
|
|
132
|
+
| 'cogvideox-t2v'
|
|
133
|
+
| 'cogvideox-i2v'
|
|
128
134
|
| 'hailuo'
|
|
135
|
+
| 'wan-2.5'
|
|
129
136
|
| 'ltx-video'
|
|
130
137
|
| 'stable-video-diffusion';
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
|
|
139
|
+
export type MediaStatus = ContentStatus;
|
|
133
140
|
|
|
134
141
|
export interface AIMedia {
|
|
135
142
|
id: number;
|
|
@@ -140,28 +147,19 @@ export interface AIMedia {
|
|
|
140
147
|
prompt_used: string | null;
|
|
141
148
|
provider: MediaProvider;
|
|
142
149
|
model_version: string | null;
|
|
143
|
-
cost_cents: number | null;
|
|
144
|
-
storage_path: string | null;
|
|
145
150
|
storage_url: string | null;
|
|
146
151
|
thumbnail_url: string | null;
|
|
147
152
|
dimensions: MediaDimensions | null;
|
|
148
153
|
file_size_bytes: number | null;
|
|
149
154
|
status: MediaStatus;
|
|
150
|
-
figma_file_id: string | null;
|
|
151
|
-
figma_node_id: string | null;
|
|
152
|
-
reviewed_by: string | null;
|
|
153
|
-
reviewed_at: string | null;
|
|
154
155
|
metadata: Record<string, unknown> | null;
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
workflow_id: string | null;
|
|
157
|
+
/** The distribution channel the media is made for. NOTE: there is no `selected_for_publish` on media — a media
|
|
158
|
+
* item is "selected" by being ATTACHED to a post that is selected (`ai_content_media`). */
|
|
159
|
+
distribution_channel_id: number | null;
|
|
160
|
+
published_at: string | null;
|
|
157
161
|
created_at: string;
|
|
158
162
|
updated_at: string;
|
|
159
|
-
// Override fields. NOTE: there is no `selected_for_publish` on media — a
|
|
160
|
-
// media item is "selected" by being ATTACHED to a post that is selected
|
|
161
|
-
// (`ai_content_media`); consumers derive the flag in their DAL.
|
|
162
|
-
override_url: string | null;
|
|
163
|
-
override_at: string | null;
|
|
164
|
-
override_by: string | null;
|
|
165
163
|
}
|
|
166
164
|
|
|
167
165
|
export interface MediaDimensions {
|
|
@@ -170,186 +168,6 @@ export interface MediaDimensions {
|
|
|
170
168
|
aspectRatio?: string; // e.g., "16:9", "9:16", "1:1"
|
|
171
169
|
}
|
|
172
170
|
|
|
173
|
-
export interface CreateAIMediaInput {
|
|
174
|
-
campaign_id?: number;
|
|
175
|
-
media_type: MediaType;
|
|
176
|
-
title?: string;
|
|
177
|
-
description?: string;
|
|
178
|
-
prompt_used?: string;
|
|
179
|
-
provider: MediaProvider;
|
|
180
|
-
model_version?: string;
|
|
181
|
-
cost_cents?: number;
|
|
182
|
-
storage_path?: string;
|
|
183
|
-
storage_url?: string;
|
|
184
|
-
thumbnail_url?: string;
|
|
185
|
-
dimensions?: MediaDimensions;
|
|
186
|
-
file_size_bytes?: number;
|
|
187
|
-
figma_file_id?: string;
|
|
188
|
-
figma_node_id?: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// =============================================================================
|
|
192
|
-
// Social Account Types
|
|
193
|
-
// =============================================================================
|
|
194
|
-
|
|
195
|
-
export type SocialChannel = 'slack' | 'linkedin' | 'facebook' | 'instagram' | 'twitter' | 'youtube';
|
|
196
|
-
export type SocialAccountType = 'personal' | 'page' | 'organization' | 'channel';
|
|
197
|
-
|
|
198
|
-
export interface SocialAccount {
|
|
199
|
-
id: number;
|
|
200
|
-
channel: SocialChannel;
|
|
201
|
-
account_type: SocialAccountType;
|
|
202
|
-
account_name: string;
|
|
203
|
-
account_id: string;
|
|
204
|
-
platform: string;
|
|
205
|
-
access_token_encrypted: string | null;
|
|
206
|
-
refresh_token_encrypted: string | null;
|
|
207
|
-
token_expires_at: string | null;
|
|
208
|
-
permissions: string[] | null;
|
|
209
|
-
is_active: boolean;
|
|
210
|
-
last_sync_at: string | null;
|
|
211
|
-
metadata: Record<string, unknown> | null;
|
|
212
|
-
created_at: string;
|
|
213
|
-
updated_at: string;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export interface CreateSocialAccountInput {
|
|
217
|
-
channel: SocialChannel;
|
|
218
|
-
account_type: SocialAccountType;
|
|
219
|
-
account_name: string;
|
|
220
|
-
account_id: string;
|
|
221
|
-
access_token?: string;
|
|
222
|
-
refresh_token?: string;
|
|
223
|
-
token_expires_at?: string;
|
|
224
|
-
permissions?: string[];
|
|
225
|
-
metadata?: Record<string, unknown>;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// =============================================================================
|
|
229
|
-
// Scheduled Post Types
|
|
230
|
-
// =============================================================================
|
|
231
|
-
|
|
232
|
-
export type ScheduledPostStatus = 'scheduled' | 'publishing' | 'published' | 'failed' | 'cancelled';
|
|
233
|
-
|
|
234
|
-
export interface ScheduledPost {
|
|
235
|
-
id: number;
|
|
236
|
-
campaign_id: number;
|
|
237
|
-
content_id: number | null;
|
|
238
|
-
media_ids: number[];
|
|
239
|
-
social_account_id: number;
|
|
240
|
-
scheduled_at: string;
|
|
241
|
-
published_at: string | null;
|
|
242
|
-
status: ScheduledPostStatus;
|
|
243
|
-
external_post_id: string | null;
|
|
244
|
-
external_post_url: string | null;
|
|
245
|
-
error_message: string | null;
|
|
246
|
-
retry_count: number;
|
|
247
|
-
created_by: string | null;
|
|
248
|
-
platform: string;
|
|
249
|
-
created_at: string;
|
|
250
|
-
updated_at: string;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export interface CreateScheduledPostInput {
|
|
254
|
-
campaign_id: number;
|
|
255
|
-
content_id?: number;
|
|
256
|
-
media_ids?: number[];
|
|
257
|
-
social_account_id: number;
|
|
258
|
-
scheduled_at: string;
|
|
259
|
-
created_by?: string;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// =============================================================================
|
|
263
|
-
// Content Approval Types
|
|
264
|
-
// =============================================================================
|
|
265
|
-
|
|
266
|
-
export type ContentApprovalType = 'ai_content' | 'ai_media' | 'campaign';
|
|
267
|
-
export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'revision_requested';
|
|
268
|
-
|
|
269
|
-
export interface ContentApproval {
|
|
270
|
-
id: number;
|
|
271
|
-
content_type: ContentApprovalType;
|
|
272
|
-
content_id: number;
|
|
273
|
-
status: ApprovalStatus;
|
|
274
|
-
reviewer_id: string | null;
|
|
275
|
-
reviewer_notes: string | null;
|
|
276
|
-
revision_notes: string | null;
|
|
277
|
-
approved_at: string | null;
|
|
278
|
-
platform: string;
|
|
279
|
-
created_at: string;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export interface CreateContentApprovalInput {
|
|
283
|
-
content_type: ContentApprovalType;
|
|
284
|
-
content_id: number;
|
|
285
|
-
status: ApprovalStatus;
|
|
286
|
-
reviewer_id?: string;
|
|
287
|
-
reviewer_notes?: string;
|
|
288
|
-
revision_notes?: string;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// =============================================================================
|
|
292
|
-
// AI Usage Tracking Types
|
|
293
|
-
// =============================================================================
|
|
294
|
-
|
|
295
|
-
export type AIService = 'anthropic' | 'openai' | 'replicate' | 'figma' | 'google';
|
|
296
|
-
export type AIOperation = 'text_generation' | 'image_generation' | 'video_generation' | 'figma_export';
|
|
297
|
-
|
|
298
|
-
export interface AIUsage {
|
|
299
|
-
id: number;
|
|
300
|
-
service: AIService;
|
|
301
|
-
operation: AIOperation;
|
|
302
|
-
model: string;
|
|
303
|
-
input_tokens: number | null;
|
|
304
|
-
output_tokens: number | null;
|
|
305
|
-
cost_cents: number | null;
|
|
306
|
-
user_id: string | null;
|
|
307
|
-
content_id: number | null;
|
|
308
|
-
media_id: number | null;
|
|
309
|
-
platform: string;
|
|
310
|
-
created_at: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export interface TrackAIUsageInput {
|
|
314
|
-
service: AIService;
|
|
315
|
-
operation: AIOperation;
|
|
316
|
-
model: string;
|
|
317
|
-
input_tokens?: number;
|
|
318
|
-
output_tokens?: number;
|
|
319
|
-
cost_cents?: number;
|
|
320
|
-
user_id?: string;
|
|
321
|
-
content_id?: number;
|
|
322
|
-
media_id?: number;
|
|
323
|
-
metadata?: Record<string, unknown>;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// =============================================================================
|
|
327
|
-
// Statistics Types
|
|
328
|
-
// =============================================================================
|
|
329
|
-
|
|
330
|
-
export interface CampaignStats {
|
|
331
|
-
totalCampaigns: number;
|
|
332
|
-
drafts: number; // Campaigns with 0 workflow runs
|
|
333
|
-
active: number; // Campaigns with ≥1 workflow run (not completed)
|
|
334
|
-
completed: number; // Campaigns marked as completed
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export interface AIUsageSummary {
|
|
338
|
-
totalCostCents: number;
|
|
339
|
-
totalTokens: number;
|
|
340
|
-
byService: Record<string, { cost: number; count: number }>;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// =============================================================================
|
|
344
|
-
// Campaign with Related Data
|
|
345
|
-
// =============================================================================
|
|
346
|
-
|
|
347
|
-
export interface CampaignWithDetails {
|
|
348
|
-
campaign: MarketingCampaign;
|
|
349
|
-
content: AIContent[];
|
|
350
|
-
media: AIMedia[];
|
|
351
|
-
}
|
|
352
|
-
|
|
353
171
|
// =============================================================================
|
|
354
172
|
// Content Source Types (NEW)
|
|
355
173
|
// =============================================================================
|
|
@@ -373,7 +191,11 @@ export type ContentSourceType =
|
|
|
373
191
|
| 'design_doc' // Internal design docs (product-hub admin; preview route only, no public page)
|
|
374
192
|
| 'from_scratch';
|
|
375
193
|
|
|
376
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Where a post's link goes: nowhere, written into the post, posted as a comment, or opened by the post itself
|
|
196
|
+
* (`as_link`: tapping the notification of an OpenFrame announcement opens it).
|
|
197
|
+
*/
|
|
198
|
+
export type URLInjectionPreference = 'none' | 'in_post' | 'as_comment' | 'as_link';
|
|
377
199
|
|
|
378
200
|
export interface ContentSourceOption {
|
|
379
201
|
id: number | string; // Events/podcasts/webinars use UUID strings
|
package/src/utils/index.ts
CHANGED
|
@@ -103,7 +103,7 @@ export {
|
|
|
103
103
|
// Dynamic icon registry — single source of truth lives at
|
|
104
104
|
// components/chat/utils/icon-registry. Re-exported here so existing
|
|
105
105
|
// `@flamingo-stack/openframe-frontend-core/utils` callers (hub admin
|
|
106
|
-
//
|
|
106
|
+
// distribution-channel screens) keep working without changing their import path.
|
|
107
107
|
export {
|
|
108
108
|
getDynamicIcon,
|
|
109
109
|
type DynamicIconSize,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an OpenFrame notification can say about itself: its severity and the
|
|
3
|
+
* dashboard section (category) it belongs to, as the backend's enums name them.
|
|
4
|
+
* Stated once for every host that writes or draws one: the OpenFrame app's
|
|
5
|
+
* notification tiles, the Backoffice API's announcement request and the hub's
|
|
6
|
+
* preview of an announcement before it is sent.
|
|
7
|
+
*
|
|
8
|
+
* Pure and server-safe; also published as the granular subpath
|
|
9
|
+
* `./utils/notifications`, so server code reads the vocabulary without React.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** The backend's notification severities, drawn as the tile's colour. */
|
|
13
|
+
export const NOTIFICATION_SEVERITIES = ['INFO', 'SUCCESS', 'WARNING', 'DANGER'] as const;
|
|
14
|
+
export type NotificationSeverity = (typeof NOTIFICATION_SEVERITIES)[number];
|
|
15
|
+
|
|
16
|
+
export const NOTIFICATION_SEVERITY_LABELS: Readonly<Record<NotificationSeverity, string>> = {
|
|
17
|
+
INFO: 'Info',
|
|
18
|
+
SUCCESS: 'Success',
|
|
19
|
+
WARNING: 'Warning',
|
|
20
|
+
DANGER: 'Danger',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** The severity a notification has when it states none. */
|
|
24
|
+
export const DEFAULT_NOTIFICATION_SEVERITY: NotificationSeverity = 'INFO';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The backend's `NotificationCategory`: the dashboard section a notification
|
|
28
|
+
* belongs to. Any section but GENERIC shows an unread counter on its menu item.
|
|
29
|
+
*/
|
|
30
|
+
export const NOTIFICATION_CATEGORIES = [
|
|
31
|
+
'DASHBOARD',
|
|
32
|
+
'CUSTOMERS',
|
|
33
|
+
'DEVICES',
|
|
34
|
+
'SCRIPTS',
|
|
35
|
+
'MONITORING',
|
|
36
|
+
'SOFTWARE',
|
|
37
|
+
'LOGS',
|
|
38
|
+
'TICKETS',
|
|
39
|
+
'INSIGHTS',
|
|
40
|
+
'MINGO',
|
|
41
|
+
'INTEGRATIONS',
|
|
42
|
+
'GENERIC',
|
|
43
|
+
] as const;
|
|
44
|
+
export type NotificationCategory = (typeof NOTIFICATION_CATEGORIES)[number];
|
|
45
|
+
|
|
46
|
+
/** Each category as the app's navigation names its section. */
|
|
47
|
+
export const NOTIFICATION_CATEGORY_LABELS: Readonly<Record<NotificationCategory, string>> = {
|
|
48
|
+
DASHBOARD: 'Dashboard',
|
|
49
|
+
CUSTOMERS: 'Customers',
|
|
50
|
+
DEVICES: 'Devices',
|
|
51
|
+
SCRIPTS: 'Scripts',
|
|
52
|
+
MONITORING: 'Monitoring',
|
|
53
|
+
SOFTWARE: 'Software',
|
|
54
|
+
LOGS: 'Logs',
|
|
55
|
+
TICKETS: 'Tickets',
|
|
56
|
+
INSIGHTS: 'Insights',
|
|
57
|
+
MINGO: 'Mingo',
|
|
58
|
+
INTEGRATIONS: 'Integrations',
|
|
59
|
+
GENERIC: 'General',
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** The category a notification has when it states none. */
|
|
63
|
+
export const DEFAULT_NOTIFICATION_CATEGORY: NotificationCategory = 'GENERIC';
|
|
64
|
+
|
|
65
|
+
export function isNotificationSeverity(value: unknown): value is NotificationSeverity {
|
|
66
|
+
return typeof value === 'string' && (NOTIFICATION_SEVERITIES as readonly string[]).includes(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function isNotificationCategory(value: unknown): value is NotificationCategory {
|
|
70
|
+
return typeof value === 'string' && (NOTIFICATION_CATEGORIES as readonly string[]).includes(value);
|
|
71
|
+
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* type, and the "find the link for a platform" picker.
|
|
4
4
|
*
|
|
5
5
|
* **This module does NOT own the list of platforms.** That list lives in the
|
|
6
|
-
* `
|
|
6
|
+
* `channel_platforms` table and only there: it is admin-editable, it carries
|
|
7
7
|
* `display_name`, `icon_name`, `base_url`, `url_pattern`, `category` and
|
|
8
8
|
* `sort_order`, and the hub already reads it everywhere
|
|
9
|
-
* (`lib/data/
|
|
9
|
+
* (`lib/data/channel-platforms-utils.ts`, `useChannelPlatforms`). A hardcoded
|
|
10
10
|
* tuple here would be a second vocabulary that drifts the first time somebody
|
|
11
11
|
* adds a row — and, being a compile-time union, would reject that row outright.
|
|
12
12
|
*
|
|
@@ -23,25 +23,25 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* One row of `
|
|
26
|
+
* One row of `channel_platforms`, in the shape callers pass around.
|
|
27
27
|
*
|
|
28
28
|
* Deliberately a narrow READ view: the columns that decide presentation and
|
|
29
29
|
* URL-building, not the OAuth or media-config columns, which have their own
|
|
30
30
|
* consumers and no business here.
|
|
31
31
|
*/
|
|
32
32
|
export interface SocialPlatformDefinition {
|
|
33
|
-
/** `
|
|
33
|
+
/** `channel_platforms.name` — the canonical key, lowercase. */
|
|
34
34
|
name: string;
|
|
35
|
-
/** `
|
|
35
|
+
/** `channel_platforms.base_url`, e.g. `https://twitter.com/`. */
|
|
36
36
|
baseUrl?: string | null;
|
|
37
|
-
/** `
|
|
37
|
+
/** `channel_platforms.url_pattern`, e.g. `https://twitter.com/{username}`. */
|
|
38
38
|
urlPattern?: string | null;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Accepted SPELLINGS that resolve onto a platform name.
|
|
43
43
|
*
|
|
44
|
-
* Not a vocabulary — every value here must be a `
|
|
44
|
+
* Not a vocabulary — every value here must be a `channel_platforms.name`. These
|
|
45
45
|
* exist because external data says `x`, `fb` or `generic` where the table says
|
|
46
46
|
* `twitter`, `facebook` and `website`.
|
|
47
47
|
*/
|
|
@@ -84,7 +84,7 @@ export function hostMatches(hostname: string | null | undefined, domain: string)
|
|
|
84
84
|
* (`x.com`), a share domain (`youtu.be`), an invite domain (`discord.gg`).
|
|
85
85
|
*
|
|
86
86
|
* The ONLY hardcoded host knowledge left, and it is additive: every primary
|
|
87
|
-
* host is derived from the row. Keyed by `
|
|
87
|
+
* host is derived from the row. Keyed by `channel_platforms.name`, so a row that
|
|
88
88
|
* does not exist contributes nothing. If this grows, the answer is an
|
|
89
89
|
* `alt_hosts` column on the table, not a longer map here.
|
|
90
90
|
*/
|
|
@@ -115,7 +115,7 @@ export function socialPlatformHosts(platform: SocialPlatformDefinition): string[
|
|
|
115
115
|
/**
|
|
116
116
|
* Classify a URL by its host against the platforms the DATABASE defines.
|
|
117
117
|
*
|
|
118
|
-
* `platforms` is the caller's loaded `
|
|
118
|
+
* `platforms` is the caller's loaded `channel_platforms` rows — passing them in
|
|
119
119
|
* is what keeps this function pure and this module free of a platform list.
|
|
120
120
|
* Returns `'website'` for a URL that parses but matches no row (the table's own
|
|
121
121
|
* catch-all row), and `null` for something that is not a URL at all.
|