@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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Wire shape for `POST /v1/workspaces/:id/sample-data`.
|
|
4
|
+
*
|
|
5
|
+
* The endpoint takes no body. The response is a count per object type, so a
|
|
6
|
+
* caller can tell the reader what the button just did without a second query.
|
|
7
|
+
*/
|
|
8
|
+
export interface SampleDataCounts {
|
|
9
|
+
readonly companies: number;
|
|
10
|
+
readonly people: number;
|
|
11
|
+
readonly positions: number;
|
|
12
|
+
readonly deals: number;
|
|
13
|
+
readonly planItems: number;
|
|
14
|
+
readonly notes: number;
|
|
15
|
+
readonly opportunities: number;
|
|
16
|
+
readonly raises: number;
|
|
17
|
+
readonly partnerships: number;
|
|
18
|
+
readonly enquiries: number;
|
|
19
|
+
readonly roles: number;
|
|
20
|
+
readonly candidates: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const sampleDataCountsSchema: z.ZodType<SampleDataCounts, unknown>;
|
|
23
|
+
//# sourceMappingURL=sampleData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleData.d.ts","sourceRoot":"","sources":["../src/sampleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CA8BrE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sampleDataCountsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
companies: z.number().int().nonnegative(),
|
|
5
|
+
people: z.number().int().nonnegative(),
|
|
6
|
+
positions: z.number().int().nonnegative(),
|
|
7
|
+
deals: z.number().int().nonnegative(),
|
|
8
|
+
plan_items: z.number().int().nonnegative(),
|
|
9
|
+
notes: z.number().int().nonnegative(),
|
|
10
|
+
opportunities: z.number().int().nonnegative(),
|
|
11
|
+
raises: z.number().int().nonnegative(),
|
|
12
|
+
partnerships: z.number().int().nonnegative(),
|
|
13
|
+
enquiries: z.number().int().nonnegative(),
|
|
14
|
+
roles: z.number().int().nonnegative(),
|
|
15
|
+
candidates: z.number().int().nonnegative(),
|
|
16
|
+
})
|
|
17
|
+
.transform((wire) => ({
|
|
18
|
+
companies: wire.companies,
|
|
19
|
+
people: wire.people,
|
|
20
|
+
positions: wire.positions,
|
|
21
|
+
deals: wire.deals,
|
|
22
|
+
planItems: wire.plan_items,
|
|
23
|
+
notes: wire.notes,
|
|
24
|
+
opportunities: wire.opportunities,
|
|
25
|
+
raises: wire.raises,
|
|
26
|
+
partnerships: wire.partnerships,
|
|
27
|
+
enquiries: wire.enquiries,
|
|
28
|
+
roles: wire.roles,
|
|
29
|
+
candidates: wire.candidates,
|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ACR,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,UAAU;IAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,aAAa,EAAE,IAAI,CAAC,aAAa;IACjC,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,YAAY,EAAE,IAAI,CAAC,YAAY;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,UAAU,EAAE,IAAI,CAAC,UAAU;CAC5B,CAAC,CACH,CAAA"}
|
package/dist/values.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const SOCIAL_NETWORK_LABELS: Readonly<Record<SocialNetworkId, str
|
|
|
37
37
|
* written and all publish events, but none of them has a detail page for a
|
|
38
38
|
* module to hang anything off.
|
|
39
39
|
*/
|
|
40
|
-
export declare const EXTENSIBLE_RECORD_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'role', 'candidate'];
|
|
40
|
+
export declare const EXTENSIBLE_RECORD_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'enquiry', 'role', 'candidate'];
|
|
41
41
|
export type ExtensibleRecordType = (typeof EXTENSIBLE_RECORD_TYPES)[number];
|
|
42
42
|
/**
|
|
43
43
|
* The record types a note, activity, decision, or plan item attaches to.
|
|
@@ -46,8 +46,10 @@ export type ExtensibleRecordType = (typeof EXTENSIBLE_RECORD_TYPES)[number];
|
|
|
46
46
|
* module can extend, but nothing attaches a note to it. Interview notes go on
|
|
47
47
|
* the Candidate, which is the person-and-role link.
|
|
48
48
|
*/
|
|
49
|
-
export declare const RECORD_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'candidate'];
|
|
49
|
+
export declare const RECORD_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'enquiry', 'candidate'];
|
|
50
50
|
export type RecordTargetType = (typeof RECORD_TARGET_TYPES)[number];
|
|
51
|
+
/** Human labels for `RECORD_TARGET_TYPES`. Used by any picker that names a type. */
|
|
52
|
+
export declare const RECORD_TARGET_TYPE_LABELS: Readonly<Record<RecordTargetType, string>>;
|
|
51
53
|
/**
|
|
52
54
|
* What `GET /v1/search` looks through, and the order its groups come back in.
|
|
53
55
|
*
|
|
@@ -59,7 +61,7 @@ export type RecordTargetType = (typeof RECORD_TARGET_TYPES)[number];
|
|
|
59
61
|
* only as the person holding it, and nobody searches for a Candidate by name
|
|
60
62
|
* without finding the Person first.
|
|
61
63
|
*/
|
|
62
|
-
export declare const SEARCH_COLLECTIONS: readonly ['handbook_page', 'person', 'role', 'company', 'deal', 'opportunity', 'raise', 'partnership', 'decision'];
|
|
64
|
+
export declare const SEARCH_COLLECTIONS: readonly ['handbook_page', 'person', 'role', 'company', 'enquiry', 'deal', 'opportunity', 'raise', 'partnership', 'decision'];
|
|
63
65
|
export type SearchCollection = (typeof SEARCH_COLLECTIONS)[number];
|
|
64
66
|
/** Whether a Role is still being hired for. */
|
|
65
67
|
export declare const ROLE_STATUSES: readonly ['open', 'closed'];
|
|
@@ -86,11 +88,11 @@ export declare const INTERVIEW_STAGE_LABELS: Readonly<Record<InterviewStage, str
|
|
|
86
88
|
/** Where a candidate enters the process when no stage is named. */
|
|
87
89
|
export declare const FIRST_INTERVIEW_STAGE: InterviewStage;
|
|
88
90
|
/**
|
|
89
|
-
* The
|
|
91
|
+
* The five pipelines whose board columns live in `pipeline_stages`. A Deal moves
|
|
90
92
|
* through `deal` stages and so on; the kinds are fixed even though the stages
|
|
91
93
|
* within each are workspace-configurable.
|
|
92
94
|
*/
|
|
93
|
-
export declare const PIPELINE_KINDS: readonly ['deal', 'opportunity', 'raise', 'partnership'];
|
|
95
|
+
export declare const PIPELINE_KINDS: readonly ['enquiry', 'deal', 'opportunity', 'raise', 'partnership'];
|
|
94
96
|
export type PipelineKind = (typeof PIPELINE_KINDS)[number];
|
|
95
97
|
/** Display names for `PIPELINE_KINDS`. "Fundraising" is what the nav calls a Raise. */
|
|
96
98
|
export declare const PIPELINE_KIND_LABELS: Readonly<Record<PipelineKind, string>>;
|
|
@@ -152,18 +154,34 @@ export type FormStatus = (typeof FORM_STATUSES)[number];
|
|
|
152
154
|
* uploads, multi-page forms and branching out of scope, and every type here is
|
|
153
155
|
* one `<input>`, `<textarea>` or `<select>`.
|
|
154
156
|
*/
|
|
155
|
-
export declare const FORM_FIELD_TYPES: readonly ['text', 'email', 'textarea', 'select'];
|
|
157
|
+
export declare const FORM_FIELD_TYPES: readonly ['text', 'email', 'textarea', 'select', 'consent', 'notice'];
|
|
156
158
|
export type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
|
|
159
|
+
/**
|
|
160
|
+
* The field types whose answer is stored as a boolean, not a string. A
|
|
161
|
+
* `consent` field renders as a checkbox whose label carries the consent
|
|
162
|
+
* statement; the answer records whether the visitor ticked it.
|
|
163
|
+
*/
|
|
164
|
+
export declare const FORM_BOOLEAN_FIELD_TYPES: readonly ['consent'];
|
|
165
|
+
export type FormBooleanFieldType = (typeof FORM_BOOLEAN_FIELD_TYPES)[number];
|
|
157
166
|
/**
|
|
158
167
|
* Where a field's answer lands on submit.
|
|
159
168
|
*
|
|
160
169
|
* `position.title` rather than a person field, because a job title belongs to the
|
|
161
170
|
* Person↔Company link and nowhere else. `submission` stores the answer without
|
|
162
171
|
* writing any CRM record, which is what a free-text "How can we help?" wants.
|
|
172
|
+
*
|
|
173
|
+
* A form asks for a name the way its author wants it asked: one `person.name`
|
|
174
|
+
* box, or the `person.first_name` / `person.last_name` pair most sign-up forms
|
|
175
|
+
* use. Mapping the pair and no `person.name` composes the display name from the
|
|
176
|
+
* two, so neither arrangement makes a nameless person. `salutation` and `suffix`
|
|
177
|
+
* are storable on a Person but are not offered here — a public form asking for
|
|
178
|
+
* them is rare enough that the choice is not worth the room in this list.
|
|
163
179
|
*/
|
|
164
|
-
export declare const FORM_FIELD_MAP_TARGETS: readonly ['person.name', 'person.email', 'company.name', 'company.domain', 'position.title', 'deal.name', 'submission'];
|
|
180
|
+
export declare const FORM_FIELD_MAP_TARGETS: readonly ['person.name', 'person.first_name', 'person.last_name', 'person.email', 'person.consent', 'company.name', 'company.domain', 'position.title', 'enquiry.name', 'deal.name', 'opportunity.name', 'partnership.name', 'submission'];
|
|
165
181
|
export type FormFieldMapTarget = (typeof FORM_FIELD_MAP_TARGETS)[number];
|
|
166
182
|
export declare const FORM_FIELD_MAP_TARGET_LABELS: Readonly<Record<FormFieldMapTarget, string>>;
|
|
183
|
+
/** The map target for a consent field. Repeats per purpose, unlike `person.email`. */
|
|
184
|
+
export declare const PERSON_CONSENT_TARGET: FormFieldMapTarget;
|
|
167
185
|
/** The one mapping a form cannot process without, and may carry at most once. */
|
|
168
186
|
export declare const PERSON_EMAIL_TARGET: FormFieldMapTarget;
|
|
169
187
|
/**
|
|
@@ -174,6 +192,14 @@ export declare const PERSON_EMAIL_TARGET: FormFieldMapTarget;
|
|
|
174
192
|
*/
|
|
175
193
|
export declare const FORM_OPTION_VALUE_TYPES: readonly ['string', 'number', 'boolean'];
|
|
176
194
|
export type FormOptionValueType = (typeof FORM_OPTION_VALUE_TYPES)[number];
|
|
195
|
+
/**
|
|
196
|
+
* Each post-submit action lands one of these on the submission's `action_log`.
|
|
197
|
+
* `ok` = the action ran; `skipped` = its precondition was absent (a company
|
|
198
|
+
* list on a submit that never resolved one); `error` = the savepoint rolled
|
|
199
|
+
* back so the rest of the submit could continue.
|
|
200
|
+
*/
|
|
201
|
+
export declare const FORM_ACTION_STATUSES: readonly ['ok', 'skipped', 'error'];
|
|
202
|
+
export type FormActionStatus = (typeof FORM_ACTION_STATUSES)[number];
|
|
177
203
|
/**
|
|
178
204
|
* The domain events a webhook can subscribe to.
|
|
179
205
|
*
|
|
@@ -205,7 +231,7 @@ export declare const WEBHOOK_STATUS_LABELS: Readonly<Record<WebhookStatus, strin
|
|
|
205
231
|
* three surfaces that carry tasks without being note targets — a Role, a
|
|
206
232
|
* Handbook page, and the workspace itself (`agent-tasks.md`).
|
|
207
233
|
*/
|
|
208
|
-
export declare const AGENT_TASK_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'candidate', 'role', 'handbook', 'workspace'];
|
|
234
|
+
export declare const AGENT_TASK_TARGET_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'enquiry', 'candidate', 'role', 'handbook', 'workspace'];
|
|
209
235
|
export type AgentTaskTargetType = (typeof AGENT_TASK_TARGET_TYPES)[number];
|
|
210
236
|
/** `primary` shows as a compact action; `overflow` lives under "More". */
|
|
211
237
|
export declare const AGENT_TASK_PLACEMENTS: readonly ['primary', 'overflow'];
|
|
@@ -219,4 +245,58 @@ export type AgentTaskPlacement = (typeof AGENT_TASK_PLACEMENTS)[number];
|
|
|
219
245
|
export declare const AGENT_RUN_STATUSES: readonly ['queued', 'running', 'succeeded', 'failed'];
|
|
220
246
|
export type AgentRunStatus = (typeof AGENT_RUN_STATUSES)[number];
|
|
221
247
|
export declare const AGENT_RUN_STATUS_LABELS: Readonly<Record<AgentRunStatus, string>>;
|
|
248
|
+
/**
|
|
249
|
+
* The seven record types a workspace may attach custom field definitions to.
|
|
250
|
+
*
|
|
251
|
+
* The ones that already carry `tags` and agent-oriented fields on the record
|
|
252
|
+
* itself. Role and Candidate are absent on purpose: hiring state hangs off the
|
|
253
|
+
* Candidate link and a Role is a header rather than a rich record, so the demand
|
|
254
|
+
* signal for custom fields on either has not landed. Kept separate from
|
|
255
|
+
* `RECORD_TARGET_TYPES` and `EXTENSIBLE_RECORD_TYPES` so a later addition here
|
|
256
|
+
* cannot silently widen either of those.
|
|
257
|
+
*/
|
|
258
|
+
export declare const CUSTOM_FIELD_OBJECT_TYPES: readonly ['person', 'company', 'deal', 'opportunity', 'partnership', 'raise', 'enquiry'];
|
|
259
|
+
export type CustomFieldObjectType = (typeof CUSTOM_FIELD_OBJECT_TYPES)[number];
|
|
260
|
+
export declare const CUSTOM_FIELD_OBJECT_TYPE_LABELS: Readonly<Record<CustomFieldObjectType, string>>;
|
|
261
|
+
/**
|
|
262
|
+
* The nine editor types a custom field can carry.
|
|
263
|
+
*
|
|
264
|
+
* Deliberately distinct from `FORM_FIELD_TYPES`: a form asks a stranger for four
|
|
265
|
+
* kinds of text over one submit; a custom field is a first-class attribute on a
|
|
266
|
+
* record with numeric, date, boolean and currency answers. Sharing one list
|
|
267
|
+
* would drag either surface toward the other's shape.
|
|
268
|
+
*
|
|
269
|
+
* `record_reference` is intentionally absent from v1 — it needs the polymorphic
|
|
270
|
+
* existence check and delete-transaction cleanup that Phase 2 owns.
|
|
271
|
+
*/
|
|
272
|
+
export declare const CUSTOM_FIELD_TYPES: readonly ['text', 'long_text', 'number', 'currency', 'date', 'checkbox', 'select', 'multi_select', 'url'];
|
|
273
|
+
export type CustomFieldType = (typeof CUSTOM_FIELD_TYPES)[number];
|
|
274
|
+
export declare const CUSTOM_FIELD_TYPE_LABELS: Readonly<Record<CustomFieldType, string>>;
|
|
275
|
+
/**
|
|
276
|
+
* The custom-field types whose definition carries an `options` list. Every
|
|
277
|
+
* other type stores its `options` as `[]` and any non-empty write is `422`.
|
|
278
|
+
*/
|
|
279
|
+
export declare const CUSTOM_FIELD_TYPES_WITH_OPTIONS: readonly ['select', 'multi_select'];
|
|
280
|
+
export type CustomFieldTypeWithOptions = (typeof CUSTOM_FIELD_TYPES_WITH_OPTIONS)[number];
|
|
281
|
+
/**
|
|
282
|
+
* The default a consent purpose starts with, and what a person without an
|
|
283
|
+
* explicit `person_consents` row inherits for that purpose. `unknown` is the
|
|
284
|
+
* safest default — silence about a person's wishes is not a grant.
|
|
285
|
+
*/
|
|
286
|
+
export declare const CONSENT_PURPOSE_STATUSES: readonly ['unknown', 'granted', 'withdrawn'];
|
|
287
|
+
export type ConsentPurposeStatus = (typeof CONSENT_PURPOSE_STATUSES)[number];
|
|
288
|
+
export declare const CONSENT_PURPOSE_STATUS_LABELS: Readonly<Record<ConsentPurposeStatus, string>>;
|
|
289
|
+
/**
|
|
290
|
+
* The explicit status on a `person_consents` row. `unknown` is deliberately
|
|
291
|
+
* absent: no row is the unknown, so a stored row always carries a decision.
|
|
292
|
+
*/
|
|
293
|
+
export declare const CONSENT_STATUSES: readonly ['granted', 'withdrawn'];
|
|
294
|
+
export type ConsentStatus = (typeof CONSENT_STATUSES)[number];
|
|
295
|
+
export declare const CONSENT_STATUS_LABELS: Readonly<Record<ConsentStatus, string>>;
|
|
296
|
+
/**
|
|
297
|
+
* Where a `person_consents` row came from. `form:<form_id>` and `list:<list_id>`
|
|
298
|
+
* are prefixed so the origin is inspectable; `import` and `manual` need no id.
|
|
299
|
+
*/
|
|
300
|
+
export declare const CONSENT_SOURCE_KINDS: readonly ['form', 'list', 'import', 'manual'];
|
|
301
|
+
export type ConsentSourceKind = (typeof CONSENT_SOURCE_KINDS)[number];
|
|
222
302
|
//# sourceMappingURL=values.d.ts.map
|
package/dist/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAO,MAAM,kBAAkB,YAAI,OAAO,EAAE,MAAM,EAAE,UAAU,CAAU,CAAA;AACxE,eAAO,MAAM,gBAAgB,YAC3B,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,UAAU,CACF,CAAA;AACV,eAAO,MAAM,mBAAmB,YAAI,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAA;AAEtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAClE,MAAM,MAAM,SAAS,GAAG,C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CAAA;AAEjF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
package/dist/values.js
CHANGED
|
@@ -74,6 +74,7 @@ export const EXTENSIBLE_RECORD_TYPES = [
|
|
|
74
74
|
'opportunity',
|
|
75
75
|
'partnership',
|
|
76
76
|
'raise',
|
|
77
|
+
'enquiry',
|
|
77
78
|
'role',
|
|
78
79
|
'candidate',
|
|
79
80
|
];
|
|
@@ -91,8 +92,20 @@ export const RECORD_TARGET_TYPES = [
|
|
|
91
92
|
'opportunity',
|
|
92
93
|
'partnership',
|
|
93
94
|
'raise',
|
|
95
|
+
'enquiry',
|
|
94
96
|
'candidate',
|
|
95
97
|
];
|
|
98
|
+
/** Human labels for `RECORD_TARGET_TYPES`. Used by any picker that names a type. */
|
|
99
|
+
export const RECORD_TARGET_TYPE_LABELS = {
|
|
100
|
+
person: 'Person',
|
|
101
|
+
company: 'Company',
|
|
102
|
+
deal: 'Deal',
|
|
103
|
+
opportunity: 'Opportunity',
|
|
104
|
+
partnership: 'Partnership',
|
|
105
|
+
raise: 'Raise',
|
|
106
|
+
enquiry: 'Enquiry',
|
|
107
|
+
candidate: 'Candidate',
|
|
108
|
+
};
|
|
96
109
|
/**
|
|
97
110
|
* What `GET /v1/search` looks through, and the order its groups come back in.
|
|
98
111
|
*
|
|
@@ -109,6 +122,7 @@ export const SEARCH_COLLECTIONS = [
|
|
|
109
122
|
'person',
|
|
110
123
|
'role',
|
|
111
124
|
'company',
|
|
125
|
+
'enquiry',
|
|
112
126
|
'deal',
|
|
113
127
|
'opportunity',
|
|
114
128
|
'raise',
|
|
@@ -157,13 +171,20 @@ export const INTERVIEW_STAGE_LABELS = {
|
|
|
157
171
|
/** Where a candidate enters the process when no stage is named. */
|
|
158
172
|
export const FIRST_INTERVIEW_STAGE = INTERVIEW_STAGES[0];
|
|
159
173
|
/**
|
|
160
|
-
* The
|
|
174
|
+
* The five pipelines whose board columns live in `pipeline_stages`. A Deal moves
|
|
161
175
|
* through `deal` stages and so on; the kinds are fixed even though the stages
|
|
162
176
|
* within each are workspace-configurable.
|
|
163
177
|
*/
|
|
164
|
-
export const PIPELINE_KINDS = [
|
|
178
|
+
export const PIPELINE_KINDS = [
|
|
179
|
+
'enquiry',
|
|
180
|
+
'deal',
|
|
181
|
+
'opportunity',
|
|
182
|
+
'raise',
|
|
183
|
+
'partnership',
|
|
184
|
+
];
|
|
165
185
|
/** Display names for `PIPELINE_KINDS`. "Fundraising" is what the nav calls a Raise. */
|
|
166
186
|
export const PIPELINE_KIND_LABELS = {
|
|
187
|
+
enquiry: 'Enquiry',
|
|
167
188
|
deal: 'Deal',
|
|
168
189
|
opportunity: 'Opportunity',
|
|
169
190
|
raise: 'Fundraising',
|
|
@@ -233,32 +254,59 @@ export const FORM_STATUSES = ['active', 'paused'];
|
|
|
233
254
|
* uploads, multi-page forms and branching out of scope, and every type here is
|
|
234
255
|
* one `<input>`, `<textarea>` or `<select>`.
|
|
235
256
|
*/
|
|
236
|
-
export const FORM_FIELD_TYPES = ['text', 'email', 'textarea', 'select'];
|
|
257
|
+
export const FORM_FIELD_TYPES = ['text', 'email', 'textarea', 'select', 'consent', 'notice'];
|
|
258
|
+
/**
|
|
259
|
+
* The field types whose answer is stored as a boolean, not a string. A
|
|
260
|
+
* `consent` field renders as a checkbox whose label carries the consent
|
|
261
|
+
* statement; the answer records whether the visitor ticked it.
|
|
262
|
+
*/
|
|
263
|
+
export const FORM_BOOLEAN_FIELD_TYPES = ['consent'];
|
|
237
264
|
/**
|
|
238
265
|
* Where a field's answer lands on submit.
|
|
239
266
|
*
|
|
240
267
|
* `position.title` rather than a person field, because a job title belongs to the
|
|
241
268
|
* Person↔Company link and nowhere else. `submission` stores the answer without
|
|
242
269
|
* writing any CRM record, which is what a free-text "How can we help?" wants.
|
|
270
|
+
*
|
|
271
|
+
* A form asks for a name the way its author wants it asked: one `person.name`
|
|
272
|
+
* box, or the `person.first_name` / `person.last_name` pair most sign-up forms
|
|
273
|
+
* use. Mapping the pair and no `person.name` composes the display name from the
|
|
274
|
+
* two, so neither arrangement makes a nameless person. `salutation` and `suffix`
|
|
275
|
+
* are storable on a Person but are not offered here — a public form asking for
|
|
276
|
+
* them is rare enough that the choice is not worth the room in this list.
|
|
243
277
|
*/
|
|
244
278
|
export const FORM_FIELD_MAP_TARGETS = [
|
|
245
279
|
'person.name',
|
|
280
|
+
'person.first_name',
|
|
281
|
+
'person.last_name',
|
|
246
282
|
'person.email',
|
|
283
|
+
'person.consent',
|
|
247
284
|
'company.name',
|
|
248
285
|
'company.domain',
|
|
249
286
|
'position.title',
|
|
287
|
+
'enquiry.name',
|
|
250
288
|
'deal.name',
|
|
289
|
+
'opportunity.name',
|
|
290
|
+
'partnership.name',
|
|
251
291
|
'submission',
|
|
252
292
|
];
|
|
253
293
|
export const FORM_FIELD_MAP_TARGET_LABELS = {
|
|
254
294
|
'person.name': 'Person · name',
|
|
295
|
+
'person.first_name': 'Person · first name',
|
|
296
|
+
'person.last_name': 'Person · last name',
|
|
255
297
|
'person.email': 'Person · email',
|
|
298
|
+
'person.consent': 'Person · consent',
|
|
256
299
|
'company.name': 'Company · name',
|
|
257
300
|
'company.domain': 'Company · domain',
|
|
258
301
|
'position.title': 'Position · title',
|
|
302
|
+
'enquiry.name': 'Enquiry · name',
|
|
259
303
|
'deal.name': 'Deal · name',
|
|
304
|
+
'opportunity.name': 'Opportunity · name',
|
|
305
|
+
'partnership.name': 'Partnership · name',
|
|
260
306
|
submission: 'Submission only',
|
|
261
307
|
};
|
|
308
|
+
/** The map target for a consent field. Repeats per purpose, unlike `person.email`. */
|
|
309
|
+
export const PERSON_CONSENT_TARGET = 'person.consent';
|
|
262
310
|
/** The one mapping a form cannot process without, and may carry at most once. */
|
|
263
311
|
export const PERSON_EMAIL_TARGET = 'person.email';
|
|
264
312
|
/**
|
|
@@ -268,6 +316,13 @@ export const PERSON_EMAIL_TARGET = 'person.email';
|
|
|
268
316
|
* the string means, so a consumer knows `"true"` was a checkbox and not a word.
|
|
269
317
|
*/
|
|
270
318
|
export const FORM_OPTION_VALUE_TYPES = ['string', 'number', 'boolean'];
|
|
319
|
+
/**
|
|
320
|
+
* Each post-submit action lands one of these on the submission's `action_log`.
|
|
321
|
+
* `ok` = the action ran; `skipped` = its precondition was absent (a company
|
|
322
|
+
* list on a submit that never resolved one); `error` = the savepoint rolled
|
|
323
|
+
* back so the rest of the submit could continue.
|
|
324
|
+
*/
|
|
325
|
+
export const FORM_ACTION_STATUSES = ['ok', 'skipped', 'error'];
|
|
271
326
|
/**
|
|
272
327
|
* The domain events a webhook can subscribe to.
|
|
273
328
|
*
|
|
@@ -311,6 +366,7 @@ export const AGENT_TASK_TARGET_TYPES = [
|
|
|
311
366
|
'opportunity',
|
|
312
367
|
'partnership',
|
|
313
368
|
'raise',
|
|
369
|
+
'enquiry',
|
|
314
370
|
'candidate',
|
|
315
371
|
'role',
|
|
316
372
|
'handbook',
|
|
@@ -331,4 +387,95 @@ export const AGENT_RUN_STATUS_LABELS = {
|
|
|
331
387
|
succeeded: 'Succeeded',
|
|
332
388
|
failed: 'Failed',
|
|
333
389
|
};
|
|
390
|
+
/**
|
|
391
|
+
* The seven record types a workspace may attach custom field definitions to.
|
|
392
|
+
*
|
|
393
|
+
* The ones that already carry `tags` and agent-oriented fields on the record
|
|
394
|
+
* itself. Role and Candidate are absent on purpose: hiring state hangs off the
|
|
395
|
+
* Candidate link and a Role is a header rather than a rich record, so the demand
|
|
396
|
+
* signal for custom fields on either has not landed. Kept separate from
|
|
397
|
+
* `RECORD_TARGET_TYPES` and `EXTENSIBLE_RECORD_TYPES` so a later addition here
|
|
398
|
+
* cannot silently widen either of those.
|
|
399
|
+
*/
|
|
400
|
+
export const CUSTOM_FIELD_OBJECT_TYPES = [
|
|
401
|
+
'person',
|
|
402
|
+
'company',
|
|
403
|
+
'deal',
|
|
404
|
+
'opportunity',
|
|
405
|
+
'partnership',
|
|
406
|
+
'raise',
|
|
407
|
+
'enquiry',
|
|
408
|
+
];
|
|
409
|
+
export const CUSTOM_FIELD_OBJECT_TYPE_LABELS = {
|
|
410
|
+
person: 'Person',
|
|
411
|
+
company: 'Company',
|
|
412
|
+
deal: 'Deal',
|
|
413
|
+
opportunity: 'Opportunity',
|
|
414
|
+
partnership: 'Partnership',
|
|
415
|
+
raise: 'Raise',
|
|
416
|
+
enquiry: 'Enquiry',
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* The nine editor types a custom field can carry.
|
|
420
|
+
*
|
|
421
|
+
* Deliberately distinct from `FORM_FIELD_TYPES`: a form asks a stranger for four
|
|
422
|
+
* kinds of text over one submit; a custom field is a first-class attribute on a
|
|
423
|
+
* record with numeric, date, boolean and currency answers. Sharing one list
|
|
424
|
+
* would drag either surface toward the other's shape.
|
|
425
|
+
*
|
|
426
|
+
* `record_reference` is intentionally absent from v1 — it needs the polymorphic
|
|
427
|
+
* existence check and delete-transaction cleanup that Phase 2 owns.
|
|
428
|
+
*/
|
|
429
|
+
export const CUSTOM_FIELD_TYPES = [
|
|
430
|
+
'text',
|
|
431
|
+
'long_text',
|
|
432
|
+
'number',
|
|
433
|
+
'currency',
|
|
434
|
+
'date',
|
|
435
|
+
'checkbox',
|
|
436
|
+
'select',
|
|
437
|
+
'multi_select',
|
|
438
|
+
'url',
|
|
439
|
+
];
|
|
440
|
+
export const CUSTOM_FIELD_TYPE_LABELS = {
|
|
441
|
+
text: 'Text',
|
|
442
|
+
long_text: 'Long text',
|
|
443
|
+
number: 'Number',
|
|
444
|
+
currency: 'Currency',
|
|
445
|
+
date: 'Date',
|
|
446
|
+
checkbox: 'Checkbox',
|
|
447
|
+
select: 'Select',
|
|
448
|
+
multi_select: 'Multi-select',
|
|
449
|
+
url: 'URL',
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* The custom-field types whose definition carries an `options` list. Every
|
|
453
|
+
* other type stores its `options` as `[]` and any non-empty write is `422`.
|
|
454
|
+
*/
|
|
455
|
+
export const CUSTOM_FIELD_TYPES_WITH_OPTIONS = ['select', 'multi_select'];
|
|
456
|
+
/**
|
|
457
|
+
* The default a consent purpose starts with, and what a person without an
|
|
458
|
+
* explicit `person_consents` row inherits for that purpose. `unknown` is the
|
|
459
|
+
* safest default — silence about a person's wishes is not a grant.
|
|
460
|
+
*/
|
|
461
|
+
export const CONSENT_PURPOSE_STATUSES = ['unknown', 'granted', 'withdrawn'];
|
|
462
|
+
export const CONSENT_PURPOSE_STATUS_LABELS = {
|
|
463
|
+
unknown: 'Unknown',
|
|
464
|
+
granted: 'Granted',
|
|
465
|
+
withdrawn: 'Withdrawn',
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* The explicit status on a `person_consents` row. `unknown` is deliberately
|
|
469
|
+
* absent: no row is the unknown, so a stored row always carries a decision.
|
|
470
|
+
*/
|
|
471
|
+
export const CONSENT_STATUSES = ['granted', 'withdrawn'];
|
|
472
|
+
export const CONSENT_STATUS_LABELS = {
|
|
473
|
+
granted: 'Granted',
|
|
474
|
+
withdrawn: 'Withdrawn',
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Where a `person_consents` row came from. `form:<form_id>` and `list:<list_id>`
|
|
478
|
+
* are prefixed so the origin is inspectable; `import` and `manual` need no id.
|
|
479
|
+
*/
|
|
480
|
+
export const CONSENT_SOURCE_KINDS = ['form', 'list', 'import', 'manual'];
|
|
334
481
|
//# sourceMappingURL=values.js.map
|
package/dist/values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAU,CAAA;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,SAAS;IACT,UAAU;CACF,CAAA;AACV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AAK;CACG,CAAA;AAIV,MAAM,CAAC,MAAM,wBAAwB,GAA8C;IACjF,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,GAAG,EAAE,KAAK;CACX,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAU,CAAA;AAIlF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAU,CAAA;AAIpF,MAAM,CAAC,MAAM,6BAA6B,GAAmD;IAC3F,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,WAAW,CAAU,CAAA;AAIjE,MAAM,CAAC,MAAM,qBAAqB,GAA4C;IAC5E,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA"}
|
package/package.json
CHANGED
package/src/account.ts
CHANGED
|
@@ -105,6 +105,47 @@ export function changePasswordBody(input: ChangePasswordInput): Record<string, u
|
|
|
105
105
|
return { current_password: input.currentPassword, new_password: input.newPassword }
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* A saved view state for one list page, keyed on a stable view id (`people`,
|
|
110
|
+
* `companies`, `deals`, …).
|
|
111
|
+
*
|
|
112
|
+
* `columns` order is the render order, so the same field carries visibility
|
|
113
|
+
* and position. Every field is optional so an old stored entry that only
|
|
114
|
+
* remembers columns still parses, and a page that adds a new knob later can
|
|
115
|
+
* store it without a migration. A field left unset means "use the page's
|
|
116
|
+
* default", which is why the hook falls back to `defaultVisible` when
|
|
117
|
+
* `columns` is absent rather than showing an empty table.
|
|
118
|
+
*
|
|
119
|
+
* `mode` covers pages that offer both a table and a board. `grouping`,
|
|
120
|
+
* `scope`, and `sort` carry page-defined slugs; the page decides which
|
|
121
|
+
* values it accepts and falls back to a default for anything it does not.
|
|
122
|
+
*/
|
|
123
|
+
export interface ListViewPreference {
|
|
124
|
+
readonly columns?: readonly string[]
|
|
125
|
+
readonly mode?: 'list' | 'columns'
|
|
126
|
+
readonly grouping?: string
|
|
127
|
+
readonly scope?: string
|
|
128
|
+
readonly sort?: string
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const listViewPreferenceSchema: z.ZodType<ListViewPreference, unknown> = z
|
|
132
|
+
.object({
|
|
133
|
+
columns: z.array(z.string()).optional(),
|
|
134
|
+
mode: z.enum(['list', 'columns']).optional(),
|
|
135
|
+
grouping: z.string().optional(),
|
|
136
|
+
scope: z.string().optional(),
|
|
137
|
+
sort: z.string().optional(),
|
|
138
|
+
})
|
|
139
|
+
.transform(
|
|
140
|
+
(wire): ListViewPreference => ({
|
|
141
|
+
...(wire.columns === undefined ? {} : { columns: wire.columns }),
|
|
142
|
+
...(wire.mode === undefined ? {} : { mode: wire.mode }),
|
|
143
|
+
...(wire.grouping === undefined ? {} : { grouping: wire.grouping }),
|
|
144
|
+
...(wire.scope === undefined ? {} : { scope: wire.scope }),
|
|
145
|
+
...(wire.sort === undefined ? {} : { sort: wire.sort }),
|
|
146
|
+
}),
|
|
147
|
+
)
|
|
148
|
+
|
|
108
149
|
/**
|
|
109
150
|
* Per-account settings that follow the person between browsers.
|
|
110
151
|
*
|
|
@@ -112,6 +153,10 @@ export function changePasswordBody(input: ChangePasswordInput): Record<string, u
|
|
|
112
153
|
* mailer: Kelpie sends no digest, mention, or product email yet. They record
|
|
113
154
|
* what to do when it does, and the Preferences page says so on screen rather
|
|
114
155
|
* than leaving a reader to infer a capability from a toggle.
|
|
156
|
+
*
|
|
157
|
+
* `listViews` is a map of view id to a column choice. The map is open: any
|
|
158
|
+
* client-defined view id is allowed, and a view id the client no longer
|
|
159
|
+
* recognises is ignored on read rather than raising a schema error.
|
|
115
160
|
*/
|
|
116
161
|
export interface AccountPreferences {
|
|
117
162
|
readonly timezone: string
|
|
@@ -119,6 +164,7 @@ export interface AccountPreferences {
|
|
|
119
164
|
readonly emailDigest: boolean
|
|
120
165
|
readonly mentionEmails: boolean
|
|
121
166
|
readonly productUpdates: boolean
|
|
167
|
+
readonly listViews: Readonly<Record<string, ListViewPreference>>
|
|
122
168
|
}
|
|
123
169
|
|
|
124
170
|
export const accountPreferencesSchema: z.ZodType<AccountPreferences, unknown> = z
|
|
@@ -128,6 +174,7 @@ export const accountPreferencesSchema: z.ZodType<AccountPreferences, unknown> =
|
|
|
128
174
|
email_digest: z.boolean(),
|
|
129
175
|
mention_emails: z.boolean(),
|
|
130
176
|
product_updates: z.boolean(),
|
|
177
|
+
list_views: z.record(z.string(), listViewPreferenceSchema).default({}),
|
|
131
178
|
})
|
|
132
179
|
.transform(
|
|
133
180
|
(wire): AccountPreferences => ({
|
|
@@ -136,6 +183,7 @@ export const accountPreferencesSchema: z.ZodType<AccountPreferences, unknown> =
|
|
|
136
183
|
emailDigest: wire.email_digest,
|
|
137
184
|
mentionEmails: wire.mention_emails,
|
|
138
185
|
productUpdates: wire.product_updates,
|
|
186
|
+
listViews: wire.list_views,
|
|
139
187
|
}),
|
|
140
188
|
)
|
|
141
189
|
|
|
@@ -145,6 +193,13 @@ export interface UpdateAccountPreferencesInput {
|
|
|
145
193
|
readonly emailDigest?: boolean
|
|
146
194
|
readonly mentionEmails?: boolean
|
|
147
195
|
readonly productUpdates?: boolean
|
|
196
|
+
/**
|
|
197
|
+
* Replaces the whole `listViews` map. Every top-level preference field
|
|
198
|
+
* follows the same rule: absent leaves the stored value alone, present
|
|
199
|
+
* overwrites it. Callers that only want to touch one view id read the
|
|
200
|
+
* current map first and PATCH the merged result.
|
|
201
|
+
*/
|
|
202
|
+
readonly listViews?: Readonly<Record<string, ListViewPreference>>
|
|
148
203
|
}
|
|
149
204
|
|
|
150
205
|
export function updateAccountPreferencesBody(
|
|
@@ -156,5 +211,6 @@ export function updateAccountPreferencesBody(
|
|
|
156
211
|
email_digest: input.emailDigest,
|
|
157
212
|
mention_emails: input.mentionEmails,
|
|
158
213
|
product_updates: input.productUpdates,
|
|
214
|
+
list_views: input.listViews,
|
|
159
215
|
})
|
|
160
216
|
}
|