@parag.more.withsurface.com/forms-sdk 0.1.4 → 0.1.6
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 +9 -4
- package/dist/index.cjs +1 -2737
- package/dist/index.mjs +1 -2714
- package/dist/react/index.cjs +1 -44
- package/dist/react/index.mjs +1 -21
- package/dist/surface-forms-sdk.min.js +21 -2
- package/dist/types/bind/bindForm.d.ts +2 -36
- package/dist/types/bind/bookingWidget.d.ts +29 -17
- package/dist/types/bind/scheduler/embedUtils.d.ts +50 -0
- package/dist/types/bind/scheduler/mountScheduler.d.ts +2 -0
- package/dist/types/bind/scheduler/providers/cal.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/calendly.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/chilical.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/clari.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/hubspot.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/index.d.ts +4 -0
- package/dist/types/bind/scheduler/providers/reclaimai.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/revenuehero.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/savvycal.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/surface.d.ts +3 -0
- package/dist/types/bind/scheduler/providers/zoom.d.ts +3 -0
- package/dist/types/bind/scheduler/styles.d.ts +3 -0
- package/dist/types/bind/scheduler/types.d.ts +65 -0
- package/dist/types/core/client/emailValidation.d.ts +3 -4
- package/dist/types/core/client/responses.d.ts +3 -15
- package/dist/types/core/client/runtimeConfig.d.ts +40 -32
- package/dist/types/core/client/scheduler.d.ts +4 -27
- package/dist/types/core/client/transport.d.ts +4 -28
- package/dist/types/core/engine/answerAudit.d.ts +3 -12
- package/dist/types/core/engine/answerStates.d.ts +4 -17
- package/dist/types/core/engine/formEngine.d.ts +16 -53
- package/dist/types/core/engine/redirect.d.ts +1 -23
- package/dist/types/core/engine/responsePayload.d.ts +4 -28
- package/dist/types/core/engine/schedulerEvents.d.ts +40 -0
- package/dist/types/core/engine/urlData.d.ts +2 -17
- package/dist/types/core/engine/urlPrefill.d.ts +1 -9
- package/dist/types/core/events/dropoffDetection.d.ts +1 -14
- package/dist/types/core/events/emitter.d.ts +1 -17
- package/dist/types/core/events/formJourneyTracker.d.ts +1 -19
- package/dist/types/core/events/pushEvents.d.ts +2 -16
- package/dist/types/core/events/startedDetection.d.ts +1 -10
- package/dist/types/core/events/viewDetection.d.ts +1 -14
- package/dist/types/core/identity/browserFingerprint.d.ts +3 -19
- package/dist/types/core/identity/ensureIdentified.d.ts +1 -16
- package/dist/types/core/identity/identify.d.ts +1 -15
- package/dist/types/core/identity/journey.d.ts +3 -16
- package/dist/types/core/identity/journey.testStubs.d.ts +1 -2
- package/dist/types/core/identity/leadDataCache.d.ts +1 -16
- package/dist/types/enrichment/attachEnrichment.d.ts +1 -21
- package/dist/types/index.d.ts +5 -3
- package/dist/types/react/index.d.ts +0 -1
- package/dist/types/react/useSurfaceForm.d.ts +1 -11
- package/dist/types/surfaceForms.d.ts +28 -73
- package/dist/types/tracking/attachTracking.d.ts +1 -22
- package/dist/types/tracking/conversionRules.d.ts +3 -12
- package/dist/types/tracking/vendors.d.ts +3 -22
- package/dist/types/validation/attachEmailValidation.d.ts +0 -1
- package/docs/api.md +51 -39
- package/docs/reference/binding.md +86 -13
- package/docs/reference/clients.md +21 -1
- package/docs/reference/engine.md +5 -1
- package/docs/reference/events.md +4 -1
- package/docs/reference/identity.md +2 -3
- package/llms.txt +58 -10
- package/package.json +1 -1
- package/skills/surface-forms-sdk/SKILL.md +19 -6
- package/skills/surface-forms-sdk/patterns.md +30 -5
- package/dist/index.cjs.map +0 -7
- package/dist/index.mjs.map +0 -7
- package/dist/react/index.cjs.map +0 -7
- package/dist/react/index.mjs.map +0 -7
- package/dist/surface-forms-sdk.min.js.map +0 -7
- package/dist/types/bind/bindForm.d.ts.map +0 -1
- package/dist/types/bind/bindForm.test.d.ts +0 -2
- package/dist/types/bind/bindForm.test.d.ts.map +0 -1
- package/dist/types/bind/bookingWidget.d.ts.map +0 -1
- package/dist/types/bind/bookingWidget.test.d.ts +0 -2
- package/dist/types/bind/bookingWidget.test.d.ts.map +0 -1
- package/dist/types/core/client/emailValidation.d.ts.map +0 -1
- package/dist/types/core/client/emailValidation.test.d.ts +0 -2
- package/dist/types/core/client/emailValidation.test.d.ts.map +0 -1
- package/dist/types/core/client/responses.d.ts.map +0 -1
- package/dist/types/core/client/responses.test.d.ts +0 -2
- package/dist/types/core/client/responses.test.d.ts.map +0 -1
- package/dist/types/core/client/runtimeConfig.contract.test.d.ts +0 -2
- package/dist/types/core/client/runtimeConfig.contract.test.d.ts.map +0 -1
- package/dist/types/core/client/runtimeConfig.d.ts.map +0 -1
- package/dist/types/core/client/runtimeConfig.test.d.ts +0 -2
- package/dist/types/core/client/runtimeConfig.test.d.ts.map +0 -1
- package/dist/types/core/client/scheduler.contract.test.d.ts +0 -2
- package/dist/types/core/client/scheduler.contract.test.d.ts.map +0 -1
- package/dist/types/core/client/scheduler.d.ts.map +0 -1
- package/dist/types/core/client/scheduler.test.d.ts +0 -2
- package/dist/types/core/client/scheduler.test.d.ts.map +0 -1
- package/dist/types/core/client/transport.d.ts.map +0 -1
- package/dist/types/core/client/transport.test.d.ts +0 -2
- package/dist/types/core/client/transport.test.d.ts.map +0 -1
- package/dist/types/core/engine/answerAudit.d.ts.map +0 -1
- package/dist/types/core/engine/answerAudit.test.d.ts +0 -2
- package/dist/types/core/engine/answerAudit.test.d.ts.map +0 -1
- package/dist/types/core/engine/answerStates.contract.test.d.ts +0 -2
- package/dist/types/core/engine/answerStates.contract.test.d.ts.map +0 -1
- package/dist/types/core/engine/answerStates.d.ts.map +0 -1
- package/dist/types/core/engine/formEngine.d.ts.map +0 -1
- package/dist/types/core/engine/formEngine.test.d.ts +0 -2
- package/dist/types/core/engine/formEngine.test.d.ts.map +0 -1
- package/dist/types/core/engine/redirect.d.ts.map +0 -1
- package/dist/types/core/engine/redirect.test.d.ts +0 -2
- package/dist/types/core/engine/redirect.test.d.ts.map +0 -1
- package/dist/types/core/engine/responsePayload.contract.test.d.ts +0 -2
- package/dist/types/core/engine/responsePayload.contract.test.d.ts.map +0 -1
- package/dist/types/core/engine/responsePayload.d.ts.map +0 -1
- package/dist/types/core/engine/responsePayload.test.d.ts +0 -2
- package/dist/types/core/engine/responsePayload.test.d.ts.map +0 -1
- package/dist/types/core/engine/urlData.contract.test.d.ts +0 -2
- package/dist/types/core/engine/urlData.contract.test.d.ts.map +0 -1
- package/dist/types/core/engine/urlData.d.ts.map +0 -1
- package/dist/types/core/engine/urlData.test.d.ts +0 -2
- package/dist/types/core/engine/urlData.test.d.ts.map +0 -1
- package/dist/types/core/engine/urlPrefill.d.ts.map +0 -1
- package/dist/types/core/engine/urlPrefill.test.d.ts +0 -2
- package/dist/types/core/engine/urlPrefill.test.d.ts.map +0 -1
- package/dist/types/core/events/dropoffDetection.d.ts.map +0 -1
- package/dist/types/core/events/dropoffDetection.test.d.ts +0 -2
- package/dist/types/core/events/dropoffDetection.test.d.ts.map +0 -1
- package/dist/types/core/events/emitter.d.ts.map +0 -1
- package/dist/types/core/events/emitter.test.d.ts +0 -2
- package/dist/types/core/events/emitter.test.d.ts.map +0 -1
- package/dist/types/core/events/formJourneyTracker.contract.test.d.ts +0 -2
- package/dist/types/core/events/formJourneyTracker.contract.test.d.ts.map +0 -1
- package/dist/types/core/events/formJourneyTracker.d.ts.map +0 -1
- package/dist/types/core/events/formJourneyTracker.test.d.ts +0 -2
- package/dist/types/core/events/formJourneyTracker.test.d.ts.map +0 -1
- package/dist/types/core/events/pushEvents.contract.test.d.ts +0 -2
- package/dist/types/core/events/pushEvents.contract.test.d.ts.map +0 -1
- package/dist/types/core/events/pushEvents.d.ts.map +0 -1
- package/dist/types/core/events/pushEvents.test.d.ts +0 -2
- package/dist/types/core/events/pushEvents.test.d.ts.map +0 -1
- package/dist/types/core/events/startedDetection.d.ts.map +0 -1
- package/dist/types/core/events/startedDetection.test.d.ts +0 -2
- package/dist/types/core/events/startedDetection.test.d.ts.map +0 -1
- package/dist/types/core/events/viewDetection.d.ts.map +0 -1
- package/dist/types/core/events/viewDetection.test.d.ts +0 -2
- package/dist/types/core/events/viewDetection.test.d.ts.map +0 -1
- package/dist/types/core/identity/browserFingerprint.d.ts.map +0 -1
- package/dist/types/core/identity/browserFingerprint.test.d.ts +0 -2
- package/dist/types/core/identity/browserFingerprint.test.d.ts.map +0 -1
- package/dist/types/core/identity/ensureIdentified.d.ts.map +0 -1
- package/dist/types/core/identity/ensureIdentified.test.d.ts +0 -2
- package/dist/types/core/identity/ensureIdentified.test.d.ts.map +0 -1
- package/dist/types/core/identity/identify.contract.test.d.ts +0 -2
- package/dist/types/core/identity/identify.contract.test.d.ts.map +0 -1
- package/dist/types/core/identity/identify.d.ts.map +0 -1
- package/dist/types/core/identity/identify.test.d.ts +0 -2
- package/dist/types/core/identity/identify.test.d.ts.map +0 -1
- package/dist/types/core/identity/journey.contract.test.d.ts +0 -2
- package/dist/types/core/identity/journey.contract.test.d.ts.map +0 -1
- package/dist/types/core/identity/journey.d.ts.map +0 -1
- package/dist/types/core/identity/journey.test.d.ts +0 -2
- package/dist/types/core/identity/journey.test.d.ts.map +0 -1
- package/dist/types/core/identity/journey.testStubs.d.ts.map +0 -1
- package/dist/types/core/identity/leadDataCache.d.ts.map +0 -1
- package/dist/types/core/identity/leadDataCache.test.d.ts +0 -2
- package/dist/types/core/identity/leadDataCache.test.d.ts.map +0 -1
- package/dist/types/enrichment/attachEnrichment.d.ts.map +0 -1
- package/dist/types/enrichment/attachEnrichment.test.d.ts +0 -2
- package/dist/types/enrichment/attachEnrichment.test.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/react/index.d.ts.map +0 -1
- package/dist/types/react/ssr.test.d.ts +0 -2
- package/dist/types/react/ssr.test.d.ts.map +0 -1
- package/dist/types/react/useSurfaceForm.d.ts.map +0 -1
- package/dist/types/react/useSurfaceForm.test.d.ts +0 -2
- package/dist/types/react/useSurfaceForm.test.d.ts.map +0 -1
- package/dist/types/surfaceForms.d.ts.map +0 -1
- package/dist/types/surfaceForms.test.d.ts +0 -2
- package/dist/types/surfaceForms.test.d.ts.map +0 -1
- package/dist/types/tracking/attachTracking.d.ts.map +0 -1
- package/dist/types/tracking/attachTracking.test.d.ts +0 -2
- package/dist/types/tracking/attachTracking.test.d.ts.map +0 -1
- package/dist/types/tracking/conversionRules.contract.test.d.ts +0 -2
- package/dist/types/tracking/conversionRules.contract.test.d.ts.map +0 -1
- package/dist/types/tracking/conversionRules.d.ts.map +0 -1
- package/dist/types/tracking/conversionRules.test.d.ts +0 -2
- package/dist/types/tracking/conversionRules.test.d.ts.map +0 -1
- package/dist/types/tracking/vendors.d.ts.map +0 -1
- package/dist/types/tracking/vendors.test.d.ts +0 -2
- package/dist/types/tracking/vendors.test.d.ts.map +0 -1
- package/dist/types/validation/attachEmailValidation.d.ts.map +0 -1
- package/dist/types/validation/attachEmailValidation.test.d.ts +0 -2
- package/dist/types/validation/attachEmailValidation.test.d.ts.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SchedulerQuestion } from "../../core/client/runtimeConfig";
|
|
2
|
+
import type { SchedulerBookingSummary, SchedulerLifecycleEvent } from "../../core/engine/schedulerEvents";
|
|
3
|
+
import type { SurfaceForm } from "../../surfaceForms";
|
|
4
|
+
import type { BookingWidgetOptions } from "../bookingWidget";
|
|
5
|
+
export type MountSchedulerOptions = {
|
|
6
|
+
form: SurfaceForm;
|
|
7
|
+
container: Element;
|
|
8
|
+
|
|
9
|
+
questionId?: string;
|
|
10
|
+
|
|
11
|
+
stepId?: string;
|
|
12
|
+
|
|
13
|
+
styled?: boolean;
|
|
14
|
+
|
|
15
|
+
persist?: boolean;
|
|
16
|
+
|
|
17
|
+
prefill?: {
|
|
18
|
+
name?: string;
|
|
19
|
+
lastName?: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
formatters?: BookingWidgetOptions["formatters"];
|
|
24
|
+
|
|
25
|
+
calendarId?: string;
|
|
26
|
+
onEvent?: (event: SchedulerLifecycleEvent) => void;
|
|
27
|
+
|
|
28
|
+
onComplete?: (booking: SchedulerBookingSummary) => void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type ProviderEvent = SchedulerLifecycleEvent extends infer T ? T extends {
|
|
32
|
+
questionId: string;
|
|
33
|
+
stepId: string;
|
|
34
|
+
provider: unknown;
|
|
35
|
+
} ? Omit<T, "questionId" | "stepId" | "provider"> : never : never;
|
|
36
|
+
|
|
37
|
+
export type ProviderContext = {
|
|
38
|
+
form: SurfaceForm;
|
|
39
|
+
container: Element;
|
|
40
|
+
question: SchedulerQuestion;
|
|
41
|
+
|
|
42
|
+
content: SchedulerQuestion["content"];
|
|
43
|
+
prefill: {
|
|
44
|
+
name?: string;
|
|
45
|
+
lastName?: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
urlParams: Record<string, string>;
|
|
50
|
+
formatters?: BookingWidgetOptions["formatters"];
|
|
51
|
+
styled: boolean;
|
|
52
|
+
emit: (event: ProviderEvent) => void;
|
|
53
|
+
|
|
54
|
+
confirmBooking: (booking: Omit<SchedulerBookingSummary, "provider">, extraAnswer?: Record<string, unknown>) => void;
|
|
55
|
+
|
|
56
|
+
cancelBooking: (reason?: string) => void;
|
|
57
|
+
|
|
58
|
+
mergeAnswer: (partial: Record<string, unknown>, opts?: {
|
|
59
|
+
save?: boolean;
|
|
60
|
+
}) => void;
|
|
61
|
+
|
|
62
|
+
ensureResponseId: () => Promise<string | null>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type ProviderMount = (ctx: ProviderContext) => () => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Transport } from "./transport";
|
|
2
2
|
export type EmailValidationResult = {
|
|
3
3
|
email: string;
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
isValid: boolean;
|
|
6
6
|
status?: string;
|
|
7
7
|
reason?: string;
|
|
8
8
|
blacklistEntryIds?: string[];
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
failed?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type EmailValidator = {
|
|
@@ -16,8 +16,7 @@ export type EmailValidator = {
|
|
|
16
16
|
export type CreateEmailValidatorOptions = {
|
|
17
17
|
transport: Transport;
|
|
18
18
|
environmentId: string;
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
preview?: boolean;
|
|
21
21
|
};
|
|
22
22
|
export declare const createEmailValidator: ({ transport, environmentId, preview, }: CreateEmailValidatorOptions) => EmailValidator;
|
|
23
|
-
//# sourceMappingURL=emailValidation.d.ts.map
|
|
@@ -3,33 +3,21 @@ import type { Transport, TransportResult } from "./transport";
|
|
|
3
3
|
export type CreateResponseResult = {
|
|
4
4
|
responseId: string;
|
|
5
5
|
leadId: string | null;
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
resumeToken: string | null;
|
|
8
8
|
};
|
|
9
9
|
export declare const submitResponse: (transport: Transport, payload: FormResponsePayload) => Promise<TransportResult<CreateResponseResult>>;
|
|
10
10
|
export declare const updateResponse: (transport: Transport, payload: FormUpdateResponsePayload) => void;
|
|
11
|
-
|
|
12
|
-
* Awaited delivery for the FINISHING update (the 2026-08 field run measured
|
|
13
|
-
* the beacon path silently dropping the terminal write on fast page close:
|
|
14
|
-
* `submit()` resolved, `saved` fired, and the server kept a step-1 partial).
|
|
15
|
-
* `keepalive` lets the request survive an immediate navigation; credentials
|
|
16
|
-
* match the beacon path's `${formId}_pa` cookie round-trip.
|
|
17
|
-
*/
|
|
11
|
+
|
|
18
12
|
export declare const updateResponseConfirmed: (transport: Transport, payload: FormUpdateResponsePayload) => Promise<TransportResult<unknown>>;
|
|
19
13
|
export type StoredAnswerRow = {
|
|
20
14
|
questionId: string;
|
|
21
15
|
response: Record<string, unknown>;
|
|
22
16
|
};
|
|
23
|
-
|
|
24
|
-
* Read-back of a stored response for resume (Decisions #11: the route is
|
|
25
|
-
* token-gated; the create reply issued the token). External-state
|
|
26
|
-
* pseudo-answers (URL_DATA) are stripped — they are attribution snapshots the
|
|
27
|
-
* engine re-derives from its own page context, not visitor answers.
|
|
28
|
-
*/
|
|
17
|
+
|
|
29
18
|
export declare const fetchStoredResponse: (transport: Transport, { responseId, resumeToken }: {
|
|
30
19
|
responseId: string;
|
|
31
20
|
resumeToken: string;
|
|
32
21
|
}) => Promise<TransportResult<{
|
|
33
22
|
answers: StoredAnswerRow[];
|
|
34
23
|
}>>;
|
|
35
|
-
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import type { Transport, TransportResult } from "./transport";
|
|
2
|
-
|
|
3
|
-
* Boot-time fetch of the published form record (forms-sdk-plan.md §2.3,
|
|
4
|
-
* Decisions #7): `GET /api/v1/public/forms/[formId]/runtime-config` serves the
|
|
5
|
-
* same `TCachedForm` payload the hosted `/s/[formId]` page reads — config
|
|
6
|
-
* (steps + components, the data contract) and settings (behavioral gates like
|
|
7
|
-
* `trackPartialResponses`; tracking ids for the Phase-2 tracking module).
|
|
8
|
-
* `settings.password` never arrives — the server strips it and the SDK
|
|
9
|
-
* validates gated forms through `/api/v1/check-password`.
|
|
10
|
-
*
|
|
11
|
-
* The step/question extraction mirrors `extractFlatComponentsFromStep`
|
|
12
|
-
* (form-render gridLayoutUtils): a step's `components` is either a flat
|
|
13
|
-
* component array or a ComponentGridLayout whose rows hold components or
|
|
14
|
-
* `GridLayoutRowItem` wrappers; stateful components carry `state.questionId` —
|
|
15
|
-
* the same discriminator the MCP validator's `collectQuestionIds` uses.
|
|
16
|
-
*/
|
|
2
|
+
|
|
17
3
|
type RuntimeStep = {
|
|
18
4
|
id: string;
|
|
19
5
|
endStepKind?: "thank_you" | "disqualified";
|
|
@@ -31,14 +17,14 @@ export type RuntimeConfig = {
|
|
|
31
17
|
trackCookie?: boolean;
|
|
32
18
|
} & Record<string, unknown>) | null;
|
|
33
19
|
};
|
|
34
|
-
|
|
20
|
+
|
|
35
21
|
export declare const fetchRuntimeConfig: (transport: Transport, formId: string, { preview, previewToken }?: {
|
|
36
22
|
preview?: boolean;
|
|
37
23
|
previewToken?: string;
|
|
38
24
|
}) => Promise<TransportResult<{
|
|
39
25
|
data?: RuntimeConfig;
|
|
40
26
|
}>>;
|
|
41
|
-
|
|
27
|
+
|
|
42
28
|
export declare const stepsOf: (config: RuntimeConfig["config"]) => Array<{
|
|
43
29
|
id: string;
|
|
44
30
|
endStepKind?: "thank_you" | "disqualified";
|
|
@@ -48,25 +34,47 @@ export declare const statefulQuestionsOf: (config: RuntimeConfig["config"]) => A
|
|
|
48
34
|
componentType?: string;
|
|
49
35
|
}>;
|
|
50
36
|
export declare const statefulQuestionIdsOf: (config: RuntimeConfig["config"]) => string[];
|
|
51
|
-
|
|
52
|
-
* Questions whose answers can trigger real-time enrichment, with the state
|
|
53
|
-
* keys to watch — the native renderer's blur triggers translated to data
|
|
54
|
-
* (identityInfo.tsx handleOnBlur): IdentityInfo fires on its configured
|
|
55
|
-
* `enrichmentSourceField` (default emailAddress) and always on `websiteUrl`;
|
|
56
|
-
* EmailForm fires on its email.
|
|
57
|
-
*/
|
|
37
|
+
|
|
58
38
|
export declare const enrichmentSourcesOf: (config: RuntimeConfig["config"]) => Array<{
|
|
59
39
|
questionId: string;
|
|
60
40
|
fieldNames: string[];
|
|
61
41
|
}>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
42
|
+
|
|
43
|
+
export type SchedulerStateRef = {
|
|
44
|
+
stepId: string;
|
|
45
|
+
questionId: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type SchedulerParamRef = SchedulerStateRef & {
|
|
49
|
+
variable: string;
|
|
50
|
+
};
|
|
51
|
+
export type SchedulerQuestion = {
|
|
52
|
+
questionId: string;
|
|
53
|
+
stepId: string;
|
|
54
|
+
|
|
55
|
+
componentType: "CalendlyScreen" | "DynamicScheduler";
|
|
56
|
+
|
|
57
|
+
calendarType: string;
|
|
58
|
+
content: {
|
|
59
|
+
dataUrl?: string;
|
|
60
|
+
eventTypeId?: string;
|
|
61
|
+
savvyCalLinkId?: string;
|
|
62
|
+
revenueHeroRouterId?: string;
|
|
63
|
+
dataUrlParams?: Record<string, SchedulerParamRef>;
|
|
64
|
+
linkNameToStep?: SchedulerStateRef;
|
|
65
|
+
linkLastNameToStep?: SchedulerStateRef;
|
|
66
|
+
linkEmailToStep?: SchedulerStateRef;
|
|
67
|
+
addSchedulerQueryParams?: boolean;
|
|
68
|
+
skipFormIfPrefilled?: boolean;
|
|
69
|
+
|
|
70
|
+
calendars?: unknown[];
|
|
71
|
+
defaultCalendar?: unknown;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare const schedulerQuestionsOf: (config: RuntimeConfig["config"]) => SchedulerQuestion[];
|
|
76
|
+
|
|
68
77
|
export declare const hasDeclaredEnrichmentSource: (config: RuntimeConfig["config"]) => boolean;
|
|
69
|
-
|
|
78
|
+
|
|
70
79
|
export declare const hasEnabledEnrichmentProvider: (settings: RuntimeConfig["settings"]) => boolean;
|
|
71
80
|
export {};
|
|
72
|
-
//# sourceMappingURL=runtimeConfig.d.ts.map
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import type { Transport, TransportResult } from "./transport";
|
|
2
|
-
|
|
3
|
-
* Thin wrap of the public Surface-native scheduler endpoints (forms-sdk-plan.md
|
|
4
|
-
* row 46 — Phase-1 MVP scope by product decision). Query and payload shapes
|
|
5
|
-
* mirror `@surface/scheduler-ui`'s hooks byte-for-byte (that package is
|
|
6
|
-
* AGPL-tree and cannot ship in the MIT SDK — plan §2.9), including the split
|
|
7
|
-
* of `YYYY-MM` into numeric month/year params and the booking `meta` block
|
|
8
|
-
* that drives server-side booking↔response linkage.
|
|
9
|
-
*
|
|
10
|
-
* `preview: true` mirrors the native BookingForm exactly: queries carry
|
|
11
|
-
* `preview=true`, and `book()` resolves a fabricated preview booking without
|
|
12
|
-
* any network call — draft interactions never create real bookings.
|
|
13
|
-
*
|
|
14
|
-
* `toSchedulerAnswerState` reproduces `SurfaceScheduler.handleBookingComplete`:
|
|
15
|
-
* the persisted DynamicScheduler component state whose `eventScheduled`/`uri`
|
|
16
|
-
* pair the payload builder's bookingId detection and the server's booking
|
|
17
|
-
* meta injection key on. `googleMeetLink` is the frozen persisted key even
|
|
18
|
-
* though the API field is `meetingJoinLink`.
|
|
19
|
-
*/
|
|
2
|
+
|
|
20
3
|
export type BookingAttendee = {
|
|
21
4
|
name: string;
|
|
22
5
|
email: string;
|
|
@@ -62,7 +45,7 @@ export type SchedulerClient = {
|
|
|
62
45
|
}>>;
|
|
63
46
|
getMonthAvailability: (args: {
|
|
64
47
|
eventTypeId: string;
|
|
65
|
-
|
|
48
|
+
|
|
66
49
|
month: string;
|
|
67
50
|
timezone: string;
|
|
68
51
|
duration?: number;
|
|
@@ -85,12 +68,7 @@ export type SchedulerClient = {
|
|
|
85
68
|
book: (args: {
|
|
86
69
|
eventTypeId: string;
|
|
87
70
|
startTime: string;
|
|
88
|
-
|
|
89
|
-
* The selected slot's end. Required — every booking comes from a picked
|
|
90
|
-
* slot, and a fallback would fabricate zero-length preview meetings. Only
|
|
91
|
-
* preview fabrication reads it (the server derives real end times); it is
|
|
92
|
-
* never sent on the wire.
|
|
93
|
-
*/
|
|
71
|
+
|
|
94
72
|
endTime: string;
|
|
95
73
|
timezone: string;
|
|
96
74
|
inviteeName: string;
|
|
@@ -115,7 +93,6 @@ export declare const createSchedulerClient: ({ transport, preview, }: {
|
|
|
115
93
|
transport: Transport;
|
|
116
94
|
preview?: boolean;
|
|
117
95
|
}) => SchedulerClient;
|
|
118
|
-
|
|
96
|
+
|
|
119
97
|
export declare const toSchedulerAnswerState: (booking: Booking) => Record<string, unknown>;
|
|
120
98
|
export {};
|
|
121
|
-
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* runtime's two transports (forms-sdk-plan.md §2.4):
|
|
4
|
-
*
|
|
5
|
-
* - `post` — plain `fetch` for calls whose response body the engine needs
|
|
6
|
-
* (response create returns `responseId`/`meta`, identify returns
|
|
7
|
-
* `leadId`/`sessionId`). Never throws: resolves to a typed result so
|
|
8
|
-
* callers keep the never-break-the-host-page guarantee (§2.6).
|
|
9
|
-
* - `beacon` — `sendBeacon`-first with `fetch(keepalive)` fallback for
|
|
10
|
-
* fire-and-forget writes (response updates, events, journey), the same
|
|
11
|
-
* semantics as form-render's `updateResponse.ts` / `sendPushEventRequest.ts`.
|
|
12
|
-
* Failures are swallowed by design: the server's drop-off sweep reconciles
|
|
13
|
-
* missed updates, and events are best-effort.
|
|
14
|
-
*
|
|
15
|
-
* Unlike form-render (relative paths, same-origin only), every request is
|
|
16
|
-
* absolute against a configurable base URL — SDK pages are customer-hosted
|
|
17
|
-
* and always cross-origin (§4.1).
|
|
18
|
-
*/
|
|
19
|
-
/** The host the public tag already targets (scripts:src/constants.ts). */
|
|
1
|
+
|
|
2
|
+
|
|
20
3
|
export declare const DEFAULT_API_BASE_URL = "https://forms.withsurface.com";
|
|
21
|
-
|
|
22
|
-
* Sent as `X-Surface-Sdk-Version` on every fetch-path request (Decisions #14:
|
|
23
|
-
* SDK 429s must be measurable before rate limits are revisited). `sendBeacon`
|
|
24
|
-
* cannot carry headers, so beacon deliveries carry the version as the `sdv`
|
|
25
|
-
* query param instead — the server reads both. Bumped manually until
|
|
26
|
-
* extraction wires it to package.json at build time.
|
|
27
|
-
*/
|
|
4
|
+
|
|
28
5
|
export declare const SDK_VERSION = "0.1.0";
|
|
29
6
|
export type TransportResult<TData> = {
|
|
30
7
|
ok: true;
|
|
@@ -47,10 +24,9 @@ export type Transport = {
|
|
|
47
24
|
keepalive?: boolean;
|
|
48
25
|
credentials?: boolean;
|
|
49
26
|
}) => Promise<TransportResult<TData>>;
|
|
50
|
-
|
|
27
|
+
|
|
51
28
|
beacon: (path: string, payload: unknown) => boolean;
|
|
52
29
|
};
|
|
53
30
|
export declare const createTransport: ({ apiBaseUrl, }?: {
|
|
54
31
|
apiBaseUrl?: string;
|
|
55
32
|
}) => Transport;
|
|
56
|
-
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* `init({ debug: true })` answer auditing: the bind layer always produces
|
|
3
|
-
* valid shapes, but headless `setAnswer` callers are one label-string away
|
|
4
|
-
* from the ingest 400 that static gates cannot see (2026-08 field run). The
|
|
5
|
-
* auditor checks only facts that cannot false-positive — unknown questionId,
|
|
6
|
-
* wrong `type` discriminator, a merged state with no `type` at all, and a
|
|
7
|
-
* choice-list answer whose `choices` is not an array — and logs every
|
|
8
|
-
* captured answer so a session is replayable from the console.
|
|
9
|
-
*/
|
|
1
|
+
|
|
10
2
|
export type AuditedQuestion = {
|
|
11
3
|
questionId: string;
|
|
12
4
|
componentType?: string;
|
|
13
5
|
};
|
|
14
6
|
export declare const auditAnswer: ({ questions, questionId, merged, }: {
|
|
15
|
-
|
|
7
|
+
|
|
16
8
|
questions: Map<string, AuditedQuestion>;
|
|
17
9
|
questionId: string;
|
|
18
|
-
|
|
10
|
+
|
|
19
11
|
merged: Record<string, unknown>;
|
|
20
12
|
}) => void;
|
|
21
|
-
//# sourceMappingURL=answerAudit.d.ts.map
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Typed answer states for headless callers (plan §2.9): the bind layer builds
|
|
3
|
-
* these automatically, but React/headless code hands them to `setAnswer` by
|
|
4
|
-
* hand — and shipping a bare label string where a structured state belongs is
|
|
5
|
-
* the classic production 400 (2026-08 field run). These local types mirror
|
|
6
|
-
* each component's wire schema and are contract-tested against
|
|
7
|
-
* `@surface/types` (dev dependency only — the SDK ships zero runtime deps).
|
|
8
|
-
*
|
|
9
|
-
* `setAnswer` itself stays structurally typed (`Record<string, unknown>`):
|
|
10
|
-
* legacy component types not listed here remain settable, and answers merge
|
|
11
|
-
* per question, so partial patches are legal. Annotate call sites with these
|
|
12
|
-
* types to get the compiler's help.
|
|
13
|
-
*/
|
|
1
|
+
|
|
14
2
|
export type ShortInputAnswer = {
|
|
15
3
|
type: "ShortInput";
|
|
16
4
|
input: string;
|
|
@@ -36,7 +24,7 @@ export type FileUploaderAnswer = {
|
|
|
36
24
|
type: "FileUploader";
|
|
37
25
|
fileUrl?: string;
|
|
38
26
|
};
|
|
39
|
-
|
|
27
|
+
|
|
40
28
|
export type MultipleOptionsAnswer = {
|
|
41
29
|
type: "MultipleOptionsQuestion";
|
|
42
30
|
choices: Array<{
|
|
@@ -70,13 +58,13 @@ export type MultipleChoiceSingleAnswerAnswer = {
|
|
|
70
58
|
value: string;
|
|
71
59
|
index: number;
|
|
72
60
|
};
|
|
73
|
-
|
|
61
|
+
|
|
74
62
|
export declare const IDENTITY_INFO_ANSWER_KEYS: readonly ["firstName", "lastName", "fullName", "emailAddress", "workEmailAddress", "phoneNumber", "companyName", "numberOfEmployees", "websiteUrl", "title", "streetAddress", "aptSuiteEtc", "city", "state", "country", "zipCode", "companyRevenue", "profilePictureUrl"];
|
|
75
63
|
export type IdentityInfoAnswerKey = (typeof IDENTITY_INFO_ANSWER_KEYS)[number];
|
|
76
64
|
export type IdentityInfoAnswer = {
|
|
77
65
|
type: "IdentityInfo";
|
|
78
66
|
} & Partial<Record<IdentityInfoAnswerKey, string>>;
|
|
79
|
-
|
|
67
|
+
|
|
80
68
|
export type SchedulerAnswer = {
|
|
81
69
|
type: "CalendlyScreen" | "DynamicScheduler";
|
|
82
70
|
eventScheduled: boolean;
|
|
@@ -89,4 +77,3 @@ export type SchedulerAnswer = {
|
|
|
89
77
|
googleMeetLink?: string;
|
|
90
78
|
};
|
|
91
79
|
export type KnownAnswerState = ShortInputAnswer | LongInputAnswer | EmailFormAnswer | DropdownAnswer | DisclaimerAnswer | FileUploaderAnswer | MultipleOptionsAnswer | MMChoiceAnswer | MultipleChoiceAnswer | GraphicOptionsAnswer | MultipleChoiceSingleAnswerAnswer | IdentityInfoAnswer | SchedulerAnswer;
|
|
92
|
-
//# sourceMappingURL=answerStates.d.ts.map
|
|
@@ -3,37 +3,8 @@ import { type Unsubscribe } from "../events/emitter";
|
|
|
3
3
|
import type { FormJourneyTracker, FormJourneyTransitionReason } from "../events/formJourneyTracker";
|
|
4
4
|
import { type PushEventClient } from "../events/pushEvents";
|
|
5
5
|
import { type AnswerStates, type ExternalStates } from "./responsePayload";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* response writes, and lifecycle events over the modules this stack built.
|
|
9
|
-
* Native semantics preserved:
|
|
10
|
-
*
|
|
11
|
-
* - **Partial saves on forward step change only** (row 23): first forward
|
|
12
|
-
* move creates the response, later moves update it, and every write sends
|
|
13
|
-
* the id of the step being *left* — all gated by
|
|
14
|
-
* `settings.trackPartialResponses` except the finishing write, which always
|
|
15
|
-
* happens.
|
|
16
|
-
* - **Finished/invalid derivation** (row 27): a resolved next step of
|
|
17
|
-
* `"END"`/`"INVALID"`/`undefined` finishes the form; `"INVALID"`
|
|
18
|
-
* disqualifies.
|
|
19
|
-
* - **Step transition events** (row 31): the `form_step_submitted` +
|
|
20
|
-
* `form_step_viewed` batch with `stepCompletionTime` in seconds since the
|
|
21
|
-
* engine was created (native's `initialRenderTime`), skipped when the form
|
|
22
|
-
* finishes (native returns before emitting on `"END"`).
|
|
23
|
-
* - `markViewed` mirrors native's view actions: `form_viewed` + first-step
|
|
24
|
-
* `form_step_viewed`, once.
|
|
25
|
-
* - Backward navigation never writes (native only re-arms `stepIdToSubmit`).
|
|
26
|
-
*
|
|
27
|
-
* **The engine does not evaluate routing** (Decisions #6): the customer's own
|
|
28
|
-
* code owns navigation. `next()`/`back()` are linear conveniences,
|
|
29
|
-
* `goToStep()` is the explicit move — forward jumps carry full forward
|
|
30
|
-
* semantics (step events, journey transition, partial write), jumps to an
|
|
31
|
-
* already-visited step rewind like `back()` (no write). Disqualification is
|
|
32
|
-
* the explicit `disqualify()` verb — in native it was a routing outcome (the
|
|
33
|
-
* `INVALID` sentinel), so without routing it needs its own API. The pluggable
|
|
34
|
-
* `resolveNextStep` remains as the headless hook for callers who express
|
|
35
|
-
* their routing as a resolver instead of imperative `goToStep` calls.
|
|
36
|
-
*/
|
|
6
|
+
import type { SchedulerLifecycleEvent } from "./schedulerEvents";
|
|
7
|
+
|
|
37
8
|
export type ResolvedNextStep = {
|
|
38
9
|
stepId: string;
|
|
39
10
|
reason?: FormJourneyTransitionReason;
|
|
@@ -68,34 +39,37 @@ export type FormEngineEvents = {
|
|
|
68
39
|
scope: "submit";
|
|
69
40
|
error: unknown;
|
|
70
41
|
};
|
|
42
|
+
scheduler: SchedulerLifecycleEvent;
|
|
71
43
|
};
|
|
72
44
|
export type FormEngineState = {
|
|
73
45
|
currentStepId: string;
|
|
74
46
|
answers: AnswerStates;
|
|
75
|
-
|
|
47
|
+
|
|
76
48
|
externalStates: ExternalStates;
|
|
77
49
|
responseId: string | null;
|
|
78
|
-
|
|
50
|
+
|
|
79
51
|
resumeToken: string | null;
|
|
80
52
|
finished: boolean;
|
|
81
53
|
};
|
|
82
54
|
export type FormEngine = {
|
|
83
55
|
setAnswer: (questionId: string, state: Record<string, unknown>) => void;
|
|
84
|
-
|
|
56
|
+
|
|
85
57
|
setExternalState: (id: string, state: {
|
|
86
58
|
type: string;
|
|
87
59
|
} & Record<string, unknown>) => void;
|
|
88
|
-
|
|
60
|
+
|
|
89
61
|
mergeMeta: (partial: Record<string, unknown>) => void;
|
|
90
62
|
next: () => Promise<void>;
|
|
91
63
|
back: () => void;
|
|
92
|
-
|
|
64
|
+
|
|
93
65
|
goToStep: (stepId: string) => Promise<void>;
|
|
94
66
|
submit: () => Promise<void>;
|
|
95
|
-
|
|
67
|
+
|
|
96
68
|
disqualify: () => Promise<void>;
|
|
97
69
|
savePartial: () => Promise<void>;
|
|
98
|
-
|
|
70
|
+
|
|
71
|
+
notifyScheduler: (event: SchedulerLifecycleEvent) => void;
|
|
72
|
+
|
|
99
73
|
flush: () => Promise<void>;
|
|
100
74
|
markViewed: () => void;
|
|
101
75
|
on: <K extends keyof FormEngineEvents>(event: K, handler: (payload: FormEngineEvents[K]) => void) => Unsubscribe;
|
|
@@ -105,7 +79,7 @@ export type FormEngine = {
|
|
|
105
79
|
export declare const createFormEngine: ({ formId, environmentId, steps, transport, resolveNextStep, trackPartialResponses, trackCookies, externalStates, meta, identity, pushEvents, formJourney, preview, resume, }: {
|
|
106
80
|
formId: string;
|
|
107
81
|
environmentId?: string;
|
|
108
|
-
|
|
82
|
+
|
|
109
83
|
steps: Array<{
|
|
110
84
|
id: string;
|
|
111
85
|
endStepKind?: "thank_you" | "disqualified";
|
|
@@ -116,11 +90,7 @@ export declare const createFormEngine: ({ formId, environmentId, steps, transpor
|
|
|
116
90
|
trackCookies?: boolean;
|
|
117
91
|
externalStates?: ExternalStates;
|
|
118
92
|
meta?: Record<string, unknown>;
|
|
119
|
-
|
|
120
|
-
* Read at every write/event, not captured at construction — a re-identify
|
|
121
|
-
* (SurfaceForm.identify after cache expiry) must attribute subsequent
|
|
122
|
-
* responses and events to the current visitor, not the boot-time one.
|
|
123
|
-
*/
|
|
93
|
+
|
|
124
94
|
identity?: () => {
|
|
125
95
|
fingerprint?: string;
|
|
126
96
|
leadSessionId?: string;
|
|
@@ -128,18 +98,11 @@ export declare const createFormEngine: ({ formId, environmentId, steps, transpor
|
|
|
128
98
|
};
|
|
129
99
|
pushEvents?: PushEventClient;
|
|
130
100
|
formJourney?: FormJourneyTracker;
|
|
131
|
-
|
|
101
|
+
|
|
132
102
|
preview?: boolean;
|
|
133
|
-
|
|
134
|
-
* Resume a stored response (row 28): the seeded responseId turns every write
|
|
135
|
-
* into an update (no duplicate row), and the seeded answers ride along in
|
|
136
|
-
* the full-answer-set resend. Answers are keyed by questionId and seeded
|
|
137
|
-
* under the first step — the wire flattens steps, and presentation (which
|
|
138
|
-
* step to show) is the caller's own navigation.
|
|
139
|
-
*/
|
|
103
|
+
|
|
140
104
|
resume?: {
|
|
141
105
|
responseId: string;
|
|
142
106
|
answers?: Record<string, Record<string, unknown>>;
|
|
143
107
|
};
|
|
144
108
|
}) => FormEngine;
|
|
145
|
-
//# sourceMappingURL=formEngine.d.ts.map
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Redirect handling (forms-sdk-plan.md rows 17/48), mirroring form-render's
|
|
3
|
-
* `handleRedirect.ts`:
|
|
4
|
-
*
|
|
5
|
-
* - Identity handoff: `leadId` and `sessionId` are appended as query params so
|
|
6
|
-
* the destination page's tag/SDK resolves the same visitor (row 17).
|
|
7
|
-
* - Protocol default matches `addProtocolToUrl` verbatim, including its quirk:
|
|
8
|
-
* the check is `startsWith("https")`, so an explicit `http://` URL gets
|
|
9
|
-
* double-prefixed. Replicated, not fixed — it's on the plan's
|
|
10
|
-
* replicate-then-review list territory (Phase 0 item 5); the parity harness
|
|
11
|
-
* compares against native.
|
|
12
|
-
* - Unparseable URLs pass through unchanged, blank URLs redirect nowhere.
|
|
13
|
-
* - `CurrentWindow` navigates `window.location` — the SDK runs first-party,
|
|
14
|
-
* which is exactly what native's `window.parent.location` resolves to on a
|
|
15
|
-
* top-level page. `NewTab` opens `_blank`.
|
|
16
|
-
* - Preview never navigates (native gates on preview/editing screens).
|
|
17
|
-
*
|
|
18
|
-
* The step engine owns *when* to redirect (per-step + thank-you triggers and
|
|
19
|
-
* the `redirectTimeout ?? 400 ms` delay — the default is exported here);
|
|
20
|
-
* parent-param forwarding via `redirectUrlParams` templating lands with the
|
|
21
|
-
* external-state store work (row 56).
|
|
22
|
-
*/
|
|
1
|
+
|
|
23
2
|
export type RedirectType = "NewTab" | "CurrentWindow";
|
|
24
3
|
export declare const DEFAULT_REDIRECT_TIMEOUT_MS = 400;
|
|
25
4
|
export declare const buildRedirectUrl: (url: string, { leadId, sessionId }?: {
|
|
@@ -33,4 +12,3 @@ export declare const performRedirect: ({ url, redirectType, leadId, sessionId, p
|
|
|
33
12
|
sessionId?: string;
|
|
34
13
|
preview?: boolean;
|
|
35
14
|
}) => void;
|
|
36
|
-
//# sourceMappingURL=redirect.d.ts.map
|
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* Response payload builders (forms-sdk-plan.md rows 24-26), mirroring
|
|
3
|
-
* form-render's `createResponseApiPayload` exactly — the semantics here are
|
|
4
|
-
* load-bearing server contracts:
|
|
5
|
-
*
|
|
6
|
-
* - **Full answer-set resend on every write** (row 26): all steps' answers
|
|
7
|
-
* plus every external-state entry as a pseudo-answer keyed by its stateId.
|
|
8
|
-
* Server-side UTM preservation depends on the URL_DATA entry riding every
|
|
9
|
-
* update.
|
|
10
|
-
* - `SCHEDULER_AVAILABILITY_DATA` entries are transient client-only data and
|
|
11
|
-
* are never persisted.
|
|
12
|
-
* - Surface-native booking detection: the first answer with
|
|
13
|
-
* `eventScheduled: true` and a non-Calendly/Cal.com `uri` stamps
|
|
14
|
-
* `meta.bookingId`.
|
|
15
|
-
* - `enrichedFields` precedence: person-attribute enrichment wins over the
|
|
16
|
-
* processed APOLLO_EMAIL_ENRICHMENT external state, `{}` as the floor.
|
|
17
|
-
* - `meta.cookies` is stripped when `trackCookies` is off.
|
|
18
|
-
* - Creates pin `responseShapeVersion: "2.0"`; updates carry `responseId`.
|
|
19
|
-
*
|
|
20
|
-
* Types are local structural mirrors of `ZFormResponseData` /
|
|
21
|
-
* `ZFormUpdateResponseData` (zero-runtime-deps); the contract test validates
|
|
22
|
-
* built payloads against the real schemas. Answer/external-state entry shapes
|
|
23
|
-
* are pass-through records — component state shapes belong to the engine.
|
|
24
|
-
*/
|
|
1
|
+
|
|
25
2
|
export type SingleFormResponse = {
|
|
26
3
|
questionId: string;
|
|
27
4
|
response: Record<string, unknown>;
|
|
28
5
|
};
|
|
29
|
-
|
|
6
|
+
|
|
30
7
|
export type AnswerStates = Record<string, Record<string, Record<string, unknown>>>;
|
|
31
|
-
|
|
8
|
+
|
|
32
9
|
export type ExternalStates = Record<string, {
|
|
33
10
|
type: string;
|
|
34
11
|
} & Record<string, unknown>>;
|
|
@@ -61,7 +38,7 @@ type BuildPayloadOptions = {
|
|
|
61
38
|
invalidResponse: boolean;
|
|
62
39
|
trackCookies: boolean;
|
|
63
40
|
meta?: Record<string, unknown>;
|
|
64
|
-
|
|
41
|
+
|
|
65
42
|
personAttributeEnrichedFields?: Record<string, unknown>;
|
|
66
43
|
fingerprint?: string;
|
|
67
44
|
leadSessionId?: string;
|
|
@@ -71,4 +48,3 @@ export declare const createUpdateResponsePayload: (options: BuildPayloadOptions
|
|
|
71
48
|
responseId: string;
|
|
72
49
|
}) => FormUpdateResponsePayload;
|
|
73
50
|
export {};
|
|
74
|
-
//# sourceMappingURL=responsePayload.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export type SchedulerProvider = "Surface" | "Calendly" | "Hubspot" | "Cal" | "SavvyCal" | "RevenueHero" | "ReclaimAI" | "Clari" | "ChiliCal" | "Zoom";
|
|
4
|
+
export type SchedulerBookingSummary = {
|
|
5
|
+
provider: SchedulerProvider;
|
|
6
|
+
|
|
7
|
+
uri: string;
|
|
8
|
+
meetingTime?: string;
|
|
9
|
+
meetingEndTime?: string;
|
|
10
|
+
inviteeName?: string;
|
|
11
|
+
guestEmails?: string;
|
|
12
|
+
ownerEmails?: string;
|
|
13
|
+
joinLink?: string;
|
|
14
|
+
|
|
15
|
+
raw?: unknown;
|
|
16
|
+
};
|
|
17
|
+
export type SchedulerLifecycleEvent = {
|
|
18
|
+
questionId: string;
|
|
19
|
+
stepId: string;
|
|
20
|
+
provider: SchedulerProvider;
|
|
21
|
+
} & ({
|
|
22
|
+
type: "viewed";
|
|
23
|
+
} | {
|
|
24
|
+
type: "date_selected";
|
|
25
|
+
date?: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: "slot_selected";
|
|
28
|
+
slot?: {
|
|
29
|
+
start: string;
|
|
30
|
+
end?: string;
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
type: "form_opened";
|
|
34
|
+
} | {
|
|
35
|
+
type: "booking_confirmed";
|
|
36
|
+
booking: SchedulerBookingSummary;
|
|
37
|
+
} | {
|
|
38
|
+
type: "booking_cancelled";
|
|
39
|
+
reason?: string;
|
|
40
|
+
});
|