@iann29/rastro 0.10.8 → 0.11.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.
- package/README.md +8 -0
- package/agent/integration.md +45 -0
- package/agent/manifest.json +4 -4
- package/dist/client/federation.d.ts +82 -9
- package/dist/client/federation.d.ts.map +1 -1
- package/dist/client/federation.js +40 -2
- package/dist/client/federation.js.map +1 -1
- package/dist/client/index.d.ts +464 -8
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +259 -7
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +10 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +273 -21
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/_generated/server.d.ts +2 -0
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/constants.d.ts +31 -0
- package/dist/component/constants.d.ts.map +1 -1
- package/dist/component/constants.js +31 -0
- package/dist/component/constants.js.map +1 -1
- package/dist/component/convex.config.d.ts +2 -0
- package/dist/component/convex.config.js +7 -0
- package/dist/component/convex.config.js.map +1 -1
- package/dist/component/errors.d.ts +1 -1
- package/dist/component/errors.d.ts.map +1 -1
- package/dist/component/errors.js.map +1 -1
- package/dist/component/http.d.ts.map +1 -1
- package/dist/component/http.js +64 -0
- package/dist/component/http.js.map +1 -1
- package/dist/component/leadAdsValidators.d.ts +1092 -0
- package/dist/component/leadAdsValidators.d.ts.map +1 -0
- package/dist/component/leadAdsValidators.js +304 -0
- package/dist/component/leadAdsValidators.js.map +1 -0
- package/dist/component/leadFormRules.d.ts +60 -0
- package/dist/component/leadFormRules.d.ts.map +1 -0
- package/dist/component/leadFormRules.js +140 -0
- package/dist/component/leadFormRules.js.map +1 -0
- package/dist/component/leadFormStore.d.ts +16 -0
- package/dist/component/leadFormStore.d.ts.map +1 -0
- package/dist/component/leadFormStore.js +92 -0
- package/dist/component/leadFormStore.js.map +1 -0
- package/dist/component/leadgenToken.d.ts +56 -0
- package/dist/component/leadgenToken.d.ts.map +1 -0
- package/dist/component/leadgenToken.js +262 -0
- package/dist/component/leadgenToken.js.map +1 -0
- package/dist/component/leads.d.ts +76 -7
- package/dist/component/leads.d.ts.map +1 -1
- package/dist/component/leads.js +112 -78
- package/dist/component/leads.js.map +1 -1
- package/dist/component/meta.d.ts.map +1 -1
- package/dist/component/meta.js +21 -1
- package/dist/component/meta.js.map +1 -1
- package/dist/component/metaCapi.d.ts.map +1 -1
- package/dist/component/metaCapi.js +10 -0
- package/dist/component/metaCapi.js.map +1 -1
- package/dist/component/metaFake.d.ts +44 -0
- package/dist/component/metaFake.d.ts.map +1 -1
- package/dist/component/metaFake.js +400 -1
- package/dist/component/metaFake.js.map +1 -1
- package/dist/component/metaGraph.d.ts +91 -0
- package/dist/component/metaGraph.d.ts.map +1 -1
- package/dist/component/metaGraph.js +217 -0
- package/dist/component/metaGraph.js.map +1 -1
- package/dist/component/metaLeads.d.ts +681 -0
- package/dist/component/metaLeads.d.ts.map +1 -0
- package/dist/component/metaLeads.js +2634 -0
- package/dist/component/metaLeads.js.map +1 -0
- package/dist/component/schema.d.ts +414 -5
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +169 -1
- package/dist/component/schema.js.map +1 -1
- package/dist/component/validators.d.ts +235 -11
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +14 -1
- package/dist/component/validators.js.map +1 -1
- package/dist/tracker/generated.d.ts +1 -1
- package/dist/tracker/generated.js +1 -1
- package/dist/ui/campaigns/CampaignsView.d.ts +5 -1
- package/dist/ui/campaigns/CampaignsView.d.ts.map +1 -1
- package/dist/ui/campaigns/CampaignsView.js.map +1 -1
- package/dist/ui/campaigns/Drawer.d.ts.map +1 -1
- package/dist/ui/campaigns/Drawer.js +8 -26
- package/dist/ui/campaigns/Drawer.js.map +1 -1
- package/dist/ui/campaigns/labels.d.ts +29 -1
- package/dist/ui/campaigns/labels.d.ts.map +1 -1
- package/dist/ui/campaigns/labels.js +77 -2
- package/dist/ui/campaigns/labels.js.map +1 -1
- package/dist/ui/campaigns/model.js +2 -2
- package/dist/ui/campaigns/model.js.map +1 -1
- package/dist/ui/forms/FirstContact.d.ts +19 -0
- package/dist/ui/forms/FirstContact.d.ts.map +1 -0
- package/dist/ui/forms/FirstContact.js +81 -0
- package/dist/ui/forms/FirstContact.js.map +1 -0
- package/dist/ui/forms/FormLead.d.ts +28 -0
- package/dist/ui/forms/FormLead.d.ts.map +1 -0
- package/dist/ui/forms/FormLead.js +199 -0
- package/dist/ui/forms/FormLead.js.map +1 -0
- package/dist/ui/forms/FormRulesDrawer.d.ts +49 -0
- package/dist/ui/forms/FormRulesDrawer.d.ts.map +1 -0
- package/dist/ui/forms/FormRulesDrawer.js +149 -0
- package/dist/ui/forms/FormRulesDrawer.js.map +1 -0
- package/dist/ui/forms/FormsView.d.ts +10 -0
- package/dist/ui/forms/FormsView.d.ts.map +1 -0
- package/dist/ui/forms/FormsView.js +215 -0
- package/dist/ui/forms/FormsView.js.map +1 -0
- package/dist/ui/forms/Icons.d.ts +46 -0
- package/dist/ui/forms/Icons.d.ts.map +1 -0
- package/dist/ui/forms/Icons.js +45 -0
- package/dist/ui/forms/Icons.js.map +1 -0
- package/dist/ui/forms/RuleRow.d.ts +37 -0
- package/dist/ui/forms/RuleRow.d.ts.map +1 -0
- package/dist/ui/forms/RuleRow.js +80 -0
- package/dist/ui/forms/RuleRow.js.map +1 -0
- package/dist/ui/forms/WhatsAppButtonGuide.d.ts +33 -0
- package/dist/ui/forms/WhatsAppButtonGuide.d.ts.map +1 -0
- package/dist/ui/forms/WhatsAppButtonGuide.js +90 -0
- package/dist/ui/forms/WhatsAppButtonGuide.js.map +1 -0
- package/dist/ui/forms/index.d.ts +11 -0
- package/dist/ui/forms/index.d.ts.map +1 -0
- package/dist/ui/forms/index.js +7 -0
- package/dist/ui/forms/index.js.map +1 -0
- package/dist/ui/forms/journey.d.ts +19 -0
- package/dist/ui/forms/journey.d.ts.map +1 -0
- package/dist/ui/forms/journey.js +54 -0
- package/dist/ui/forms/journey.js.map +1 -0
- package/dist/ui/forms/model.d.ts +239 -0
- package/dist/ui/forms/model.d.ts.map +1 -0
- package/dist/ui/forms/model.js +556 -0
- package/dist/ui/forms/model.js.map +1 -0
- package/dist/ui/forms/sample.d.ts +36 -0
- package/dist/ui/forms/sample.d.ts.map +1 -0
- package/dist/ui/forms/sample.js +444 -0
- package/dist/ui/forms/sample.js.map +1 -0
- package/dist/ui/forms/types.d.ts +454 -0
- package/dist/ui/forms/types.d.ts.map +1 -0
- package/dist/ui/forms/types.js +2 -0
- package/dist/ui/forms/types.js.map +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +4 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/integrations/Overlay.d.ts +3 -1
- package/dist/ui/integrations/Overlay.d.ts.map +1 -1
- package/dist/ui/integrations/Overlay.js +2 -2
- package/dist/ui/integrations/Overlay.js.map +1 -1
- package/dist/ui/portfolio/PortfolioView.d.ts +4 -1
- package/dist/ui/portfolio/PortfolioView.d.ts.map +1 -1
- package/dist/ui/portfolio/PortfolioView.js.map +1 -1
- package/dist/ui/sample.d.ts +3 -1
- package/dist/ui/sample.d.ts.map +1 -1
- package/dist/ui/sample.js +2 -0
- package/dist/ui/sample.js.map +1 -1
- package/dist/ui/seed.d.ts +1 -1
- package/dist/ui/ui.css +2301 -0
- package/docs/federation.md +19 -0
- package/docs/meta-ads.md +713 -7
- package/docs/upgrading.md +75 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
- package/src/component/_generated/api.ts +10 -0
- package/src/component/_generated/component.ts +289 -20
- package/src/component/_generated/server.ts +2 -0
- package/src/component/constants.ts +33 -0
- package/src/component/convex.config.ts +7 -0
- package/src/component/errors.ts +3 -1
- package/src/component/http.ts +75 -0
- package/src/component/leadAdsValidators.ts +365 -0
- package/src/component/leadFormRules.ts +202 -0
- package/src/component/leadFormStore.ts +129 -0
- package/src/component/leadgenToken.ts +348 -0
- package/src/component/leads.ts +136 -84
- package/src/component/meta.ts +21 -1
- package/src/component/metaCapi.ts +13 -1
- package/src/component/metaFake.ts +485 -1
- package/src/component/metaGraph.ts +327 -0
- package/src/component/metaLeads.ts +3101 -0
- package/src/component/schema.ts +187 -1
- package/src/component/validators.ts +17 -1
- package/src/tracker/generated.ts +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -5,17 +5,22 @@ export { visitorIdForUser } from "./identity.js";
|
|
|
5
5
|
export type { IdentityHttpAuthorizer } from "./identity.js";
|
|
6
6
|
import type { ComponentApi } from "../component/_generated/component.js";
|
|
7
7
|
import { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator, visitorProfileValidator } from "../component/validators.js";
|
|
8
|
+
import { formLeadPayloadValidator } from "../component/leadAdsValidators.js";
|
|
9
|
+
export { formLeadPayloadValidator };
|
|
10
|
+
export { META_PAGE_ERROR_CODES, type MetaPageErrorCode, } from "../component/leadAdsValidators.js";
|
|
8
11
|
import { type FederatedAnalyticsAuthorizerOptions, type FederatedAnalyticsConnectionStatus, type FederatedSiteSummary } from "./federation.js";
|
|
9
12
|
export { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator, visitorProfileValidator, };
|
|
10
13
|
export type { Channel, EventProperties, EventType, Evidence, FunnelStep, IngestContext, TrackerEvent, VisitorProfile, PersonAttributes, PersonFilter, } from "../component/validators.js";
|
|
11
14
|
export { channelForPlatform, platformDimensionValue, platformForSource, splitPlatformDimension, } from "../component/origin.js";
|
|
12
15
|
export { VITAL_METRICS, VITAL_THRESHOLDS } from "../component/vitals.js";
|
|
16
|
+
export { META_LEADGEN_TOKEN } from "../component/constants.js";
|
|
17
|
+
export { PAID_LEADS_ORIGIN } from "../component/constants.js";
|
|
13
18
|
export { normalizeRoute, validateRoutePatterns, } from "../component/sanitize.js";
|
|
14
19
|
export { localDayStart, nextLocalDayStart, previousLocalDayStart, } from "../component/localTime.js";
|
|
15
20
|
export { HEAT_HOT_SCORE, HEAT_WARM_SCORE, visitorHeat } from "./heat.js";
|
|
16
21
|
export type { HeatInput, HeatLevel, HeatSignal, VisitorHeat } from "./heat.js";
|
|
17
22
|
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_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";
|
|
23
|
+
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_META_LEAD_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
24
|
export type { FederatedAnalyticsCapability, FederatedAnalyticsAuthorizerOptions, FederatedAnalyticsConnection, FederatedAnalyticsConnectionStatus, FederatedAnalyticsErrorCode, FederatedAnalyticsIdentity, FederatedAnalyticsManifest, FederatedAnalyticsPermission, FederatedSiteSummary, ResolveFederatedAnalyticsConnection, } from "./federation.js";
|
|
20
25
|
export type CreateSiteInput = FunctionArgs<ComponentApi["sites"]["create"]>;
|
|
21
26
|
export type ListPeopleInput = FunctionArgs<ComponentApi["people"]["list"]>;
|
|
@@ -131,6 +136,35 @@ export type MetaColumnEvent = NonNullable<EventMapColumn["event"]>;
|
|
|
131
136
|
export type UnlinkPreviewInput = FunctionArgs<ComponentApi["meta"]["unlinkPreview"]>;
|
|
132
137
|
/** What unlinking an ad account takes out of the site's reports. */
|
|
133
138
|
export type UnlinkPreview = FunctionReturnType<ComponentApi["meta"]["unlinkPreview"]>;
|
|
139
|
+
/** A Facebook Page an owner's Meta login lists (never its token). */
|
|
140
|
+
export type MetaPage = FunctionReturnType<ComponentApi["metaLeads"]["pages"]>[number];
|
|
141
|
+
export type LinkPageInput = FunctionArgs<ComponentApi["metaLeads"]["linkPage"]>;
|
|
142
|
+
export type LinkPageOutput = FunctionReturnType<ComponentApi["metaLeads"]["linkPage"]>;
|
|
143
|
+
export type MetaFormsInput = FunctionArgs<ComponentApi["metaLeads"]["forms"]>;
|
|
144
|
+
/** The site's linked Pages, each with its instant forms. */
|
|
145
|
+
export type MetaForms = FunctionReturnType<ComponentApi["metaLeads"]["forms"]>;
|
|
146
|
+
export type MetaFormsPage = MetaForms[number];
|
|
147
|
+
export type MetaFormRow = MetaFormsPage["forms"][number];
|
|
148
|
+
export type MetaFormQuestion = MetaFormRow["questions"][number];
|
|
149
|
+
export type SetFormRulesInput = FunctionArgs<ComponentApi["metaLeads"]["setFormRules"]>;
|
|
150
|
+
/** One rule: an answer to a choice question sends the lead somewhere. */
|
|
151
|
+
export type FormRule = SetFormRulesInput["rules"][number];
|
|
152
|
+
/** How the host makes the first contact with a form lead. */
|
|
153
|
+
export type FirstContact = SetFormRulesInput["firstContact"];
|
|
154
|
+
export type FormRulesInput = FunctionArgs<ComponentApi["metaLeads"]["formRules"]>;
|
|
155
|
+
export type FormRules = FunctionReturnType<ComponentApi["metaLeads"]["formRules"]>;
|
|
156
|
+
export type SimulateFormRulesInput = FunctionArgs<ComponentApi["metaLeads"]["simulateFormRules"]>;
|
|
157
|
+
export type FormRulesSimulation = FunctionReturnType<ComponentApi["metaLeads"]["simulateFormRules"]>;
|
|
158
|
+
export type FormsReport = FunctionReturnType<ComponentApi["metaLeads"]["formsReport"]>;
|
|
159
|
+
/** A form lead's answers, origin and rule path, as the lead journey shows. */
|
|
160
|
+
export type FormLeadDetail = NonNullable<NonNullable<NonNullable<LeadJourney>["form"]>>;
|
|
161
|
+
/**
|
|
162
|
+
* What the host's form lead handler receives: validate its args with
|
|
163
|
+
* `formLeadPayloadValidator`. `contact` and `freeAnswers` are the lead's
|
|
164
|
+
* personal data; Rastro never stores them.
|
|
165
|
+
*/
|
|
166
|
+
export type FormLeadPayload = Infer<typeof formLeadPayloadValidator>;
|
|
167
|
+
export type FormLeadDecision = FormLeadPayload["decision"];
|
|
134
168
|
export type CleanupInput = {
|
|
135
169
|
siteId: string;
|
|
136
170
|
kind: RetentionKind;
|
|
@@ -1084,7 +1118,7 @@ export declare class Rastro {
|
|
|
1084
1118
|
}>;
|
|
1085
1119
|
listLeads(ctx: QueryCtx | MutationCtx | ActionCtx, args: ListLeadsInput): Promise<{
|
|
1086
1120
|
adId: string | null;
|
|
1087
|
-
channel: "whatsapp";
|
|
1121
|
+
channel: "whatsapp" | "form";
|
|
1088
1122
|
entryPoint: string | null;
|
|
1089
1123
|
firstAt: number;
|
|
1090
1124
|
hasVisitor: boolean;
|
|
@@ -1115,9 +1149,43 @@ export declare class Rastro {
|
|
|
1115
1149
|
revenueCents: number | null;
|
|
1116
1150
|
type: "created" | "qualified" | "won" | "lost" | "open";
|
|
1117
1151
|
}>;
|
|
1152
|
+
form?: {
|
|
1153
|
+
answers: Array<{
|
|
1154
|
+
label: string;
|
|
1155
|
+
questionKey: string;
|
|
1156
|
+
values: Array<string>;
|
|
1157
|
+
}>;
|
|
1158
|
+
decision: {
|
|
1159
|
+
column: string | null;
|
|
1160
|
+
} | {
|
|
1161
|
+
discard: string;
|
|
1162
|
+
};
|
|
1163
|
+
leadgenId: string;
|
|
1164
|
+
origin: {
|
|
1165
|
+
adId: string | null;
|
|
1166
|
+
adName: string | null;
|
|
1167
|
+
adsetId: string | null;
|
|
1168
|
+
adsetName: string | null;
|
|
1169
|
+
campaignId: string | null;
|
|
1170
|
+
campaignName: string | null;
|
|
1171
|
+
formId: string;
|
|
1172
|
+
formName: string | null;
|
|
1173
|
+
isOrganic: boolean;
|
|
1174
|
+
pageId: string;
|
|
1175
|
+
pageName: string | null;
|
|
1176
|
+
platform: string | null;
|
|
1177
|
+
};
|
|
1178
|
+
receivedAt: number;
|
|
1179
|
+
returned: {
|
|
1180
|
+
at: number;
|
|
1181
|
+
reason: string;
|
|
1182
|
+
} | null;
|
|
1183
|
+
ruleIndex: number | null;
|
|
1184
|
+
rulePath: Array<number>;
|
|
1185
|
+
} | null;
|
|
1118
1186
|
lead: {
|
|
1119
1187
|
adId: string | null;
|
|
1120
|
-
channel: "whatsapp";
|
|
1188
|
+
channel: "whatsapp" | "form";
|
|
1121
1189
|
entryPoint: string | null;
|
|
1122
1190
|
firstAt: number;
|
|
1123
1191
|
hasVisitor: boolean;
|
|
@@ -1315,6 +1383,113 @@ export declare class Rastro {
|
|
|
1315
1383
|
}): Promise<{
|
|
1316
1384
|
scheduled: boolean;
|
|
1317
1385
|
}>;
|
|
1386
|
+
/**
|
|
1387
|
+
* Registers the host's form lead handler, once and before `linkPage` (safe
|
|
1388
|
+
* to call again): a function handle to an internal mutation taking
|
|
1389
|
+
* `formLeadPayloadValidator`, idempotent on `leadgenId`. The component
|
|
1390
|
+
* calls it with every lead, the only place the lead's name, phone, e-mail
|
|
1391
|
+
* and free answers ever go. `null` removes it; leads then wait. It is the
|
|
1392
|
+
* host's Lead Ads opt-in: only with it do Meta connects read and seal the
|
|
1393
|
+
* owners' Facebook Pages (the first registration reads those already
|
|
1394
|
+
* connected).
|
|
1395
|
+
*
|
|
1396
|
+
* ```ts
|
|
1397
|
+
* await rastro.setFormLeadHandler(ctx, {
|
|
1398
|
+
* handle: await createFunctionHandle(internal.rastroLeads.formLeadArrived),
|
|
1399
|
+
* });
|
|
1400
|
+
* ```
|
|
1401
|
+
*/
|
|
1402
|
+
setFormLeadHandler(ctx: MutationCtx | ActionCtx, args: {
|
|
1403
|
+
handle: string | null;
|
|
1404
|
+
}): Promise<null>;
|
|
1405
|
+
/**
|
|
1406
|
+
* The Facebook Pages an owner's Meta login lists (read with every connect
|
|
1407
|
+
* and `listMetaAdAccounts` once the form lead handler is registered),
|
|
1408
|
+
* whether Meta granted their leads, and the site
|
|
1409
|
+
* each feeds. Never a token.
|
|
1410
|
+
*/
|
|
1411
|
+
metaPages(ctx: QueryCtx | MutationCtx | ActionCtx, args: {
|
|
1412
|
+
ownerKey: string;
|
|
1413
|
+
}): Promise<MetaPage[]>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Makes one of the owner's Pages feed the site's leads: subscribes it to
|
|
1416
|
+
* Meta's `leadgen` webhook, reads its forms and starts the 15-minute
|
|
1417
|
+
* reconciliation. One Page feeds one site (`CONFLICT`). `backfillDays`
|
|
1418
|
+
* (0–30) also brings the leads of the days before.
|
|
1419
|
+
*/
|
|
1420
|
+
linkPage(ctx: ActionCtx, args: LinkPageInput): Promise<LinkPageOutput>;
|
|
1421
|
+
/**
|
|
1422
|
+
* Stops a Page feeding the site. The app's webhook subscription stays on the
|
|
1423
|
+
* Page: every host shares it, so another host linking the Page keeps its
|
|
1424
|
+
* notifications.
|
|
1425
|
+
*/
|
|
1426
|
+
unlinkPage(ctx: ActionCtx, args: {
|
|
1427
|
+
siteId: string;
|
|
1428
|
+
pageId: string;
|
|
1429
|
+
ownerKey?: string;
|
|
1430
|
+
}): Promise<{
|
|
1431
|
+
unlinked: boolean;
|
|
1432
|
+
}>;
|
|
1433
|
+
/**
|
|
1434
|
+
* The site's linked Pages and their instant forms: leads in the 30 days up
|
|
1435
|
+
* to `now` (and per day), last lead, rules, the end screen's WhatsApp
|
|
1436
|
+
* button. With `ownerKey`, whether that owner may edit each (`own`).
|
|
1437
|
+
*/
|
|
1438
|
+
metaForms(ctx: QueryCtx | MutationCtx | ActionCtx, args: MetaFormsInput): Promise<MetaForms>;
|
|
1439
|
+
/** Reads the forms of the site's linked Pages from Meta again. */
|
|
1440
|
+
refreshForms(ctx: ActionCtx, args: {
|
|
1441
|
+
siteId: string;
|
|
1442
|
+
pageId?: string;
|
|
1443
|
+
}): Promise<{
|
|
1444
|
+
pages: number;
|
|
1445
|
+
forms: number;
|
|
1446
|
+
}>;
|
|
1447
|
+
/**
|
|
1448
|
+
* Where a form sends its leads: rules in order (first match decides), the
|
|
1449
|
+
* entry column when none matches (null: the host's own entry) and how the
|
|
1450
|
+
* first contact happens. Columns are the ones `setPipeline` declared. It
|
|
1451
|
+
* decides the next leads only.
|
|
1452
|
+
*/
|
|
1453
|
+
setFormRules(ctx: MutationCtx, args: SetFormRulesInput): Promise<null>;
|
|
1454
|
+
/** A form's rules, each with the leads it decided in the 30 days to `now`. */
|
|
1455
|
+
formRules(ctx: QueryCtx | MutationCtx | ActionCtx, args: FormRulesInput): Promise<FormRules>;
|
|
1456
|
+
/** The last 30 days' leads of a form under a draft of its rules. */
|
|
1457
|
+
simulateFormRules(ctx: QueryCtx | MutationCtx | ActionCtx, args: SimulateFormRulesInput): Promise<FormRulesSimulation>;
|
|
1458
|
+
/** Per form: leads, where the rules sent them, sales and revenue. */
|
|
1459
|
+
formsReport(ctx: QueryCtx | MutationCtx | ActionCtx, args: {
|
|
1460
|
+
siteIds: string[];
|
|
1461
|
+
from: number;
|
|
1462
|
+
to: number;
|
|
1463
|
+
}): Promise<FormsReport>;
|
|
1464
|
+
/**
|
|
1465
|
+
* Sends a discarded form lead back to the funnel (clears the decision; the
|
|
1466
|
+
* host moves its card back). With `ownerKey`, only on that owner's Page.
|
|
1467
|
+
*/
|
|
1468
|
+
returnFormLead(ctx: MutationCtx, args: {
|
|
1469
|
+
siteId: string;
|
|
1470
|
+
leadId: string;
|
|
1471
|
+
ownerKey?: string;
|
|
1472
|
+
}): Promise<{
|
|
1473
|
+
returned: boolean;
|
|
1474
|
+
}>;
|
|
1475
|
+
/**
|
|
1476
|
+
* The Pages linked to the sites (for the control plane's webhook routes),
|
|
1477
|
+
* whether the leadgen route can verify forwards (`leadgenReady`), the
|
|
1478
|
+
* issuer it checks them against, the audience it expects, and whether the
|
|
1479
|
+
* host registered its form lead handler (`handlerReady`).
|
|
1480
|
+
*/
|
|
1481
|
+
metaLinkedPages(ctx: QueryCtx | MutationCtx | ActionCtx, args: {
|
|
1482
|
+
siteIds: string[];
|
|
1483
|
+
}): Promise<{
|
|
1484
|
+
pages: Array<{
|
|
1485
|
+
pageId: string;
|
|
1486
|
+
siteId: string;
|
|
1487
|
+
}>;
|
|
1488
|
+
leadgenReady: boolean;
|
|
1489
|
+
issuer: string;
|
|
1490
|
+
audience: string | null;
|
|
1491
|
+
handlerReady: boolean;
|
|
1492
|
+
}>;
|
|
1318
1493
|
cleanup(ctx: MutationCtx, args: CleanupInput): Promise<{
|
|
1319
1494
|
before: number;
|
|
1320
1495
|
deleted: number;
|
|
@@ -3266,7 +3441,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
3266
3441
|
to: number;
|
|
3267
3442
|
}, Promise<{
|
|
3268
3443
|
adId: string | null;
|
|
3269
|
-
channel: "whatsapp";
|
|
3444
|
+
channel: "whatsapp" | "form";
|
|
3270
3445
|
entryPoint: string | null;
|
|
3271
3446
|
firstAt: number;
|
|
3272
3447
|
hasVisitor: boolean;
|
|
@@ -3297,9 +3472,43 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
3297
3472
|
revenueCents: number | null;
|
|
3298
3473
|
type: "created" | "qualified" | "won" | "lost" | "open";
|
|
3299
3474
|
}>;
|
|
3475
|
+
form?: {
|
|
3476
|
+
answers: Array<{
|
|
3477
|
+
label: string;
|
|
3478
|
+
questionKey: string;
|
|
3479
|
+
values: Array<string>;
|
|
3480
|
+
}>;
|
|
3481
|
+
decision: {
|
|
3482
|
+
column: string | null;
|
|
3483
|
+
} | {
|
|
3484
|
+
discard: string;
|
|
3485
|
+
};
|
|
3486
|
+
leadgenId: string;
|
|
3487
|
+
origin: {
|
|
3488
|
+
adId: string | null;
|
|
3489
|
+
adName: string | null;
|
|
3490
|
+
adsetId: string | null;
|
|
3491
|
+
adsetName: string | null;
|
|
3492
|
+
campaignId: string | null;
|
|
3493
|
+
campaignName: string | null;
|
|
3494
|
+
formId: string;
|
|
3495
|
+
formName: string | null;
|
|
3496
|
+
isOrganic: boolean;
|
|
3497
|
+
pageId: string;
|
|
3498
|
+
pageName: string | null;
|
|
3499
|
+
platform: string | null;
|
|
3500
|
+
};
|
|
3501
|
+
receivedAt: number;
|
|
3502
|
+
returned: {
|
|
3503
|
+
at: number;
|
|
3504
|
+
reason: string;
|
|
3505
|
+
} | null;
|
|
3506
|
+
ruleIndex: number | null;
|
|
3507
|
+
rulePath: Array<number>;
|
|
3508
|
+
} | null;
|
|
3300
3509
|
lead: {
|
|
3301
3510
|
adId: string | null;
|
|
3302
|
-
channel: "whatsapp";
|
|
3511
|
+
channel: "whatsapp" | "form";
|
|
3303
3512
|
entryPoint: string | null;
|
|
3304
3513
|
firstAt: number;
|
|
3305
3514
|
hasVisitor: boolean;
|
|
@@ -4100,9 +4309,20 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
4100
4309
|
removeMetaPixel?: "removeMetaPixel" | undefined;
|
|
4101
4310
|
setMetaEventMap?: "setMetaEventMap" | undefined;
|
|
4102
4311
|
syncMetaNow?: "syncMetaNow" | undefined;
|
|
4312
|
+
metaPages?: "metaPages" | undefined;
|
|
4313
|
+
metaForms?: "metaForms" | undefined;
|
|
4314
|
+
metaFormRules?: "metaFormRules" | undefined;
|
|
4315
|
+
simulateMetaFormRules?: "simulateMetaFormRules" | undefined;
|
|
4316
|
+
metaFormsReport?: "metaFormsReport" | undefined;
|
|
4317
|
+
metaLinkedPages?: "metaLinkedPages" | undefined;
|
|
4318
|
+
linkMetaPage?: "linkMetaPage" | undefined;
|
|
4319
|
+
unlinkMetaPage?: "unlinkMetaPage" | undefined;
|
|
4320
|
+
refreshMetaForms?: "refreshMetaForms" | undefined;
|
|
4321
|
+
setMetaFormRules?: "setMetaFormRules" | undefined;
|
|
4322
|
+
returnMetaFormLead?: "returnMetaFormLead" | undefined;
|
|
4103
4323
|
transferConnection?: "transferConnection" | undefined;
|
|
4104
4324
|
};
|
|
4105
|
-
capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "leads" | "liveVisitors" | "localDays" | "metaAds" | "overview" | "people" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "visitorProfiles" | "vitals")[];
|
|
4325
|
+
capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "leads" | "leadsPaid" | "liveVisitors" | "localDays" | "metaAds" | "metaLeads" | "overview" | "people" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "visitorProfiles" | "vitals")[];
|
|
4106
4326
|
limits: {
|
|
4107
4327
|
maxSitesPerRequest: 10;
|
|
4108
4328
|
maxSitesPerConnection: 10;
|
|
@@ -5093,7 +5313,7 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
5093
5313
|
to: number;
|
|
5094
5314
|
}, Promise<{
|
|
5095
5315
|
adId: string | null;
|
|
5096
|
-
channel: "whatsapp";
|
|
5316
|
+
channel: "whatsapp" | "form";
|
|
5097
5317
|
entryPoint: string | null;
|
|
5098
5318
|
firstAt: number;
|
|
5099
5319
|
hasVisitor: boolean;
|
|
@@ -5124,9 +5344,43 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
5124
5344
|
revenueCents: number | null;
|
|
5125
5345
|
type: "created" | "qualified" | "won" | "lost" | "open";
|
|
5126
5346
|
}>;
|
|
5347
|
+
form?: {
|
|
5348
|
+
answers: Array<{
|
|
5349
|
+
label: string;
|
|
5350
|
+
questionKey: string;
|
|
5351
|
+
values: Array<string>;
|
|
5352
|
+
}>;
|
|
5353
|
+
decision: {
|
|
5354
|
+
column: string | null;
|
|
5355
|
+
} | {
|
|
5356
|
+
discard: string;
|
|
5357
|
+
};
|
|
5358
|
+
leadgenId: string;
|
|
5359
|
+
origin: {
|
|
5360
|
+
adId: string | null;
|
|
5361
|
+
adName: string | null;
|
|
5362
|
+
adsetId: string | null;
|
|
5363
|
+
adsetName: string | null;
|
|
5364
|
+
campaignId: string | null;
|
|
5365
|
+
campaignName: string | null;
|
|
5366
|
+
formId: string;
|
|
5367
|
+
formName: string | null;
|
|
5368
|
+
isOrganic: boolean;
|
|
5369
|
+
pageId: string;
|
|
5370
|
+
pageName: string | null;
|
|
5371
|
+
platform: string | null;
|
|
5372
|
+
};
|
|
5373
|
+
receivedAt: number;
|
|
5374
|
+
returned: {
|
|
5375
|
+
at: number;
|
|
5376
|
+
reason: string;
|
|
5377
|
+
} | null;
|
|
5378
|
+
ruleIndex: number | null;
|
|
5379
|
+
rulePath: Array<number>;
|
|
5380
|
+
} | null;
|
|
5127
5381
|
lead: {
|
|
5128
5382
|
adId: string | null;
|
|
5129
|
-
channel: "whatsapp";
|
|
5383
|
+
channel: "whatsapp" | "form";
|
|
5130
5384
|
entryPoint: string | null;
|
|
5131
5385
|
firstAt: number;
|
|
5132
5386
|
hasVisitor: boolean;
|
|
@@ -5266,6 +5520,7 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
5266
5520
|
spendCents: number;
|
|
5267
5521
|
}>>;
|
|
5268
5522
|
authorizeMetaAction: import("convex/server").RegisteredQuery<"internal", {
|
|
5523
|
+
leads?: boolean | undefined;
|
|
5269
5524
|
siteId?: string | undefined;
|
|
5270
5525
|
wholeOwner?: boolean | undefined;
|
|
5271
5526
|
}, Promise<{
|
|
@@ -5334,6 +5589,207 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
5334
5589
|
}, Promise<{
|
|
5335
5590
|
scheduled: boolean;
|
|
5336
5591
|
}>>;
|
|
5592
|
+
metaPages: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
5593
|
+
handlerReady: boolean;
|
|
5594
|
+
lastError: "META_TOKEN_INVALID" | "META_PERMISSION_MISSING" | "HANDLER_MISSING" | "HANDLER_FAILED" | "HANDLER_GAVE_UP" | "SECRETS_KEY_MISSING" | "META_TRUNCATED" | "META_RATE_LIMITED" | "META_UNAVAILABLE" | "RUN_TIMEOUT" | null;
|
|
5595
|
+
leadsAllowed: boolean;
|
|
5596
|
+
linkedOutsideScope?: boolean;
|
|
5597
|
+
linkedSiteId: string | null;
|
|
5598
|
+
name: string;
|
|
5599
|
+
own: boolean | null;
|
|
5600
|
+
pageId: string;
|
|
5601
|
+
subscribedAt: number | null;
|
|
5602
|
+
tasks: Array<string>;
|
|
5603
|
+
}[]>>;
|
|
5604
|
+
metaForms: import("convex/server").RegisteredQuery<"public", {
|
|
5605
|
+
now?: number | undefined;
|
|
5606
|
+
siteId: string;
|
|
5607
|
+
}, Promise<{
|
|
5608
|
+
forms: Array<{
|
|
5609
|
+
createdTime: number | null;
|
|
5610
|
+
daily: Array<number> | null;
|
|
5611
|
+
formId: string;
|
|
5612
|
+
lastLeadAt: number | null;
|
|
5613
|
+
leads30d: number | null;
|
|
5614
|
+
name: string;
|
|
5615
|
+
questions: Array<{
|
|
5616
|
+
key: string;
|
|
5617
|
+
label: string;
|
|
5618
|
+
options?: Array<{
|
|
5619
|
+
key: string;
|
|
5620
|
+
value: string;
|
|
5621
|
+
}>;
|
|
5622
|
+
type: string;
|
|
5623
|
+
}>;
|
|
5624
|
+
rules: {
|
|
5625
|
+
configured: boolean;
|
|
5626
|
+
count: number;
|
|
5627
|
+
entryColumn: string | null;
|
|
5628
|
+
own?: boolean;
|
|
5629
|
+
};
|
|
5630
|
+
status: string;
|
|
5631
|
+
syncedAt: number;
|
|
5632
|
+
whatsappButton: boolean | null;
|
|
5633
|
+
whatsappButtonConfirmed: boolean;
|
|
5634
|
+
}>;
|
|
5635
|
+
handlerReady: boolean;
|
|
5636
|
+
lastError: "META_TOKEN_INVALID" | "META_PERMISSION_MISSING" | "HANDLER_MISSING" | "HANDLER_FAILED" | "HANDLER_GAVE_UP" | "SECRETS_KEY_MISSING" | "META_TRUNCATED" | "META_RATE_LIMITED" | "META_UNAVAILABLE" | "RUN_TIMEOUT" | null;
|
|
5637
|
+
lastLeadAt: number | null;
|
|
5638
|
+
lastReconcileAt: number | null;
|
|
5639
|
+
leadsAllowed: boolean;
|
|
5640
|
+
own?: boolean;
|
|
5641
|
+
pageId: string;
|
|
5642
|
+
pageName: string;
|
|
5643
|
+
subscribedAt: number | null;
|
|
5644
|
+
}[]>>;
|
|
5645
|
+
metaFormRules: import("convex/server").RegisteredQuery<"public", {
|
|
5646
|
+
formId: string;
|
|
5647
|
+
now?: number | undefined;
|
|
5648
|
+
siteId: string;
|
|
5649
|
+
}, Promise<{
|
|
5650
|
+
configured: boolean;
|
|
5651
|
+
entryColumn: string | null;
|
|
5652
|
+
firstContact: {
|
|
5653
|
+
brakes?: {
|
|
5654
|
+
businessHoursOnly: boolean;
|
|
5655
|
+
maxPerHour: number;
|
|
5656
|
+
waitMinutes: number;
|
|
5657
|
+
};
|
|
5658
|
+
mode: "lead_starts" | "one_click" | "automatic";
|
|
5659
|
+
text?: string;
|
|
5660
|
+
};
|
|
5661
|
+
formId: string;
|
|
5662
|
+
own?: boolean;
|
|
5663
|
+
rules: Array<{
|
|
5664
|
+
answers: Array<string>;
|
|
5665
|
+
monthCount: number | null;
|
|
5666
|
+
questionKey: string;
|
|
5667
|
+
to: {
|
|
5668
|
+
column: string;
|
|
5669
|
+
} | {
|
|
5670
|
+
discard: string;
|
|
5671
|
+
};
|
|
5672
|
+
}>;
|
|
5673
|
+
siteId: string;
|
|
5674
|
+
updatedAt: number | null;
|
|
5675
|
+
whatsappButtonConfirmed: boolean;
|
|
5676
|
+
}>>;
|
|
5677
|
+
simulateMetaFormRules: import("convex/server").RegisteredQuery<"public", {
|
|
5678
|
+
entryColumn: string | null;
|
|
5679
|
+
formId: string;
|
|
5680
|
+
now: number;
|
|
5681
|
+
rules: {
|
|
5682
|
+
answers: string[];
|
|
5683
|
+
questionKey: string;
|
|
5684
|
+
to: {
|
|
5685
|
+
column: string;
|
|
5686
|
+
} | {
|
|
5687
|
+
discard: string;
|
|
5688
|
+
};
|
|
5689
|
+
}[];
|
|
5690
|
+
siteId: string;
|
|
5691
|
+
}, Promise<{
|
|
5692
|
+
columns: Array<{
|
|
5693
|
+
column: string;
|
|
5694
|
+
leads: number;
|
|
5695
|
+
}>;
|
|
5696
|
+
discarded: Array<{
|
|
5697
|
+
leads: number;
|
|
5698
|
+
reason: string;
|
|
5699
|
+
}>;
|
|
5700
|
+
entry: number;
|
|
5701
|
+
partial: boolean;
|
|
5702
|
+
rules: Array<number>;
|
|
5703
|
+
total: number;
|
|
5704
|
+
}>>;
|
|
5705
|
+
metaFormsReport: import("convex/server").RegisteredQuery<"public", {
|
|
5706
|
+
from: number;
|
|
5707
|
+
siteIds: string[];
|
|
5708
|
+
to: number;
|
|
5709
|
+
}, Promise<{
|
|
5710
|
+
forms: Array<{
|
|
5711
|
+
columns: Array<{
|
|
5712
|
+
column: string;
|
|
5713
|
+
leads: number;
|
|
5714
|
+
}>;
|
|
5715
|
+
discarded: Array<{
|
|
5716
|
+
leads: number;
|
|
5717
|
+
reason: string;
|
|
5718
|
+
}>;
|
|
5719
|
+
entry: number;
|
|
5720
|
+
formId: string;
|
|
5721
|
+
leads: number;
|
|
5722
|
+
name: string | null;
|
|
5723
|
+
pageId: string;
|
|
5724
|
+
qualified: number;
|
|
5725
|
+
returned: number;
|
|
5726
|
+
revenueCents: number;
|
|
5727
|
+
siteId: string;
|
|
5728
|
+
won: number;
|
|
5729
|
+
}>;
|
|
5730
|
+
partial: boolean;
|
|
5731
|
+
}>>;
|
|
5732
|
+
metaLinkedPages: import("convex/server").RegisteredQuery<"public", {
|
|
5733
|
+
siteIds: string[];
|
|
5734
|
+
}, Promise<{
|
|
5735
|
+
pages: Array<{
|
|
5736
|
+
pageId: string;
|
|
5737
|
+
siteId: string;
|
|
5738
|
+
}>;
|
|
5739
|
+
leadgenReady: boolean;
|
|
5740
|
+
issuer: string;
|
|
5741
|
+
audience: string | null;
|
|
5742
|
+
handlerReady: boolean;
|
|
5743
|
+
}>>;
|
|
5744
|
+
linkMetaPage: import("convex/server").RegisteredAction<"public", {
|
|
5745
|
+
pageId: string;
|
|
5746
|
+
siteId: string;
|
|
5747
|
+
}, Promise<{
|
|
5748
|
+
forms: number;
|
|
5749
|
+
linked: boolean;
|
|
5750
|
+
}>>;
|
|
5751
|
+
unlinkMetaPage: import("convex/server").RegisteredAction<"public", {
|
|
5752
|
+
pageId: string;
|
|
5753
|
+
siteId: string;
|
|
5754
|
+
}, Promise<{
|
|
5755
|
+
unlinked: boolean;
|
|
5756
|
+
}>>;
|
|
5757
|
+
refreshMetaForms: import("convex/server").RegisteredAction<"public", {
|
|
5758
|
+
siteId: string;
|
|
5759
|
+
}, Promise<{
|
|
5760
|
+
pages: number;
|
|
5761
|
+
forms: number;
|
|
5762
|
+
}>>;
|
|
5763
|
+
setMetaFormRules: import("convex/server").RegisteredMutation<"public", {
|
|
5764
|
+
entryColumn: string | null;
|
|
5765
|
+
firstContact: {
|
|
5766
|
+
brakes?: {
|
|
5767
|
+
businessHoursOnly: boolean;
|
|
5768
|
+
maxPerHour: number;
|
|
5769
|
+
waitMinutes: number;
|
|
5770
|
+
} | undefined;
|
|
5771
|
+
mode: "automatic" | "lead_starts" | "one_click";
|
|
5772
|
+
text?: string | undefined;
|
|
5773
|
+
};
|
|
5774
|
+
formId: string;
|
|
5775
|
+
rules: {
|
|
5776
|
+
answers: string[];
|
|
5777
|
+
questionKey: string;
|
|
5778
|
+
to: {
|
|
5779
|
+
column: string;
|
|
5780
|
+
} | {
|
|
5781
|
+
discard: string;
|
|
5782
|
+
};
|
|
5783
|
+
}[];
|
|
5784
|
+
siteId: string;
|
|
5785
|
+
whatsappButtonConfirmed?: boolean | undefined;
|
|
5786
|
+
}, Promise<null>>;
|
|
5787
|
+
returnMetaFormLead: import("convex/server").RegisteredMutation<"public", {
|
|
5788
|
+
leadId: string;
|
|
5789
|
+
siteId: string;
|
|
5790
|
+
}, Promise<{
|
|
5791
|
+
returned: boolean;
|
|
5792
|
+
}>>;
|
|
5337
5793
|
retentionStatus: import("convex/server").RegisteredQuery<"public", {
|
|
5338
5794
|
siteId: string;
|
|
5339
5795
|
}, Promise<{
|