@kelpie/schemas 0.7.0 → 0.9.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/dist/account.d.ts +35 -0
- package/dist/account.d.ts.map +1 -1
- package/dist/account.js +18 -0
- package/dist/account.js.map +1 -1
- package/dist/company.d.ts +11 -0
- package/dist/company.d.ts.map +1 -1
- package/dist/company.js +7 -0
- package/dist/company.js.map +1 -1
- package/dist/consentPurpose.d.ts +49 -0
- package/dist/consentPurpose.d.ts.map +1 -0
- package/dist/consentPurpose.js +40 -0
- package/dist/consentPurpose.js.map +1 -0
- package/dist/customField.d.ts +99 -0
- package/dist/customField.d.ts.map +1 -0
- package/dist/customField.js +133 -0
- package/dist/customField.js.map +1 -0
- package/dist/deal.d.ts +8 -0
- package/dist/deal.d.ts.map +1 -1
- package/dist/deal.js +4 -0
- package/dist/deal.js.map +1 -1
- package/dist/emailDomainLinker.d.ts +16 -0
- package/dist/emailDomainLinker.d.ts.map +1 -0
- package/dist/emailDomainLinker.js +11 -0
- package/dist/emailDomainLinker.js.map +1 -0
- package/dist/enquiry.d.ts +43 -0
- package/dist/enquiry.d.ts.map +1 -0
- package/dist/enquiry.js +47 -0
- package/dist/enquiry.js.map +1 -0
- package/dist/form.d.ts +117 -2
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +102 -1
- package/dist/form.js.map +1 -1
- package/dist/formSubmission.d.ts +29 -0
- package/dist/formSubmission.d.ts.map +1 -1
- package/dist/formSubmission.js +34 -0
- package/dist/formSubmission.js.map +1 -1
- package/dist/importExport.d.ts +28 -4
- package/dist/importExport.d.ts.map +1 -1
- package/dist/importExport.js +25 -2
- package/dist/importExport.js.map +1 -1
- package/dist/index.d.ts +27 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/list.d.ts +44 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +41 -0
- package/dist/list.js.map +1 -0
- package/dist/listMember.d.ts +24 -0
- package/dist/listMember.d.ts.map +1 -0
- package/dist/listMember.js +27 -0
- package/dist/listMember.js.map +1 -0
- package/dist/listMembership.d.ts +20 -0
- package/dist/listMembership.d.ts.map +1 -0
- package/dist/listMembership.js +23 -0
- package/dist/listMembership.js.map +1 -0
- package/dist/names.d.ts +43 -0
- package/dist/names.d.ts.map +1 -0
- package/dist/names.js +35 -0
- package/dist/names.js.map +1 -0
- package/dist/opportunity.d.ts +10 -0
- package/dist/opportunity.d.ts.map +1 -1
- package/dist/opportunity.js +7 -0
- package/dist/opportunity.js.map +1 -1
- package/dist/partnership.d.ts +8 -0
- package/dist/partnership.d.ts.map +1 -1
- package/dist/partnership.js +4 -0
- package/dist/partnership.js.map +1 -1
- package/dist/person.d.ts +42 -1
- package/dist/person.d.ts.map +1 -1
- package/dist/person.js +23 -0
- package/dist/person.js.map +1 -1
- package/dist/personConsent.d.ts +31 -0
- package/dist/personConsent.d.ts.map +1 -0
- package/dist/personConsent.js +27 -0
- package/dist/personConsent.js.map +1 -0
- package/dist/raise.d.ts +8 -0
- package/dist/raise.d.ts.map +1 -1
- package/dist/raise.js +4 -0
- package/dist/raise.js.map +1 -1
- package/dist/sampleData.d.ts +23 -0
- package/dist/sampleData.d.ts.map +1 -0
- package/dist/sampleData.js +31 -0
- package/dist/sampleData.js.map +1 -0
- package/dist/values.d.ts +88 -8
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +150 -3
- package/dist/values.js.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +56 -0
- package/src/company.ts +19 -0
- package/src/consentPurpose.ts +95 -0
- package/src/customField.ts +211 -0
- package/src/deal.ts +13 -0
- package/src/emailDomainLinker.ts +28 -0
- package/src/enquiry.ts +94 -0
- package/src/form.ts +230 -2
- package/src/formSubmission.ts +63 -0
- package/src/importExport.ts +45 -6
- package/src/index.ts +86 -2
- package/src/list.ts +89 -0
- package/src/listMember.ts +54 -0
- package/src/listMembership.ts +45 -0
- package/src/names.ts +49 -0
- package/src/opportunity.ts +18 -0
- package/src/partnership.ts +13 -0
- package/src/person.ts +69 -1
- package/src/personConsent.ts +60 -0
- package/src/raise.ts +13 -0
- package/src/sampleData.ts +55 -0
- package/src/values.ts +180 -3
package/dist/deal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deal.js","sourceRoot":"","sources":["../src/deal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"deal.js","sourceRoot":"","sources":["../src/deal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEjF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AA0BrE,MAAM,CAAC,MAAM,UAAU,GAA6B,CAAC;KAClD,MAAM,CAAC;IACN,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;IAC7B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,KAAK,EA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AAK,CAAC,UAAU;QAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,OAAO;QACvB,cAAc,EAAE,KAAK,CAAC,aAAa;QACnC,UAAU,EAAE,KAAK,CAAC,SAAS;QAC3B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,aAAa,EACX,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC;KAC3F,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Wire shape for `POST /v1/workspaces/:id/relink-email-domains`.
|
|
4
|
+
*
|
|
5
|
+
* The endpoint takes no body. The response counts what the sweep did: how
|
|
6
|
+
* many Companies were scanned and how many titleless Positions were newly
|
|
7
|
+
* created. A follow-up run on the same workspace returns the same count for
|
|
8
|
+
* `companies_scanned` and zero for `positions_created` — the sweep is
|
|
9
|
+
* idempotent (a person already linked to that company is skipped).
|
|
10
|
+
*/
|
|
11
|
+
export interface RelinkEmailDomainsCounts {
|
|
12
|
+
readonly companiesScanned: number;
|
|
13
|
+
readonly positionsCreated: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const relinkEmailDomainsCountsSchema: z.ZodType<RelinkEmailDomainsCounts, unknown>;
|
|
16
|
+
//# sourceMappingURL=emailDomainLinker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailDomainLinker.d.ts","sourceRoot":"","sources":["../src/emailDomainLinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;GAQG;AAEH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAwB,EAAE,OAAO,CAUrF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const relinkEmailDomainsCountsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
companies_scanned: z.number().int().nonnegative(),
|
|
5
|
+
positions_created: z.number().int().nonnegative(),
|
|
6
|
+
})
|
|
7
|
+
.transform((wire) => ({
|
|
8
|
+
companiesScanned: wire.companies_scanned,
|
|
9
|
+
positionsCreated: wire.positions_created,
|
|
10
|
+
}));
|
|
11
|
+
//# sourceMappingURL=emailDomainLinker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailDomainLinker.js","sourceRoot":"","sources":["../src/emailDomainLinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,MAAM,CAAC,MAAM,8BAA8B,GAAiD,CAAC;KAC1F,MAAM,CAAC;IACN,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACjD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CAClD,CAAC;KACD,SAAS,CACR,CAAC,IAAI,EAA4B,EAAE,CAAC,CAAC;IACnC,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;IACxC,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;CACzC,CAAC,CACH,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CustomFieldValue, CustomFieldValues } from './customField.ts';
|
|
3
|
+
import type { RecordTimestamps } from './wire.ts';
|
|
4
|
+
/** Wire and write shapes for `/v1/enquiries`. */
|
|
5
|
+
export interface Enquiry extends RecordTimestamps {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** Free text ("Website", "Email", "Referral", …), like Opportunity's `kind`. */
|
|
9
|
+
readonly source: string;
|
|
10
|
+
readonly stageId: string;
|
|
11
|
+
/** Nullable: an early enquiry may arrive before a company is on file. */
|
|
12
|
+
readonly companyId: string | null;
|
|
13
|
+
readonly ownerId: string | null;
|
|
14
|
+
/** Non-null once the enquiry has been converted to a Deal; nulled if that deal is deleted. */
|
|
15
|
+
readonly convertedDealId: string | null;
|
|
16
|
+
readonly personIds: readonly string[];
|
|
17
|
+
readonly summary: string;
|
|
18
|
+
readonly tags: readonly string[];
|
|
19
|
+
/** Workspace-defined fields, keyed by definition key. Always present (default `{}`). */
|
|
20
|
+
readonly customFields: CustomFieldValues;
|
|
21
|
+
}
|
|
22
|
+
export declare const enquirySchema: z.ZodType<Enquiry, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* `convertedDealId` is deliberately absent from the input: it is set only by
|
|
25
|
+
* `POST /v1/enquiries/:id/convert`, and a `PATCH` that carried it is `422`.
|
|
26
|
+
*/
|
|
27
|
+
export interface EnquiryInput {
|
|
28
|
+
readonly name?: string;
|
|
29
|
+
readonly source?: string;
|
|
30
|
+
readonly stageId?: string;
|
|
31
|
+
readonly companyId?: string | null;
|
|
32
|
+
readonly ownerId?: string | null;
|
|
33
|
+
readonly personIds?: readonly string[];
|
|
34
|
+
readonly summary?: string;
|
|
35
|
+
readonly tags?: readonly string[];
|
|
36
|
+
/**
|
|
37
|
+
* Partial merge patch: sent keys change, `null` clears a key, absent keys are
|
|
38
|
+
* left alone. Unknown keys are rejected at `422`.
|
|
39
|
+
*/
|
|
40
|
+
readonly customFields?: Readonly<Record<string, CustomFieldValue | null>>;
|
|
41
|
+
}
|
|
42
|
+
export declare function enquiryBody(input: EnquiryInput): Record<string, unknown>;
|
|
43
|
+
//# sourceMappingURL=enquiry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enquiry.d.ts","sourceRoot":"","sources":["../src/enquiry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEjD,iDAAiD;AAEjD,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,8FAA8F;IAC9F,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,wFAAwF;IACxF,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAA;CACzC;AAED,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CA+BnD,CAAA;AAEH;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAA;CAC1E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAaxE"}
|
package/dist/enquiry.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { customFieldValuesBody, customFieldValuesSchema } from './customField.js';
|
|
3
|
+
import { definedFields, idSchema, recordTimestamps } from './wire.js';
|
|
4
|
+
export const enquirySchema = z
|
|
5
|
+
.object({
|
|
6
|
+
id: idSchema,
|
|
7
|
+
name: z.string(),
|
|
8
|
+
source: z.string(),
|
|
9
|
+
stage_id: idSchema,
|
|
10
|
+
company_id: idSchema.nullable(),
|
|
11
|
+
owner_id: idSchema.nullable(),
|
|
12
|
+
converted_deal_id: idSchema.nullable(),
|
|
13
|
+
person_ids: z.array(idSchema),
|
|
14
|
+
summary: z.string(),
|
|
15
|
+
tags: z.array(z.string()),
|
|
16
|
+
custom_fields: customFieldValuesSchema,
|
|
17
|
+
...recordTimestamps,
|
|
18
|
+
})
|
|
19
|
+
.transform((wire) => ({
|
|
20
|
+
id: wire.id,
|
|
21
|
+
name: wire.name,
|
|
22
|
+
source: wire.source,
|
|
23
|
+
stageId: wire.stage_id,
|
|
24
|
+
companyId: wire.company_id,
|
|
25
|
+
ownerId: wire.owner_id,
|
|
26
|
+
convertedDealId: wire.converted_deal_id,
|
|
27
|
+
personIds: wire.person_ids,
|
|
28
|
+
summary: wire.summary,
|
|
29
|
+
tags: wire.tags,
|
|
30
|
+
customFields: wire.custom_fields,
|
|
31
|
+
createdAt: wire.created_at,
|
|
32
|
+
updatedAt: wire.updated_at,
|
|
33
|
+
}));
|
|
34
|
+
export function enquiryBody(input) {
|
|
35
|
+
return definedFields({
|
|
36
|
+
name: input.name,
|
|
37
|
+
source: input.source,
|
|
38
|
+
stage_id: input.stageId,
|
|
39
|
+
company_id: input.companyId,
|
|
40
|
+
owner_id: input.ownerId,
|
|
41
|
+
person_ids: input.personIds,
|
|
42
|
+
summary: input.summary,
|
|
43
|
+
tags: input.tags,
|
|
44
|
+
custom_fields: input.customFields === undefined ? undefined : customFieldValuesBody(input.customFields),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=enquiry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enquiry.js","sourceRoot":"","sources":["../src/enquiry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEjF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAuBrE,MAAM,CAAC,MAAM,aAAa,GAAgC,CAAC;KACxD,MAAM,CAAC;IACN,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ,CAAC,QAAQ,EAAE;I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AChB,aAAa,EACX,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC;KAC3F,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { FormFieldMapTarget, FormFieldType, FormOptionValueType, FormStatus } from './values.ts';
|
|
2
|
+
import type { FormFieldMapTarget, FormFieldType, FormOptionValueType, FormStatus, PipelineKind } from './values.ts';
|
|
3
3
|
import type { RecordTimestamps } from './wire.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Wire and write shapes for `/v1/forms`, the embeddable inbound capture from
|
|
@@ -29,12 +29,44 @@ export interface FormField {
|
|
|
29
29
|
/** Empty for every type but `select`. */
|
|
30
30
|
readonly options: readonly FormFieldOption[];
|
|
31
31
|
readonly placeholder: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* The intro sentence for a `consent` field — sits above the list of purpose
|
|
34
|
+
* checkboxes. `label` is the field heading; `statement` is what the visitor
|
|
35
|
+
* reads before ticking. Null for every other type.
|
|
36
|
+
*/
|
|
37
|
+
readonly statement: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Workspace consent purposes this `consent` field offers, in display order.
|
|
40
|
+
* Non-empty when `type === 'consent'`; empty otherwise. Each ticked box
|
|
41
|
+
* grants the purpose it belongs to; an unticked one is absence.
|
|
42
|
+
*/
|
|
43
|
+
readonly consentPurposeIds: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* Per-purpose override for the checkbox text, keyed by purpose id. Absent
|
|
46
|
+
* keys fall back to the workspace purpose's own label. Only the wording
|
|
47
|
+
* changes — the checkbox stays bound to its purpose.
|
|
48
|
+
*/
|
|
49
|
+
readonly consentPurposeLabels: Readonly<Record<string, string>>;
|
|
32
50
|
/** Position in the form, contiguous from 0. The server renumbers on every write. */
|
|
33
51
|
readonly sortOrder: number;
|
|
34
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* One pre-existing pipeline record every submitter is linked into through
|
|
55
|
+
* `person_links`. `target_type` is fixed at form-write time; the row itself
|
|
56
|
+
* lives in `form_attach_targets` on the server.
|
|
57
|
+
*/
|
|
58
|
+
export interface FormAttachTarget {
|
|
59
|
+
readonly targetType: PipelineKind;
|
|
60
|
+
readonly targetId: string;
|
|
61
|
+
}
|
|
35
62
|
export interface Form extends RecordTimestamps {
|
|
36
63
|
readonly id: string;
|
|
37
64
|
readonly name: string;
|
|
65
|
+
/**
|
|
66
|
+
* Heading on the hosted/embed page. Defaults to `name` when the form is
|
|
67
|
+
* created; edit it from Settings without renaming the form in the CRM.
|
|
68
|
+
*/
|
|
69
|
+
readonly title: string;
|
|
38
70
|
readonly description: string | null;
|
|
39
71
|
readonly status: FormStatus;
|
|
40
72
|
readonly fields: readonly FormField[];
|
|
@@ -44,6 +76,39 @@ export interface Form extends RecordTimestamps {
|
|
|
44
76
|
readonly dealStageId: string | null;
|
|
45
77
|
/** Expands `{{company.name}}` and `{{person.name}}`. Null when `createDeal` is off. */
|
|
46
78
|
readonly dealNameTemplate: string | null;
|
|
79
|
+
readonly createOpportunity: boolean;
|
|
80
|
+
/** Required when `createOpportunity` is on: opportunities carry a `kind`. */
|
|
81
|
+
readonly opportunityKind: string | null;
|
|
82
|
+
readonly opportunityStageId: string | null;
|
|
83
|
+
readonly opportunityNameTemplate: string | null;
|
|
84
|
+
/** Null falls back to the workspace default member at submit time. */
|
|
85
|
+
readonly opportunityOwnerId: string | null;
|
|
86
|
+
readonly createPartnership: boolean;
|
|
87
|
+
/** Required when `createPartnership` is on. */
|
|
88
|
+
readonly partnershipKind: string | null;
|
|
89
|
+
readonly partnershipStageId: string | null;
|
|
90
|
+
readonly partnershipNameTemplate: string | null;
|
|
91
|
+
/** Null falls back to the workspace default member at submit time. */
|
|
92
|
+
readonly partnershipOwnerId: string | null;
|
|
93
|
+
readonly createEnquiry: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Free-text label for the enquiry's `source` column. Optional: an unset value
|
|
96
|
+
* stores an empty string. Enquiry needs no `kind` because it has no `kind`
|
|
97
|
+
* column — a form's source is the source.
|
|
98
|
+
*/
|
|
99
|
+
readonly enquirySource: string | null;
|
|
100
|
+
readonly enquiryStageId: string | null;
|
|
101
|
+
readonly enquiryNameTemplate: string | null;
|
|
102
|
+
/** Null falls back to the workspace default member at submit time. */
|
|
103
|
+
readonly enquiryOwnerId: string | null;
|
|
104
|
+
/** Tags to merge (union) into the resolved Person's `tags` on every submit. */
|
|
105
|
+
readonly personTags: readonly string[];
|
|
106
|
+
/** Tags to merge (union) into the resolved Company's `tags`; skipped when no company resolved. */
|
|
107
|
+
readonly companyTags: readonly string[];
|
|
108
|
+
/** Lists (person or company) every matching record is added to on submit. */
|
|
109
|
+
readonly listIds: readonly string[];
|
|
110
|
+
/** Pre-existing pipeline records the submitter is linked to via `person_links`. */
|
|
111
|
+
readonly attachTargets: readonly FormAttachTarget[];
|
|
47
112
|
/**
|
|
48
113
|
* The handle the public submit and embed endpoints resolve a workspace from.
|
|
49
114
|
* Globally unique, and the only credential those endpoints take.
|
|
@@ -70,9 +135,17 @@ export interface FormFieldInput {
|
|
|
70
135
|
readonly mapTo: FormFieldMapTarget;
|
|
71
136
|
readonly options?: readonly FormFieldOptionInput[];
|
|
72
137
|
readonly placeholder?: string | null;
|
|
138
|
+
/** The intro sentence above the list of consent checkboxes. */
|
|
139
|
+
readonly statement?: string | null;
|
|
140
|
+
/** Non-empty for `consent` fields; each id becomes a checkbox in display order. */
|
|
141
|
+
readonly consentPurposeIds?: readonly string[];
|
|
142
|
+
/** Per-purpose override for the checkbox text. Falls back to the workspace label. */
|
|
143
|
+
readonly consentPurposeLabels?: Readonly<Record<string, string>>;
|
|
73
144
|
}
|
|
74
145
|
export interface CreateFormInput {
|
|
75
146
|
readonly name: string;
|
|
147
|
+
/** Defaults to `name` when omitted. */
|
|
148
|
+
readonly title?: string;
|
|
76
149
|
readonly description?: string | null;
|
|
77
150
|
readonly status?: FormStatus;
|
|
78
151
|
readonly fields: readonly FormFieldInput[];
|
|
@@ -80,10 +153,33 @@ export interface CreateFormInput {
|
|
|
80
153
|
readonly createDeal?: boolean;
|
|
81
154
|
readonly dealStageId?: string | null;
|
|
82
155
|
readonly dealNameTemplate?: string | null;
|
|
156
|
+
readonly createOpportunity?: boolean;
|
|
157
|
+
readonly opportunityKind?: string | null;
|
|
158
|
+
readonly opportunityStageId?: string | null;
|
|
159
|
+
readonly opportunityNameTemplate?: string | null;
|
|
160
|
+
readonly opportunityOwnerId?: string | null;
|
|
161
|
+
readonly createPartnership?: boolean;
|
|
162
|
+
readonly partnershipKind?: string | null;
|
|
163
|
+
readonly partnershipStageId?: string | null;
|
|
164
|
+
readonly partnershipNameTemplate?: string | null;
|
|
165
|
+
readonly partnershipOwnerId?: string | null;
|
|
166
|
+
readonly createEnquiry?: boolean;
|
|
167
|
+
readonly enquirySource?: string | null;
|
|
168
|
+
readonly enquiryStageId?: string | null;
|
|
169
|
+
readonly enquiryNameTemplate?: string | null;
|
|
170
|
+
readonly enquiryOwnerId?: string | null;
|
|
171
|
+
readonly personTags?: readonly string[];
|
|
172
|
+
readonly companyTags?: readonly string[];
|
|
173
|
+
readonly listIds?: readonly string[];
|
|
174
|
+
readonly attachTargets?: readonly FormAttachTarget[];
|
|
83
175
|
}
|
|
84
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* `fields`, `list_ids`, and `attach_targets` are each absent or the whole list;
|
|
178
|
+
* there is no per-entry patch.
|
|
179
|
+
*/
|
|
85
180
|
export interface FormInput {
|
|
86
181
|
readonly name?: string;
|
|
182
|
+
readonly title?: string;
|
|
87
183
|
readonly description?: string | null;
|
|
88
184
|
readonly status?: FormStatus;
|
|
89
185
|
readonly fields?: readonly FormFieldInput[];
|
|
@@ -91,6 +187,25 @@ export interface FormInput {
|
|
|
91
187
|
readonly createDeal?: boolean;
|
|
92
188
|
readonly dealStageId?: string | null;
|
|
93
189
|
readonly dealNameTemplate?: string | null;
|
|
190
|
+
readonly createOpportunity?: boolean;
|
|
191
|
+
readonly opportunityKind?: string | null;
|
|
192
|
+
readonly opportunityStageId?: string | null;
|
|
193
|
+
readonly opportunityNameTemplate?: string | null;
|
|
194
|
+
readonly opportunityOwnerId?: string | null;
|
|
195
|
+
readonly createPartnership?: boolean;
|
|
196
|
+
readonly partnershipKind?: string | null;
|
|
197
|
+
readonly partnershipStageId?: string | null;
|
|
198
|
+
readonly partnershipNameTemplate?: string | null;
|
|
199
|
+
readonly partnershipOwnerId?: string | null;
|
|
200
|
+
readonly createEnquiry?: boolean;
|
|
201
|
+
readonly enquirySource?: string | null;
|
|
202
|
+
readonly enquiryStageId?: string | null;
|
|
203
|
+
readonly enquiryNameTemplate?: string | null;
|
|
204
|
+
readonly enquiryOwnerId?: string | null;
|
|
205
|
+
readonly personTags?: readonly string[];
|
|
206
|
+
readonly companyTags?: readonly string[];
|
|
207
|
+
readonly listIds?: readonly string[];
|
|
208
|
+
readonly attachTargets?: readonly FormAttachTarget[];
|
|
94
209
|
}
|
|
95
210
|
export declare function createFormBody(input: CreateFormInput): Record<string, unknown>;
|
|
96
211
|
export declare function formBody(input: FormInput): Record<string, unknown>;
|
package/dist/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,YAAY,EACb,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAA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
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { FORM_FIELD_MAP_TARGETS, FORM_FIELD_TYPES, FORM_OPTION_VALUE_TYPES, FORM_STATUSES, } from './values.js';
|
|
2
|
+
import { FORM_FIELD_MAP_TARGETS, FORM_FIELD_TYPES, FORM_OPTION_VALUE_TYPES, FORM_STATUSES, PIPELINE_KINDS, } from './values.js';
|
|
3
3
|
import { definedFields, idSchema, recordTimestamps } from './wire.js';
|
|
4
4
|
const formFieldOptionSchema = z
|
|
5
5
|
.object({
|
|
@@ -21,6 +21,9 @@ const formFieldSchema = z
|
|
|
21
21
|
map_to: z.enum(FORM_FIELD_MAP_TARGETS),
|
|
22
22
|
options: z.array(formFieldOptionSchema),
|
|
23
23
|
placeholder: z.string().nullable(),
|
|
24
|
+
statement: z.string().nullable(),
|
|
25
|
+
consent_purpose_ids: z.array(idSchema),
|
|
26
|
+
consent_purpose_labels: z.record(z.string(), z.string()),
|
|
24
27
|
sort_order: z.number().int(),
|
|
25
28
|
})
|
|
26
29
|
.transform((wire) => ({
|
|
@@ -31,12 +34,25 @@ const formFieldSchema = z
|
|
|
31
34
|
mapTo: wire.map_to,
|
|
32
35
|
options: wire.options,
|
|
33
36
|
placeholder: wire.placeholder,
|
|
37
|
+
statement: wire.statement,
|
|
38
|
+
consentPurposeIds: wire.consent_purpose_ids,
|
|
39
|
+
consentPurposeLabels: wire.consent_purpose_labels,
|
|
34
40
|
sortOrder: wire.sort_order,
|
|
35
41
|
}));
|
|
42
|
+
const attachTargetSchema = z
|
|
43
|
+
.object({
|
|
44
|
+
target_type: z.enum(PIPELINE_KINDS),
|
|
45
|
+
target_id: idSchema,
|
|
46
|
+
})
|
|
47
|
+
.transform((wire) => ({
|
|
48
|
+
targetType: wire.target_type,
|
|
49
|
+
targetId: wire.target_id,
|
|
50
|
+
}));
|
|
36
51
|
export const formSchema = z
|
|
37
52
|
.object({
|
|
38
53
|
id: idSchema,
|
|
39
54
|
name: z.string(),
|
|
55
|
+
title: z.string(),
|
|
40
56
|
description: z.string().nullable(),
|
|
41
57
|
status: z.enum(FORM_STATUSES),
|
|
42
58
|
fields: z.array(formFieldSchema),
|
|
@@ -44,12 +60,32 @@ export const formSchema = z
|
|
|
44
60
|
create_deal: z.boolean(),
|
|
45
61
|
deal_stage_id: idSchema.nullable(),
|
|
46
62
|
deal_name_template: z.string().nullable(),
|
|
63
|
+
create_opportunity: z.boolean(),
|
|
64
|
+
opportunity_kind: z.string().nullable(),
|
|
65
|
+
opportunity_stage_id: idSchema.nullable(),
|
|
66
|
+
opportunity_name_template: z.string().nullable(),
|
|
67
|
+
opportunity_owner_id: idSchema.nullable(),
|
|
68
|
+
create_partnership: z.boolean(),
|
|
69
|
+
partnership_kind: z.string().nullable(),
|
|
70
|
+
partnership_stage_id: idSchema.nullable(),
|
|
71
|
+
partnership_name_template: z.string().nullable(),
|
|
72
|
+
partnership_owner_id: idSchema.nullable(),
|
|
73
|
+
create_enquiry: z.boolean(),
|
|
74
|
+
enquiry_source: z.string().nullable(),
|
|
75
|
+
enquiry_stage_id: idSchema.nullable(),
|
|
76
|
+
enquiry_name_template: z.string().nullable(),
|
|
77
|
+
enquiry_owner_id: idSchema.nullable(),
|
|
78
|
+
person_tags: z.array(z.string()),
|
|
79
|
+
company_tags: z.array(z.string()),
|
|
80
|
+
list_ids: z.array(idSchema),
|
|
81
|
+
attach_targets: z.array(attachTargetSchema),
|
|
47
82
|
public_key: z.string(),
|
|
48
83
|
...recordTimestamps,
|
|
49
84
|
})
|
|
50
85
|
.transform((wire) => ({
|
|
51
86
|
id: wire.id,
|
|
52
87
|
name: wire.name,
|
|
88
|
+
title: wire.title,
|
|
53
89
|
description: wire.description,
|
|
54
90
|
status: wire.status,
|
|
55
91
|
fields: wire.fields,
|
|
@@ -57,6 +93,25 @@ export const formSchema = z
|
|
|
57
93
|
createDeal: wire.create_deal,
|
|
58
94
|
dealStageId: wire.deal_stage_id,
|
|
59
95
|
dealNameTemplate: wire.deal_name_template,
|
|
96
|
+
createOpportunity: wire.create_opportunity,
|
|
97
|
+
opportunityKind: wire.opportunity_kind,
|
|
98
|
+
opportunityStageId: wire.opportunity_stage_id,
|
|
99
|
+
opportunityNameTemplate: wire.opportunity_name_template,
|
|
100
|
+
opportunityOwnerId: wire.opportunity_owner_id,
|
|
101
|
+
createPartnership: wire.create_partnership,
|
|
102
|
+
partnershipKind: wire.partnership_kind,
|
|
103
|
+
partnershipStageId: wire.partnership_stage_id,
|
|
104
|
+
partnershipNameTemplate: wire.partnership_name_template,
|
|
105
|
+
partnershipOwnerId: wire.partnership_owner_id,
|
|
106
|
+
createEnquiry: wire.create_enquiry,
|
|
107
|
+
enquirySource: wire.enquiry_source,
|
|
108
|
+
enquiryStageId: wire.enquiry_stage_id,
|
|
109
|
+
enquiryNameTemplate: wire.enquiry_name_template,
|
|
110
|
+
enquiryOwnerId: wire.enquiry_owner_id,
|
|
111
|
+
personTags: wire.person_tags,
|
|
112
|
+
companyTags: wire.company_tags,
|
|
113
|
+
listIds: wire.list_ids,
|
|
114
|
+
attachTargets: wire.attach_targets,
|
|
60
115
|
publicKey: wire.public_key,
|
|
61
116
|
createdAt: wire.created_at,
|
|
62
117
|
updatedAt: wire.updated_at,
|
|
@@ -69,11 +124,18 @@ function fieldBody(field) {
|
|
|
69
124
|
map_to: field.mapTo,
|
|
70
125
|
options: field.options?.map((option) => definedFields({ key: option.key, value: option.value, value_type: option.valueType })),
|
|
71
126
|
placeholder: field.placeholder,
|
|
127
|
+
statement: field.statement,
|
|
128
|
+
consent_purpose_ids: field.consentPurposeIds,
|
|
129
|
+
consent_purpose_labels: field.consentPurposeLabels,
|
|
72
130
|
});
|
|
73
131
|
}
|
|
132
|
+
function attachTargetBody(target) {
|
|
133
|
+
return { target_type: target.targetType, target_id: target.targetId };
|
|
134
|
+
}
|
|
74
135
|
export function createFormBody(input) {
|
|
75
136
|
return definedFields({
|
|
76
137
|
name: input.name,
|
|
138
|
+
title: input.title,
|
|
77
139
|
description: input.description,
|
|
78
140
|
status: input.status,
|
|
79
141
|
fields: input.fields.map(fieldBody),
|
|
@@ -81,11 +143,31 @@ export function createFormBody(input) {
|
|
|
81
143
|
create_deal: input.createDeal,
|
|
82
144
|
deal_stage_id: input.dealStageId,
|
|
83
145
|
deal_name_template: input.dealNameTemplate,
|
|
146
|
+
create_opportunity: input.createOpportunity,
|
|
147
|
+
opportunity_kind: input.opportunityKind,
|
|
148
|
+
opportunity_stage_id: input.opportunityStageId,
|
|
149
|
+
opportunity_name_template: input.opportunityNameTemplate,
|
|
150
|
+
opportunity_owner_id: input.opportunityOwnerId,
|
|
151
|
+
create_partnership: input.createPartnership,
|
|
152
|
+
partnership_kind: input.partnershipKind,
|
|
153
|
+
partnership_stage_id: input.partnershipStageId,
|
|
154
|
+
partnership_name_template: input.partnershipNameTemplate,
|
|
155
|
+
partnership_owner_id: input.partnershipOwnerId,
|
|
156
|
+
create_enquiry: input.createEnquiry,
|
|
157
|
+
enquiry_source: input.enquirySource,
|
|
158
|
+
enquiry_stage_id: input.enquiryStageId,
|
|
159
|
+
enquiry_name_template: input.enquiryNameTemplate,
|
|
160
|
+
enquiry_owner_id: input.enquiryOwnerId,
|
|
161
|
+
person_tags: input.personTags,
|
|
162
|
+
company_tags: input.companyTags,
|
|
163
|
+
list_ids: input.listIds,
|
|
164
|
+
attach_targets: input.attachTargets?.map(attachTargetBody),
|
|
84
165
|
});
|
|
85
166
|
}
|
|
86
167
|
export function formBody(input) {
|
|
87
168
|
return definedFields({
|
|
88
169
|
name: input.name,
|
|
170
|
+
title: input.title,
|
|
89
171
|
description: input.description,
|
|
90
172
|
status: input.status,
|
|
91
173
|
fields: input.fields?.map(fieldBody),
|
|
@@ -93,6 +175,25 @@ export function formBody(input) {
|
|
|
93
175
|
create_deal: input.createDeal,
|
|
94
176
|
deal_stage_id: input.dealStageId,
|
|
95
177
|
deal_name_template: input.dealNameTemplate,
|
|
178
|
+
create_opportunity: input.createOpportunity,
|
|
179
|
+
opportunity_kind: input.opportunityKind,
|
|
180
|
+
opportunity_stage_id: input.opportunityStageId,
|
|
181
|
+
opportunity_name_template: input.opportunityNameTemplate,
|
|
182
|
+
opportunity_owner_id: input.opportunityOwnerId,
|
|
183
|
+
create_partnership: input.createPartnership,
|
|
184
|
+
partnership_kind: input.partnershipKind,
|
|
185
|
+
partnership_stage_id: input.partnershipStageId,
|
|
186
|
+
partnership_name_template: input.partnershipNameTemplate,
|
|
187
|
+
partnership_owner_id: input.partnershipOwnerId,
|
|
188
|
+
create_enquiry: input.createEnquiry,
|
|
189
|
+
enquiry_source: input.enquirySource,
|
|
190
|
+
enquiry_stage_id: input.enquiryStageId,
|
|
191
|
+
enquiry_name_template: input.enquiryNameTemplate,
|
|
192
|
+
enquiry_owner_id: input.enquiryOwnerId,
|
|
193
|
+
person_tags: input.personTags,
|
|
194
|
+
company_tags: input.companyTags,
|
|
195
|
+
list_ids: input.listIds,
|
|
196
|
+
attach_targets: input.attachTargets?.map(attachTargetBody),
|
|
96
197
|
});
|
|
97
198
|
}
|
|
98
199
|
//# sourceMappingURL=form.js.map
|
package/dist/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAA;AAQpB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AA0HrE,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,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,CAAC,kBAAkB;QAC9C,kBAAkB,EAAE,KAAK,CAAC,iBAAiB;QAC3C,gBAAgB,EAAE,KAAK,CAAC,eAAe;QACvC,oBAAoB,EAAE,KAAK,CAAC,kBAAkB;QAC9C,yBAAyB,EAAE,KAAK,CAAC,uBAAuB;QACxD,oBAAoB,EAAE,KAAK,CAAC,kBAAkB;QAC9C,cAAc,EAAE,KAAK,CAAC,aAAa;QACnC,cAAc,EAAE,KAAK,CAAC,aAAa;QACnC,gBAAgB,EAAE,KAAK,CAAC,cAAc;QACtC,qBAAqB,EAAE,KAAK,CAAC,mBAAmB;QAChD,gBAAgB,EAAE,KAAK,CAAC,cAAc;QACtC,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW;QAC/B,QAAQ,EAAE,KAAK,CAAC,OAAO;QACvB,cAAc,EAAE,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,gBAAgB,CAAC;KAC3D,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/formSubmission.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { FormActionStatus } from './values.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The record types a submission can name through its FK columns. Used by
|
|
5
|
+
* `GET /v1/form-submissions?target_type=…` so the query, the server, and the
|
|
6
|
+
* UI hook agree on the seven values.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FORM_SUBMISSION_LINK_TARGETS: readonly ['person', 'company', 'position', 'deal', 'opportunity', 'partnership', 'enquiry'];
|
|
9
|
+
export type FormSubmissionLinkTarget = (typeof FORM_SUBMISSION_LINK_TARGETS)[number];
|
|
2
10
|
/**
|
|
3
11
|
* Wire shape for `/v1/forms/:id/submissions`, and for what the public submit
|
|
4
12
|
* endpoint answers with.
|
|
@@ -7,6 +15,18 @@ import { z } from 'zod';
|
|
|
7
15
|
* no create body here (the public endpoint takes an answer map, not a
|
|
8
16
|
* submission) and no update at all.
|
|
9
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* One post-submit action's outcome. The submission's `actionLog` carries these
|
|
20
|
+
* in the order the runner attempted them, so a reader can see what ran, what
|
|
21
|
+
* was skipped, and what rolled back.
|
|
22
|
+
*/
|
|
23
|
+
export interface FormSubmissionActionEntry {
|
|
24
|
+
/** A machine name for the action ('create_deal', 'tag_person', 'add_list'…). */
|
|
25
|
+
readonly action: string;
|
|
26
|
+
readonly status: FormActionStatus;
|
|
27
|
+
/** Human-readable message. Never a stack trace; safe for the Submissions UI. */
|
|
28
|
+
readonly detail: string;
|
|
29
|
+
}
|
|
10
30
|
export interface FormSubmission {
|
|
11
31
|
readonly id: string;
|
|
12
32
|
readonly formId: string;
|
|
@@ -22,6 +42,15 @@ export interface FormSubmission {
|
|
|
22
42
|
readonly companyId: string | null;
|
|
23
43
|
readonly positionId: string | null;
|
|
24
44
|
readonly dealId: string | null;
|
|
45
|
+
readonly opportunityId: string | null;
|
|
46
|
+
readonly partnershipId: string | null;
|
|
47
|
+
readonly enquiryId: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Per-action outcome from the post-submit runner, in the order attempted.
|
|
50
|
+
* Only actions the form was configured to run appear; a form with no
|
|
51
|
+
* post-actions has an empty log.
|
|
52
|
+
*/
|
|
53
|
+
readonly actionLog: readonly FormSubmissionActionEntry[];
|
|
25
54
|
readonly createdAt: Date;
|
|
26
55
|
}
|
|
27
56
|
export declare const formSubmissionSchema: z.ZodType<FormSubmission, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formSubmission.d.ts","sourceRoot":"","sources":["../src/formSubmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"formSubmission.d.ts","sourceRoot":"","sources":["../src/formSubmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,K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