@wirecat/cli-core 0.639.0 → 0.641.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/CHANGELOG.md +83 -0
- package/dist/cli/messenger/backfill-command.js +16 -1
- package/dist/cli/messenger/search-answers.js +2 -0
- package/dist/cli/store-settings.d.ts +4 -1
- package/dist/cli/store-settings.js +26 -9
- package/dist/crm/cli/csv.js +2 -0
- package/dist/crm/cli/index.js +8 -2
- package/dist/crm/cli/search-all.js +4 -4
- package/dist/crm/stage-tasks.d.ts +8 -0
- package/dist/crm/stage-tasks.js +42 -0
- package/dist/domain/crm.d.ts +9 -0
- package/dist/domain/name-variants.d.ts +2 -0
- package/dist/domain/name-variants.js +107 -0
- package/dist/domain/person-kinds.d.ts +6 -3
- package/dist/domain/person-kinds.js +5 -2
- package/dist/entities/contact-activity.d.ts +3 -0
- package/dist/entities/contact-activity.js +3 -0
- package/dist/entities/contact-context.d.ts +6 -0
- package/dist/entities/deal.d.ts +6 -0
- package/dist/entities/deal.js +3 -0
- package/dist/entities/index.d.ts +10 -0
- package/dist/errors/reasons.js +2 -1
- package/dist/resolve.d.ts +8 -0
- package/dist/resolve.js +48 -6
- package/dist/runs/events.d.ts +9 -1
- package/dist/runs/events.js +5 -1
- package/dist/runs/log-events.js +2 -0
- package/dist/search/lucene/registry.js +17 -15
- package/dist/services/deal-context.js +17 -0
- package/dist/services/message-resolution.d.ts +13 -1
- package/dist/services/message-resolution.js +44 -3
- package/dist/services/messages-search.js +41 -20
- package/dist/services/metadata.d.ts +1 -1
- package/dist/services/search-all.d.ts +10 -3
- package/dist/services/search-all.js +10 -4
- package/dist/store/index.d.ts +2 -2
- package/dist/store/people.d.ts +10 -3
- package/dist/store/people.js +2 -1
- package/dist/store/sqlite/accounts.js +2 -0
- package/dist/store/sqlite/crm-rows.js +2 -0
- package/dist/store/sqlite/crm-settings.d.ts +26 -1
- package/dist/store/sqlite/crm-settings.js +104 -1
- package/dist/store/sqlite/crm.d.ts +12 -0
- package/dist/store/sqlite/crm.js +9 -1
- package/dist/store/sqlite/deals.d.ts +28 -5
- package/dist/store/sqlite/deals.js +158 -14
- package/dist/store/sqlite/hit-places.js +19 -6
- package/dist/store/sqlite/identities.js +21 -1
- package/dist/store/sqlite/lucene-fields.d.ts +2 -1
- package/dist/store/sqlite/lucene-fields.js +129 -16
- package/dist/store/sqlite/lucene.js +8 -8
- package/dist/store/sqlite/note-search.js +9 -0
- package/dist/store/sqlite/people-list.js +14 -8
- package/dist/store/sqlite/person-doubts.d.ts +13 -3
- package/dist/store/sqlite/person-doubts.js +92 -48
- package/dist/store/sqlite/person-links.js +15 -2
- package/dist/store/sqlite/tasks.js +9 -8
- package/dist/store/sqlite/test-people.d.ts +24 -0
- package/dist/store/sqlite/test-people.js +92 -0
- package/dist/store/types.d.ts +6 -0
- package/dist/tasks/model.d.ts +6 -2
- package/dist/tasks/service.d.ts +2 -0
- package/docs/search/recipes.json +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,89 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
|
|
|
5
5
|
minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
|
|
6
6
|
shape of this file.
|
|
7
7
|
|
|
8
|
+
## 0.641.0 — 11.11.2026
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **A deal or a lead keeps the person and company its CRM holds on the item itself.** A lead often has no contact or
|
|
13
|
+
company linked yet; its own name and company were all it said of who it is, and they were dropped. `CrmItem` takes
|
|
14
|
+
`contactName` and `companyName`, the store keeps them, `deals show` and `leads show` answer them as `contact_name`
|
|
15
|
+
and `company_name` (marked untrusted, as a CRM's users or a web form wrote them), the CSV export has both columns, and
|
|
16
|
+
`search all` finds the item by them, the name as a contact and the company as a company. See
|
|
17
|
+
[ARCHITECTURE.md](docs/dev/ARCHITECTURE.md).
|
|
18
|
+
- **A deal or lead entering a stage opens a local task.** The owner's setting `crm.<provider>:<account>.stage-tasks`
|
|
19
|
+
maps a stage to a task, `{"<stage id>": {"title": "…", "due_days": 2}}`, a lead's stage as `lead:<stage id>`. After
|
|
20
|
+
each CRM `sync`, every move into such a stage since the last sync opens one task, due that many days later, whose
|
|
21
|
+
description names the deal, the stage and the responsible user. A move counts once: a dismissed task never comes
|
|
22
|
+
back, and entering the stage again opens a new one. Moves made before the setting was first saved, and a new row's
|
|
23
|
+
first stage, open none. The sync answer's `stage_tasks` says how many it opened, a deal's context lists them, and
|
|
24
|
+
an agent cannot change the setting. See
|
|
25
|
+
[KNOWLEDGE.md, "Relationships a source reports"](docs/dev/KNOWLEDGE.md#relationships-a-source-reports).
|
|
26
|
+
- **`NewTask.title` and `description`.** A rule that knows what to do gives its task a title and a description.
|
|
27
|
+
- **A part inside a word in chat messages.** `*договор*` without a field, or under `text:` or `exact:`, finds «Договор», «ДОГОВОРЫ» and «переговоры» through the store's index of three-letter pieces of message text, which every store already has. A large archive no longer refuses it, and it works inside `AND`/`OR`/`NOT`, groups, and with `chat:` and `date:`. Case does not matter, and ё and е are one letter; other letters match as typed. The part needs three letters in a row. `*вор`, `*дог*вор` and `*гов?р*` use the same index and are then checked word by word; a part found in too many messages is `query.too-large`, which `chat:`, `date:` or `*part*` avoid. Mail, transcripts and file text keep the word list and its `word*` hint.
|
|
28
|
+
- **A run's log keeps the progress of `messages sync`.** Each progress line is also a `sync.progress` event with its counts, whatever the output format, so `runs show` tells what a desktop app's bar showed and when ([reference](docs/REFERENCE.md)).
|
|
29
|
+
|
|
30
|
+
### Changed — may break callers
|
|
31
|
+
|
|
32
|
+
- **`Deal` has two more fields, `contactName` and `companyName` (`string | null`).** A caller that builds a whole
|
|
33
|
+
`Deal` adds both; the `deal` and `lead` entities require `contact_name` and `company_name`. The CSV export of deals
|
|
34
|
+
and leads has the two new columns after `organization`, so a reader that takes columns by position moves past them.
|
|
35
|
+
- **`*part*` in chat-message text no longer folds й/и or accents.** Through the word list, `*мои*` also found «мой» and `*cafe*` found «café»; through the trigram index the part matches as typed, except case and ё/е. Write the letter as the text has it, or search the whole word (`мой`), which still folds them.
|
|
36
|
+
- **CRM search no longer matches inside a word.** `cement` no longer finds `replacement`, nor «кто» «Вектор». A query
|
|
37
|
+
word shorter than four letters matches only a whole word.
|
|
38
|
+
- **`search all stage:won` skips deals and leads with the reason** instead of finding none and calling the answer
|
|
39
|
+
complete; so do `status:` and `pipeline:`. `deals list stage:<name>` lists them by stage.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **A search over chats and mail together says when mail was left out.** Mail refused for a reason other than a messenger field (such as `*word*` over a large mailbox) used to drop out silently, so the answer looked complete; it is now listed under `skipped` with the reason.
|
|
44
|
+
- **`to:`, `cc:` and `bcc:` name themselves when nobody matches.** The error said `from:owner — nobody matches` for `to:owner`.
|
|
45
|
+
- **`list:` in a search without a mail account is refused** as `subject:` and `to:` are (`query.unsupported-field`, "list: is a mail field"), instead of finding nothing.
|
|
46
|
+
- **`search all` finds deals and leads by any form of a word, and by their company and contacts.** A query word
|
|
47
|
+
matches a stored word it begins or one of the same stem, so «поставки цемента» finds «Поставка цемента» and
|
|
48
|
+
`repairs` finds `Forklift repair`. A deal's or a lead's company name and its contacts' names, e-mails and phones are
|
|
49
|
+
searched too, never the owner's, and a CRM copy only by what its own CRM holds of them, so a locked profile learns
|
|
50
|
+
nothing of a person's other accounts; `+79161234567` finds `+7 916 123-45-67`. `found_by` stays `title` when the title
|
|
51
|
+
matched and is `words` when only the company or a contact did. `deals.find` gives each hit's `matched` parts. See
|
|
52
|
+
[ARCHITECTURE.md](docs/dev/ARCHITECTURE.md).
|
|
53
|
+
- **A misspelt CRM search is corrected once.** When nothing matches as typed, a word is corrected to the nearest
|
|
54
|
+
stored words, as messages search does, and those hits carry `match: "corrected"` and `corrections`. `--exact` turns
|
|
55
|
+
forms, word beginnings and correction off.
|
|
56
|
+
- **`messages sync --all` reports progress while a chat is read.** Its progress line on stderr came only when a chat was finished, so a chat of many paced pages showed the same count for minutes, and a desktop app's bar stood still at the first chat. Every page now updates `fetched`, with the chat totals of `--all`.
|
|
57
|
+
|
|
58
|
+
## 0.640.0 — 11.11.2026
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
|
|
62
|
+
- **Part of a name in `from:`, `to:`, `cc:`, `bcc:` and `chat:`.** An unquoted value with `*` or `?` is a pattern over names, aliases and @usernames (titles for chats; addresses too in mail): `from:Ярослав*` finds «Ярослав» and «Ярослав Орлов», `from:*Орлов*` anyone with it inside, `chat:*отчет*` every chat with it in the title. The search reads them all. Case, ё/е and letter forms do not matter. A pattern that fits nobody is `not_found` with the nearest names; more than 50 fits is `query.too-large`. An id and an exact name work as before.
|
|
63
|
+
- **An ambiguous name lists more choices.** When several people are named exactly as typed, the error's candidates also list the people whose name only contains it, so «Ярослав» offers «Ярослав Орлов» too.
|
|
64
|
+
- **Wildcards in `mailbox:`, `label:` and `tag:`, and a word's start in `subject:`, `content:` and `transcript:`** (`mailbox:Proj*`, `tag:work-*`, `subject:отчет*`, `content:накладн*`).
|
|
65
|
+
- **A bare word's start looks where a bare word does.** `invoi*` without a field now also finds the word in voice transcripts, file text and file names, as `invoice` does, and says where (`matched_in`).
|
|
66
|
+
- **Test data is hidden from people lists.** A person whose every identity has a seed id or an address at a reserved
|
|
67
|
+
domain (`example.com`, `.test`, `.invalid` and the like) is of the new kind `test`, which every kind and `all` leave
|
|
68
|
+
out; `people.list({ kind: "test" })` lists them. `people.markTestData` hides a person the owner calls test data, and
|
|
69
|
+
`people.keep` on a hidden person brings them back as a real contact. Both are kept in the store, so every computer
|
|
70
|
+
sees them. See [ARCHITECTURE.md, "Who is shown"](docs/dev/ARCHITECTURE.md).
|
|
71
|
+
- **Every phone and address of a CRM contact.** `CrmPerson.phones` and `emails`, and `PersonFacts.phones` and
|
|
72
|
+
`emails`, keep all of them on the identity; a linked identity gives them as `phones` and `emails`, its `phone` and
|
|
73
|
+
`email` among them.
|
|
74
|
+
|
|
75
|
+
### Changed — may break callers
|
|
76
|
+
|
|
77
|
+
- **`PersonKind` has a sixth kind, `test`.** A caller that keeps a record of every kind adds it; `people.list` and
|
|
78
|
+
`people.counts` give it, and `kind: "all"` leaves it out.
|
|
79
|
+
|
|
80
|
+
- **A doubt about test data asks only when unsure.** A seed name alone is a `test-data` doubt with the move
|
|
81
|
+
`{ op: "test-data", person }` (`people links resolve <who> test`), and `keep` now answers it as a real contact
|
|
82
|
+
instead of refusing it with `person.test-data`, which is no longer raised. A test identity on a person who holds a real one is a doubt with an
|
|
83
|
+
unlink. Sure test data is no longer a doubt.
|
|
84
|
+
- **A short form of a name, or a name that repeats the mailbox, is no second name.** Ярик and Ярослав, Bob and Robert,
|
|
85
|
+
and a Drive or mail identity named after its own address no longer make a `shared-address` or `mixed-names` doubt.
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- **`*word*` in the text names the way out.** A pattern that starts with `*` reads every indexed word; over the expansion budget its error now suggests `word*`, which also finds the word's forms.
|
|
90
|
+
|
|
8
91
|
## 0.639.0 — 11.11.2026
|
|
9
92
|
|
|
10
93
|
### Changed — may break callers
|
|
@@ -7,6 +7,7 @@ import { Command } from "commander";
|
|
|
7
7
|
import { parseDuration } from "../../domain/duration.js";
|
|
8
8
|
import { isCliFailure } from "../../errors/failures.js";
|
|
9
9
|
import { envName } from "../../ports/app.js";
|
|
10
|
+
import { runEvent } from "../../runs/scope.js";
|
|
10
11
|
import { FETCHING } from "../../services/archive.js";
|
|
11
12
|
import { JOBS_QUERY, jobItems } from "../../services/job-query.js";
|
|
12
13
|
import { dateWindow } from "../../services/moment.js";
|
|
@@ -172,6 +173,8 @@ export const syncCommand = (messenger) => {
|
|
|
172
173
|
const stop = stopOnSignal(this);
|
|
173
174
|
// A background job keeps its log as it was; its progress is the job file.
|
|
174
175
|
const progress = syncProgress(stepLines(context.streams.diagnostic, !jobId && context.format !== "pretty"));
|
|
176
|
+
// One chat of --all can take minutes of paced pages: its pages move the count, not only its end.
|
|
177
|
+
let walked = { chats: 0, done: 0, fetched: 0 };
|
|
175
178
|
try {
|
|
176
179
|
const options = {
|
|
177
180
|
limit,
|
|
@@ -189,8 +192,13 @@ export const syncCommand = (messenger) => {
|
|
|
189
192
|
updateJob(jobs, jobId, { progress: { ...page, at: new Date().toISOString() } });
|
|
190
193
|
if (chat !== undefined)
|
|
191
194
|
progress({ chats: null, chats_done: null, fetched: page.fetched });
|
|
195
|
+
else
|
|
196
|
+
progress({ chats: walked.chats, chats_done: walked.done, fetched: walked.fetched + page.fetched });
|
|
197
|
+
},
|
|
198
|
+
onChat: (counts) => {
|
|
199
|
+
walked = counts;
|
|
200
|
+
progress({ chats: counts.chats, chats_done: counts.done, fetched: counts.fetched }, counts.done === 0 || counts.done === counts.chats);
|
|
192
201
|
},
|
|
193
|
-
onChat: ({ chats, done, fetched }) => progress({ chats, chats_done: done, fetched }, done === 0 || done === chats),
|
|
194
202
|
};
|
|
195
203
|
const result = await context.withServices((services) => chat === undefined ? services.archive.fetchAll(options) : services.archive.fetch(chat, options));
|
|
196
204
|
if (jobId)
|
|
@@ -258,6 +266,7 @@ const PROGRESS_EVERY_MS = 500;
|
|
|
258
266
|
/**
|
|
259
267
|
* `messages sync`'s progress for a window to draw a bar by: counts only, because the lines reach a desktop app and
|
|
260
268
|
* its logs — never a chat's id or title. `always` keeps the first and the last line of `--all` through the throttle.
|
|
269
|
+
* The run's log gets the same counts as `sync.progress`, whatever the output format.
|
|
261
270
|
*/
|
|
262
271
|
const syncProgress = (emit) => {
|
|
263
272
|
let last = Number.NEGATIVE_INFINITY;
|
|
@@ -267,6 +276,12 @@ const syncProgress = (emit) => {
|
|
|
267
276
|
return;
|
|
268
277
|
last = now;
|
|
269
278
|
emit({ event: "progress", step: "sync", ...counts });
|
|
279
|
+
runEvent({
|
|
280
|
+
event: "progress",
|
|
281
|
+
operation: "sync.progress",
|
|
282
|
+
kind: "progress",
|
|
283
|
+
counts: Object.fromEntries(Object.entries(counts).filter((entry) => entry[1] !== null)),
|
|
284
|
+
});
|
|
270
285
|
};
|
|
271
286
|
};
|
|
272
287
|
/**
|
|
@@ -332,6 +332,8 @@ export const allHitItem = (item) => item.kind === "meeting"
|
|
|
332
332
|
sender_is_me: item.senderIsMe,
|
|
333
333
|
sender_ref: item.from?.ref,
|
|
334
334
|
found_by: item.foundBy,
|
|
335
|
+
match: item.match,
|
|
336
|
+
corrections: item.corrections,
|
|
335
337
|
review: item.review,
|
|
336
338
|
source_record: item.sourceRecord === undefined
|
|
337
339
|
? undefined
|
|
@@ -7,7 +7,10 @@ export declare const STORE_SETTINGS: string[];
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const storeSettingsOf: (app: Pick<AppIdentity, "messenger">) => string[];
|
|
9
9
|
export declare const offersStoreSetting: (app: Pick<AppIdentity, "messenger">, setting: string) => boolean;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Whose deals a CRM copy holds and what opens the owner's tasks: the owner's to set; an agent's run is stopped from
|
|
12
|
+
* changing them by mistake.
|
|
13
|
+
*/
|
|
11
14
|
export declare const isOwnerOnlyStoreSetting: (setting: string) => boolean;
|
|
12
15
|
export declare const isStoreSetting: (setting: string) => boolean;
|
|
13
16
|
export declare const changeStoreSetting: (app: AppIdentity, env: NodeJS.ProcessEnv, setting: string, value: string | undefined) => Promise<{
|
|
@@ -33,10 +33,10 @@ export const STORE_SETTINGS = [
|
|
|
33
33
|
];
|
|
34
34
|
const GROUP_PREFIX = `${ACCOUNT_GROUPS_SETTING}.`;
|
|
35
35
|
/**
|
|
36
|
-
* A CRM account's: whether what it reports is a relationship or waits for review, what its company types mean,
|
|
37
|
-
*
|
|
36
|
+
* A CRM account's: whether what it reports is a relationship or waits for review, what its company types mean, whose
|
|
37
|
+
* deals and leads its sync copies, and which stages open a task.
|
|
38
38
|
*/
|
|
39
|
-
const CRM_SETTINGS = ["links", "company-types", "scope", "unassigned", "self"].map((name) => `crm.<provider>:<account>.${name}`);
|
|
39
|
+
const CRM_SETTINGS = ["links", "company-types", "scope", "unassigned", "self", "stage-tasks"].map((name) => `crm.<provider>:<account>.${name}`);
|
|
40
40
|
/**
|
|
41
41
|
* The store settings a CLI offers. Phone countries, task rules and account groups belong to messages; a CLI that is
|
|
42
42
|
* not a messenger would change them for tg and MAX without reading them itself.
|
|
@@ -45,10 +45,13 @@ export const storeSettingsOf = (app) => app.messenger === false
|
|
|
45
45
|
? [...Object.keys(SCRIPTS), OWNER_LANGUAGES, ...CRM_SETTINGS]
|
|
46
46
|
: [...STORE_SETTINGS, `${GROUP_PREFIX}<name>`, ...CRM_SETTINGS];
|
|
47
47
|
export const offersStoreSetting = (app, setting) => app.messenger !== false || setting in SCRIPTS || setting === OWNER_LANGUAGES || parseCrmSetting(setting) !== undefined;
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Whose deals a CRM copy holds and what opens the owner's tasks: the owner's to set; an agent's run is stopped from
|
|
50
|
+
* changing them by mistake.
|
|
51
|
+
*/
|
|
49
52
|
export const isOwnerOnlyStoreSetting = (setting) => {
|
|
50
53
|
const name = parseCrmSetting(setting)?.name;
|
|
51
|
-
return name === "scope" || name === "self" || name === "unassigned";
|
|
54
|
+
return name === "scope" || name === "self" || name === "unassigned" || name === "stage-tasks";
|
|
52
55
|
};
|
|
53
56
|
export const isStoreSetting = (setting) => setting in SCRIPTS ||
|
|
54
57
|
setting === OWNER_LANGUAGES ||
|
|
@@ -261,10 +264,19 @@ const crmValueText = (value) => typeof value === "string"
|
|
|
261
264
|
? value
|
|
262
265
|
: Array.isArray(value)
|
|
263
266
|
? value.join(",")
|
|
264
|
-
: Object.
|
|
265
|
-
.
|
|
266
|
-
.
|
|
267
|
-
|
|
267
|
+
: Object.values(value).some((one) => typeof one === "object")
|
|
268
|
+
? JSON.stringify(value)
|
|
269
|
+
: Object.entries(value)
|
|
270
|
+
.map(([type, meaning]) => `${type}=${meaning}`)
|
|
271
|
+
.join(",");
|
|
272
|
+
const CRM_DEFAULTS = {
|
|
273
|
+
links: "reported",
|
|
274
|
+
"company-types": {},
|
|
275
|
+
scope: "mine",
|
|
276
|
+
unassigned: [],
|
|
277
|
+
self: "",
|
|
278
|
+
"stage-tasks": {},
|
|
279
|
+
};
|
|
268
280
|
const crmNote = (name, now) => {
|
|
269
281
|
if (name === "links")
|
|
270
282
|
return `store-wide — the next sync of that account writes what it reports as ${now === "review" ? "proposals for the owner to review" : "reported relationships"}; relationships already stored stay`;
|
|
@@ -277,6 +289,11 @@ const crmNote = (name, now) => {
|
|
|
277
289
|
"of the unassigned users, and marks the others deleted here; contacts and companies stay whole";
|
|
278
290
|
if (name === "unassigned")
|
|
279
291
|
return "store-wide — with scope mine, the next sync also copies the deals and leads of these users";
|
|
292
|
+
if (name === "stage-tasks")
|
|
293
|
+
return Object.keys(now).length === 0
|
|
294
|
+
? "store-wide — no stage opens a task"
|
|
295
|
+
: "store-wide — from now on, each sync opens a local task for every deal or lead that moved into one of these " +
|
|
296
|
+
"stages since the last sync; moves made before the rules were first set open none";
|
|
280
297
|
return now === ""
|
|
281
298
|
? "store-wide — the next sync gives the account's copy to its sign-in's user, and narrows it to that user's deals"
|
|
282
299
|
: "store-wide — the account's copy holds this user's deals; a sync signed in as another user is refused";
|
package/dist/crm/cli/csv.js
CHANGED
package/dist/crm/cli/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { DEAL_KINDS, DEAL_STATUSES } from "../../domain/deals.js";
|
|
|
15
15
|
import { deal as dealEntity } from "../../entities/deal.js";
|
|
16
16
|
import { count, text } from "../../entities/fields.js";
|
|
17
17
|
import { CRM_SCOPES, crmSettingKey } from "../../store/sqlite/crm-settings.js";
|
|
18
|
+
import { openStageTasks } from "../stage-tasks.js";
|
|
18
19
|
import { crmStatus, syncCrm } from "../sync.js";
|
|
19
20
|
import { closeCrmItem, createCrmItem, fieldPairsOf, moveCrmItem, pipelineOf, removeCrmItem, updateCrmItem, } from "../writes.js";
|
|
20
21
|
import { csvFormatOption, renderCsv } from "./csv.js";
|
|
@@ -53,6 +54,8 @@ const DEAL_UNTRUSTED = [
|
|
|
53
54
|
"stage",
|
|
54
55
|
"pipeline_name",
|
|
55
56
|
"organization.name",
|
|
57
|
+
"contact_name",
|
|
58
|
+
"company_name",
|
|
56
59
|
"people.name",
|
|
57
60
|
"provider_metadata",
|
|
58
61
|
];
|
|
@@ -76,6 +79,7 @@ const crmSync = v.strictObject({
|
|
|
76
79
|
users: v.optional(count),
|
|
77
80
|
skipped_owner_rejected: count,
|
|
78
81
|
contacts_removed: v.optional(crmContactsRemoved),
|
|
82
|
+
stage_tasks: count,
|
|
79
83
|
synced: v.array(v.strictObject({
|
|
80
84
|
kind: v.picklist(CRM_KINDS),
|
|
81
85
|
round: v.picklist(["full", "changes"]),
|
|
@@ -184,7 +188,8 @@ const addCrmCommandsDefinition = (program, options) => {
|
|
|
184
188
|
const example = (command, ...lines) => annotate(command, { examples: lines.map((line) => `${options.app.command} work ${line}`) });
|
|
185
189
|
example(answerEntity(annotate(program.command("sync"), { effects: FETCH, offline: false, cooperative: true, partial: true }), "crm_sync", crmSync).description("bring the CRM's copy in the local store up to date: pipelines, companies, contacts, deals and leads that " +
|
|
186
190
|
"changed since the last sync, or everything with --rescan; a run stops before its deadline or --max-pages " +
|
|
187
|
-
"and the next one goes on from there
|
|
191
|
+
"and the next one goes on from there. Then each deal or lead that moved into a stage the stage-tasks setting " +
|
|
192
|
+
"names opens a local task, once per move"), "sync", "sync --rescan", "sync --max-pages 20")
|
|
188
193
|
.option("--rescan", "list everything again, every id too, dropping a round in progress")
|
|
189
194
|
.option("--max-pages <pages>", "at most this many requests to the CRM in this run", integer(100_000))
|
|
190
195
|
.action(async (opts, command) => {
|
|
@@ -196,6 +201,7 @@ const addCrmCommandsDefinition = (program, options) => {
|
|
|
196
201
|
...(signal ? { signal } : {}),
|
|
197
202
|
...(opts.rescan ? { rescan: true } : {}),
|
|
198
203
|
});
|
|
204
|
+
const stageTasks = await openStageTasks(run.store, run.account, now());
|
|
199
205
|
const failed = report.synced.filter((one) => one.error !== undefined);
|
|
200
206
|
// A kind that failed on a setting fails the same way again until the owner changes it: no retry is offered.
|
|
201
207
|
const retried = failed.filter((one) => one.setting === undefined);
|
|
@@ -241,7 +247,7 @@ const addCrmCommandsDefinition = (program, options) => {
|
|
|
241
247
|
})),
|
|
242
248
|
];
|
|
243
249
|
const partial = report.state === "partial" || issues.length > 0;
|
|
244
|
-
return itemOf(snakeKeys({ ...rest, ...(hint === undefined ? {} : { hint }) }), {
|
|
250
|
+
return itemOf(snakeKeys({ ...rest, stageTasks, ...(hint === undefined ? {} : { hint }) }), {
|
|
245
251
|
...(partial ? { meta: { complete: false, ...(issues.length ? { issues } : {}) } } : {}),
|
|
246
252
|
...(next ? { next } : {}),
|
|
247
253
|
});
|
|
@@ -22,10 +22,10 @@ const DEFAULT_LIMIT = 20;
|
|
|
22
22
|
export const addCrmSearchAll = (searches, { within, app, example, }) => {
|
|
23
23
|
const all = annotate(new Command("all"), { effects: LOCAL_READ, partial: true, output: { entity: "hit" } })
|
|
24
24
|
.summary("search stored deals and leads, messages, notes, calendar events and meetings")
|
|
25
|
-
.description("search the CRM's deals and leads by the words of their title, and messages, notes,
|
|
26
|
-
"meetings other WireCat tools stored — best match first. Use it when you do not know
|
|
27
|
-
"written")
|
|
28
|
-
.argument("<query...>", 'words and "phrases"; deals and leads match the words of their title')
|
|
25
|
+
.description("search the CRM's deals and leads by the words of their title, company and contacts, and messages, notes, " +
|
|
26
|
+
"calendar events and meetings other WireCat tools stored — best match first. Use it when you do not know " +
|
|
27
|
+
"where something was written")
|
|
28
|
+
.argument("<query...>", 'words and "phrases"; deals and leads match the words of their title, company and contacts')
|
|
29
29
|
.addHelpText("after", SAVE_HELP);
|
|
30
30
|
searches.addCommand(searchAllOptions(all, SEARCHED));
|
|
31
31
|
example(all, "search all Example LLC", "search all website --only crm --json");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MessageStore } from "../store/store.js";
|
|
2
|
+
import type { AccountKey } from "../store/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Opens the owner's task for each stage a deal or lead of the account entered that its `stage-tasks` setting names:
|
|
5
|
+
* one per entry, so a dismissed task never comes back and a later entry into the same stage opens a new one.
|
|
6
|
+
* Answers how many it opened.
|
|
7
|
+
*/
|
|
8
|
+
export declare const openStageTasks: (store: MessageStore, account: AccountKey, now: number) => Promise<number>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { taskAccount } from "../services/task-rules.js";
|
|
2
|
+
import { createTaskService } from "../tasks/index.js";
|
|
3
|
+
const DAY = 86_400_000;
|
|
4
|
+
/**
|
|
5
|
+
* Opens the owner's task for each stage a deal or lead of the account entered that its `stage-tasks` setting names:
|
|
6
|
+
* one per entry, so a dismissed task never comes back and a later entry into the same stage opens a new one.
|
|
7
|
+
* Answers how many it opened.
|
|
8
|
+
*/
|
|
9
|
+
export const openStageTasks = async (store, account, now) => {
|
|
10
|
+
const rules = await store.crm.stageTasks(account);
|
|
11
|
+
if (Object.keys(rules.deal).length + Object.keys(rules.lead).length === 0)
|
|
12
|
+
return 0;
|
|
13
|
+
const { moves, through } = await store.crm.stageMoves(account);
|
|
14
|
+
// Every deal entering a stage gets the same title, so the duplicate review would pair tasks of different deals.
|
|
15
|
+
const { reviewDuplicates: _review, ...tasks } = store.tasks;
|
|
16
|
+
const service = createTaskService({ store: tasks, now: () => new Date(now) });
|
|
17
|
+
let opened = 0;
|
|
18
|
+
for (const move of moves) {
|
|
19
|
+
const rule = rules[move.kind][move.stage];
|
|
20
|
+
if (!rule)
|
|
21
|
+
continue;
|
|
22
|
+
const item = await store.deals.get(move.ref);
|
|
23
|
+
const responsible = item.people.find((one) => one.role === "owner")?.name ??
|
|
24
|
+
(item.assignee === null ? "nobody" : `CRM user ${item.assignee.split("/").at(-1)}`);
|
|
25
|
+
const { created } = await service.add({
|
|
26
|
+
source: `${move.ref}/move/${move.id}`,
|
|
27
|
+
sourceKind: move.kind,
|
|
28
|
+
account: taskAccount(account),
|
|
29
|
+
group: move.ref,
|
|
30
|
+
kind: "request",
|
|
31
|
+
origin: "rule",
|
|
32
|
+
dueAt: new Date(now + rule.dueDays * DAY),
|
|
33
|
+
title: rule.title,
|
|
34
|
+
description: `${item.title} (${move.ref}) entered the stage ${move.stageName} of the pipeline ${move.pipelineName}. ` +
|
|
35
|
+
`Responsible: ${responsible}.`,
|
|
36
|
+
});
|
|
37
|
+
if (created)
|
|
38
|
+
opened += 1;
|
|
39
|
+
}
|
|
40
|
+
await store.crm.markStageMoves(account, through);
|
|
41
|
+
return opened;
|
|
42
|
+
};
|
package/dist/domain/crm.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ export interface CrmItem {
|
|
|
40
40
|
closedReason?: string | null;
|
|
41
41
|
/** A company's id. */
|
|
42
42
|
organization?: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* A lead's own person and company, as the CRM keeps them on the item itself: a lead often has no contact or company
|
|
45
|
+
* linked yet, and these are then all it says of who it is.
|
|
46
|
+
*/
|
|
47
|
+
contactName?: string | null;
|
|
48
|
+
companyName?: string | null;
|
|
43
49
|
/**
|
|
44
50
|
* Contacts on it, by their id, the part each plays and whether the CRM marks one its main contact. Left out, the CRM
|
|
45
51
|
* did not say who is on it, and the people stored stay.
|
|
@@ -79,6 +85,9 @@ export interface CrmPerson {
|
|
|
79
85
|
name: string | null;
|
|
80
86
|
email?: string | null;
|
|
81
87
|
phone?: string | null;
|
|
88
|
+
/** Every phone and address the contact holds, `phone` and `email` first; left out, the stored ones stay. */
|
|
89
|
+
phones?: string[];
|
|
90
|
+
emails?: string[];
|
|
82
91
|
/** The job title as the CRM writes it: kept beside the relationship, never a role. */
|
|
83
92
|
position?: string | null;
|
|
84
93
|
/**
|
|
@@ -19,3 +19,5 @@ export declare const variantKey: (name: string | null | undefined) => string | n
|
|
|
19
19
|
* spelling and the older one with `y` (`Iuliia`, `Yuliia`), Latin read as Russian. Each spelling once.
|
|
20
20
|
*/
|
|
21
21
|
export declare const spellings: (text: string) => string[];
|
|
22
|
+
/** A word's skeleton with the skeletons of the full names it may stand for: `iarik` gives `iarik` and `iaroslav`. */
|
|
23
|
+
export declare const fullNames: (skeleton: string) => string[];
|
|
@@ -145,3 +145,110 @@ export const spellings = (text) => {
|
|
|
145
145
|
}
|
|
146
146
|
return [...new Set([folded, LATIN.test(folded) ? toCyrillic(folded) : folded])];
|
|
147
147
|
};
|
|
148
|
+
/** Each full first name and its everyday short forms, Russian and English. */
|
|
149
|
+
const SHORT_FORMS = {
|
|
150
|
+
Александр: "Саша Саня Шура Алекс",
|
|
151
|
+
Александра: "Саша Саня Шура",
|
|
152
|
+
Алексей: "Алеша Леша",
|
|
153
|
+
Анастасия: "Настя",
|
|
154
|
+
Анатолий: "Толя",
|
|
155
|
+
Андрей: "Андрюша",
|
|
156
|
+
Анна: "Аня",
|
|
157
|
+
Антон: "Антоша",
|
|
158
|
+
Артем: "Тема",
|
|
159
|
+
Борис: "Боря",
|
|
160
|
+
Валентин: "Валя",
|
|
161
|
+
Валентина: "Валя",
|
|
162
|
+
Валерий: "Валера",
|
|
163
|
+
Валерия: "Лера",
|
|
164
|
+
Василий: "Вася",
|
|
165
|
+
Виктор: "Витя",
|
|
166
|
+
Виктория: "Вика",
|
|
167
|
+
Виталий: "Виталик",
|
|
168
|
+
Владимир: "Вова Володя",
|
|
169
|
+
Владислав: "Влад Слава",
|
|
170
|
+
Вячеслав: "Слава",
|
|
171
|
+
Галина: "Галя",
|
|
172
|
+
Геннадий: "Гена",
|
|
173
|
+
Георгий: "Жора Гоша",
|
|
174
|
+
Григорий: "Гриша",
|
|
175
|
+
Дарья: "Даша",
|
|
176
|
+
Дмитрий: "Дима Митя",
|
|
177
|
+
Евгений: "Женя",
|
|
178
|
+
Евгения: "Женя",
|
|
179
|
+
Екатерина: "Катя",
|
|
180
|
+
Елена: "Лена",
|
|
181
|
+
Елизавета: "Лиза",
|
|
182
|
+
Иван: "Ваня",
|
|
183
|
+
Илья: "Илюша",
|
|
184
|
+
Ирина: "Ира",
|
|
185
|
+
Константин: "Костя",
|
|
186
|
+
Ксения: "Ксюша",
|
|
187
|
+
Леонид: "Леня",
|
|
188
|
+
Любовь: "Люба",
|
|
189
|
+
Людмила: "Люда",
|
|
190
|
+
Максим: "Макс",
|
|
191
|
+
Маргарита: "Рита",
|
|
192
|
+
Мария: "Маша",
|
|
193
|
+
Михаил: "Миша",
|
|
194
|
+
Надежда: "Надя",
|
|
195
|
+
Наталья: "Наташа",
|
|
196
|
+
Николай: "Коля",
|
|
197
|
+
Ольга: "Оля",
|
|
198
|
+
Павел: "Паша",
|
|
199
|
+
Петр: "Петя",
|
|
200
|
+
Полина: "Поля",
|
|
201
|
+
Роман: "Рома",
|
|
202
|
+
Светлана: "Света",
|
|
203
|
+
Семен: "Сема",
|
|
204
|
+
Сергей: "Сережа",
|
|
205
|
+
Софья: "Соня",
|
|
206
|
+
Станислав: "Стас",
|
|
207
|
+
Степан: "Степа",
|
|
208
|
+
Татьяна: "Таня",
|
|
209
|
+
Федор: "Федя",
|
|
210
|
+
Эдуард: "Эдик",
|
|
211
|
+
Юлия: "Юля",
|
|
212
|
+
Юрий: "Юра",
|
|
213
|
+
Яков: "Яша",
|
|
214
|
+
Ярослав: "Ярик Слава",
|
|
215
|
+
Alexander: "Alex Sasha",
|
|
216
|
+
Andrew: "Andy Drew",
|
|
217
|
+
Anthony: "Tony",
|
|
218
|
+
Benjamin: "Ben",
|
|
219
|
+
Catherine: "Cathy Kate Katie",
|
|
220
|
+
Charles: "Charlie Chuck",
|
|
221
|
+
Christopher: "Chris",
|
|
222
|
+
Daniel: "Dan Danny",
|
|
223
|
+
David: "Dave",
|
|
224
|
+
Edward: "Ed Eddie Ted",
|
|
225
|
+
Elizabeth: "Liz Lizzy Beth Betty",
|
|
226
|
+
James: "Jim Jimmy Jamie",
|
|
227
|
+
Jennifer: "Jen Jenny",
|
|
228
|
+
John: "Johnny Jack",
|
|
229
|
+
Joseph: "Joe Joey",
|
|
230
|
+
Katherine: "Kate Katie Kathy",
|
|
231
|
+
Margaret: "Maggie Meg Peggy",
|
|
232
|
+
Matthew: "Matt",
|
|
233
|
+
Michael: "Mike Mick",
|
|
234
|
+
Nicholas: "Nick",
|
|
235
|
+
Patrick: "Pat",
|
|
236
|
+
Peter: "Pete",
|
|
237
|
+
Rebecca: "Becky",
|
|
238
|
+
Richard: "Rick Rich Dick",
|
|
239
|
+
Robert: "Bob Bobby Rob Robbie",
|
|
240
|
+
Samuel: "Sam",
|
|
241
|
+
Stephen: "Steve",
|
|
242
|
+
Steven: "Steve",
|
|
243
|
+
Thomas: "Tom Tommy",
|
|
244
|
+
Timothy: "Tim",
|
|
245
|
+
William: "Bill Billy Will Liam",
|
|
246
|
+
};
|
|
247
|
+
const FULL_NAMES = new Map();
|
|
248
|
+
for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
249
|
+
for (const form of [full, ...short.split(" ")]) {
|
|
250
|
+
const key = wordSkeleton(form);
|
|
251
|
+
FULL_NAMES.set(key, [...new Set([...(FULL_NAMES.get(key) ?? []), wordSkeleton(full)])]);
|
|
252
|
+
}
|
|
253
|
+
/** A word's skeleton with the skeletons of the full names it may stand for: `iarik` gives `iarik` and `iaroslav`. */
|
|
254
|
+
export const fullNames = (skeleton) => [skeleton, ...(FULL_NAMES.get(skeleton) ?? [])];
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* What a person in the store is, for a list that shows the useful ones and keeps the noise apart. `test` is what a
|
|
3
|
+
* test run left, which `all` leaves out too.
|
|
4
|
+
*/
|
|
5
|
+
export declare const PERSON_KINDS: readonly ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
3
6
|
export type PersonKind = (typeof PERSON_KINDS)[number];
|
|
4
7
|
/** What decided a kind, besides the ties that make someone a `person`. */
|
|
5
|
-
export type KindSignal = "bot" | "no-reply" | "bulk-mail" | "bulk-never-replied" | "automated-name" | "organization" | "role-address" | "company-name" | "no-tie" | "no-name";
|
|
8
|
+
export type KindSignal = "test-data" | "bot" | "no-reply" | "bulk-mail" | "bulk-never-replied" | "automated-name" | "organization" | "role-address" | "company-name" | "no-tie" | "no-name";
|
|
6
9
|
/** A sender that is a program: «Notifications», «Рассылка», «no-reply». */
|
|
7
10
|
export declare const isAutomatedName: (name: string | null) => boolean;
|
|
8
11
|
/** A legal form or a word only a business calls itself: «ООО Ромашка», «CZECH AIRLINES», «OpenWeather Team». */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* What a person in the store is, for a list that shows the useful ones and keeps the noise apart. `test` is what a
|
|
3
|
+
* test run left, which `all` leaves out too.
|
|
4
|
+
*/
|
|
5
|
+
export const PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
3
6
|
const AUTOMATED_WORDS = new Set([
|
|
4
7
|
"noreply",
|
|
5
8
|
"notification",
|
|
@@ -11,6 +11,9 @@ export declare const linkedPerson: v.StrictObjectSchema<{
|
|
|
11
11
|
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
12
12
|
readonly phone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
13
13
|
readonly email: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
14
|
+
/** Every phone and address the source gave, `phone` and `email` among them. */
|
|
15
|
+
readonly phones: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
16
|
+
readonly emails: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
14
17
|
readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
15
18
|
readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
16
19
|
readonly seen_in: v.ArraySchema<v.StrictObjectSchema<{
|
|
@@ -8,6 +8,9 @@ const linkedIdentity = v.strictObject({
|
|
|
8
8
|
username: v.nullable(text),
|
|
9
9
|
phone: v.optional(v.nullable(text)),
|
|
10
10
|
email: v.optional(v.nullable(text)),
|
|
11
|
+
/** Every phone and address the source gave, `phone` and `email` among them. */
|
|
12
|
+
phones: v.optional(v.array(text)),
|
|
13
|
+
emails: v.optional(v.array(text)),
|
|
11
14
|
is_bot: v.nullable(v.boolean()),
|
|
12
15
|
accounts: v.array(id),
|
|
13
16
|
seen_in: v.array(v.strictObject({ account: id, scope: v.picklist(["personal", "work"]) })),
|
|
@@ -33,6 +33,8 @@ declare const context: v.StrictObjectSchema<{
|
|
|
33
33
|
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
34
34
|
readonly phone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
35
35
|
readonly email: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
36
|
+
readonly phones: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
37
|
+
readonly emails: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
36
38
|
readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
37
39
|
readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
38
40
|
readonly seen_in: v.ArraySchema<v.StrictObjectSchema<{
|
|
@@ -826,6 +828,8 @@ export declare const contactContext: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
826
828
|
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
827
829
|
readonly phone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
828
830
|
readonly email: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
831
|
+
readonly phones: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
832
|
+
readonly emails: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
829
833
|
readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
830
834
|
readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
831
835
|
readonly seen_in: v.ArraySchema<v.StrictObjectSchema<{
|
|
@@ -1630,6 +1634,8 @@ export declare const contactPreparation: v.StrictObjectSchema<{
|
|
|
1630
1634
|
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1631
1635
|
readonly phone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1632
1636
|
readonly email: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1637
|
+
readonly phones: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1638
|
+
readonly emails: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1633
1639
|
readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1634
1640
|
readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
1635
1641
|
readonly seen_in: v.ArraySchema<v.StrictObjectSchema<{
|
package/dist/entities/deal.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ export declare const deal: v.StrictObjectSchema<{
|
|
|
24
24
|
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
25
25
|
readonly owner: v.BooleanSchema<undefined>;
|
|
26
26
|
}, undefined>, undefined>;
|
|
27
|
+
/** A CRM copy's own person and company as the CRM keeps them on it, such as a lead's with nobody linked yet. */
|
|
28
|
+
readonly contact_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
readonly company_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
27
30
|
readonly currency: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
28
31
|
readonly amount: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
29
32
|
readonly close_date: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
@@ -90,6 +93,9 @@ export declare const lead: v.StrictObjectSchema<{
|
|
|
90
93
|
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
91
94
|
readonly owner: v.BooleanSchema<undefined>;
|
|
92
95
|
}, undefined>, undefined>;
|
|
96
|
+
/** A CRM copy's own person and company as the CRM keeps them on it, such as a lead's with nobody linked yet. */
|
|
97
|
+
readonly contact_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
98
|
+
readonly company_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
93
99
|
readonly currency: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
94
100
|
readonly amount: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
95
101
|
readonly close_date: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
package/dist/entities/deal.js
CHANGED
|
@@ -24,6 +24,9 @@ export const deal = v.strictObject({
|
|
|
24
24
|
base_stage: v.nullable(v.strictObject({ ref: reference, name: text })),
|
|
25
25
|
status: outcome,
|
|
26
26
|
organization: v.nullable(party),
|
|
27
|
+
/** A CRM copy's own person and company as the CRM keeps them on it, such as a lead's with nobody linked yet. */
|
|
28
|
+
contact_name: nullableText,
|
|
29
|
+
company_name: nullableText,
|
|
27
30
|
currency: nullableText,
|
|
28
31
|
amount: nullableText,
|
|
29
32
|
close_date: day,
|