@hasna/contacts 0.6.14 → 0.6.16
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/LICENSE +13 -176
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/crm.d.ts.map +1 -1
- package/dist/cli/index.js +45 -13
- package/dist/db/activity.d.ts +4 -4
- package/dist/db/activity.d.ts.map +1 -1
- package/dist/db/applications.d.ts +8 -8
- package/dist/db/applications.d.ts.map +1 -1
- package/dist/db/companies.d.ts +11 -11
- package/dist/db/companies.d.ts.map +1 -1
- package/dist/db/contact-tasks.d.ts +8 -8
- package/dist/db/contact-tasks.d.ts.map +1 -1
- package/dist/db/contacts.d.ts +22 -22
- package/dist/db/contacts.d.ts.map +1 -1
- package/dist/db/coordination.d.ts +7 -7
- package/dist/db/coordination.d.ts.map +1 -1
- package/dist/db/database.d.ts +3 -2
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/deals.d.ts +7 -7
- package/dist/db/deals.d.ts.map +1 -1
- package/dist/db/documents.d.ts +5 -5
- package/dist/db/documents.d.ts.map +1 -1
- package/dist/db/events.d.ts +5 -5
- package/dist/db/events.d.ts.map +1 -1
- package/dist/db/field-history.d.ts +4 -4
- package/dist/db/field-history.d.ts.map +1 -1
- package/dist/db/freshness.d.ts +4 -4
- package/dist/db/freshness.d.ts.map +1 -1
- package/dist/db/graph.d.ts +5 -5
- package/dist/db/graph.d.ts.map +1 -1
- package/dist/db/groups.d.ts +15 -15
- package/dist/db/groups.d.ts.map +1 -1
- package/dist/db/health.d.ts +4 -4
- package/dist/db/health.d.ts.map +1 -1
- package/dist/db/identity.d.ts +5 -5
- package/dist/db/identity.d.ts.map +1 -1
- package/dist/db/job-history.d.ts +5 -5
- package/dist/db/job-history.d.ts.map +1 -1
- package/dist/db/learnings.d.ts +7 -7
- package/dist/db/learnings.d.ts.map +1 -1
- package/dist/db/notes.d.ts +6 -6
- package/dist/db/notes.d.ts.map +1 -1
- package/dist/db/org-chart.d.ts +6 -6
- package/dist/db/org-chart.d.ts.map +1 -1
- package/dist/db/org-members.d.ts +7 -7
- package/dist/db/org-members.d.ts.map +1 -1
- package/dist/db/relationships.d.ts +9 -9
- package/dist/db/relationships.d.ts.map +1 -1
- package/dist/db/signals.d.ts +5 -5
- package/dist/db/signals.d.ts.map +1 -1
- package/dist/db/tags.d.ts +12 -12
- package/dist/db/tags.d.ts.map +1 -1
- package/dist/db/vendor-comms.d.ts +8 -8
- package/dist/db/vendor-comms.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/audit.d.ts +2 -2
- package/dist/lib/audit.d.ts.map +1 -1
- package/dist/lib/brief.d.ts +2 -2
- package/dist/lib/brief.d.ts.map +1 -1
- package/dist/lib/context.d.ts +4 -4
- package/dist/lib/context.d.ts.map +1 -1
- package/dist/lib/dedup.d.ts +3 -3
- package/dist/lib/dedup.d.ts.map +1 -1
- package/dist/lib/embeddings.d.ts +4 -4
- package/dist/lib/embeddings.d.ts.map +1 -1
- package/dist/lib/freshness.d.ts +4 -4
- package/dist/lib/freshness.d.ts.map +1 -1
- package/dist/lib/import.d.ts.map +1 -1
- package/dist/lib/learning-maintenance.d.ts +3 -3
- package/dist/lib/learning-maintenance.d.ts.map +1 -1
- package/dist/lib/meeting-capture.d.ts +2 -2
- package/dist/lib/meeting-capture.d.ts.map +1 -1
- package/dist/lib/signals.d.ts +3 -3
- package/dist/lib/signals.d.ts.map +1 -1
- package/dist/lib/stats.d.ts +2 -2
- package/dist/lib/stats.d.ts.map +1 -1
- package/dist/lib/timeline.d.ts +2 -2
- package/dist/lib/timeline.d.ts.map +1 -1
- package/dist/lib/upcoming.d.ts +2 -2
- package/dist/lib/upcoming.d.ts.map +1 -1
- package/dist/mcp/handlers/types.d.ts +1 -1
- package/dist/mcp/index.js +9869 -5829
- package/dist/mcp/register-tools.d.ts +3 -0
- package/dist/mcp/register-tools.d.ts.map +1 -0
- package/dist/mcp/schema.d.ts +3 -0
- package/dist/mcp/schema.d.ts.map +1 -0
- package/dist/mcp/tools.d.ts +4 -4
- package/dist/server/index.js +3 -3
- package/dist/types/index.d.ts +15 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,180 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Copyright 2026 Hasna, Inc.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship made available under
|
|
36
|
-
the License, as indicated by a copyright notice that is
|
|
37
|
-
included in or attached to the work (an example is provided
|
|
38
|
-
in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other
|
|
43
|
-
transformations represent, as a whole, an original work of authorship.
|
|
44
|
-
For the purposes of this License, Derivative Works shall not include
|
|
45
|
-
works that remain separable from, or merely link (or bind by name)
|
|
46
|
-
to the interfaces of, the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
49
|
-
in the Work by the copyright owner or by an Individual or Legal Entity
|
|
50
|
-
authorized to submit on behalf of the copyright owner. For the purposes
|
|
51
|
-
of this definition, "submitted" means any form of electronic, verbal,
|
|
52
|
-
or written communication sent to the Licensor or its representatives,
|
|
53
|
-
including but not limited to communication on electronic mailing lists,
|
|
54
|
-
source code control systems, and issue tracking systems that are managed
|
|
55
|
-
by, or on behalf of, the Licensor for the purpose of documenting and
|
|
56
|
-
discussing improvements to the Work, but excluding communication that is
|
|
57
|
-
conspicuously marked or designated in writing by the copyright owner as
|
|
58
|
-
"Not a Contribution."
|
|
59
|
-
|
|
60
|
-
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
61
|
-
whom a Contribution has been received by the Licensor and included
|
|
62
|
-
within the Work.
|
|
63
|
-
|
|
64
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
65
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
66
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
67
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
68
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
69
|
-
Work and such Derivative Works in Source or Object form.
|
|
70
|
-
|
|
71
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
72
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
73
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
74
|
-
(except as stated in this section) patent license to make, have made,
|
|
75
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
76
|
-
where such license applies only to those patent claims licensable
|
|
77
|
-
by such Contributor that are necessarily infringed by their
|
|
78
|
-
Contribution(s) alone or by the combination of their Contribution(s)
|
|
79
|
-
with the Work to which such Contribution(s) were submitted. If You
|
|
80
|
-
institute patent litigation against any entity (including a cross-claim
|
|
81
|
-
or counterclaim in a lawsuit) alleging that the Work or any claim
|
|
82
|
-
constituting direct or indirect patent infringement, then any patent
|
|
83
|
-
licenses granted to You under this License for that Work shall
|
|
84
|
-
terminate as of the date such litigation is filed.
|
|
85
|
-
|
|
86
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
-
modifications, and in Source or Object form, provided that You
|
|
89
|
-
meet the following conditions:
|
|
90
|
-
|
|
91
|
-
(a) You must give any other recipients of the Work or
|
|
92
|
-
Derivative Works a copy of this License; and
|
|
93
|
-
|
|
94
|
-
(b) You must cause any modified files to carry prominent notices
|
|
95
|
-
stating that You changed the files; and
|
|
96
|
-
|
|
97
|
-
(c) You must retain, in the Source form of any Derivative Work,
|
|
98
|
-
any patent, copyright, trademark, and other attribution
|
|
99
|
-
notices from the Source form of the Work, excluding those
|
|
100
|
-
notices that do not pertain to any part of the Derivative
|
|
101
|
-
Works; and
|
|
102
|
-
|
|
103
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
-
distribution, then You must include a readable copy of the
|
|
105
|
-
attribution notices contained within such NOTICE file, in
|
|
106
|
-
at least one of the following places: within a NOTICE text
|
|
107
|
-
file distributed as part of the Derivative Works; within
|
|
108
|
-
the Source form or documentation, if provided along with the
|
|
109
|
-
Derivative Works; or, within a display generated by the
|
|
110
|
-
Derivative Works, if and wherever such third-party notices
|
|
111
|
-
normally appear. The contents of the NOTICE file are for
|
|
112
|
-
informational purposes only and do not modify the License.
|
|
113
|
-
You may add Your own attribution notices within Derivative
|
|
114
|
-
Works that You place alongside or in addition to the NOTICE
|
|
115
|
-
text from the Work, provided that such additional attribution
|
|
116
|
-
notices cannot be construed as modifying the License.
|
|
117
|
-
|
|
118
|
-
You may add Your own license statement for Your modifications and
|
|
119
|
-
may provide additional terms and conditions for use, reproduction,
|
|
120
|
-
or modification of Your Derivative Works, as set forth in Section 6,
|
|
121
|
-
provided, however, that such additional terms do not contradict the
|
|
122
|
-
terms of this License.
|
|
123
|
-
|
|
124
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
125
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
126
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
127
|
-
this License, without any additional terms or conditions.
|
|
128
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
129
|
-
the terms of any separate license agreement you may have executed
|
|
130
|
-
with Licensor regarding such Contributions.
|
|
131
|
-
|
|
132
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
133
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
134
|
-
except as required for reasonable and customary use in describing the
|
|
135
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
136
|
-
|
|
137
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
138
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
139
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
140
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
141
|
-
implied, including, without limitation, any conditions of
|
|
142
|
-
TITLE, MERCHANTIBILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
143
|
-
You are solely responsible for determining the appropriateness of
|
|
144
|
-
using or reproducing the Work and assume any risks associated with
|
|
145
|
-
Your exercise of permissions under this License.
|
|
146
|
-
|
|
147
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
148
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
149
|
-
unless required by applicable law (such as deliberate and grossly
|
|
150
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
151
|
-
liable to You for damages, including any direct, indirect, special,
|
|
152
|
-
incidental, or exemplary damages of any character arising as a
|
|
153
|
-
result of this License or out of the use or inability to use the
|
|
154
|
-
Work (even if such Contributor has been advised of the possibility
|
|
155
|
-
of such damages).
|
|
156
|
-
|
|
157
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
158
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
159
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
160
|
-
or other liability obligations and/or rights consistent with this
|
|
161
|
-
License. However, in accepting such obligations, You may offer only
|
|
162
|
-
conditions that are consistent with this License and agree that
|
|
163
|
-
indemnity or any other liability be Your responsibility for any
|
|
164
|
-
obligations accepted beyond the terms of this License.
|
|
165
|
-
|
|
166
|
-
END OF TERMS AND CONDITIONS
|
|
167
|
-
|
|
168
|
-
Copyright 2025 Andrei Hasna
|
|
169
|
-
|
|
170
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
171
|
-
you may not use this file except in compliance with the License.
|
|
172
|
-
You may obtain a copy of the License at
|
|
173
|
-
|
|
174
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
175
|
-
|
|
176
|
-
Unless required by applicable law or agreed to in writing, software
|
|
177
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
178
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
-
See the License for the specific language governing permissions and
|
|
180
|
-
limitations under the License.
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/core.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/core.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAq3B3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgDzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgDzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAs7B1D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -12185,7 +12185,7 @@ function getDatabase(path) {
|
|
|
12185
12185
|
return _db;
|
|
12186
12186
|
const dbPath = path || getDbPath2();
|
|
12187
12187
|
ensureDir(dbPath);
|
|
12188
|
-
const db = new SqliteAdapter(dbPath
|
|
12188
|
+
const db = new SqliteAdapter(dbPath);
|
|
12189
12189
|
db.exec("PRAGMA journal_mode=WAL");
|
|
12190
12190
|
db.exec("PRAGMA foreign_keys=ON");
|
|
12191
12191
|
if (typeof db["query"] !== "function") {
|
|
@@ -13340,7 +13340,7 @@ function autoLinkContactToCompany(contactId, db) {
|
|
|
13340
13340
|
const row = d.query(`SELECT * FROM contacts WHERE id = ?`).get(contactId);
|
|
13341
13341
|
if (!row || row.company_id)
|
|
13342
13342
|
return null;
|
|
13343
|
-
const emailRow = d.query(`SELECT address FROM emails WHERE contact_id = ?
|
|
13343
|
+
const emailRow = d.query(`SELECT address FROM emails WHERE contact_id = ? LIMIT 1`).get(contactId);
|
|
13344
13344
|
if (!emailRow)
|
|
13345
13345
|
return null;
|
|
13346
13346
|
const domain = emailRow.address.split("@")[1];
|
|
@@ -14023,8 +14023,8 @@ function parseVcfBlock(block) {
|
|
|
14023
14023
|
return contact;
|
|
14024
14024
|
}
|
|
14025
14025
|
function decodeVcfValue(val) {
|
|
14026
|
-
return val.replace(/\\n/g, `
|
|
14027
|
-
`).replace(/\\,/g, ",").replace(/\\;/g, ";").replace(
|
|
14026
|
+
return val.replace(/\\\\/g, "\x00").replace(/\\n/g, `
|
|
14027
|
+
`).replace(/\\,/g, ",").replace(/\\;/g, ";").replace(/\x00/g, "\\");
|
|
14028
14028
|
}
|
|
14029
14029
|
function detectPlatform(url) {
|
|
14030
14030
|
const lower = url.toLowerCase();
|
|
@@ -16886,13 +16886,20 @@ Add New Contact
|
|
|
16886
16886
|
\u2713 Contact created: ${contact.display_name} (${contact.id})
|
|
16887
16887
|
`));
|
|
16888
16888
|
});
|
|
16889
|
-
program2.command("list").description("List contacts").option("--tag <tag_id>", "Filter by tag ID").option("--company <id>", "Filter by company ID").option("--include-restricted", "Include restricted-sensitivity contacts").option("--limit <n>", "Max results", "50").action(async (opts) => {
|
|
16889
|
+
program2.command("list").description("List contacts").option("--tag <tag_id>", "Filter by tag ID").option("--company <id>", "Filter by company ID").option("--include-restricted", "Include restricted-sensitivity contacts").option("-l, --limit <n>", "Max results", "50").option("-o, --offset <n>", "Skip first N results", "0").option("--order-by <field>", "Sort field: display_name|created_at|updated_at|last_contacted_at|follow_up_at", "display_name").option("--order-dir <dir>", "Sort direction: asc|desc", "asc").option("-j, --json", "Output JSON").action(async (opts) => {
|
|
16890
16890
|
const result = listContacts({
|
|
16891
16891
|
tag_id: opts.tag,
|
|
16892
16892
|
company_id: opts.company,
|
|
16893
16893
|
include_restricted: opts.includeRestricted,
|
|
16894
|
-
limit: parseInt(opts.limit, 10)
|
|
16894
|
+
limit: parseInt(opts.limit, 10),
|
|
16895
|
+
offset: parseInt(opts.offset, 10),
|
|
16896
|
+
order_by: opts.orderBy,
|
|
16897
|
+
order_dir: opts.orderDir === "desc" ? "desc" : "asc"
|
|
16895
16898
|
});
|
|
16899
|
+
if (opts.json) {
|
|
16900
|
+
console.log(JSON.stringify(result, null, 2));
|
|
16901
|
+
return;
|
|
16902
|
+
}
|
|
16896
16903
|
if (result.contacts.length === 0) {
|
|
16897
16904
|
console.log(chalk2.gray(`
|
|
16898
16905
|
No contacts found.
|
|
@@ -17020,8 +17027,17 @@ No contacts found for: "${query}"
|
|
|
17020
17027
|
${contacts.length} result(s) for "${query}"
|
|
17021
17028
|
`));
|
|
17022
17029
|
});
|
|
17023
|
-
const companiesCmd = program2.command("companies").description("Manage companies").action(() => {
|
|
17024
|
-
const result = listCompanies({
|
|
17030
|
+
const companiesCmd = program2.command("companies").description("Manage companies").option("-l, --limit <n>", "Max results", "50").option("-o, --offset <n>", "Skip first N results", "0").option("--order-by <field>", "Sort field: name|created_at|updated_at", "name").option("--order-dir <dir>", "Sort direction: asc|desc", "asc").option("-j, --json", "Output JSON").action((opts) => {
|
|
17031
|
+
const result = listCompanies({
|
|
17032
|
+
limit: parseInt(opts.limit, 10),
|
|
17033
|
+
offset: parseInt(opts.offset, 10),
|
|
17034
|
+
order_by: opts.orderBy,
|
|
17035
|
+
order_dir: opts.orderDir === "desc" ? "desc" : "asc"
|
|
17036
|
+
});
|
|
17037
|
+
if (opts.json) {
|
|
17038
|
+
console.log(JSON.stringify(result, null, 2));
|
|
17039
|
+
return;
|
|
17040
|
+
}
|
|
17025
17041
|
if (result.companies.length === 0) {
|
|
17026
17042
|
console.log(chalk2.gray(`
|
|
17027
17043
|
No companies found.
|
|
@@ -17244,9 +17260,13 @@ ${chalk2.bold("Available tools (24 total):")}
|
|
|
17244
17260
|
await proc.exited;
|
|
17245
17261
|
console.log(chalk2.green(`Opening ${url}`));
|
|
17246
17262
|
});
|
|
17247
|
-
program2.command("recent").description("Show recently added or modified contacts").option("--limit <n>", "Number to show", "10").action((opts) => {
|
|
17263
|
+
program2.command("recent").description("Show recently added or modified contacts").option("-l, --limit <n>", "Number to show", "10").option("-j, --json", "Output JSON").action((opts) => {
|
|
17248
17264
|
const limit = parseInt(opts.limit, 10);
|
|
17249
17265
|
const contacts = listRecentContacts(limit);
|
|
17266
|
+
if (opts.json) {
|
|
17267
|
+
console.log(JSON.stringify({ contacts, total: contacts.length }, null, 2));
|
|
17268
|
+
return;
|
|
17269
|
+
}
|
|
17250
17270
|
if (contacts.length === 0) {
|
|
17251
17271
|
console.log(chalk2.gray(`
|
|
17252
17272
|
No contacts found.
|
|
@@ -18194,10 +18214,14 @@ ${apps.length} application(s) need follow-up:
|
|
|
18194
18214
|
const brief = generateBrief2(id, db);
|
|
18195
18215
|
console.log(brief);
|
|
18196
18216
|
});
|
|
18197
|
-
program2.command("cold").description("Show contacts you haven't reached out to recently").option("--days <n>", "Days threshold", "30").action(async (opts) => {
|
|
18217
|
+
program2.command("cold").description("Show contacts you haven't reached out to recently").option("-d, --days <n>", "Days threshold", "30").option("-j, --json", "Output JSON").action(async (opts) => {
|
|
18198
18218
|
const { listColdContacts: listColdContacts2 } = await Promise.resolve().then(() => (init_contacts(), exports_contacts));
|
|
18199
18219
|
const db = getDatabase();
|
|
18200
18220
|
const contacts = listColdContacts2(parseInt(opts.days, 10), db);
|
|
18221
|
+
if (opts.json) {
|
|
18222
|
+
console.log(JSON.stringify({ contacts, total: contacts.length, threshold_days: parseInt(opts.days, 10) }, null, 2));
|
|
18223
|
+
return;
|
|
18224
|
+
}
|
|
18201
18225
|
if (!contacts.length) {
|
|
18202
18226
|
console.log(chalk3.green(`
|
|
18203
18227
|
No cold contacts!
|
|
@@ -18221,10 +18245,14 @@ No cold contacts!
|
|
|
18221
18245
|
${contacts.length} cold contact(s) (${opts.days}+ days)
|
|
18222
18246
|
`));
|
|
18223
18247
|
});
|
|
18224
|
-
program2.command("upcoming").option("--days <n>", "Days ahead to show", "7").description("Show upcoming follow-ups, birthdays, and deadlines").action(async (opts) => {
|
|
18248
|
+
program2.command("upcoming").option("-d, --days <n>", "Days ahead to show", "7").option("-j, --json", "Output JSON").description("Show upcoming follow-ups, birthdays, and deadlines").action(async (opts) => {
|
|
18225
18249
|
const { getUpcomingItems: getUpcomingItems2 } = await Promise.resolve().then(() => (init_upcoming(), exports_upcoming));
|
|
18226
18250
|
const db = getDatabase();
|
|
18227
18251
|
const items = getUpcomingItems2(parseInt(opts.days, 10), db);
|
|
18252
|
+
if (opts.json) {
|
|
18253
|
+
console.log(JSON.stringify({ items, total: items.length, window_days: parseInt(opts.days, 10) }, null, 2));
|
|
18254
|
+
return;
|
|
18255
|
+
}
|
|
18228
18256
|
if (!items.length) {
|
|
18229
18257
|
console.log(chalk3.green(`
|
|
18230
18258
|
Nothing upcoming!
|
|
@@ -18248,10 +18276,14 @@ Nothing upcoming!
|
|
|
18248
18276
|
${items.length} upcoming item(s) in next ${opts.days} days
|
|
18249
18277
|
`));
|
|
18250
18278
|
});
|
|
18251
|
-
program2.command("stats").description("Network health dashboard").action(async () => {
|
|
18279
|
+
program2.command("stats").description("Network health dashboard").option("-j, --json", "Output JSON").action(async (opts) => {
|
|
18252
18280
|
const { getNetworkStats: getNetworkStats2 } = await Promise.resolve().then(() => (init_stats(), exports_stats));
|
|
18253
18281
|
const db = getDatabase();
|
|
18254
18282
|
const s = getNetworkStats2(db);
|
|
18283
|
+
if (opts.json) {
|
|
18284
|
+
console.log(JSON.stringify(s, null, 2));
|
|
18285
|
+
return;
|
|
18286
|
+
}
|
|
18255
18287
|
console.log(chalk3.bold.blue(`
|
|
18256
18288
|
\u2501\u2501\u2501 Network Health Dashboard \u2501\u2501\u2501
|
|
18257
18289
|
`));
|
|
@@ -18276,7 +18308,7 @@ ${items.length} upcoming item(s) in next ${opts.days} days
|
|
|
18276
18308
|
console.log(` ${chalk3.cyan("$" + s.active_deals_value.toLocaleString())} active pipeline ${chalk3.cyan(String(s.total_deals))} active deal(s)`);
|
|
18277
18309
|
console.log();
|
|
18278
18310
|
});
|
|
18279
|
-
program2.command("audit").description("Score contacts for data completeness").option("--limit <n>", "Number to show", "20").action(async (opts) => {
|
|
18311
|
+
program2.command("audit").description("Score contacts for data completeness").option("-l, --limit <n>", "Number to show", "20").action(async (opts) => {
|
|
18280
18312
|
const { listContactAudit: listContactAudit2 } = await Promise.resolve().then(() => (init_audit(), exports_audit));
|
|
18281
18313
|
const db = getDatabase();
|
|
18282
18314
|
const results = (await listContactAudit2(db)).slice(0, parseInt(opts.limit, 10));
|
package/dist/db/activity.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
import type { ActivityLog, CreateActivityInput } from "../types/index.js";
|
|
3
|
-
export declare function logActivity(db:
|
|
3
|
+
export declare function logActivity(db: ContactsDatabase, input: CreateActivityInput): ActivityLog;
|
|
4
4
|
export interface ListActivityOptions {
|
|
5
5
|
contact_id?: string;
|
|
6
6
|
company_id?: string;
|
|
7
7
|
limit?: number;
|
|
8
8
|
offset?: number;
|
|
9
9
|
}
|
|
10
|
-
export declare function listActivity(opts?: ListActivityOptions, db?:
|
|
10
|
+
export declare function listActivity(opts?: ListActivityOptions, db?: ContactsDatabase): {
|
|
11
11
|
entries: ActivityLog[];
|
|
12
12
|
total: number;
|
|
13
13
|
};
|
|
14
|
-
export declare function getActivity(id: string, db?:
|
|
14
|
+
export declare function getActivity(id: string, db?: ContactsDatabase): ActivityLog | null;
|
|
15
15
|
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/db/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/db/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAe,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOvF,wBAAgB,WAAW,CAAC,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB,GAAG,WAAW,CAOzF;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,IAAI,GAAE,mBAAwB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAe7H;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAIjF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
import type { Application, CreateApplicationInput, UpdateApplicationInput, ListApplicationsOptions } from "../types/index.js";
|
|
3
|
-
export declare function createApplication(input: CreateApplicationInput, db?:
|
|
4
|
-
export declare function getApplication(id: string, db?:
|
|
5
|
-
export declare function listApplications(opts?: ListApplicationsOptions, db?:
|
|
6
|
-
export declare function updateApplication(id: string, input: UpdateApplicationInput, db?:
|
|
7
|
-
export declare function deleteApplication(id: string, db?:
|
|
8
|
-
export declare function listFollowUpDue(db?:
|
|
9
|
-
export declare function listPendingApplications(db?:
|
|
3
|
+
export declare function createApplication(input: CreateApplicationInput, db?: ContactsDatabase): Application;
|
|
4
|
+
export declare function getApplication(id: string, db?: ContactsDatabase): Application | null;
|
|
5
|
+
export declare function listApplications(opts?: ListApplicationsOptions, db?: ContactsDatabase): Application[];
|
|
6
|
+
export declare function updateApplication(id: string, input: UpdateApplicationInput, db?: ContactsDatabase): Application;
|
|
7
|
+
export declare function deleteApplication(id: string, db?: ContactsDatabase): void;
|
|
8
|
+
export declare function listFollowUpDue(db?: ContactsDatabase): Application[];
|
|
9
|
+
export declare function listPendingApplications(db?: ContactsDatabase): Application[];
|
|
10
10
|
//# sourceMappingURL=applications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../src/db/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../src/db/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EAIxB,MAAM,mBAAmB,CAAC;AAiD3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAkCnG;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAIpF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAiBzG;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,CA2B/G;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAGzE;AAED,wBAAgB,eAAe,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CASpE;AAED,wBAAgB,uBAAuB,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAQ5E"}
|
package/dist/db/companies.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
import type { CompanyListOptions, CompanyWithDetails, Contact, CreateCompanyInput, UpdateCompanyInput } from "../types/index.js";
|
|
3
|
-
export declare function createCompany(input: CreateCompanyInput, db?:
|
|
4
|
-
export declare function getCompany(id: string, db?:
|
|
5
|
-
export declare function listCompanies(opts?: CompanyListOptions, db?:
|
|
3
|
+
export declare function createCompany(input: CreateCompanyInput, db?: ContactsDatabase): CompanyWithDetails;
|
|
4
|
+
export declare function getCompany(id: string, db?: ContactsDatabase): CompanyWithDetails;
|
|
5
|
+
export declare function listCompanies(opts?: CompanyListOptions, db?: ContactsDatabase): {
|
|
6
6
|
companies: CompanyWithDetails[];
|
|
7
7
|
total: number;
|
|
8
8
|
};
|
|
9
|
-
export declare function updateCompany(id: string, input: UpdateCompanyInput, db?:
|
|
10
|
-
export declare function deleteCompany(id: string, db?:
|
|
11
|
-
export declare function searchCompanies(query: string, db?:
|
|
12
|
-
export declare function listCompanyEmployees(companyId: string, db?:
|
|
13
|
-
export declare function archiveCompany(id: string, db?:
|
|
14
|
-
export declare function unarchiveCompany(id: string, db?:
|
|
15
|
-
export declare function listOwnedEntities(db?:
|
|
9
|
+
export declare function updateCompany(id: string, input: UpdateCompanyInput, db?: ContactsDatabase): CompanyWithDetails;
|
|
10
|
+
export declare function deleteCompany(id: string, db?: ContactsDatabase): void;
|
|
11
|
+
export declare function searchCompanies(query: string, db?: ContactsDatabase): CompanyWithDetails[];
|
|
12
|
+
export declare function listCompanyEmployees(companyId: string, db?: ContactsDatabase): Contact[];
|
|
13
|
+
export declare function archiveCompany(id: string, db?: ContactsDatabase): CompanyWithDetails;
|
|
14
|
+
export declare function unarchiveCompany(id: string, db?: ContactsDatabase): CompanyWithDetails;
|
|
15
|
+
export declare function listOwnedEntities(db?: ContactsDatabase): {
|
|
16
16
|
companies: CompanyWithDetails[];
|
|
17
17
|
total: number;
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/db/companies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/db/companies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAGV,kBAAkB,EAElB,kBAAkB,EAClB,OAAO,EAGP,kBAAkB,EAUlB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAwG3B,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAyClG;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAKhF;AAED,wBAAgB,aAAa,CAAC,IAAI,GAAE,kBAAuB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG;IAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiDtI;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CA4B9G;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAQrE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,EAAE,CAU1F;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,OAAO,EAAE,CAoBxF;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAQpF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAQtF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG;IAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAE3G"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
import type { ContactTask, CreateContactTaskInput, UpdateContactTaskInput, EscalationRule } from "../types/index.js";
|
|
3
|
-
export declare function createContactTask(input: CreateContactTaskInput, db?:
|
|
4
|
-
export declare function getContactTask(id: string, db?:
|
|
3
|
+
export declare function createContactTask(input: CreateContactTaskInput, db?: ContactsDatabase): ContactTask;
|
|
4
|
+
export declare function getContactTask(id: string, db?: ContactsDatabase): ContactTask | null;
|
|
5
5
|
export interface ListContactTasksOptions {
|
|
6
6
|
contact_id?: string;
|
|
7
7
|
entity_id?: string;
|
|
8
8
|
status?: ContactTask["status"];
|
|
9
9
|
priority?: ContactTask["priority"];
|
|
10
10
|
}
|
|
11
|
-
export declare function listContactTasks(opts?: ListContactTasksOptions, db?:
|
|
12
|
-
export declare function updateContactTask(id: string, input: UpdateContactTaskInput, db?:
|
|
13
|
-
export declare function deleteContactTask(id: string, db?:
|
|
14
|
-
export declare function listOverdueTasks(db?:
|
|
15
|
-
export declare function checkEscalations(db?:
|
|
11
|
+
export declare function listContactTasks(opts?: ListContactTasksOptions, db?: ContactsDatabase): ContactTask[];
|
|
12
|
+
export declare function updateContactTask(id: string, input: UpdateContactTaskInput, db?: ContactsDatabase): ContactTask;
|
|
13
|
+
export declare function deleteContactTask(id: string, db?: ContactsDatabase): void;
|
|
14
|
+
export declare function listOverdueTasks(db?: ContactsDatabase): ContactTask[];
|
|
15
|
+
export declare function checkEscalations(db?: ContactsDatabase): Array<{
|
|
16
16
|
task: ContactTask;
|
|
17
17
|
rules_triggered: EscalationRule[];
|
|
18
18
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-tasks.d.ts","sourceRoot":"","sources":["../../src/db/contact-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"contact-tasks.d.ts","sourceRoot":"","sources":["../../src/db/contact-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAyC3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,CA8BnG;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAIpF;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAiBzG;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAsB/G;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAGzE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CASrE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,eAAe,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAsBvH"}
|
package/dist/db/contacts.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
import type { ContactListOptions, ContactWithDetails, CreateContactInput, CreateEmailInput, CreatePhoneInput, UpdateContactInput } from "../types/index.js";
|
|
3
|
-
export declare function createContact(input: CreateContactInput, db?:
|
|
4
|
-
export declare function getContact(id: string, db?:
|
|
5
|
-
export declare function listContacts(opts?: ContactListOptions, db?:
|
|
3
|
+
export declare function createContact(input: CreateContactInput, db?: ContactsDatabase): ContactWithDetails;
|
|
4
|
+
export declare function getContact(id: string, db?: ContactsDatabase): ContactWithDetails;
|
|
5
|
+
export declare function listContacts(opts?: ContactListOptions, db?: ContactsDatabase): {
|
|
6
6
|
contacts: ContactWithDetails[];
|
|
7
7
|
total: number;
|
|
8
8
|
};
|
|
9
|
-
export declare function updateContact(id: string, input: UpdateContactInput, db?:
|
|
10
|
-
export declare function deleteContact(id: string, db?:
|
|
11
|
-
export declare function searchContacts(query: string, db?:
|
|
12
|
-
export declare function listRecentContacts(limit: number, db?:
|
|
13
|
-
export declare function mergeContacts(keepId: string, mergeId: string, db?:
|
|
14
|
-
export declare function getContactByEmail(email: string, db?:
|
|
15
|
-
export declare function addEmailToContact(contactId: string, email: CreateEmailInput, db?:
|
|
16
|
-
export declare function addPhoneToContact(contactId: string, phone: CreatePhoneInput, db?:
|
|
17
|
-
export declare function archiveContact(id: string, db?:
|
|
18
|
-
export declare function unarchiveContact(id: string, db?:
|
|
19
|
-
export declare function listColdContacts(days: number, db?:
|
|
20
|
-
export declare function findOrCreateContact(input: CreateContactInput, db?:
|
|
9
|
+
export declare function updateContact(id: string, input: UpdateContactInput, db?: ContactsDatabase): ContactWithDetails;
|
|
10
|
+
export declare function deleteContact(id: string, db?: ContactsDatabase): void;
|
|
11
|
+
export declare function searchContacts(query: string, db?: ContactsDatabase): ContactWithDetails[];
|
|
12
|
+
export declare function listRecentContacts(limit: number, db?: ContactsDatabase): ContactWithDetails[];
|
|
13
|
+
export declare function mergeContacts(keepId: string, mergeId: string, db?: ContactsDatabase): ContactWithDetails;
|
|
14
|
+
export declare function getContactByEmail(email: string, db?: ContactsDatabase): ContactWithDetails | null;
|
|
15
|
+
export declare function addEmailToContact(contactId: string, email: CreateEmailInput, db?: ContactsDatabase): ContactWithDetails;
|
|
16
|
+
export declare function addPhoneToContact(contactId: string, phone: CreatePhoneInput, db?: ContactsDatabase): ContactWithDetails;
|
|
17
|
+
export declare function archiveContact(id: string, db?: ContactsDatabase): ContactWithDetails;
|
|
18
|
+
export declare function unarchiveContact(id: string, db?: ContactsDatabase): ContactWithDetails;
|
|
19
|
+
export declare function listColdContacts(days: number, db?: ContactsDatabase): ContactWithDetails[];
|
|
20
|
+
export declare function findOrCreateContact(input: CreateContactInput, db?: ContactsDatabase): Promise<{
|
|
21
21
|
contact: ContactWithDetails;
|
|
22
22
|
created: boolean;
|
|
23
23
|
}>;
|
|
24
|
-
export declare function autoLinkContactToCompany(contactId: string, db?:
|
|
25
|
-
export declare function linkContactToProject(contactId: string, projectId: string, db?:
|
|
26
|
-
export declare function unlinkContactFromProject(contactId: string, projectId: string, db?:
|
|
27
|
-
export declare function getContactProjectIds(contactId: string, db?:
|
|
28
|
-
export declare function listContactIdsByProject(projectId: string, db?:
|
|
29
|
-
export declare function setContactProjects(contactId: string, projectIds: string[], db?:
|
|
24
|
+
export declare function autoLinkContactToCompany(contactId: string, db?: ContactsDatabase): ContactWithDetails | null;
|
|
25
|
+
export declare function linkContactToProject(contactId: string, projectId: string, db?: ContactsDatabase): void;
|
|
26
|
+
export declare function unlinkContactFromProject(contactId: string, projectId: string, db?: ContactsDatabase): void;
|
|
27
|
+
export declare function getContactProjectIds(contactId: string, db?: ContactsDatabase): string[];
|
|
28
|
+
export declare function listContactIdsByProject(projectId: string, db?: ContactsDatabase): string[];
|
|
29
|
+
export declare function setContactProjects(contactId: string, projectIds: string[], db?: ContactsDatabase): void;
|
|
30
30
|
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/db/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/db/contacts.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ContactsDatabase } from "./database.js";
|
|
2
2
|
export interface ContactLock {
|
|
3
3
|
id: string;
|
|
4
4
|
contact_id: string;
|
|
@@ -17,14 +17,14 @@ export interface AgentActivity {
|
|
|
17
17
|
session_id?: string | null;
|
|
18
18
|
created_at: string;
|
|
19
19
|
}
|
|
20
|
-
export declare function acquireLock(contactId: string, agentName: string, ttlSeconds?: number, reason?: string, sessionId?: string, db?:
|
|
20
|
+
export declare function acquireLock(contactId: string, agentName: string, ttlSeconds?: number, reason?: string, sessionId?: string, db?: ContactsDatabase): {
|
|
21
21
|
acquired: boolean;
|
|
22
22
|
lock?: ContactLock;
|
|
23
23
|
held_by?: string;
|
|
24
24
|
};
|
|
25
|
-
export declare function releaseLock(contactId: string, agentName: string, db?:
|
|
26
|
-
export declare function checkLock(contactId: string, db?:
|
|
27
|
-
export declare function cleanExpiredLocks(db?:
|
|
28
|
-
export declare function logAgentActivity(contactId: string, agentName: string, action: string, details?: string, sessionId?: string, db?:
|
|
29
|
-
export declare function getAgentActivity(contactId: string, limit?: number, db?:
|
|
25
|
+
export declare function releaseLock(contactId: string, agentName: string, db?: ContactsDatabase): boolean;
|
|
26
|
+
export declare function checkLock(contactId: string, db?: ContactsDatabase): ContactLock | null;
|
|
27
|
+
export declare function cleanExpiredLocks(db?: ContactsDatabase): void;
|
|
28
|
+
export declare function logAgentActivity(contactId: string, agentName: string, action: string, details?: string, sessionId?: string, db?: ContactsDatabase): void;
|
|
29
|
+
export declare function getAgentActivity(contactId: string, limit?: number, db?: ContactsDatabase): AgentActivity[];
|
|
30
30
|
//# sourceMappingURL=coordination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordination.d.ts","sourceRoot":"","sources":["../../src/db/coordination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"coordination.d.ts","sourceRoot":"","sources":["../../src/db/coordination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,gBAAgB,GACpB;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAkB7D;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAMhG;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAMtF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAG7D;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,gBAAgB,GACpB,IAAI,CAON;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,KAAK,SAAK,EACV,EAAE,CAAC,EAAE,gBAAgB,GACpB,aAAa,EAAE,CAOjB"}
|
package/dist/db/database.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SqliteAdapter
|
|
1
|
+
import { SqliteAdapter } from "@hasna/cloud";
|
|
2
2
|
export declare function getDataDir(): string;
|
|
3
3
|
export declare function getDbPath(): string;
|
|
4
|
-
export
|
|
4
|
+
export type ContactsDatabase = InstanceType<typeof SqliteAdapter>;
|
|
5
|
+
export declare function getDatabase(path?: string): ContactsDatabase;
|
|
5
6
|
export declare function resetDatabase(): void;
|
|
6
7
|
export declare function uuid(): string;
|
|
7
8
|
export declare function now(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,wBAAgB,UAAU,IAAI,MAAM,CAkBnC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAIlC;AA4hBD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAIlE,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAe3D;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B"}
|