@iann29/rastro 0.9.0 → 0.10.0

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.
Files changed (257) hide show
  1. package/README.md +9 -1
  2. package/agent/integration.md +23 -1
  3. package/agent/manifest.json +4 -4
  4. package/dist/client/federation.d.ts +114 -9
  5. package/dist/client/federation.d.ts.map +1 -1
  6. package/dist/client/federation.js +54 -2
  7. package/dist/client/federation.js.map +1 -1
  8. package/dist/client/index.d.ts +637 -8
  9. package/dist/client/index.d.ts.map +1 -1
  10. package/dist/client/index.js +385 -9
  11. package/dist/client/index.js.map +1 -1
  12. package/dist/component/_generated/api.d.ts +14 -0
  13. package/dist/component/_generated/api.d.ts.map +1 -1
  14. package/dist/component/_generated/api.js.map +1 -1
  15. package/dist/component/_generated/component.d.ts +277 -1
  16. package/dist/component/_generated/component.d.ts.map +1 -1
  17. package/dist/component/_generated/server.d.ts +4 -0
  18. package/dist/component/_generated/server.d.ts.map +1 -1
  19. package/dist/component/_generated/server.js.map +1 -1
  20. package/dist/component/constants.d.ts +5 -0
  21. package/dist/component/constants.d.ts.map +1 -1
  22. package/dist/component/constants.js +10 -0
  23. package/dist/component/constants.js.map +1 -1
  24. package/dist/component/convex.config.d.ts +4 -0
  25. package/dist/component/convex.config.js +9 -0
  26. package/dist/component/convex.config.js.map +1 -1
  27. package/dist/component/errors.d.ts +1 -1
  28. package/dist/component/errors.d.ts.map +1 -1
  29. package/dist/component/errors.js.map +1 -1
  30. package/dist/component/leads.d.ts +69 -3
  31. package/dist/component/leads.d.ts.map +1 -1
  32. package/dist/component/leads.js +419 -16
  33. package/dist/component/leads.js.map +1 -1
  34. package/dist/component/meta.d.ts +352 -0
  35. package/dist/component/meta.d.ts.map +1 -0
  36. package/dist/component/meta.js +1239 -0
  37. package/dist/component/meta.js.map +1 -0
  38. package/dist/component/metaCapi.d.ts +162 -0
  39. package/dist/component/metaCapi.d.ts.map +1 -0
  40. package/dist/component/metaCapi.js +754 -0
  41. package/dist/component/metaCapi.js.map +1 -0
  42. package/dist/component/metaFake.d.ts +5 -0
  43. package/dist/component/metaFake.d.ts.map +1 -0
  44. package/dist/component/metaFake.js +225 -0
  45. package/dist/component/metaFake.js.map +1 -0
  46. package/dist/component/metaGraph.d.ts +165 -0
  47. package/dist/component/metaGraph.d.ts.map +1 -0
  48. package/dist/component/metaGraph.js +507 -0
  49. package/dist/component/metaGraph.js.map +1 -0
  50. package/dist/component/metaSync.d.ts +186 -0
  51. package/dist/component/metaSync.d.ts.map +1 -0
  52. package/dist/component/metaSync.js +961 -0
  53. package/dist/component/metaSync.js.map +1 -0
  54. package/dist/component/pipeline.d.ts +98 -0
  55. package/dist/component/pipeline.d.ts.map +1 -0
  56. package/dist/component/pipeline.js +324 -0
  57. package/dist/component/pipeline.js.map +1 -0
  58. package/dist/component/schema.d.ts +404 -2
  59. package/dist/component/schema.d.ts.map +1 -1
  60. package/dist/component/schema.js +168 -2
  61. package/dist/component/schema.js.map +1 -1
  62. package/dist/component/secrets.d.ts +15 -0
  63. package/dist/component/secrets.d.ts.map +1 -0
  64. package/dist/component/secrets.js +67 -0
  65. package/dist/component/secrets.js.map +1 -0
  66. package/dist/component/validators.d.ts +1052 -15
  67. package/dist/component/validators.d.ts.map +1 -1
  68. package/dist/component/validators.js +307 -3
  69. package/dist/component/validators.js.map +1 -1
  70. package/dist/tracker/generated.d.ts +1 -1
  71. package/dist/tracker/generated.d.ts.map +1 -1
  72. package/dist/tracker/generated.js +1 -1
  73. package/dist/tracker/generated.js.map +1 -1
  74. package/dist/ui/campaigns/CampaignsView.d.ts +48 -0
  75. package/dist/ui/campaigns/CampaignsView.d.ts.map +1 -0
  76. package/dist/ui/campaigns/CampaignsView.js +47 -0
  77. package/dist/ui/campaigns/CampaignsView.js.map +1 -0
  78. package/dist/ui/campaigns/Conversions.d.ts +16 -0
  79. package/dist/ui/campaigns/Conversions.d.ts.map +1 -0
  80. package/dist/ui/campaigns/Conversions.js +40 -0
  81. package/dist/ui/campaigns/Conversions.js.map +1 -0
  82. package/dist/ui/campaigns/Drawer.d.ts +24 -0
  83. package/dist/ui/campaigns/Drawer.d.ts.map +1 -0
  84. package/dist/ui/campaigns/Drawer.js +120 -0
  85. package/dist/ui/campaigns/Drawer.js.map +1 -0
  86. package/dist/ui/campaigns/Icons.d.ts +35 -0
  87. package/dist/ui/campaigns/Icons.d.ts.map +1 -0
  88. package/dist/ui/campaigns/Icons.js +41 -0
  89. package/dist/ui/campaigns/Icons.js.map +1 -0
  90. package/dist/ui/campaigns/Summary.d.ts +21 -0
  91. package/dist/ui/campaigns/Summary.d.ts.map +1 -0
  92. package/dist/ui/campaigns/Summary.js +56 -0
  93. package/dist/ui/campaigns/Summary.js.map +1 -0
  94. package/dist/ui/campaigns/Thumbnail.d.ts +11 -0
  95. package/dist/ui/campaigns/Thumbnail.d.ts.map +1 -0
  96. package/dist/ui/campaigns/Thumbnail.js +23 -0
  97. package/dist/ui/campaigns/Thumbnail.js.map +1 -0
  98. package/dist/ui/campaigns/Tree.d.ts +12 -0
  99. package/dist/ui/campaigns/Tree.d.ts.map +1 -0
  100. package/dist/ui/campaigns/Tree.js +105 -0
  101. package/dist/ui/campaigns/Tree.js.map +1 -0
  102. package/dist/ui/campaigns/glyphs.d.ts +20 -0
  103. package/dist/ui/campaigns/glyphs.d.ts.map +1 -0
  104. package/dist/ui/campaigns/glyphs.js +19 -0
  105. package/dist/ui/campaigns/glyphs.js.map +1 -0
  106. package/dist/ui/campaigns/index.d.ts +4 -0
  107. package/dist/ui/campaigns/index.d.ts.map +1 -0
  108. package/dist/ui/campaigns/index.js +3 -0
  109. package/dist/ui/campaigns/index.js.map +1 -0
  110. package/dist/ui/campaigns/labels.d.ts +53 -0
  111. package/dist/ui/campaigns/labels.d.ts.map +1 -0
  112. package/dist/ui/campaigns/labels.js +169 -0
  113. package/dist/ui/campaigns/labels.js.map +1 -0
  114. package/dist/ui/campaigns/model.d.ts +99 -0
  115. package/dist/ui/campaigns/model.d.ts.map +1 -0
  116. package/dist/ui/campaigns/model.js +230 -0
  117. package/dist/ui/campaigns/model.js.map +1 -0
  118. package/dist/ui/campaigns/modes.d.ts +18 -0
  119. package/dist/ui/campaigns/modes.d.ts.map +1 -0
  120. package/dist/ui/campaigns/modes.js +7 -0
  121. package/dist/ui/campaigns/modes.js.map +1 -0
  122. package/dist/ui/index.d.ts +21 -0
  123. package/dist/ui/index.d.ts.map +1 -0
  124. package/dist/ui/index.js +19 -0
  125. package/dist/ui/index.js.map +1 -0
  126. package/dist/ui/integrations/AccountPicker.d.ts +26 -0
  127. package/dist/ui/integrations/AccountPicker.d.ts.map +1 -0
  128. package/dist/ui/integrations/AccountPicker.js +97 -0
  129. package/dist/ui/integrations/AccountPicker.js.map +1 -0
  130. package/dist/ui/integrations/ClientCards.d.ts +17 -0
  131. package/dist/ui/integrations/ClientCards.d.ts.map +1 -0
  132. package/dist/ui/integrations/ClientCards.js +38 -0
  133. package/dist/ui/integrations/ClientCards.js.map +1 -0
  134. package/dist/ui/integrations/ClientsTable.d.ts +36 -0
  135. package/dist/ui/integrations/ClientsTable.d.ts.map +1 -0
  136. package/dist/ui/integrations/ClientsTable.js +127 -0
  137. package/dist/ui/integrations/ClientsTable.js.map +1 -0
  138. package/dist/ui/integrations/Connect.d.ts +29 -0
  139. package/dist/ui/integrations/Connect.d.ts.map +1 -0
  140. package/dist/ui/integrations/Connect.js +49 -0
  141. package/dist/ui/integrations/Connect.js.map +1 -0
  142. package/dist/ui/integrations/Connection.d.ts +37 -0
  143. package/dist/ui/integrations/Connection.d.ts.map +1 -0
  144. package/dist/ui/integrations/Connection.js +94 -0
  145. package/dist/ui/integrations/Connection.js.map +1 -0
  146. package/dist/ui/integrations/Dialogs.d.ts +18 -0
  147. package/dist/ui/integrations/Dialogs.d.ts.map +1 -0
  148. package/dist/ui/integrations/Dialogs.js +25 -0
  149. package/dist/ui/integrations/Dialogs.js.map +1 -0
  150. package/dist/ui/integrations/EventsFeed.d.ts +15 -0
  151. package/dist/ui/integrations/EventsFeed.d.ts.map +1 -0
  152. package/dist/ui/integrations/EventsFeed.js +57 -0
  153. package/dist/ui/integrations/EventsFeed.js.map +1 -0
  154. package/dist/ui/integrations/EventsSheet.d.ts +28 -0
  155. package/dist/ui/integrations/EventsSheet.d.ts.map +1 -0
  156. package/dist/ui/integrations/EventsSheet.js +121 -0
  157. package/dist/ui/integrations/EventsSheet.js.map +1 -0
  158. package/dist/ui/integrations/Icons.d.ts +36 -0
  159. package/dist/ui/integrations/Icons.d.ts.map +1 -0
  160. package/dist/ui/integrations/Icons.js +38 -0
  161. package/dist/ui/integrations/Icons.js.map +1 -0
  162. package/dist/ui/integrations/IntegrationsView.d.ts +14 -0
  163. package/dist/ui/integrations/IntegrationsView.d.ts.map +1 -0
  164. package/dist/ui/integrations/IntegrationsView.js +113 -0
  165. package/dist/ui/integrations/IntegrationsView.js.map +1 -0
  166. package/dist/ui/integrations/Overlay.d.ts +18 -0
  167. package/dist/ui/integrations/Overlay.d.ts.map +1 -0
  168. package/dist/ui/integrations/Overlay.js +36 -0
  169. package/dist/ui/integrations/Overlay.js.map +1 -0
  170. package/dist/ui/integrations/RowMenu.d.ts +15 -0
  171. package/dist/ui/integrations/RowMenu.d.ts.map +1 -0
  172. package/dist/ui/integrations/RowMenu.js +47 -0
  173. package/dist/ui/integrations/RowMenu.js.map +1 -0
  174. package/dist/ui/integrations/UnlinkDialog.d.ts +18 -0
  175. package/dist/ui/integrations/UnlinkDialog.d.ts.map +1 -0
  176. package/dist/ui/integrations/UnlinkDialog.js +29 -0
  177. package/dist/ui/integrations/UnlinkDialog.js.map +1 -0
  178. package/dist/ui/integrations/format.d.ts +28 -0
  179. package/dist/ui/integrations/format.d.ts.map +1 -0
  180. package/dist/ui/integrations/format.js +101 -0
  181. package/dist/ui/integrations/format.js.map +1 -0
  182. package/dist/ui/integrations/index.d.ts +5 -0
  183. package/dist/ui/integrations/index.d.ts.map +1 -0
  184. package/dist/ui/integrations/index.js +3 -0
  185. package/dist/ui/integrations/index.js.map +1 -0
  186. package/dist/ui/integrations/model.d.ts +84 -0
  187. package/dist/ui/integrations/model.d.ts.map +1 -0
  188. package/dist/ui/integrations/model.js +131 -0
  189. package/dist/ui/integrations/model.js.map +1 -0
  190. package/dist/ui/integrations/overlay.d.ts +10 -0
  191. package/dist/ui/integrations/overlay.d.ts.map +1 -0
  192. package/dist/ui/integrations/overlay.js +77 -0
  193. package/dist/ui/integrations/overlay.js.map +1 -0
  194. package/dist/ui/integrations/parts.d.ts +36 -0
  195. package/dist/ui/integrations/parts.d.ts.map +1 -0
  196. package/dist/ui/integrations/parts.js +85 -0
  197. package/dist/ui/integrations/parts.js.map +1 -0
  198. package/dist/ui/integrations/types.d.ts +96 -0
  199. package/dist/ui/integrations/types.d.ts.map +1 -0
  200. package/dist/ui/integrations/types.js +2 -0
  201. package/dist/ui/integrations/types.js.map +1 -0
  202. package/dist/ui/metrics.d.ts +106 -0
  203. package/dist/ui/metrics.d.ts.map +1 -0
  204. package/dist/ui/metrics.js +166 -0
  205. package/dist/ui/metrics.js.map +1 -0
  206. package/dist/ui/portfolio/PortfolioView.d.ts +26 -0
  207. package/dist/ui/portfolio/PortfolioView.d.ts.map +1 -0
  208. package/dist/ui/portfolio/PortfolioView.js +216 -0
  209. package/dist/ui/portfolio/PortfolioView.js.map +1 -0
  210. package/dist/ui/portfolio/SpendChart.d.ts +10 -0
  211. package/dist/ui/portfolio/SpendChart.d.ts.map +1 -0
  212. package/dist/ui/portfolio/SpendChart.js +196 -0
  213. package/dist/ui/portfolio/SpendChart.js.map +1 -0
  214. package/dist/ui/portfolio/alerts.d.ts +74 -0
  215. package/dist/ui/portfolio/alerts.d.ts.map +1 -0
  216. package/dist/ui/portfolio/alerts.js +291 -0
  217. package/dist/ui/portfolio/alerts.js.map +1 -0
  218. package/dist/ui/portfolio/figures.d.ts +79 -0
  219. package/dist/ui/portfolio/figures.d.ts.map +1 -0
  220. package/dist/ui/portfolio/figures.js +103 -0
  221. package/dist/ui/portfolio/figures.js.map +1 -0
  222. package/dist/ui/portfolio/format.d.ts +8 -0
  223. package/dist/ui/portfolio/format.d.ts.map +1 -0
  224. package/dist/ui/portfolio/format.js +28 -0
  225. package/dist/ui/portfolio/format.js.map +1 -0
  226. package/dist/ui/sample.d.ts +474 -0
  227. package/dist/ui/sample.d.ts.map +1 -0
  228. package/dist/ui/sample.js +553 -0
  229. package/dist/ui/sample.js.map +1 -0
  230. package/dist/ui/seed.d.ts +188 -0
  231. package/dist/ui/seed.d.ts.map +1 -0
  232. package/dist/ui/seed.js +563 -0
  233. package/dist/ui/seed.js.map +1 -0
  234. package/dist/ui/ui.css +3356 -0
  235. package/docs/federation.md +46 -1
  236. package/docs/meta-ads.md +746 -0
  237. package/docs/upgrading.md +95 -0
  238. package/llms.txt +3 -0
  239. package/package.json +15 -3
  240. package/src/component/_generated/api.ts +14 -0
  241. package/src/component/_generated/component.ts +323 -1
  242. package/src/component/_generated/server.ts +4 -0
  243. package/src/component/constants.ts +10 -0
  244. package/src/component/convex.config.ts +9 -0
  245. package/src/component/errors.ts +5 -1
  246. package/src/component/leads.ts +517 -17
  247. package/src/component/meta.ts +1461 -0
  248. package/src/component/metaCapi.ts +921 -0
  249. package/src/component/metaFake.ts +277 -0
  250. package/src/component/metaGraph.ts +722 -0
  251. package/src/component/metaSync.ts +1164 -0
  252. package/src/component/pipeline.ts +392 -0
  253. package/src/component/schema.ts +197 -1
  254. package/src/component/secrets.ts +98 -0
  255. package/src/component/validators.ts +376 -3
  256. package/src/tracker/generated.ts +1 -1
  257. package/src/ui/seed.ts +755 -0
@@ -15,7 +15,7 @@ export { localDayStart, nextLocalDayStart, previousLocalDayStart, } from "../com
15
15
  export { HEAT_HOT_SCORE, HEAT_WARM_SCORE, visitorHeat } from "./heat.js";
16
16
  export type { HeatInput, HeatLevel, HeatSignal, VisitorHeat } from "./heat.js";
17
17
  export type { VitalMetric } from "../component/vitals.js";
18
- export { effectiveFederatedPermissions, federatedPermissionSatisfies, isPublicFederatedAccess, FEDERATED_ANALYTICS_CLAIMS, FEDERATED_ANALYTICS_CONFIGURE_FUNCTIONS, FEDERATED_ANALYTICS_CONFIGURE_PERMISSION, FEDERATED_ANALYTICS_CONNECTOR_MANIFEST, FEDERATED_ANALYTICS_ERROR_CODES, FEDERATED_ANALYTICS_LEAD_FUNCTIONS, FEDERATED_ANALYTICS_PERMISSIONS, FEDERATED_ANALYTICS_PUBLIC_FUNCTIONS, FEDERATED_ANALYTICS_PUBLIC_PERMISSION, FEDERATED_ANALYTICS_READ_PERMISSION, FEDERATED_ANALYTICS_REQUIRED_CAPABILITIES, FEDERATED_ANALYTICS_REQUIRED_FUNCTIONS, federatedAnalyticsPermissionValidator, } from "./federation.js";
18
+ export { effectiveFederatedPermissions, federatedPermissionSatisfies, isPublicFederatedAccess, FEDERATED_ANALYTICS_CLAIMS, FEDERATED_ANALYTICS_CONFIGURE_FUNCTIONS, FEDERATED_ANALYTICS_CONFIGURE_PERMISSION, FEDERATED_ANALYTICS_CONNECTOR_MANIFEST, FEDERATED_ANALYTICS_ERROR_CODES, FEDERATED_ANALYTICS_LEAD_FUNCTIONS, FEDERATED_ANALYTICS_META_AUTHORIZER, FEDERATED_ANALYTICS_META_FUNCTIONS, FEDERATED_ANALYTICS_PERMISSIONS, federatedMetaOwnerKey, FEDERATED_ANALYTICS_PUBLIC_FUNCTIONS, FEDERATED_ANALYTICS_PUBLIC_PERMISSION, FEDERATED_ANALYTICS_READ_PERMISSION, FEDERATED_ANALYTICS_REQUIRED_CAPABILITIES, FEDERATED_ANALYTICS_REQUIRED_FUNCTIONS, federatedAnalyticsPermissionValidator, } from "./federation.js";
19
19
  export type { FederatedAnalyticsCapability, FederatedAnalyticsAuthorizerOptions, FederatedAnalyticsConnection, FederatedAnalyticsConnectionStatus, FederatedAnalyticsErrorCode, FederatedAnalyticsIdentity, FederatedAnalyticsManifest, FederatedAnalyticsPermission, FederatedSiteSummary, ResolveFederatedAnalyticsConnection, } from "./federation.js";
20
20
  export type CreateSiteInput = FunctionArgs<ComponentApi["sites"]["create"]>;
21
21
  export type ListPeopleInput = FunctionArgs<ComponentApi["people"]["list"]>;
@@ -69,14 +69,68 @@ export type CreateTrackedLinkInput = FunctionArgs<ComponentApi["trackedLinks"]["
69
69
  export type UpdateTrackedLinkInput = FunctionArgs<ComponentApi["trackedLinks"]["update"]>;
70
70
  export type ListTrackedLinksInput = FunctionArgs<ComponentApi["trackedLinks"]["list"]>;
71
71
  export type TrackedLink = FunctionReturnType<ComponentApi["trackedLinks"]["list"]>[number];
72
- export type RecordLeadInput = FunctionArgs<ComponentApi["leads"]["record"]>;
73
- export type SetLeadStageInput = FunctionArgs<ComponentApi["leads"]["setStage"]>;
72
+ /**
73
+ * What the host knows of a lead's contact for the Meta pixel, every value
74
+ * already a SHA-256 hex digest: the phone numbers (digits with the country
75
+ * code) and the host's own contact id.
76
+ */
77
+ export type MetaHashes = {
78
+ ph: string[];
79
+ externalId?: string;
80
+ };
81
+ export type RecordLeadInput = Omit<FunctionArgs<ComponentApi["leads"]["record"]>, "meta"> & {
82
+ meta?: MetaHashes;
83
+ };
84
+ export type SetLeadStageInput = Omit<FunctionArgs<ComponentApi["leads"]["setStage"]>, "meta"> & {
85
+ meta?: MetaHashes;
86
+ };
74
87
  export type UpsertAdCatalogInput = FunctionArgs<ComponentApi["leads"]["upsertAdCatalog"]>;
75
88
  export type LeadsReportInput = FunctionArgs<ComponentApi["leads"]["report"]>;
76
89
  export type LeadsReport = FunctionReturnType<ComponentApi["leads"]["report"]>;
77
90
  export type ListLeadsInput = FunctionArgs<ComponentApi["leads"]["list"]>;
78
91
  export type LeadSummary = FunctionReturnType<ComponentApi["leads"]["list"]>[number];
79
92
  export type LeadJourney = FunctionReturnType<ComponentApi["leads"]["journey"]>;
93
+ export type LeadsDailyInput = FunctionArgs<ComponentApi["leads"]["daily"]>;
94
+ export type LeadsDaily = FunctionReturnType<ComponentApi["leads"]["daily"]>;
95
+ export type MetaStatus = FunctionReturnType<ComponentApi["meta"]["status"]>;
96
+ export type MetaConversionsInput = FunctionArgs<ComponentApi["meta"]["conversions"]>;
97
+ export type MetaConversion = FunctionReturnType<ComponentApi["meta"]["conversions"]>[number];
98
+ export type MetaAdAccount = FunctionReturnType<ComponentApi["meta"]["listAdAccounts"]>[number];
99
+ export type SetMetaConnectionInput = FunctionArgs<ComponentApi["meta"]["connect"]>;
100
+ export type SetMetaConnectionOutput = FunctionReturnType<ComponentApi["meta"]["connect"]>;
101
+ export type LinkSiteAdAccountInput = FunctionArgs<ComponentApi["meta"]["linkAdAccount"]>;
102
+ /**
103
+ * The site's pixel, picked from an owner's connection (`ownerKey`: it sends
104
+ * with that connection's token) or set with its own Conversions API token
105
+ * (`accessToken`, plan B). Exactly one of the two.
106
+ */
107
+ export type SetSitePixelInput = Omit<FunctionArgs<ComponentApi["meta"]["setPixel"]>, "accessToken" | "ownerKey"> & ({
108
+ ownerKey: string;
109
+ accessToken?: never;
110
+ } | {
111
+ accessToken: string;
112
+ ownerKey?: never;
113
+ });
114
+ export type ConnectMetaWithCodeInput = FunctionArgs<ComponentApi["meta"]["connectWithCode"]>;
115
+ export type ConnectMetaWithCodeOutput = FunctionReturnType<ComponentApi["meta"]["connectWithCode"]>;
116
+ /** An owner's Meta connection as a screen shows it (never a token). */
117
+ export type MetaConnection = NonNullable<FunctionReturnType<ComponentApi["meta"]["connection"]>>;
118
+ export type MetaConnectionAdAccount = MetaConnection["adAccounts"][number];
119
+ export type MetaPixel = MetaConnection["pixels"][number];
120
+ /** Where a site's pixel sends from: a connection's token, or its own. */
121
+ export type MetaPixelSource = "connection" | "token";
122
+ export type SetPipelineInput = FunctionArgs<ComponentApi["pipeline"]["setPipeline"]>;
123
+ export type PipelineColumn = SetPipelineInput["columns"][number];
124
+ export type SetEventMapInput = FunctionArgs<ComponentApi["pipeline"]["setEventMap"]>;
125
+ export type EventMapInput = FunctionArgs<ComponentApi["pipeline"]["eventMap"]>;
126
+ /** A site's columns, the Meta event each sends and its monthly entries. */
127
+ export type EventMap = FunctionReturnType<ComponentApi["pipeline"]["eventMap"]>;
128
+ export type EventMapColumn = EventMap["columns"][number];
129
+ /** The events a column may send; `Purchase` comes from the sale alone. */
130
+ export type MetaColumnEvent = NonNullable<EventMapColumn["event"]>;
131
+ export type UnlinkPreviewInput = FunctionArgs<ComponentApi["meta"]["unlinkPreview"]>;
132
+ /** What unlinking an ad account takes out of the site's reports. */
133
+ export type UnlinkPreview = FunctionReturnType<ComponentApi["meta"]["unlinkPreview"]>;
80
134
  export type CleanupInput = {
81
135
  siteId: string;
82
136
  kind: RetentionKind;
@@ -918,7 +972,9 @@ export declare class Rastro {
918
972
  * Records a lead the host's server saw (a WhatsApp conversation), once per
919
973
  * `leadKey`: pass the host's own opaque id for the conversation, never a
920
974
  * phone number. The first touch wins; a repeat call only fills `label` or
921
- * `visitorId`. Call it from the host's inbound handler.
975
+ * `visitorId`. Call it from the host's inbound handler. `meta` (SHA-256
976
+ * hashes of the phone and the contact id) lets the site's Meta pixel
977
+ * receive `Lead` when the pixel sends new leads.
922
978
  */
923
979
  recordLead(ctx: MutationCtx, args: RecordLeadInput): Promise<{
924
980
  created: boolean;
@@ -926,8 +982,11 @@ export declare class Rastro {
926
982
  }>;
927
983
  /**
928
984
  * Moves a recorded lead to `qualified`, `won` (with the sale value in the
929
- * site's currency), `lost`, or back `open`. Idempotent by `eventId`; a lead
930
- * never recorded returns `applied: false` instead of being invented.
985
+ * site's currency), `lost`, or back `open`, and/or to the host's board
986
+ * `column` (see `setPipeline`). Idempotent by `eventId`; a lead never
987
+ * recorded returns `applied: false` instead of being invented. With `meta`
988
+ * (SHA-256 hashes) and an active pixel, a sale with a value is sent to Meta
989
+ * as `Purchase` and a mapped column's event goes out, once per lead each.
931
990
  */
932
991
  setLeadStage(ctx: MutationCtx, args: SetLeadStageInput): Promise<{
933
992
  applied: boolean;
@@ -941,48 +1000,85 @@ export declare class Rastro {
941
1000
  upserted: number;
942
1001
  }>;
943
1002
  leadsReport(ctx: QueryCtx | MutationCtx | ActionCtx, args: LeadsReportInput): Promise<{
1003
+ bySite?: Array<{
1004
+ currencyMismatch?: boolean;
1005
+ leads: number;
1006
+ paid: {
1007
+ leads: number;
1008
+ qualified: number;
1009
+ revenueCents: number;
1010
+ won: number;
1011
+ };
1012
+ qualified: number;
1013
+ revenueCents: number;
1014
+ siteId: string;
1015
+ spendCents?: number | null;
1016
+ spendCurrency?: string | null;
1017
+ won: number;
1018
+ }>;
944
1019
  campaigns: Array<{
945
1020
  adsets: Array<{
946
1021
  ads: Array<{
947
1022
  adId: string;
948
1023
  adName: string | null;
1024
+ adStatus?: string | null;
1025
+ clicks?: number | null;
1026
+ creativeType?: string | null;
1027
+ impressions?: number | null;
949
1028
  leads: number;
950
1029
  qualified: number;
951
1030
  revenueCents: number;
1031
+ siteId?: string;
952
1032
  sourceApp: string | null;
953
1033
  sourceUrl: string | null;
1034
+ spendCents?: number | null;
954
1035
  thumbnailUrl: string | null;
955
1036
  title: string | null;
956
1037
  won: number;
957
1038
  }>;
958
1039
  adsetId: string | null;
959
1040
  adsetName: string | null;
1041
+ clicks?: number | null;
1042
+ impressions?: number | null;
960
1043
  leads: number;
961
1044
  qualified: number;
962
1045
  revenueCents: number;
1046
+ spendCents?: number | null;
963
1047
  won: number;
964
1048
  }>;
965
1049
  campaignId: string | null;
966
1050
  campaignName: string | null;
1051
+ clicks?: number | null;
1052
+ impressions?: number | null;
967
1053
  leads: number;
968
1054
  qualified: number;
969
1055
  revenueCents: number;
1056
+ spendCents?: number | null;
970
1057
  won: number;
971
1058
  }>;
972
1059
  currency: string | null;
1060
+ currencyMismatch?: boolean;
973
1061
  from: number;
974
1062
  origins: Array<{
1063
+ clicks?: number | null;
1064
+ impressions?: number | null;
975
1065
  key: string;
976
1066
  leads: number;
977
1067
  qualified: number;
978
1068
  revenueCents: number;
1069
+ spendCents?: number | null;
979
1070
  won: number;
980
1071
  }>;
1072
+ spendCurrency?: string | null;
1073
+ spendIncomplete?: boolean;
981
1074
  to: number;
982
1075
  totals: {
1076
+ clicks?: number | null;
1077
+ impressions?: number | null;
983
1078
  leads: number;
984
1079
  qualified: number;
985
1080
  revenueCents: number;
1081
+ spendCents?: number | null;
986
1082
  won: number;
987
1083
  };
988
1084
  }>;
@@ -1036,6 +1132,184 @@ export declare class Rastro {
1036
1132
  };
1037
1133
  visitorId: string | null;
1038
1134
  } | null>;
1135
+ /**
1136
+ * The lead funnel per cohort day (every UTC day in the range, empty days
1137
+ * included), optionally for one ad, with that day's Meta spend.
1138
+ */
1139
+ leadsDaily(ctx: QueryCtx | MutationCtx | ActionCtx, args: LeadsDailyInput): Promise<{
1140
+ dayStart: number;
1141
+ leads: number;
1142
+ qualified: number;
1143
+ revenueCents: number;
1144
+ spendCents: number | null;
1145
+ won: number;
1146
+ }[]>;
1147
+ /**
1148
+ * Where each site stands with Meta: linked ad accounts, pixel, sends. With
1149
+ * `ownerKey`, each link and the pixel say whether that owner made them
1150
+ * (`own`).
1151
+ */
1152
+ metaStatus(ctx: QueryCtx | MutationCtx | ActionCtx, args: {
1153
+ siteIds: string[];
1154
+ ownerKey?: string;
1155
+ now?: number;
1156
+ }): Promise<{
1157
+ adAccounts: Array<{
1158
+ adAccountId: string;
1159
+ backfill?: {
1160
+ done: number;
1161
+ total: number;
1162
+ } | null;
1163
+ currency: string;
1164
+ lastError: string | null;
1165
+ lastSyncAt: number | null;
1166
+ name: string;
1167
+ own?: boolean;
1168
+ syncState: "backfill" | "live" | "error";
1169
+ timezone: string;
1170
+ }>;
1171
+ conversions: {
1172
+ failed: number;
1173
+ last30d?: {
1174
+ Lead: number;
1175
+ Purchase: number;
1176
+ QualifiedLead: number;
1177
+ Schedule: number;
1178
+ } | null;
1179
+ pending: number;
1180
+ sent: number;
1181
+ sentToday?: number | null;
1182
+ };
1183
+ linked: boolean;
1184
+ pixel: {
1185
+ enabled: boolean;
1186
+ lastError?: string | null;
1187
+ name?: string | null;
1188
+ own?: boolean;
1189
+ pixelId: string | null;
1190
+ source?: "connection" | "token" | null;
1191
+ testMode?: boolean;
1192
+ };
1193
+ siteId: string;
1194
+ }[]>;
1195
+ /** The site's latest conversions for its Meta pixel, without user data. */
1196
+ metaConversions(ctx: QueryCtx | MutationCtx | ActionCtx, args: MetaConversionsInput): Promise<{
1197
+ adId: string | null;
1198
+ adName: string | null;
1199
+ createdAt: number;
1200
+ eventId: string;
1201
+ eventName: "Lead" | "QualifiedLead" | "Schedule" | "Purchase";
1202
+ leadId: string | null;
1203
+ leadLabel: string | null;
1204
+ sentAt: number | null;
1205
+ status: "pending" | "sent" | "failed";
1206
+ valueCents: number | null;
1207
+ }[]>;
1208
+ /**
1209
+ * Validates a Meta token (a system user token with `ads_read`) for the
1210
+ * host's opaque `ownerKey`, lists its ad accounts and stores the token
1211
+ * encrypted with RASTRO_SECRETS_KEY. Pasting a new token for the same owner
1212
+ * replaces the old one. Fails with `SECRETS_KEY_MISSING` without the key and
1213
+ * `META_TOKEN_INVALID` when Meta refuses the token.
1214
+ */
1215
+ setMetaConnection(ctx: ActionCtx, args: SetMetaConnectionInput): Promise<SetMetaConnectionOutput>;
1216
+ /**
1217
+ * Facebook Login for Business: trades the `code` Meta sent to `redirectUri`
1218
+ * for the owner's token (with the component's RASTRO_META_APP_ID/SECRET),
1219
+ * then connects it like `setMetaConnection` and records who authorized it.
1220
+ * Fails with `META_LOGIN_UNAVAILABLE` without the app env and
1221
+ * `META_TOKEN_INVALID` when Meta refuses the code.
1222
+ */
1223
+ connectMetaWithCode(ctx: ActionCtx, args: ConnectMetaWithCodeInput): Promise<ConnectMetaWithCodeOutput>;
1224
+ /**
1225
+ * The owner's connection for a screen: status, who authorized it, the
1226
+ * listed ad accounts with the site each feeds, the listed pixels. Null when
1227
+ * the owner never connected. Never a token.
1228
+ */
1229
+ metaConnection(ctx: QueryCtx | MutationCtx | ActionCtx, args: {
1230
+ ownerKey: string;
1231
+ }): Promise<MetaConnection | null>;
1232
+ /** What unlinking the ad account takes out of the site's reports. */
1233
+ metaUnlinkPreview(ctx: QueryCtx | MutationCtx | ActionCtx, args: UnlinkPreviewInput): Promise<UnlinkPreview>;
1234
+ /**
1235
+ * Declares the host's board columns for the site, in order (at most 40).
1236
+ * Declaring again replaces names and order; a column that is gone leaves
1237
+ * the event map. Then pass `column` to `recordLead` / `setLeadStage`.
1238
+ */
1239
+ setPipeline(ctx: MutationCtx, args: SetPipelineInput): Promise<null>;
1240
+ /**
1241
+ * Which Meta event each declared column sends (`Lead`, `QualifiedLead`,
1242
+ * `Schedule` or null), replacing the whole map, and whether a new lead is
1243
+ * sent as `Lead`. `Purchase` is never a column's: it goes with the sale.
1244
+ */
1245
+ setEventMap(ctx: MutationCtx, args: SetEventMapInput): Promise<null>;
1246
+ /**
1247
+ * The site's columns with their events and the leads that entered each in
1248
+ * the 30 days up to `now` (pass the caller's clock; without it the counts
1249
+ * are null).
1250
+ */
1251
+ eventMap(ctx: QueryCtx | MutationCtx | ActionCtx, args: EventMapInput): Promise<EventMap>;
1252
+ /**
1253
+ * Forgets the Meta owner a federated dashboard connection acted as on this
1254
+ * host (`rastro:connection:<connectionId>`): its token, links and pixels.
1255
+ * Call it when the host revokes or deletes that connection's grant.
1256
+ */
1257
+ removeFederatedMetaConnection(ctx: MutationCtx | ActionCtx, args: {
1258
+ connectionId: string;
1259
+ }): Promise<{
1260
+ removed: boolean;
1261
+ }>;
1262
+ /** Forgets the owner's token and unlinks every ad account it fed. */
1263
+ removeMetaConnection(ctx: MutationCtx | ActionCtx, args: {
1264
+ ownerKey: string;
1265
+ }): Promise<{
1266
+ removed: boolean;
1267
+ }>;
1268
+ /** The owner's ad accounts (and their pixels), read again from Meta. */
1269
+ listMetaAdAccounts(ctx: ActionCtx, args: {
1270
+ ownerKey: string;
1271
+ }): Promise<MetaAdAccount[]>;
1272
+ /**
1273
+ * Makes one of the owner's ad accounts a spend source for the site: a
1274
+ * 90-day backfill with the catalog, then the live sync. The account must be
1275
+ * in the connection's last listing.
1276
+ */
1277
+ linkSiteAdAccount(ctx: MutationCtx, args: LinkSiteAdAccountInput): Promise<{
1278
+ linked: boolean;
1279
+ }>;
1280
+ /**
1281
+ * Stops an ad account feeding the site; its spend leaves the reports. With
1282
+ * `ownerKey`, only that owner's link (another's is a `CONFLICT`).
1283
+ */
1284
+ unlinkSiteAdAccount(ctx: MutationCtx, args: {
1285
+ siteId: string;
1286
+ adAccountId: string;
1287
+ ownerKey?: string;
1288
+ }): Promise<{
1289
+ unlinked: boolean;
1290
+ }>;
1291
+ /**
1292
+ * Sets the site's Meta pixel (dataset): with `ownerKey`, one from that
1293
+ * owner's connection listing, sending with the connection's token; with
1294
+ * `accessToken`, a Conversions API token from Events Manager, checked
1295
+ * against the pixel and encrypted like the connection's.
1296
+ */
1297
+ setSitePixel(ctx: ActionCtx, args: SetSitePixelInput): Promise<{
1298
+ ok: true;
1299
+ }>;
1300
+ /** Forgets the site's pixel; with `ownerKey`, only if that owner set it. */
1301
+ removeSitePixel(ctx: MutationCtx, args: {
1302
+ siteId: string;
1303
+ ownerKey?: string;
1304
+ }): Promise<{
1305
+ removed: boolean;
1306
+ }>;
1307
+ /** Asks the Meta sync to read the site's ad accounts now. */
1308
+ syncMetaNow(ctx: MutationCtx | ActionCtx, args: {
1309
+ siteId: string;
1310
+ }): Promise<{
1311
+ scheduled: boolean;
1312
+ }>;
1039
1313
  cleanup(ctx: MutationCtx, args: CleanupInput): Promise<{
1040
1314
  before: number;
1041
1315
  deleted: number;
@@ -1083,7 +1357,7 @@ export declare class Rastro {
1083
1357
  hasMore: boolean;
1084
1358
  }>;
1085
1359
  }
1086
- export type AnalyticsOperation = "site.create" | "site.update" | "site.get" | "site.list" | "ingest" | "conversion.track" | "visitor.link" | "visitor.identify" | "visitor.profile" | "visitor.list" | "visitor.index" | "report.overview" | "report.live" | "report.sessions" | "report.sessionJourney" | "report.conversions" | "report.visitorJourney" | "report.goals" | "report.funnels" | "report.affiliates" | "report.vitals" | "report.siteMap" | "goal.upsert" | "goal.list" | "goal.remove" | "funnel.upsert" | "funnel.list" | "funnel.remove" | "affiliate.upsert" | "affiliate.list" | "affiliate.remove" | "trackedLink.create" | "trackedLink.update" | "trackedLink.delete" | "trackedLink.list" | "lead.report" | "lead.list" | "lead.journey" | "retention.cleanup" | "retention.policy" | "retention.status" | "coverage.read";
1360
+ export type AnalyticsOperation = "site.create" | "site.update" | "site.get" | "site.list" | "ingest" | "conversion.track" | "visitor.link" | "visitor.identify" | "visitor.profile" | "visitor.list" | "visitor.index" | "report.overview" | "report.live" | "report.sessions" | "report.sessionJourney" | "report.conversions" | "report.visitorJourney" | "report.goals" | "report.funnels" | "report.affiliates" | "report.vitals" | "report.siteMap" | "goal.upsert" | "goal.list" | "goal.remove" | "funnel.upsert" | "funnel.list" | "funnel.remove" | "affiliate.upsert" | "affiliate.list" | "affiliate.remove" | "trackedLink.create" | "trackedLink.update" | "trackedLink.delete" | "trackedLink.list" | "lead.report" | "lead.list" | "lead.journey" | "lead.daily" | "meta.status" | "meta.conversions" | "retention.cleanup" | "retention.policy" | "retention.status" | "coverage.read";
1087
1361
  export type AnalyticsAuthorizationRequest = {
1088
1362
  operation: AnalyticsOperation;
1089
1363
  siteIds: string[];
@@ -2896,48 +3170,85 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
2896
3170
  siteIds: string[];
2897
3171
  to: number;
2898
3172
  }, Promise<{
3173
+ bySite?: Array<{
3174
+ currencyMismatch?: boolean;
3175
+ leads: number;
3176
+ paid: {
3177
+ leads: number;
3178
+ qualified: number;
3179
+ revenueCents: number;
3180
+ won: number;
3181
+ };
3182
+ qualified: number;
3183
+ revenueCents: number;
3184
+ siteId: string;
3185
+ spendCents?: number | null;
3186
+ spendCurrency?: string | null;
3187
+ won: number;
3188
+ }>;
2899
3189
  campaigns: Array<{
2900
3190
  adsets: Array<{
2901
3191
  ads: Array<{
2902
3192
  adId: string;
2903
3193
  adName: string | null;
3194
+ adStatus?: string | null;
3195
+ clicks?: number | null;
3196
+ creativeType?: string | null;
3197
+ impressions?: number | null;
2904
3198
  leads: number;
2905
3199
  qualified: number;
2906
3200
  revenueCents: number;
3201
+ siteId?: string;
2907
3202
  sourceApp: string | null;
2908
3203
  sourceUrl: string | null;
3204
+ spendCents?: number | null;
2909
3205
  thumbnailUrl: string | null;
2910
3206
  title: string | null;
2911
3207
  won: number;
2912
3208
  }>;
2913
3209
  adsetId: string | null;
2914
3210
  adsetName: string | null;
3211
+ clicks?: number | null;
3212
+ impressions?: number | null;
2915
3213
  leads: number;
2916
3214
  qualified: number;
2917
3215
  revenueCents: number;
3216
+ spendCents?: number | null;
2918
3217
  won: number;
2919
3218
  }>;
2920
3219
  campaignId: string | null;
2921
3220
  campaignName: string | null;
3221
+ clicks?: number | null;
3222
+ impressions?: number | null;
2922
3223
  leads: number;
2923
3224
  qualified: number;
2924
3225
  revenueCents: number;
3226
+ spendCents?: number | null;
2925
3227
  won: number;
2926
3228
  }>;
2927
3229
  currency: string | null;
3230
+ currencyMismatch?: boolean;
2928
3231
  from: number;
2929
3232
  origins: Array<{
3233
+ clicks?: number | null;
3234
+ impressions?: number | null;
2930
3235
  key: string;
2931
3236
  leads: number;
2932
3237
  qualified: number;
2933
3238
  revenueCents: number;
3239
+ spendCents?: number | null;
2934
3240
  won: number;
2935
3241
  }>;
3242
+ spendCurrency?: string | null;
3243
+ spendIncomplete?: boolean;
2936
3244
  to: number;
2937
3245
  totals: {
3246
+ clicks?: number | null;
3247
+ impressions?: number | null;
2938
3248
  leads: number;
2939
3249
  qualified: number;
2940
3250
  revenueCents: number;
3251
+ spendCents?: number | null;
2941
3252
  won: number;
2942
3253
  };
2943
3254
  }>>;
@@ -2998,6 +3309,79 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
2998
3309
  };
2999
3310
  visitorId: string | null;
3000
3311
  } | null>>;
3312
+ leadsDaily: import("convex/server").RegisteredQuery<"public", {
3313
+ adId?: string | undefined;
3314
+ from: number;
3315
+ origin?: string | undefined;
3316
+ siteIds: string[];
3317
+ to: number;
3318
+ }, Promise<{
3319
+ dayStart: number;
3320
+ leads: number;
3321
+ qualified: number;
3322
+ revenueCents: number;
3323
+ spendCents: number | null;
3324
+ won: number;
3325
+ }[]>>;
3326
+ metaStatus: import("convex/server").RegisteredQuery<"public", {
3327
+ now?: number | undefined;
3328
+ siteIds: string[];
3329
+ }, Promise<{
3330
+ adAccounts: Array<{
3331
+ adAccountId: string;
3332
+ backfill?: {
3333
+ done: number;
3334
+ total: number;
3335
+ } | null;
3336
+ currency: string;
3337
+ lastError: string | null;
3338
+ lastSyncAt: number | null;
3339
+ name: string;
3340
+ own?: boolean;
3341
+ syncState: "backfill" | "live" | "error";
3342
+ timezone: string;
3343
+ }>;
3344
+ conversions: {
3345
+ failed: number;
3346
+ last30d?: {
3347
+ Lead: number;
3348
+ Purchase: number;
3349
+ QualifiedLead: number;
3350
+ Schedule: number;
3351
+ } | null;
3352
+ pending: number;
3353
+ sent: number;
3354
+ sentToday?: number | null;
3355
+ };
3356
+ linked: boolean;
3357
+ pixel: {
3358
+ enabled: boolean;
3359
+ lastError?: string | null;
3360
+ name?: string | null;
3361
+ own?: boolean;
3362
+ pixelId: string | null;
3363
+ source?: "connection" | "token" | null;
3364
+ testMode?: boolean;
3365
+ };
3366
+ siteId: string;
3367
+ }[]>>;
3368
+ metaConversions: import("convex/server").RegisteredQuery<"public", {
3369
+ before?: number | undefined;
3370
+ beforeEventId?: string | undefined;
3371
+ limit?: number | undefined;
3372
+ siteId: string;
3373
+ }, Promise<{
3374
+ adId: string | null;
3375
+ adName: string | null;
3376
+ createdAt: number;
3377
+ eventId: string;
3378
+ eventName: "Lead" | "QualifiedLead" | "Schedule" | "Purchase";
3379
+ leadId: string | null;
3380
+ leadLabel: string | null;
3381
+ sentAt: number | null;
3382
+ status: "pending" | "sent" | "failed";
3383
+ valueCents: number | null;
3384
+ }[]>>;
3001
3385
  revenueSummary: import("convex/server").RegisteredQuery<"public", {
3002
3386
  from: number;
3003
3387
  siteIds: string[];
@@ -3696,9 +4080,24 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
3696
4080
  leadsReport?: "leadsReport" | undefined;
3697
4081
  listLeads?: "listLeads" | undefined;
3698
4082
  leadJourney?: "leadJourney" | undefined;
4083
+ leadsDaily?: "leadsDaily" | undefined;
4084
+ metaStatus?: "metaStatus" | undefined;
4085
+ metaConversions?: "metaConversions" | undefined;
4086
+ metaConnection?: "metaConnection" | undefined;
4087
+ metaEventMap?: "metaEventMap" | undefined;
4088
+ metaUnlinkPreview?: "metaUnlinkPreview" | undefined;
4089
+ connectMeta?: "connectMeta" | undefined;
4090
+ disconnectMeta?: "disconnectMeta" | undefined;
4091
+ refreshMetaAccounts?: "refreshMetaAccounts" | undefined;
4092
+ linkMetaAdAccount?: "linkMetaAdAccount" | undefined;
4093
+ unlinkMetaAdAccount?: "unlinkMetaAdAccount" | undefined;
4094
+ setMetaPixel?: "setMetaPixel" | undefined;
4095
+ removeMetaPixel?: "removeMetaPixel" | undefined;
4096
+ setMetaEventMap?: "setMetaEventMap" | undefined;
4097
+ syncMetaNow?: "syncMetaNow" | undefined;
3699
4098
  transferConnection?: "transferConnection" | undefined;
3700
4099
  };
3701
- capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "leads" | "liveVisitors" | "localDays" | "overview" | "people" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "visitorProfiles" | "vitals")[];
4100
+ capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "leads" | "liveVisitors" | "localDays" | "metaAds" | "overview" | "people" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "visitorProfiles" | "vitals")[];
3702
4101
  limits: {
3703
4102
  maxSitesPerRequest: 10;
3704
4103
  maxSitesPerConnection: 10;
@@ -4598,48 +4997,85 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
4598
4997
  siteIds: string[];
4599
4998
  to: number;
4600
4999
  }, Promise<{
5000
+ bySite?: Array<{
5001
+ currencyMismatch?: boolean;
5002
+ leads: number;
5003
+ paid: {
5004
+ leads: number;
5005
+ qualified: number;
5006
+ revenueCents: number;
5007
+ won: number;
5008
+ };
5009
+ qualified: number;
5010
+ revenueCents: number;
5011
+ siteId: string;
5012
+ spendCents?: number | null;
5013
+ spendCurrency?: string | null;
5014
+ won: number;
5015
+ }>;
4601
5016
  campaigns: Array<{
4602
5017
  adsets: Array<{
4603
5018
  ads: Array<{
4604
5019
  adId: string;
4605
5020
  adName: string | null;
5021
+ adStatus?: string | null;
5022
+ clicks?: number | null;
5023
+ creativeType?: string | null;
5024
+ impressions?: number | null;
4606
5025
  leads: number;
4607
5026
  qualified: number;
4608
5027
  revenueCents: number;
5028
+ siteId?: string;
4609
5029
  sourceApp: string | null;
4610
5030
  sourceUrl: string | null;
5031
+ spendCents?: number | null;
4611
5032
  thumbnailUrl: string | null;
4612
5033
  title: string | null;
4613
5034
  won: number;
4614
5035
  }>;
4615
5036
  adsetId: string | null;
4616
5037
  adsetName: string | null;
5038
+ clicks?: number | null;
5039
+ impressions?: number | null;
4617
5040
  leads: number;
4618
5041
  qualified: number;
4619
5042
  revenueCents: number;
5043
+ spendCents?: number | null;
4620
5044
  won: number;
4621
5045
  }>;
4622
5046
  campaignId: string | null;
4623
5047
  campaignName: string | null;
5048
+ clicks?: number | null;
5049
+ impressions?: number | null;
4624
5050
  leads: number;
4625
5051
  qualified: number;
4626
5052
  revenueCents: number;
5053
+ spendCents?: number | null;
4627
5054
  won: number;
4628
5055
  }>;
4629
5056
  currency: string | null;
5057
+ currencyMismatch?: boolean;
4630
5058
  from: number;
4631
5059
  origins: Array<{
5060
+ clicks?: number | null;
5061
+ impressions?: number | null;
4632
5062
  key: string;
4633
5063
  leads: number;
4634
5064
  qualified: number;
4635
5065
  revenueCents: number;
5066
+ spendCents?: number | null;
4636
5067
  won: number;
4637
5068
  }>;
5069
+ spendCurrency?: string | null;
5070
+ spendIncomplete?: boolean;
4638
5071
  to: number;
4639
5072
  totals: {
5073
+ clicks?: number | null;
5074
+ impressions?: number | null;
4640
5075
  leads: number;
4641
5076
  qualified: number;
4642
5077
  revenueCents: number;
5078
+ spendCents?: number | null;
4643
5079
  won: number;
4644
5080
  };
4645
5081
  }>>;
@@ -4700,6 +5136,199 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
4700
5136
  };
4701
5137
  visitorId: string | null;
4702
5138
  } | null>>;
5139
+ leadsDaily: import("convex/server").RegisteredQuery<"public", {
5140
+ adId?: string | undefined;
5141
+ from: number;
5142
+ origin?: string | undefined;
5143
+ siteIds: string[];
5144
+ to: number;
5145
+ }, Promise<{
5146
+ dayStart: number;
5147
+ leads: number;
5148
+ qualified: number;
5149
+ revenueCents: number;
5150
+ spendCents: number | null;
5151
+ won: number;
5152
+ }[]>>;
5153
+ metaStatus: import("convex/server").RegisteredQuery<"public", {
5154
+ now?: number | undefined;
5155
+ siteIds: string[];
5156
+ }, Promise<{
5157
+ adAccounts: Array<{
5158
+ adAccountId: string;
5159
+ backfill?: {
5160
+ done: number;
5161
+ total: number;
5162
+ } | null;
5163
+ currency: string;
5164
+ lastError: string | null;
5165
+ lastSyncAt: number | null;
5166
+ name: string;
5167
+ own?: boolean;
5168
+ syncState: "backfill" | "live" | "error";
5169
+ timezone: string;
5170
+ }>;
5171
+ conversions: {
5172
+ failed: number;
5173
+ last30d?: {
5174
+ Lead: number;
5175
+ Purchase: number;
5176
+ QualifiedLead: number;
5177
+ Schedule: number;
5178
+ } | null;
5179
+ pending: number;
5180
+ sent: number;
5181
+ sentToday?: number | null;
5182
+ };
5183
+ linked: boolean;
5184
+ pixel: {
5185
+ enabled: boolean;
5186
+ lastError?: string | null;
5187
+ name?: string | null;
5188
+ own?: boolean;
5189
+ pixelId: string | null;
5190
+ source?: "connection" | "token" | null;
5191
+ testMode?: boolean;
5192
+ };
5193
+ siteId: string;
5194
+ }[]>>;
5195
+ metaConversions: import("convex/server").RegisteredQuery<"public", {
5196
+ before?: number | undefined;
5197
+ beforeEventId?: string | undefined;
5198
+ limit?: number | undefined;
5199
+ siteId: string;
5200
+ }, Promise<{
5201
+ adId: string | null;
5202
+ adName: string | null;
5203
+ createdAt: number;
5204
+ eventId: string;
5205
+ eventName: "Lead" | "QualifiedLead" | "Schedule" | "Purchase";
5206
+ leadId: string | null;
5207
+ leadLabel: string | null;
5208
+ sentAt: number | null;
5209
+ status: "pending" | "sent" | "failed";
5210
+ valueCents: number | null;
5211
+ }[]>>;
5212
+ metaConnection: import("convex/server").RegisteredQuery<"public", {}, Promise<{
5213
+ authorizedAt: number | null;
5214
+ authorizedBy: {
5215
+ name: string | null;
5216
+ } | null;
5217
+ businessName: string | null;
5218
+ expiresAt: number | null;
5219
+ expiringSoon: boolean;
5220
+ invalidSince: number | null;
5221
+ lastError: string | null;
5222
+ pixels: Array<{
5223
+ name: string;
5224
+ pixelId: string;
5225
+ }>;
5226
+ status: "active" | "invalid";
5227
+ adAccounts: {
5228
+ adAccountId: string;
5229
+ currency: string;
5230
+ linkedOutsideScope?: boolean;
5231
+ linkedSiteId: string | null;
5232
+ name: string;
5233
+ timezone: string;
5234
+ }[];
5235
+ } | null>>;
5236
+ metaEventMap: import("convex/server").RegisteredQuery<"public", {
5237
+ now?: number | undefined;
5238
+ siteId: string;
5239
+ }, Promise<{
5240
+ columns: Array<{
5241
+ color: string | null;
5242
+ event: "Lead" | "QualifiedLead" | "Schedule" | null;
5243
+ group: string | null;
5244
+ key: string;
5245
+ monthCount: number | null;
5246
+ name: string;
5247
+ }>;
5248
+ purchase: {
5249
+ enabled: boolean;
5250
+ };
5251
+ sendLeadEvent: boolean;
5252
+ }>>;
5253
+ metaUnlinkPreview: import("convex/server").RegisteredQuery<"public", {
5254
+ adAccountId: string;
5255
+ siteId: string;
5256
+ }, Promise<{
5257
+ campaigns: number;
5258
+ currency: string;
5259
+ days: number;
5260
+ partial: boolean;
5261
+ spendCents: number;
5262
+ }>>;
5263
+ authorizeMetaAction: import("convex/server").RegisteredQuery<"internal", {
5264
+ siteId?: string | undefined;
5265
+ wholeOwner?: boolean | undefined;
5266
+ }, Promise<{
5267
+ ownerKey: string;
5268
+ }>>;
5269
+ connectMeta: import("convex/server").RegisteredAction<"public", {
5270
+ code: string;
5271
+ redirectUri: string;
5272
+ }, Promise<{
5273
+ adAccounts: Array<{
5274
+ adAccountId: string;
5275
+ currency: string;
5276
+ name: string;
5277
+ timezone: string;
5278
+ }>;
5279
+ businessName: string | null;
5280
+ connectionId: string;
5281
+ pixels: Array<{
5282
+ name: string;
5283
+ pixelId: string;
5284
+ }>;
5285
+ }>>;
5286
+ refreshMetaAccounts: import("convex/server").RegisteredAction<"public", {}, Promise<{
5287
+ adAccountId: string;
5288
+ currency: string;
5289
+ name: string;
5290
+ timezone: string;
5291
+ }[]>>;
5292
+ setMetaPixel: import("convex/server").RegisteredAction<"public", {
5293
+ accessToken?: string | undefined;
5294
+ enabled?: boolean | undefined;
5295
+ pixelId: string;
5296
+ sendLeadEvent?: boolean | undefined;
5297
+ siteId: string;
5298
+ testEventCode?: string | undefined;
5299
+ }, Promise<{
5300
+ ok: true;
5301
+ }>>;
5302
+ disconnectMeta: import("convex/server").RegisteredMutation<"public", {}, Promise<{
5303
+ removed: boolean;
5304
+ }>>;
5305
+ linkMetaAdAccount: import("convex/server").RegisteredMutation<"public", {
5306
+ adAccountId: string;
5307
+ siteId: string;
5308
+ }, Promise<{
5309
+ linked: boolean;
5310
+ }>>;
5311
+ unlinkMetaAdAccount: import("convex/server").RegisteredMutation<"public", {
5312
+ adAccountId: string;
5313
+ siteId: string;
5314
+ }, Promise<{
5315
+ unlinked: boolean;
5316
+ }>>;
5317
+ removeMetaPixel: import("convex/server").RegisteredMutation<"public", {
5318
+ siteId: string;
5319
+ }, Promise<{
5320
+ removed: boolean;
5321
+ }>>;
5322
+ setMetaEventMap: import("convex/server").RegisteredMutation<"public", {
5323
+ columns: Record<string, "Lead" | "QualifiedLead" | "Schedule" | null>;
5324
+ sendLeadEvent: boolean;
5325
+ siteId: string;
5326
+ }, Promise<null>>;
5327
+ syncMetaNow: import("convex/server").RegisteredMutation<"public", {
5328
+ siteId: string;
5329
+ }, Promise<{
5330
+ scheduled: boolean;
5331
+ }>>;
4703
5332
  retentionStatus: import("convex/server").RegisteredQuery<"public", {
4704
5333
  siteId: string;
4705
5334
  }, Promise<{