@wirecat/hubspot-cli 0.0.0-stage → 0.1.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 +29 -0
- package/LICENSE +204 -0
- package/README.md +256 -2
- package/contracts/wirecat.json +1965 -0
- package/dist/bin/hubspot.d.ts +3 -0
- package/dist/bin/hubspot.d.ts.map +1 -0
- package/dist/bin/hubspot.js +40 -0
- package/dist/bin/hubspot.js.map +1 -0
- package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
- package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
- package/dist/bundle/app-server-422MCA7S.js +245 -0
- package/dist/bundle/bun-M3J2QTR3.js +169 -0
- package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
- package/dist/bundle/chunk-24ERVFJP.js +73 -0
- package/dist/bundle/chunk-2QZK5BEP.js +392 -0
- package/dist/bundle/chunk-2TWQIWWG.js +1328 -0
- package/dist/bundle/chunk-2VGD63G6.js +604 -0
- package/dist/bundle/chunk-2VGZRYEH.js +334 -0
- package/dist/bundle/chunk-36ITRDYY.js +63116 -0
- package/dist/bundle/chunk-43EKCUBJ.js +72 -0
- package/dist/bundle/chunk-4W6BMH45.js +731 -0
- package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5GBUCHRU.js +274 -0
- package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
- package/dist/bundle/chunk-65TWQ7BV.js +54 -0
- package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-B3MANLNK.js +602 -0
- package/dist/bundle/chunk-BKXDHU3G.js +1395 -0
- package/dist/bundle/chunk-C32AKHTY.js +2310 -0
- package/dist/bundle/chunk-CLAN3FES.js +1246 -0
- package/dist/bundle/chunk-CWXOXIWS.js +46 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DB2XKHI4.js +72 -0
- package/dist/bundle/chunk-DBEQI5YM.js +100 -0
- package/dist/bundle/chunk-DFCHHR5M.js +38 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DRWWJLI6.js +188 -0
- package/dist/bundle/chunk-DSP36YHQ.js +29 -0
- package/dist/bundle/chunk-E52JAS35.js +1028 -0
- package/dist/bundle/chunk-E5WLE7BM.js +78 -0
- package/dist/bundle/chunk-ECEZOLOD.js +230 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-FBCCBCFH.js +288 -0
- package/dist/bundle/chunk-FKA7DOCK.js +53 -0
- package/dist/bundle/chunk-FOZYMDRL.js +259 -0
- package/dist/bundle/chunk-FPUGMDJV.js +7 -0
- package/dist/bundle/chunk-FTFV3HFW.js +721 -0
- package/dist/bundle/chunk-H3TNVEQX.js +782 -0
- package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
- package/dist/bundle/chunk-HCAZV5NP.js +95 -0
- package/dist/bundle/chunk-HTAN663T.js +4045 -0
- package/dist/bundle/chunk-HZRQLAHO.js +16 -0
- package/dist/bundle/chunk-IMJQRPLN.js +92 -0
- package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
- package/dist/bundle/chunk-JRCPCVPI.js +9393 -0
- package/dist/bundle/chunk-LNV33FDC.js +786 -0
- package/dist/bundle/chunk-LOBVOGOE.js +66 -0
- package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
- package/dist/bundle/chunk-N2XADGL4.js +76 -0
- package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
- package/dist/bundle/chunk-NUU4WZVL.js +52 -0
- package/dist/bundle/chunk-NWHEHV3K.js +133 -0
- package/dist/bundle/chunk-NXERIDPJ.js +319 -0
- package/dist/bundle/chunk-O3DYRCIT.js +23 -0
- package/dist/bundle/chunk-O55RWNSH.js +161 -0
- package/dist/bundle/chunk-P5BHKKBI.js +206 -0
- package/dist/bundle/chunk-PPHBRESD.js +82 -0
- package/dist/bundle/chunk-PVKF24ZW.js +364 -0
- package/dist/bundle/chunk-QGFX5MXL.js +460 -0
- package/dist/bundle/chunk-QJW35N5V.js +761 -0
- package/dist/bundle/chunk-QU25DA5N.js +360 -0
- package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
- package/dist/bundle/chunk-RR5MX5TM.js +142 -0
- package/dist/bundle/chunk-SAKK2YRU.js +218 -0
- package/dist/bundle/chunk-SDQGB4KB.js +185 -0
- package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
- package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
- package/dist/bundle/chunk-TKVL2C3B.js +170 -0
- package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
- package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
- package/dist/bundle/chunk-UUMUL4L3.js +72 -0
- package/dist/bundle/chunk-VIEYMDBR.js +41 -0
- package/dist/bundle/chunk-W53EJOFQ.js +63 -0
- package/dist/bundle/chunk-W7HM2VGO.js +24 -0
- package/dist/bundle/chunk-WE4UFASG.js +88 -0
- package/dist/bundle/chunk-WQBX7XYP.js +26174 -0
- package/dist/bundle/chunk-X2M6NIQG.js +18 -0
- package/dist/bundle/chunk-X7XUX7A4.js +1846 -0
- package/dist/bundle/chunk-XRREFEIW.js +372 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-ZBDSHFG4.js +40933 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
- package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
- package/dist/bundle/decode-FC65Y4IV.js +297 -0
- package/dist/bundle/definitions-MVPICAWV.js +2991 -0
- package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
- package/dist/bundle/dist-MYZZKZJ7.js +7577 -0
- package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
- package/dist/bundle/embed-VNBZFPYH.js +38 -0
- package/dist/bundle/embedder-6U4NOFRO.js +111 -0
- package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
- package/dist/bundle/first-run-RPIJZEDT.js +29 -0
- package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
- package/dist/bundle/hubspot.js +198 -0
- package/dist/bundle/instructions-HET7BCYK.js +11 -0
- package/dist/bundle/mcp-RGNRW77S.js +167 -0
- package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
- package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
- package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
- package/dist/bundle/node-CXZIFHZC.js +176 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
- package/dist/bundle/oauth-HNCY4B2S.js +20 -0
- package/dist/bundle/open-F4P6YV54.js +23 -0
- package/dist/bundle/openai-4AICLIK3.js +238 -0
- package/dist/bundle/process-5RUXWGYS.js +91 -0
- package/dist/bundle/program-POG5GHUQ.js +9241 -0
- package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
- package/dist/bundle/recognize-DKN3RY4V.js +26 -0
- package/dist/bundle/remote-6QHAGQWY.js +31 -0
- package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
- package/dist/bundle/schemas-JRL3DLMP.js +952 -0
- package/dist/bundle/serve-DNU43ND6.js +199 -0
- package/dist/bundle/server-C3ZHA7AZ.js +77 -0
- package/dist/bundle/server-XJSNF3K5.js +207 -0
- package/dist/bundle/source-A3SBLHC4.js +934 -0
- package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
- package/dist/bundle/state-T45CX7VY.js +36 -0
- package/dist/bundle/store-6LCEVBAZ.js +176 -0
- package/dist/bundle/store-6TZ2FCVA.js +295 -0
- package/dist/bundle/store-CCDNUB6A.js +32 -0
- package/dist/bundle/store-maintenance-command-BRCG6MNA.js +68 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +87 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +65 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/crm-shared.d.ts +8 -0
- package/dist/commands/crm-shared.d.ts.map +1 -0
- package/dist/commands/crm-shared.js +93 -0
- package/dist/commands/crm-shared.js.map +1 -0
- package/dist/commands/schedule.d.ts +3 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +9 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/session.d.ts +14 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +164 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +28 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +88 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +137 -0
- package/dist/context.js.map +1 -0
- package/dist/crm/activities.d.ts +24 -0
- package/dist/crm/activities.d.ts.map +1 -0
- package/dist/crm/activities.js +214 -0
- package/dist/crm/activities.js.map +1 -0
- package/dist/crm/associations.d.ts +20 -0
- package/dist/crm/associations.d.ts.map +1 -0
- package/dist/crm/associations.js +47 -0
- package/dist/crm/associations.js.map +1 -0
- package/dist/crm/records.d.ts +63 -0
- package/dist/crm/records.d.ts.map +1 -0
- package/dist/crm/records.js +333 -0
- package/dist/crm/records.js.map +1 -0
- package/dist/crm/search.d.ts +57 -0
- package/dist/crm/search.d.ts.map +1 -0
- package/dist/crm/search.js +47 -0
- package/dist/crm/search.js.map +1 -0
- package/dist/crm/source.d.ts +32 -0
- package/dist/crm/source.d.ts.map +1 -0
- package/dist/crm/source.js +369 -0
- package/dist/crm/source.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +2987 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +6499 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +205 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +810 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +1114 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/hubspot/account.d.ts +12 -0
- package/dist/hubspot/account.d.ts.map +1 -0
- package/dist/hubspot/account.js +23 -0
- package/dist/hubspot/account.js.map +1 -0
- package/dist/hubspot/transport.d.ts +76 -0
- package/dist/hubspot/transport.d.ts.map +1 -0
- package/dist/hubspot/transport.js +346 -0
- package/dist/hubspot/transport.js.map +1 -0
- package/dist/identity.d.ts +7 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +32 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +77 -0
- package/dist/program.js.map +1 -0
- package/dist/reasons.d.ts +10 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +33 -0
- package/dist/reasons.js.map +1 -0
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/records.d.ts +16 -0
- package/dist/sample/records.d.ts.map +1 -0
- package/dist/sample/records.js +22 -0
- package/dist/sample/records.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +153 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/setup/flow.d.ts +2 -0
- package/dist/setup/flow.d.ts.map +1 -0
- package/dist/setup/flow.js +97 -0
- package/dist/setup/flow.js.map +1 -0
- package/dist/setup/texts.en.json +19 -0
- package/dist/setup/texts.es.json +19 -0
- package/dist/setup/texts.ru.json +19 -0
- package/dist/store.d.ts +16 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +34 -0
- package/dist/store.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/dist/whoami.d.ts +19 -0
- package/dist/whoami.d.ts.map +1 -0
- package/dist/whoami.js +15 -0
- package/dist/whoami.js.map +1 -0
- package/package.json +98 -4
- package/skills/hubspot-cli/SKILL.md +97 -0
- package/skills/hubspot-cli/references/api/api-basic.md +462 -0
- package/skills/hubspot-cli/references/api/api-batch.md +149 -0
- package/skills/hubspot-cli/references/api/api-search.md +147 -0
- package/skills/hubspot-cli/references/api.md +15 -0
|
@@ -0,0 +1,2003 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
QUERY_LIMITS,
|
|
5
|
+
exhausted,
|
|
6
|
+
searchError
|
|
7
|
+
} from "./chunk-43EKCUBJ.js";
|
|
8
|
+
import {
|
|
9
|
+
fold
|
|
10
|
+
} from "./chunk-HZRQLAHO.js";
|
|
11
|
+
import {
|
|
12
|
+
CATALOG_KINDS,
|
|
13
|
+
CONTRACT_KINDS,
|
|
14
|
+
CONTRACT_STATUSES,
|
|
15
|
+
DEAL_KINDS,
|
|
16
|
+
DEAL_STATUSES,
|
|
17
|
+
INVOICE_DIRECTIONS,
|
|
18
|
+
MONEY_DIRECTIONS,
|
|
19
|
+
ORDER_DIRECTIONS,
|
|
20
|
+
ORDER_PURPOSES,
|
|
21
|
+
ORDER_STATUSES,
|
|
22
|
+
SUBSCRIPTION_STATUSES,
|
|
23
|
+
TRANSACTION_STATUSES,
|
|
24
|
+
WALLET_KINDS,
|
|
25
|
+
looksLikeReference,
|
|
26
|
+
parseReference,
|
|
27
|
+
providerLabel,
|
|
28
|
+
providerNamed
|
|
29
|
+
} from "./chunk-QJW35N5V.js";
|
|
30
|
+
import {
|
|
31
|
+
CliError,
|
|
32
|
+
singleLine
|
|
33
|
+
} from "./chunk-DB2XKHI4.js";
|
|
34
|
+
import {
|
|
35
|
+
__name
|
|
36
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
37
|
+
|
|
38
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
39
|
+
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
40
|
+
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
41
|
+
var ROLE_ADDRESS_WORDS = {
|
|
42
|
+
noReply: ["noreply", "no-reply", "donotreply", "do-not-reply", "mailer-daemon", "bounce", "bounces"],
|
|
43
|
+
shared: [
|
|
44
|
+
"info",
|
|
45
|
+
"hello",
|
|
46
|
+
"hi",
|
|
47
|
+
"contact",
|
|
48
|
+
"contacts",
|
|
49
|
+
"support",
|
|
50
|
+
"help",
|
|
51
|
+
"helpdesk",
|
|
52
|
+
"service",
|
|
53
|
+
"sales",
|
|
54
|
+
"office",
|
|
55
|
+
"admin",
|
|
56
|
+
"team",
|
|
57
|
+
"billing",
|
|
58
|
+
"accounts",
|
|
59
|
+
"accounting",
|
|
60
|
+
"invoices",
|
|
61
|
+
"finance",
|
|
62
|
+
"hr",
|
|
63
|
+
"jobs",
|
|
64
|
+
"careers",
|
|
65
|
+
"press",
|
|
66
|
+
"media",
|
|
67
|
+
"marketing",
|
|
68
|
+
"partners",
|
|
69
|
+
"legal",
|
|
70
|
+
"privacy",
|
|
71
|
+
"security",
|
|
72
|
+
"abuse",
|
|
73
|
+
"postmaster",
|
|
74
|
+
"webmaster",
|
|
75
|
+
"mail",
|
|
76
|
+
"inbox",
|
|
77
|
+
"enquiries",
|
|
78
|
+
"inquiries",
|
|
79
|
+
"booking",
|
|
80
|
+
"reservations",
|
|
81
|
+
"orders",
|
|
82
|
+
"feedback",
|
|
83
|
+
"newsletter",
|
|
84
|
+
"notifications",
|
|
85
|
+
"alerts"
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
var bare = /* @__PURE__ */ __name((word) => word.replace(/[.\-_]/gu, ""), "bare");
|
|
89
|
+
var NO_REPLY = new Set(ROLE_ADDRESS_WORDS.noReply.map(bare));
|
|
90
|
+
var ROLE = new Set([...ROLE_ADDRESS_WORDS.shared, ...ROLE_ADDRESS_WORDS.noReply].map(bare));
|
|
91
|
+
var localWord = /* @__PURE__ */ __name((address) => {
|
|
92
|
+
const local = address.trim().toLowerCase().split("@")[0] ?? "";
|
|
93
|
+
return bare(local.split("+")[0] ?? "");
|
|
94
|
+
}, "localWord");
|
|
95
|
+
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
96
|
+
var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
97
|
+
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
98
|
+
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
99
|
+
|
|
100
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
101
|
+
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
102
|
+
var literal = /* @__PURE__ */ __name((c) => ({
|
|
103
|
+
kind: "char",
|
|
104
|
+
ranges: [[c.codePointAt(0) ?? 0, c.codePointAt(0) ?? 0]],
|
|
105
|
+
negate: false
|
|
106
|
+
}), "literal");
|
|
107
|
+
var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end: pattern.length }) => {
|
|
108
|
+
if (pattern.length > QUERY_LIMITS.pattern * 2)
|
|
109
|
+
exhausted("pattern");
|
|
110
|
+
const chars = [...pattern];
|
|
111
|
+
if (chars.length > QUERY_LIMITS.pattern)
|
|
112
|
+
exhausted("pattern");
|
|
113
|
+
let at = 0, depth = 0;
|
|
114
|
+
const failure = /* @__PURE__ */ __name(() => searchError("query.invalid-regex", span, "use the supported Lucene regex subset"), "failure");
|
|
115
|
+
const character = /* @__PURE__ */ __name(() => {
|
|
116
|
+
if (at >= chars.length)
|
|
117
|
+
return failure();
|
|
118
|
+
return chars[at++];
|
|
119
|
+
}, "character");
|
|
120
|
+
const predefined = /* @__PURE__ */ __name(() => {
|
|
121
|
+
if (chars[at] !== "\\")
|
|
122
|
+
return void 0;
|
|
123
|
+
const name = chars[at + 1] ?? "";
|
|
124
|
+
let ranges;
|
|
125
|
+
if (name.toLowerCase() === "d")
|
|
126
|
+
ranges = [[48, 57]];
|
|
127
|
+
if (name.toLowerCase() === "w")
|
|
128
|
+
ranges = [
|
|
129
|
+
[48, 57],
|
|
130
|
+
[65, 90],
|
|
131
|
+
[95, 95],
|
|
132
|
+
[97, 122]
|
|
133
|
+
];
|
|
134
|
+
if (name.toLowerCase() === "s")
|
|
135
|
+
ranges = [
|
|
136
|
+
[9, 10],
|
|
137
|
+
[13, 13],
|
|
138
|
+
[32, 32]
|
|
139
|
+
];
|
|
140
|
+
if (ranges) {
|
|
141
|
+
at += 2;
|
|
142
|
+
return { kind: "char", ranges, negate: name === name.toUpperCase() };
|
|
143
|
+
}
|
|
144
|
+
if (/^[a-zA-Z]$/u.test(name))
|
|
145
|
+
return failure();
|
|
146
|
+
return void 0;
|
|
147
|
+
}, "predefined");
|
|
148
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
149
|
+
if (chars[at] === "\\")
|
|
150
|
+
at++;
|
|
151
|
+
return character();
|
|
152
|
+
}, "escaped");
|
|
153
|
+
const union = /* @__PURE__ */ __name(() => {
|
|
154
|
+
if (++depth > QUERY_LIMITS.depth)
|
|
155
|
+
exhausted("pattern depth");
|
|
156
|
+
const children = [concat()];
|
|
157
|
+
while (chars[at] === "|") {
|
|
158
|
+
at++;
|
|
159
|
+
children.push(concat());
|
|
160
|
+
}
|
|
161
|
+
depth--;
|
|
162
|
+
return children.length === 1 ? children[0] : { kind: "union", children };
|
|
163
|
+
}, "union");
|
|
164
|
+
const concat = /* @__PURE__ */ __name(() => {
|
|
165
|
+
const children = [];
|
|
166
|
+
do {
|
|
167
|
+
children.push(repeat());
|
|
168
|
+
} while (at < chars.length && ![")", "|", "&"].includes(chars[at] ?? ""));
|
|
169
|
+
if (chars[at] === "&")
|
|
170
|
+
searchError("query.unsupported-regex", span, "automaton intersection is not supported");
|
|
171
|
+
return children.length === 1 ? children[0] : { kind: "concat", children };
|
|
172
|
+
}, "concat");
|
|
173
|
+
const repeat = /* @__PURE__ */ __name(() => {
|
|
174
|
+
let child = simple();
|
|
175
|
+
while (["?", "*", "+", "{"].includes(chars[at] ?? "")) {
|
|
176
|
+
const op = character();
|
|
177
|
+
let min = op === "+" ? 1 : 0, max = op === "?" ? 1 : null;
|
|
178
|
+
if (op === "{") {
|
|
179
|
+
const number = /* @__PURE__ */ __name(() => {
|
|
180
|
+
const start2 = at;
|
|
181
|
+
while (/^[0-9]$/u.test(chars[at] ?? ""))
|
|
182
|
+
at++;
|
|
183
|
+
if (at === start2)
|
|
184
|
+
return failure();
|
|
185
|
+
return Number(chars.slice(start2, at).join(""));
|
|
186
|
+
}, "number");
|
|
187
|
+
min = number();
|
|
188
|
+
max = min;
|
|
189
|
+
if (chars[at] === ",") {
|
|
190
|
+
at++;
|
|
191
|
+
max = chars[at] === "}" ? null : number();
|
|
192
|
+
}
|
|
193
|
+
if (character() !== "}" || max !== null && max < min)
|
|
194
|
+
return failure();
|
|
195
|
+
}
|
|
196
|
+
if (min > QUERY_LIMITS.states || max !== null && max > QUERY_LIMITS.states)
|
|
197
|
+
exhausted("automaton states");
|
|
198
|
+
child = { kind: "repeat", child, min, max };
|
|
199
|
+
}
|
|
200
|
+
return child;
|
|
201
|
+
}, "repeat");
|
|
202
|
+
const simple = /* @__PURE__ */ __name(() => {
|
|
203
|
+
const predefinedAtom = predefined();
|
|
204
|
+
if (predefinedAtom)
|
|
205
|
+
return predefinedAtom;
|
|
206
|
+
const c = character();
|
|
207
|
+
if (c === "~" || c === "<")
|
|
208
|
+
searchError("query.unsupported-regex", span, "complement, named automata and numeric intervals are not supported");
|
|
209
|
+
if (c === ".")
|
|
210
|
+
return any;
|
|
211
|
+
if (c === "#")
|
|
212
|
+
return { kind: "empty" };
|
|
213
|
+
if (c === "@")
|
|
214
|
+
return { kind: "repeat", child: any, min: 0, max: null };
|
|
215
|
+
if (c === '"') {
|
|
216
|
+
const children = [];
|
|
217
|
+
while (chars[at] !== '"')
|
|
218
|
+
children.push(literal(character()));
|
|
219
|
+
at++;
|
|
220
|
+
return { kind: "concat", children };
|
|
221
|
+
}
|
|
222
|
+
if (c === "(") {
|
|
223
|
+
if (chars[at] === ")") {
|
|
224
|
+
at++;
|
|
225
|
+
return { kind: "epsilon" };
|
|
226
|
+
}
|
|
227
|
+
if (chars[at] === "?")
|
|
228
|
+
searchError("query.unsupported-regex", span, "JavaScript groups and lookaround are not Lucene operators");
|
|
229
|
+
const child = union();
|
|
230
|
+
if (character() !== ")")
|
|
231
|
+
return failure();
|
|
232
|
+
return child;
|
|
233
|
+
}
|
|
234
|
+
if (c === "[") {
|
|
235
|
+
const negate = chars[at] === "^";
|
|
236
|
+
if (negate)
|
|
237
|
+
at++;
|
|
238
|
+
const choices = [];
|
|
239
|
+
do {
|
|
240
|
+
const pre = predefined();
|
|
241
|
+
if (pre) {
|
|
242
|
+
choices.push(pre);
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const lo = escaped().codePointAt(0) ?? 0;
|
|
246
|
+
let hi = lo;
|
|
247
|
+
if (chars[at] === "-") {
|
|
248
|
+
at++;
|
|
249
|
+
hi = escaped().codePointAt(0) ?? 0;
|
|
250
|
+
}
|
|
251
|
+
if (hi < lo)
|
|
252
|
+
return failure();
|
|
253
|
+
choices.push({ kind: "char", ranges: [[lo, hi]], negate: false });
|
|
254
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
255
|
+
if (character() !== "]")
|
|
256
|
+
return failure();
|
|
257
|
+
if (!negate)
|
|
258
|
+
return { kind: "union", children: choices };
|
|
259
|
+
const ranges = [];
|
|
260
|
+
for (const choice of choices) {
|
|
261
|
+
if (choice.kind !== "char" || choice.negate)
|
|
262
|
+
searchError("query.unsupported-regex", span, "negative predefined classes inside a negated class are not supported");
|
|
263
|
+
ranges.push(...choice.ranges);
|
|
264
|
+
}
|
|
265
|
+
return { kind: "char", ranges, negate: true };
|
|
266
|
+
}
|
|
267
|
+
if (c === "\\")
|
|
268
|
+
return literal(character());
|
|
269
|
+
return literal(c);
|
|
270
|
+
}, "simple");
|
|
271
|
+
const expression = chars.length === 0 ? { kind: "epsilon" } : union();
|
|
272
|
+
if (at !== chars.length)
|
|
273
|
+
return failure();
|
|
274
|
+
const states = [];
|
|
275
|
+
const state = /* @__PURE__ */ __name(() => {
|
|
276
|
+
if (states.length >= QUERY_LIMITS.states)
|
|
277
|
+
exhausted("automaton states");
|
|
278
|
+
states.push({ epsilon: [], edges: [] });
|
|
279
|
+
return states.length - 1;
|
|
280
|
+
}, "state");
|
|
281
|
+
const epsilon = /* @__PURE__ */ __name((from, to) => {
|
|
282
|
+
;
|
|
283
|
+
states[from].epsilon.push(to);
|
|
284
|
+
}, "epsilon");
|
|
285
|
+
const build = /* @__PURE__ */ __name((node, from, to) => {
|
|
286
|
+
if (node.kind === "char") {
|
|
287
|
+
;
|
|
288
|
+
states[from].edges.push({ to, atom: node });
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (node.kind === "empty")
|
|
292
|
+
return;
|
|
293
|
+
if (node.kind === "epsilon") {
|
|
294
|
+
epsilon(from, to);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (node.kind === "union") {
|
|
298
|
+
for (const child of node.children)
|
|
299
|
+
build(child, from, to);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
if (node.kind === "concat") {
|
|
303
|
+
let current2 = from;
|
|
304
|
+
node.children.forEach((child, index) => {
|
|
305
|
+
const next = index === node.children.length - 1 ? to : state();
|
|
306
|
+
build(child, current2, next);
|
|
307
|
+
current2 = next;
|
|
308
|
+
});
|
|
309
|
+
if (node.children.length === 0)
|
|
310
|
+
epsilon(from, to);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
let current = from;
|
|
314
|
+
for (let i = 0; i < node.min; i++) {
|
|
315
|
+
const next = state();
|
|
316
|
+
build(node.child, current, next);
|
|
317
|
+
current = next;
|
|
318
|
+
}
|
|
319
|
+
if (node.max === null) {
|
|
320
|
+
epsilon(current, to);
|
|
321
|
+
const end2 = state();
|
|
322
|
+
build(node.child, current, end2);
|
|
323
|
+
epsilon(end2, current);
|
|
324
|
+
} else {
|
|
325
|
+
for (let i = node.min; i < node.max; i++) {
|
|
326
|
+
epsilon(current, to);
|
|
327
|
+
const next = state();
|
|
328
|
+
build(node.child, current, next);
|
|
329
|
+
current = next;
|
|
330
|
+
}
|
|
331
|
+
epsilon(current, to);
|
|
332
|
+
}
|
|
333
|
+
}, "build");
|
|
334
|
+
const start = state(), end = state();
|
|
335
|
+
build(expression, start, end);
|
|
336
|
+
return {
|
|
337
|
+
states: states.length,
|
|
338
|
+
test: /* @__PURE__ */ __name((text2, budget = { work: 0 }) => {
|
|
339
|
+
const spend = /* @__PURE__ */ __name(() => {
|
|
340
|
+
if (++budget.work > (budget.maxWork ?? QUERY_LIMITS.work))
|
|
341
|
+
exhausted("automaton work");
|
|
342
|
+
}, "spend");
|
|
343
|
+
const closure = /* @__PURE__ */ __name((initial) => {
|
|
344
|
+
const stack = [...initial];
|
|
345
|
+
while (stack.length) {
|
|
346
|
+
const id = stack.pop();
|
|
347
|
+
for (const next of states[id].epsilon) {
|
|
348
|
+
spend();
|
|
349
|
+
if (!initial.has(next)) {
|
|
350
|
+
initial.add(next);
|
|
351
|
+
stack.push(next);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return initial;
|
|
356
|
+
}, "closure");
|
|
357
|
+
let current = closure(/* @__PURE__ */ new Set([start]));
|
|
358
|
+
for (const c of text2) {
|
|
359
|
+
const point = c.codePointAt(0) ?? 0;
|
|
360
|
+
const next = /* @__PURE__ */ new Set();
|
|
361
|
+
for (const id of current)
|
|
362
|
+
for (const edge of states[id].edges) {
|
|
363
|
+
spend();
|
|
364
|
+
const inside = edge.atom.ranges.some(([lo, hi]) => point >= lo && point <= hi);
|
|
365
|
+
if (inside !== edge.atom.negate)
|
|
366
|
+
next.add(edge.to);
|
|
367
|
+
}
|
|
368
|
+
current = closure(next);
|
|
369
|
+
if (current.size === 0)
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
return current.has(end);
|
|
373
|
+
}, "test")
|
|
374
|
+
};
|
|
375
|
+
}, "compileAutomaton");
|
|
376
|
+
var wildcardPattern = /* @__PURE__ */ __name((value) => {
|
|
377
|
+
const chars = [...value];
|
|
378
|
+
let pattern = "";
|
|
379
|
+
for (let at = 0; at < chars.length; at++) {
|
|
380
|
+
const c = chars[at];
|
|
381
|
+
if (c === "\\") {
|
|
382
|
+
const escaped = chars[++at];
|
|
383
|
+
if (escaped === void 0)
|
|
384
|
+
searchError("query.invalid-escape", { start: 0, end: value.length });
|
|
385
|
+
pattern += /[|&?*+(){}[\].#@<>"~\\]/u.test(escaped) ? `\\${escaped}` : escaped;
|
|
386
|
+
} else
|
|
387
|
+
pattern += c === "*" ? ".*" : c === "?" ? "." : /[|&?*+(){}[\].#@<>"~\\]/u.test(c) ? `\\${c}` : c;
|
|
388
|
+
}
|
|
389
|
+
return pattern;
|
|
390
|
+
}, "wildcardPattern");
|
|
391
|
+
var FOLD_RANGE = 4096;
|
|
392
|
+
var unfoldable = /* @__PURE__ */ __name((span, what) => searchError("query.unsupported-regex", span, `${what} has no single lowercase form without accents, which is what text: words are \u2014 write it that way, or use body:/\u2026/ to match the original text`), "unfoldable");
|
|
393
|
+
var classChar = /* @__PURE__ */ __name((point) => {
|
|
394
|
+
const c = String.fromCodePoint(point);
|
|
395
|
+
return /[\p{L}\p{N}]/u.test(c) ? c : `\\${c}`;
|
|
396
|
+
}, "classChar");
|
|
397
|
+
var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
398
|
+
const chars = [...pattern.normalize("NFC")];
|
|
399
|
+
let out = "";
|
|
400
|
+
let at = 0;
|
|
401
|
+
const literal2 = /* @__PURE__ */ __name((c) => {
|
|
402
|
+
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
403
|
+
return c;
|
|
404
|
+
const folded = fold(c);
|
|
405
|
+
if (folded === "")
|
|
406
|
+
return unfoldable(span, `"${c}"`);
|
|
407
|
+
if ([...folded].length === 1 && /[\p{L}\p{N}]/u.test(folded))
|
|
408
|
+
return folded;
|
|
409
|
+
if (folded.includes('"'))
|
|
410
|
+
return unfoldable(span, `"${c}"`);
|
|
411
|
+
return `"${folded}"`;
|
|
412
|
+
}, "literal");
|
|
413
|
+
const characterClass = /* @__PURE__ */ __name(() => {
|
|
414
|
+
const begin = at - 1;
|
|
415
|
+
let negate = "";
|
|
416
|
+
if (chars[at] === "^") {
|
|
417
|
+
negate = "^";
|
|
418
|
+
at++;
|
|
419
|
+
}
|
|
420
|
+
const kept2 = [];
|
|
421
|
+
const points = /* @__PURE__ */ new Set();
|
|
422
|
+
do {
|
|
423
|
+
const start = at;
|
|
424
|
+
if (chars[at] === "\\" && /^[a-zA-Z]$/u.test(chars[at + 1] ?? "")) {
|
|
425
|
+
kept2.push(`\\${chars[at + 1]}`);
|
|
426
|
+
at += 2;
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
430
|
+
if (chars[at] === "\\")
|
|
431
|
+
at++;
|
|
432
|
+
return (chars[at++] ?? "").codePointAt(0) ?? 0;
|
|
433
|
+
}, "escaped");
|
|
434
|
+
const lo = escaped();
|
|
435
|
+
let hi = lo;
|
|
436
|
+
if (chars[at] === "-") {
|
|
437
|
+
at++;
|
|
438
|
+
hi = escaped();
|
|
439
|
+
}
|
|
440
|
+
if (at > chars.length) {
|
|
441
|
+
out += chars.slice(begin).join("");
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const single = /* @__PURE__ */ __name((point) => [...fold(String.fromCodePoint(point))], "single");
|
|
445
|
+
if (hi < lo)
|
|
446
|
+
kept2.push(chars.slice(start, at).join(""));
|
|
447
|
+
else if (hi - lo >= FOLD_RANGE) {
|
|
448
|
+
if (single(lo).join("") !== String.fromCodePoint(lo) || single(hi).join("") !== String.fromCodePoint(hi))
|
|
449
|
+
unfoldable(span, `the range ${chars.slice(start, at).join("")}`);
|
|
450
|
+
kept2.push(chars.slice(start, at).join(""));
|
|
451
|
+
} else
|
|
452
|
+
for (let point = lo; point <= hi; point++) {
|
|
453
|
+
const folded = single(point);
|
|
454
|
+
if (folded.length === 1)
|
|
455
|
+
points.add(folded[0]?.codePointAt(0) ?? 0);
|
|
456
|
+
else if (lo === hi)
|
|
457
|
+
unfoldable(span, `"${String.fromCodePoint(point)}"`);
|
|
458
|
+
}
|
|
459
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
460
|
+
const sorted = [...points].sort((a, b) => a - b);
|
|
461
|
+
const ranges = [];
|
|
462
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
463
|
+
const first = sorted[i];
|
|
464
|
+
while (sorted[i + 1] === sorted[i] + 1)
|
|
465
|
+
i++;
|
|
466
|
+
const last = sorted[i];
|
|
467
|
+
ranges.push(last === first ? classChar(first) : `${classChar(first)}-${classChar(last)}`);
|
|
468
|
+
}
|
|
469
|
+
if (!kept2.length && !ranges.length)
|
|
470
|
+
unfoldable(span, "the class");
|
|
471
|
+
out += `[${negate}${kept2.join("")}${ranges.join("")}`;
|
|
472
|
+
}, "characterClass");
|
|
473
|
+
while (at < chars.length) {
|
|
474
|
+
const c = chars[at++];
|
|
475
|
+
if (c === "\\") {
|
|
476
|
+
const next = chars[at++];
|
|
477
|
+
if (next === void 0)
|
|
478
|
+
out += c;
|
|
479
|
+
else
|
|
480
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal2(next);
|
|
481
|
+
} else if (c === '"') {
|
|
482
|
+
const end = chars.indexOf('"', at);
|
|
483
|
+
if (end < 0) {
|
|
484
|
+
out += chars.slice(at - 1).join("");
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
const folded = fold(chars.slice(at, end).join(""));
|
|
488
|
+
if (folded.includes('"'))
|
|
489
|
+
unfoldable(span, `"${chars.slice(at, end).join("")}"`);
|
|
490
|
+
out += `"${folded}"`;
|
|
491
|
+
at = end + 1;
|
|
492
|
+
} else if (c === "[")
|
|
493
|
+
characterClass();
|
|
494
|
+
else
|
|
495
|
+
out += literal2(c);
|
|
496
|
+
}
|
|
497
|
+
return out;
|
|
498
|
+
}, "foldRegex");
|
|
499
|
+
|
|
500
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
501
|
+
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
502
|
+
const padded = ` ${term} `;
|
|
503
|
+
const pieces = /* @__PURE__ */ new Set();
|
|
504
|
+
for (let at = 0; at + 3 <= padded.length; at++)
|
|
505
|
+
pieces.add(padded.slice(at, at + 3));
|
|
506
|
+
return [...pieces];
|
|
507
|
+
}, "trigrams");
|
|
508
|
+
|
|
509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
510
|
+
var TAKES = {
|
|
511
|
+
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
512
|
+
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
513
|
+
};
|
|
514
|
+
var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
515
|
+
var wrongKind = /* @__PURE__ */ __name((text2, kind, takes) => new CliError("validation_error", `${text2} names ${article(kind)} ${kind}; this takes ${TAKES[takes]}`, {
|
|
516
|
+
reason: "ref.wrong-kind"
|
|
517
|
+
}), "wrongKind");
|
|
518
|
+
var wrongProvider = /* @__PURE__ */ __name((text2, provider, kind) => {
|
|
519
|
+
const entry = providerNamed(provider);
|
|
520
|
+
const command = entry?.command;
|
|
521
|
+
const opens = kind === "entity" ? void 0 : entry?.opens?.[kind];
|
|
522
|
+
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text2}` : "open it with its own CLI";
|
|
523
|
+
const label2 = providerLabel(provider);
|
|
524
|
+
return new CliError("validation_error", `${text2} is ${article(label2.toLowerCase())} ${label2} ${kind}; ${how}`, {
|
|
525
|
+
reason: "ref.wrong-provider"
|
|
526
|
+
});
|
|
527
|
+
}, "wrongProvider");
|
|
528
|
+
var chatReferenceOf = /* @__PURE__ */ __name((text2, provider, takes = "chat") => {
|
|
529
|
+
const trimmed = text2.trim();
|
|
530
|
+
if (!looksLikeReference(trimmed))
|
|
531
|
+
return void 0;
|
|
532
|
+
const reference = parseReference(trimmed);
|
|
533
|
+
if (reference.type !== "chat" && reference.type !== "message")
|
|
534
|
+
throw wrongKind(trimmed, reference.type, takes);
|
|
535
|
+
if (reference.provider !== provider)
|
|
536
|
+
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
537
|
+
const found = {
|
|
538
|
+
text: trimmed,
|
|
539
|
+
provider: reference.provider,
|
|
540
|
+
account: reference.account,
|
|
541
|
+
chat: reference.chat,
|
|
542
|
+
...reference.type === "message" ? { message: reference.message } : {}
|
|
543
|
+
};
|
|
544
|
+
return found;
|
|
545
|
+
}, "chatReferenceOf");
|
|
546
|
+
var contactReferenceOf = /* @__PURE__ */ __name((text2, provider) => {
|
|
547
|
+
const trimmed = text2.trim();
|
|
548
|
+
if (!trimmed.startsWith("contact:"))
|
|
549
|
+
return void 0;
|
|
550
|
+
const reference = parseReference(trimmed);
|
|
551
|
+
if (reference.type !== "contact")
|
|
552
|
+
return void 0;
|
|
553
|
+
if (provider !== void 0 && reference.provider !== provider)
|
|
554
|
+
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
555
|
+
return reference.id;
|
|
556
|
+
}, "contactReferenceOf");
|
|
557
|
+
var wrongAccount = /* @__PURE__ */ __name((reference, scope, profiles) => {
|
|
558
|
+
const here = scope.account === void 0 ? "the account of this profile is not known yet" : `${scope.profile === void 0 ? "this profile" : `profile ${scope.profile}`} is account ${scope.account}`;
|
|
559
|
+
const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
|
|
560
|
+
return new CliError("validation_error", `${reference.text} belongs to account ${reference.account}; ${here}${others}`, { reason: "ref.wrong-account" });
|
|
561
|
+
}, "wrongAccount");
|
|
562
|
+
var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn) => {
|
|
563
|
+
if (scope.account !== void 0 && scope.account === reference.account)
|
|
564
|
+
return;
|
|
565
|
+
const profiles = await profilesOn?.(reference.account).catch(() => void 0);
|
|
566
|
+
throw wrongAccount(reference, scope, profiles);
|
|
567
|
+
}, "ensureAccount");
|
|
568
|
+
|
|
569
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
570
|
+
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
571
|
+
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
572
|
+
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
573
|
+
const wanted = foldName(reference.trim());
|
|
574
|
+
const matches = chats.filter((chat) => chat.title !== null && foldName(chat.title).includes(wanted));
|
|
575
|
+
if (matches.length === 1 && matches[0])
|
|
576
|
+
return matches[0];
|
|
577
|
+
if (matches.length === 0)
|
|
578
|
+
throw new CliError("not_found", `no chat matches "${reference}"`);
|
|
579
|
+
throw ambiguous(reference, "chats", matches.map((chat) => ({ id: chat.id, title: chat.title })), ({ title }) => singleLine(String(title)));
|
|
580
|
+
}, "pickChat");
|
|
581
|
+
var pickPerson = /* @__PURE__ */ __name((reference, people) => {
|
|
582
|
+
const trimmed = reference.trim();
|
|
583
|
+
const contact = contactReferenceOf(trimmed, people.provider);
|
|
584
|
+
if (contact !== void 0) {
|
|
585
|
+
const named = people.get(contact);
|
|
586
|
+
if (named)
|
|
587
|
+
return named;
|
|
588
|
+
throw new CliError("not_found", `no person ${contact} in what this account has seen`);
|
|
589
|
+
}
|
|
590
|
+
const known = people.get(trimmed);
|
|
591
|
+
if (known)
|
|
592
|
+
return known;
|
|
593
|
+
if (isId(trimmed))
|
|
594
|
+
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
595
|
+
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
596
|
+
const everyone = people.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
597
|
+
const exact = everyone.filter((person) => namesOf(person).includes(wanted));
|
|
598
|
+
const containing = everyone.filter((person) => namesOf(person).some((one) => one.includes(wanted)));
|
|
599
|
+
if (exact.length === 1 && exact[0])
|
|
600
|
+
return exact[0];
|
|
601
|
+
if (containing.length === 1 && containing[0])
|
|
602
|
+
return containing[0];
|
|
603
|
+
if (containing.length === 0)
|
|
604
|
+
throw new CliError("not_found", `nobody matches "${reference}"`);
|
|
605
|
+
const matches = exact.length > 0 ? [...exact, ...containing.filter((person) => !exact.includes(person))] : containing;
|
|
606
|
+
throw ambiguous(reference, "people", matches.map(({ id, name, username }) => ({ id, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
607
|
+
}, "pickPerson");
|
|
608
|
+
var namesOf = /* @__PURE__ */ __name((person, byAddress = false) => [person.alias, person.name, person.username, byAddress ? person.id : void 0].filter(isPresent).map(foldName), "namesOf");
|
|
609
|
+
var chatNamesOf = /* @__PURE__ */ __name((chat) => [chat.title, chat.providerMetadata?.username].filter((one) => typeof one === "string" && one !== "").map(foldName), "chatNamesOf");
|
|
610
|
+
var namePattern = /* @__PURE__ */ __name((pattern) => {
|
|
611
|
+
const automaton = compileAutomaton(wildcardPattern(foldName(pattern.trim().replace(/^@/, ""))));
|
|
612
|
+
return (names) => names.some((one) => automaton.test(one));
|
|
613
|
+
}, "namePattern");
|
|
614
|
+
var peopleMatching = /* @__PURE__ */ __name((pattern, people, { byAddress = false } = {}) => {
|
|
615
|
+
const fits = namePattern(pattern);
|
|
616
|
+
return people.filter((person) => fits(namesOf(person, byAddress)));
|
|
617
|
+
}, "peopleMatching");
|
|
618
|
+
var chatsMatching = /* @__PURE__ */ __name((pattern, chats) => {
|
|
619
|
+
const fits = namePattern(pattern);
|
|
620
|
+
return chats.filter((chat) => fits(chatNamesOf(chat)));
|
|
621
|
+
}, "chatsMatching");
|
|
622
|
+
var nearest = /* @__PURE__ */ __name((pattern, items, names, most = 5) => {
|
|
623
|
+
const pieces = /* @__PURE__ */ __name((text2) => foldName(text2).split(/\s+/u).flatMap(trigrams), "pieces");
|
|
624
|
+
const wanted = new Set(pieces(pattern.replace(/\\(.)/gu, "$1").replace(/[*?@]/gu, " ").trim()));
|
|
625
|
+
if (wanted.size === 0)
|
|
626
|
+
return [];
|
|
627
|
+
return items.map((item) => ({
|
|
628
|
+
item,
|
|
629
|
+
score: names(item).flatMap(pieces).filter((piece) => wanted.has(piece)).length
|
|
630
|
+
})).filter(({ score }) => score > 1).toSorted((a, b) => b.score - a.score).slice(0, most).map(({ item }) => item);
|
|
631
|
+
}, "nearest");
|
|
632
|
+
var ambiguous = /* @__PURE__ */ __name((reference, what, candidates, label2) => {
|
|
633
|
+
const width = Math.max(...candidates.map(({ id }) => id.length));
|
|
634
|
+
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label2(candidate)}`).join("\n");
|
|
635
|
+
return new CliError("validation_error", `"${singleLine(reference)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
636
|
+
${lines}`, { candidates });
|
|
637
|
+
}, "ambiguous");
|
|
638
|
+
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
639
|
+
|
|
640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
641
|
+
var QUOTES = [
|
|
642
|
+
['"', '"'],
|
|
643
|
+
["'", "'"],
|
|
644
|
+
["\xAB", "\xBB"],
|
|
645
|
+
["\u201C", "\u201D"],
|
|
646
|
+
["\u201E", "\u201C"],
|
|
647
|
+
["\u2018", "\u2019"],
|
|
648
|
+
["`", "`"]
|
|
649
|
+
];
|
|
650
|
+
var READABLE = /[\p{L}\p{N}]/u;
|
|
651
|
+
var PLACEHOLDERS = /* @__PURE__ */ new Set(["null", "undefined", "none", "\u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438", "deleted account", "\u0443\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442"]);
|
|
652
|
+
var unquoted = /* @__PURE__ */ __name((text2) => {
|
|
653
|
+
let at = text2.replace(/\s+/gu, " ").trim();
|
|
654
|
+
for (; ; ) {
|
|
655
|
+
const pair = QUOTES.find(([open, close]) => at.length >= 2 && at.startsWith(open) && at.endsWith(close));
|
|
656
|
+
if (pair === void 0)
|
|
657
|
+
return at;
|
|
658
|
+
at = at.slice(pair[0].length, at.length - pair[1].length).trim();
|
|
659
|
+
}
|
|
660
|
+
}, "unquoted");
|
|
661
|
+
var given = /* @__PURE__ */ __name((value) => {
|
|
662
|
+
const text2 = typeof value === "string" ? value.trim() : "";
|
|
663
|
+
return text2 === "" ? void 0 : text2;
|
|
664
|
+
}, "given");
|
|
665
|
+
var displayName = /* @__PURE__ */ __name((name, fallbacks = {}) => {
|
|
666
|
+
const unwrapped = typeof name === "string" ? unquoted(name) : "";
|
|
667
|
+
const cleaned = PLACEHOLDERS.has(unwrapped.toLowerCase()) ? "" : unwrapped;
|
|
668
|
+
if (READABLE.test(cleaned))
|
|
669
|
+
return cleaned;
|
|
670
|
+
const borrowed = fallbacks.name === void 0 || fallbacks.name === null ? null : displayName(fallbacks.name);
|
|
671
|
+
if (borrowed !== null && READABLE.test(borrowed) && !borrowed.startsWith("@"))
|
|
672
|
+
return borrowed;
|
|
673
|
+
const username = given(fallbacks.username);
|
|
674
|
+
return (username === void 0 ? void 0 : username.startsWith("@") ? username : `@${username}`) ?? given(fallbacks.phone) ?? given(fallbacks.email) ?? (cleaned === "" ? null : cleaned);
|
|
675
|
+
}, "displayName");
|
|
676
|
+
var present = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "" ? value : null, "present");
|
|
677
|
+
var takeFallbacks = /* @__PURE__ */ __name((into, identity) => {
|
|
678
|
+
const named = displayName(identity.name);
|
|
679
|
+
if (into.name === null && isReadable(named) && !named?.startsWith("@"))
|
|
680
|
+
into.name = named;
|
|
681
|
+
into.username ??= present(identity.username);
|
|
682
|
+
into.phone ??= present(identity.phone) ?? (identity.provider === "phone" ? identity.id : null);
|
|
683
|
+
into.email ??= present(identity.email) ?? (identity.provider === "email" ? identity.id : null);
|
|
684
|
+
return into;
|
|
685
|
+
}, "takeFallbacks");
|
|
686
|
+
var noFallbacks = /* @__PURE__ */ __name(() => ({ name: null, username: null, phone: null, email: null }), "noFallbacks");
|
|
687
|
+
var nameKey = /* @__PURE__ */ __name((name) => {
|
|
688
|
+
if (typeof name !== "string")
|
|
689
|
+
return null;
|
|
690
|
+
const unwrapped = unquoted(name);
|
|
691
|
+
if (PLACEHOLDERS.has(unwrapped.toLowerCase()))
|
|
692
|
+
return null;
|
|
693
|
+
const words = foldName(unwrapped).split(/[^\p{L}\p{N}]+/u).filter((word) => word !== "");
|
|
694
|
+
return words.length === 0 ? null : words.sort().join(" ");
|
|
695
|
+
}, "nameKey");
|
|
696
|
+
var isReadable = /* @__PURE__ */ __name((shown) => shown !== null && READABLE.test(shown), "isReadable");
|
|
697
|
+
|
|
698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
699
|
+
var PHONE_PLANS = [
|
|
700
|
+
{
|
|
701
|
+
country: "us",
|
|
702
|
+
code: "1",
|
|
703
|
+
trunk: "1",
|
|
704
|
+
lengths: [10],
|
|
705
|
+
valid: "[2-9]\\d{9}|3\\d{6}",
|
|
706
|
+
mobile: null
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
country: "ca",
|
|
710
|
+
code: "1",
|
|
711
|
+
trunk: "1",
|
|
712
|
+
lengths: [7, 10],
|
|
713
|
+
valid: "[2-9]\\d{9}|3\\d{6}",
|
|
714
|
+
mobile: null
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
country: "gb",
|
|
718
|
+
code: "44",
|
|
719
|
+
trunk: "0|180020",
|
|
720
|
+
lengths: [7, 9, 10],
|
|
721
|
+
valid: "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",
|
|
722
|
+
mobile: "7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
country: "ie",
|
|
726
|
+
code: "353",
|
|
727
|
+
trunk: "0",
|
|
728
|
+
lengths: [7, 8, 9, 10],
|
|
729
|
+
valid: "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",
|
|
730
|
+
mobile: "8(?:22|[35-9]\\d)\\d{6}"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
country: "es",
|
|
734
|
+
code: "34",
|
|
735
|
+
trunk: "",
|
|
736
|
+
lengths: [9],
|
|
737
|
+
valid: "(?:400|[5-9]\\d\\d)\\d{6}",
|
|
738
|
+
mobile: "96906(?:09|10)\\d\\d|(?:590(?:10[0-2]|600)|97390\\d)\\d{3}|(?:6\\d|7[1-48])\\d{7}"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
country: "pt",
|
|
742
|
+
code: "351",
|
|
743
|
+
trunk: "",
|
|
744
|
+
lengths: [9],
|
|
745
|
+
valid: "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",
|
|
746
|
+
mobile: "6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
country: "fr",
|
|
750
|
+
code: "33",
|
|
751
|
+
trunk: "0",
|
|
752
|
+
lengths: [9],
|
|
753
|
+
valid: "[1-9]\\d{8}",
|
|
754
|
+
mobile: "(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
country: "be",
|
|
758
|
+
code: "32",
|
|
759
|
+
trunk: "0",
|
|
760
|
+
lengths: [8, 9],
|
|
761
|
+
valid: "4\\d{8}|[1-9]\\d{7}",
|
|
762
|
+
mobile: "4[5-9]\\d{7}"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
country: "nl",
|
|
766
|
+
code: "31",
|
|
767
|
+
trunk: "0",
|
|
768
|
+
lengths: [5, 6, 7, 8, 9, 10, 11],
|
|
769
|
+
valid: "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",
|
|
770
|
+
mobile: "(?:6[1-58]|970\\d)\\d{7}"
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
country: "lu",
|
|
774
|
+
code: "352",
|
|
775
|
+
trunk: "",
|
|
776
|
+
lengths: [4, 5, 6, 7, 8, 9, 10, 11],
|
|
777
|
+
valid: "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",
|
|
778
|
+
mobile: "6(?:[26][18]|5[1568]|7[189]|81|9[128])\\d{6}"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
country: "de",
|
|
782
|
+
code: "49",
|
|
783
|
+
trunk: "0",
|
|
784
|
+
lengths: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
785
|
+
valid: "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",
|
|
786
|
+
mobile: "1(?:6[023]|7\\d)\\d{7,8}|15(?:[0-25-9]\\d\\d|3(?:10|33))\\d{6}"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
country: "at",
|
|
790
|
+
code: "43",
|
|
791
|
+
trunk: "0",
|
|
792
|
+
lengths: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
|
|
793
|
+
valid: "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",
|
|
794
|
+
mobile: "6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
country: "ch",
|
|
798
|
+
code: "41",
|
|
799
|
+
trunk: "0",
|
|
800
|
+
lengths: [9, 12],
|
|
801
|
+
valid: "8\\d{11}|[2-9]\\d{8}",
|
|
802
|
+
mobile: "(?:6[89]|7[235-9])\\d{7}"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
country: "li",
|
|
806
|
+
code: "423",
|
|
807
|
+
trunk: "0",
|
|
808
|
+
lengths: [7, 9],
|
|
809
|
+
valid: "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",
|
|
810
|
+
mobile: "(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-68]\\d|1[01]|3[7-9]|7[02]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
country: "it",
|
|
814
|
+
code: "39",
|
|
815
|
+
trunk: "",
|
|
816
|
+
lengths: [6, 7, 8, 9, 10, 11, 12],
|
|
817
|
+
valid: "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",
|
|
818
|
+
mobile: "3[2-9]\\d{7,8}|(?:31|43)\\d{8}"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
country: "mt",
|
|
822
|
+
code: "356",
|
|
823
|
+
trunk: "",
|
|
824
|
+
lengths: [8],
|
|
825
|
+
valid: "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",
|
|
826
|
+
mobile: "(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
country: "si",
|
|
830
|
+
code: "386",
|
|
831
|
+
trunk: "0",
|
|
832
|
+
lengths: [5, 6, 7, 8],
|
|
833
|
+
valid: "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",
|
|
834
|
+
mobile: "65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[013]|51|6[489])\\d{6}"
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
country: "hr",
|
|
838
|
+
code: "385",
|
|
839
|
+
trunk: "0",
|
|
840
|
+
lengths: [7, 8, 9],
|
|
841
|
+
valid: "[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",
|
|
842
|
+
mobile: "9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
country: "ba",
|
|
846
|
+
code: "387",
|
|
847
|
+
trunk: "0",
|
|
848
|
+
lengths: [8, 9],
|
|
849
|
+
valid: "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",
|
|
850
|
+
mobile: "6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
country: "rs",
|
|
854
|
+
code: "381",
|
|
855
|
+
trunk: "0",
|
|
856
|
+
lengths: [6, 7, 8, 9, 10, 11, 12],
|
|
857
|
+
valid: "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",
|
|
858
|
+
mobile: "6(?:[0-689]|7\\d)\\d{6,7}"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
country: "me",
|
|
862
|
+
code: "382",
|
|
863
|
+
trunk: "0",
|
|
864
|
+
lengths: [8, 9],
|
|
865
|
+
valid: "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",
|
|
866
|
+
mobile: "6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
country: "mk",
|
|
870
|
+
code: "389",
|
|
871
|
+
trunk: "0",
|
|
872
|
+
lengths: [8],
|
|
873
|
+
valid: "[2-578]\\d{7}",
|
|
874
|
+
mobile: "7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
country: "al",
|
|
878
|
+
code: "355",
|
|
879
|
+
trunk: "0",
|
|
880
|
+
lengths: [6, 7, 8, 9],
|
|
881
|
+
valid: "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",
|
|
882
|
+
mobile: "6(?:[78][2-9]|9\\d)\\d{6}"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
country: "gr",
|
|
886
|
+
code: "30",
|
|
887
|
+
trunk: "",
|
|
888
|
+
lengths: [10, 11, 12],
|
|
889
|
+
valid: "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",
|
|
890
|
+
mobile: "68[57-9]\\d{7}|(?:69|94)\\d{8}"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
country: "cy",
|
|
894
|
+
code: "357",
|
|
895
|
+
trunk: "",
|
|
896
|
+
lengths: [8],
|
|
897
|
+
valid: "(?:[279]\\d|[58]0)\\d{6}",
|
|
898
|
+
mobile: "9(?:10|[4-79]\\d)\\d{5}"
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
country: "bg",
|
|
902
|
+
code: "359",
|
|
903
|
+
trunk: "0",
|
|
904
|
+
lengths: [6, 7, 8, 9, 12],
|
|
905
|
+
valid: "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",
|
|
906
|
+
mobile: "(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}"
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
country: "ro",
|
|
910
|
+
code: "40",
|
|
911
|
+
trunk: "0",
|
|
912
|
+
lengths: [6, 9],
|
|
913
|
+
valid: "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",
|
|
914
|
+
mobile: "(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
country: "md",
|
|
918
|
+
code: "373",
|
|
919
|
+
trunk: "0",
|
|
920
|
+
lengths: [8],
|
|
921
|
+
valid: "(?:[235-7]\\d|[89]0)\\d{6}",
|
|
922
|
+
mobile: "562\\d{5}|(?:6\\d|7[16-9])\\d{6}"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
country: "hu",
|
|
926
|
+
code: "36",
|
|
927
|
+
trunk: "06",
|
|
928
|
+
lengths: [8, 9],
|
|
929
|
+
valid: "[235-7]\\d{8}|[1-9]\\d{7}",
|
|
930
|
+
mobile: "(?:[257]0|3[01])\\d{7}"
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
country: "sk",
|
|
934
|
+
code: "421",
|
|
935
|
+
trunk: "0",
|
|
936
|
+
lengths: [6, 7, 9],
|
|
937
|
+
valid: "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",
|
|
938
|
+
mobile: "909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
country: "cz",
|
|
942
|
+
code: "420",
|
|
943
|
+
trunk: "",
|
|
944
|
+
lengths: [9, 10, 11, 12],
|
|
945
|
+
valid: "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",
|
|
946
|
+
mobile: "7060\\d{5}|(?:60[1-8]|7(?:0[2-5]|19|[2379]\\d))\\d{6}"
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
country: "pl",
|
|
950
|
+
code: "48",
|
|
951
|
+
trunk: "",
|
|
952
|
+
lengths: [6, 7, 8, 9, 10],
|
|
953
|
+
valid: "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",
|
|
954
|
+
mobile: "21(?:1[013-5]|2\\d|3[1-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
country: "lt",
|
|
958
|
+
code: "370",
|
|
959
|
+
trunk: "[08]",
|
|
960
|
+
lengths: [8],
|
|
961
|
+
valid: "(?:[3469]\\d|52|[78]0)\\d{6}",
|
|
962
|
+
mobile: "6\\d{7}"
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
country: "lv",
|
|
966
|
+
code: "371",
|
|
967
|
+
trunk: "",
|
|
968
|
+
lengths: [8],
|
|
969
|
+
valid: "(?:[268]\\d|78|90)\\d{6}",
|
|
970
|
+
mobile: "2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
country: "ee",
|
|
974
|
+
code: "372",
|
|
975
|
+
trunk: "",
|
|
976
|
+
lengths: [7, 8, 10],
|
|
977
|
+
valid: "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",
|
|
978
|
+
mobile: "(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|[2-79]\\d\\d)\\d)|2(?:0(?:0(?:00|4\\d)|[1-7]\\d\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[013-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}"
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
country: "fi",
|
|
982
|
+
code: "358",
|
|
983
|
+
trunk: "0",
|
|
984
|
+
lengths: [5, 6, 7, 8, 9, 10, 11, 12],
|
|
985
|
+
valid: "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",
|
|
986
|
+
mobile: "4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
country: "se",
|
|
990
|
+
code: "46",
|
|
991
|
+
trunk: "0",
|
|
992
|
+
lengths: [6, 7, 8, 9, 10, 12],
|
|
993
|
+
valid: "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",
|
|
994
|
+
mobile: "7[023689]\\d{7}"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
country: "no",
|
|
998
|
+
code: "47",
|
|
999
|
+
trunk: "",
|
|
1000
|
+
lengths: [5, 8],
|
|
1001
|
+
valid: "(?:0|[2-9]\\d{3})\\d{4}",
|
|
1002
|
+
mobile: "45(?:[0-24-9]\\d|3[0-57-9])\\d{4}|(?:4[016-8]|9\\d)\\d{6}"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
country: "dk",
|
|
1006
|
+
code: "45",
|
|
1007
|
+
trunk: "",
|
|
1008
|
+
lengths: [8],
|
|
1009
|
+
valid: "[2-9]\\d{7}",
|
|
1010
|
+
mobile: "(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
country: "is",
|
|
1014
|
+
code: "354",
|
|
1015
|
+
trunk: "",
|
|
1016
|
+
lengths: [7, 9],
|
|
1017
|
+
valid: "(?:38\\d|[4-9])\\d{6}",
|
|
1018
|
+
mobile: "(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
country: "ua",
|
|
1022
|
+
code: "380",
|
|
1023
|
+
trunk: "0",
|
|
1024
|
+
lengths: [9, 10],
|
|
1025
|
+
valid: "[89]\\d{9}|[3-9]\\d{8}",
|
|
1026
|
+
mobile: "790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
country: "by",
|
|
1030
|
+
code: "375",
|
|
1031
|
+
trunk: "0|80?",
|
|
1032
|
+
lengths: [6, 7, 8, 9, 10, 11],
|
|
1033
|
+
valid: "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",
|
|
1034
|
+
mobile: "(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
country: "ru",
|
|
1038
|
+
code: "7",
|
|
1039
|
+
trunk: "8",
|
|
1040
|
+
lengths: [10, 14],
|
|
1041
|
+
valid: "8\\d{13}|[347-9]\\d{9}",
|
|
1042
|
+
mobile: "9\\d{9}"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
country: "kz",
|
|
1046
|
+
code: "7",
|
|
1047
|
+
trunk: "8",
|
|
1048
|
+
lengths: [10, 14],
|
|
1049
|
+
valid: "8\\d{13}|[78]\\d{9}",
|
|
1050
|
+
mobile: "7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}"
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
country: "ge",
|
|
1054
|
+
code: "995",
|
|
1055
|
+
trunk: "0",
|
|
1056
|
+
lengths: [9],
|
|
1057
|
+
valid: "(?:[3-57]\\d\\d|800)\\d{6}",
|
|
1058
|
+
mobile: "5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|4(?:0[04]0|411)|5222|9000)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|2[02]|3[0-6]|4[04]|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[02-6]|7[0-6])|4\\d\\d)|2(?:228|555)|3555|4(?:4(?:[02-9]\\d|14)|555)|5(?:[0157-9]\\d\\d|200|333|4(?:44|55))|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
country: "am",
|
|
1062
|
+
code: "374",
|
|
1063
|
+
trunk: "0",
|
|
1064
|
+
lengths: [8],
|
|
1065
|
+
valid: "(?:[1-489]\\d|55|60|77)\\d{6}",
|
|
1066
|
+
mobile: "(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
country: "tr",
|
|
1070
|
+
code: "90",
|
|
1071
|
+
trunk: "0",
|
|
1072
|
+
lengths: [7, 10, 12, 13],
|
|
1073
|
+
valid: "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",
|
|
1074
|
+
mobile: "5(?:61(?:011|61\\d)|82[2-5]\\d\\d)\\d{4}|5(?:[03-5]\\d|1[06]|24|6[24]|7[245]|9[46])\\d{7}"
|
|
1075
|
+
}
|
|
1076
|
+
];
|
|
1077
|
+
|
|
1078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
1079
|
+
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
1080
|
+
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
1081
|
+
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
1082
|
+
const countries = value.split(/[\s,]+/).map((one) => one.trim().toLowerCase()).filter(Boolean);
|
|
1083
|
+
const unknown = countries.filter((one) => !PHONE_COUNTRIES.includes(one));
|
|
1084
|
+
if (countries.length === 0 || unknown.length > 0)
|
|
1085
|
+
throw new CliError("validation_error", `phone_countries takes country codes, ${unknown.length > 0 ? `not ${unknown.join(", ")}` : "at least one"}: ` + PHONE_COUNTRIES.join(", "));
|
|
1086
|
+
return [...new Set(countries)];
|
|
1087
|
+
}, "parsePhoneCountries");
|
|
1088
|
+
var PLANS = new Map(PHONE_PLANS.map((plan) => [
|
|
1089
|
+
plan.country,
|
|
1090
|
+
{
|
|
1091
|
+
code: plan.code,
|
|
1092
|
+
trunk: plan.trunk ? new RegExp(`^(?:${plan.trunk})`) : null,
|
|
1093
|
+
lengths: new Set(plan.lengths),
|
|
1094
|
+
valid: new RegExp(`^(?:${plan.valid})$`),
|
|
1095
|
+
mobile: plan.mobile === null ? null : new RegExp(`^(?:${plan.mobile})$`)
|
|
1096
|
+
}
|
|
1097
|
+
]));
|
|
1098
|
+
var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
1099
|
+
for (const country of countries) {
|
|
1100
|
+
const plan = PLANS.get(country);
|
|
1101
|
+
if (!plan)
|
|
1102
|
+
continue;
|
|
1103
|
+
const readings = [
|
|
1104
|
+
...plan.trunk?.test(digits) ? [digits.replace(plan.trunk, "")] : [],
|
|
1105
|
+
digits,
|
|
1106
|
+
...digits.startsWith(plan.code) ? [digits.slice(plan.code.length)] : []
|
|
1107
|
+
];
|
|
1108
|
+
for (const national of readings) {
|
|
1109
|
+
if (!plan.lengths.has(national.length) || !plan.valid.test(national))
|
|
1110
|
+
continue;
|
|
1111
|
+
const mobile = plan.mobile?.test(national) ?? false;
|
|
1112
|
+
if (anyType || mobile)
|
|
1113
|
+
return { value: `+${plan.code}${national}`, national, mobile };
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return void 0;
|
|
1117
|
+
}, "nationalPhone");
|
|
1118
|
+
var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE_COUNTRIES } = {}) => {
|
|
1119
|
+
const text2 = typed.trim();
|
|
1120
|
+
if (!/^\+?[\d\s().\-–]+$/.test(text2))
|
|
1121
|
+
return void 0;
|
|
1122
|
+
const digits = text2.replace(/\(0\)/, "").replace(/\D/g, "").replace(/^00/, "");
|
|
1123
|
+
if (digits.length < 7 || digits.length > 15)
|
|
1124
|
+
return void 0;
|
|
1125
|
+
const national = nationalPhone(digits, phoneCountries, { anyType: true });
|
|
1126
|
+
const tail = national?.national ?? digits.replace(/^0+/, "");
|
|
1127
|
+
return {
|
|
1128
|
+
value: text2.startsWith("+") || /^00/.test(text2) ? `+${digits}` : national?.value ?? digits,
|
|
1129
|
+
national: tail.length >= 8 ? tail : null
|
|
1130
|
+
};
|
|
1131
|
+
}, "typedPhone");
|
|
1132
|
+
var e164Of = /* @__PURE__ */ __name((phone, region) => {
|
|
1133
|
+
if (/^\s*(\+|00)/.test(phone))
|
|
1134
|
+
return typedPhone(phone)?.value;
|
|
1135
|
+
if (typedPhone(phone) === void 0)
|
|
1136
|
+
return void 0;
|
|
1137
|
+
if (region === void 0)
|
|
1138
|
+
return null;
|
|
1139
|
+
const digits = phone.replace(/\(0\)/, "").replace(/\D/g, "");
|
|
1140
|
+
return nationalPhone(digits, [region], { anyType: true })?.value;
|
|
1141
|
+
}, "e164Of");
|
|
1142
|
+
var isMobilePhone = /* @__PURE__ */ __name((e164) => /^\+\d+$/.test(e164) && PHONE_COUNTRIES.some((country) => nationalPhone(e164.slice(1), [country], { anyType: false })?.value === e164), "isMobilePhone");
|
|
1143
|
+
var BARE_INTERNATIONAL_PROVIDERS = ["telegram", "max", "whatsapp"];
|
|
1144
|
+
var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
1145
|
+
if (/^\s*(\+|00)/.test(raw))
|
|
1146
|
+
return typedPhone(raw)?.value;
|
|
1147
|
+
if (!BARE_INTERNATIONAL_PROVIDERS.includes(provider))
|
|
1148
|
+
return void 0;
|
|
1149
|
+
const found = /^([1-9]\d{6,14})$/.exec(raw.trim());
|
|
1150
|
+
return found ? `+${found[1]}` : void 0;
|
|
1151
|
+
}, "storedPhone");
|
|
1152
|
+
|
|
1153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
1154
|
+
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
1155
|
+
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
1156
|
+
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
1157
|
+
var INSTANT = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]{1,9})?)?(Z|[+-][0-9]{2}:[0-9]{2})$";
|
|
1158
|
+
var text = /* @__PURE__ */ __name((description, maxLength = 2e3) => ({
|
|
1159
|
+
type: "string",
|
|
1160
|
+
minLength: 1,
|
|
1161
|
+
maxLength,
|
|
1162
|
+
...description ? { description } : {}
|
|
1163
|
+
}), "text");
|
|
1164
|
+
var decimal = /* @__PURE__ */ __name((description) => ({ type: "string", pattern: DECIMAL_PATTERN, description }), "decimal");
|
|
1165
|
+
var signedDecimal = /* @__PURE__ */ __name((description) => ({
|
|
1166
|
+
type: "string",
|
|
1167
|
+
pattern: SIGNED_DECIMAL,
|
|
1168
|
+
description
|
|
1169
|
+
}), "signedDecimal");
|
|
1170
|
+
var day = /* @__PURE__ */ __name((description) => ({ type: "string", pattern: DAY, description }), "day");
|
|
1171
|
+
var instant = /* @__PURE__ */ __name((description) => ({ type: "string", pattern: INSTANT, description }), "instant");
|
|
1172
|
+
var enumOf = /* @__PURE__ */ __name((values, description) => ({
|
|
1173
|
+
type: "string",
|
|
1174
|
+
enum: values,
|
|
1175
|
+
...description ? { description } : {}
|
|
1176
|
+
}), "enumOf");
|
|
1177
|
+
var currency = { type: "string", pattern: "^[A-Za-z]{3}$", description: "ISO 4217 code" };
|
|
1178
|
+
var nullable = /* @__PURE__ */ __name((schema) => {
|
|
1179
|
+
if (schema.type === void 0)
|
|
1180
|
+
return schema;
|
|
1181
|
+
const types = typeof schema.type === "string" ? [schema.type] : [...schema.type];
|
|
1182
|
+
return {
|
|
1183
|
+
...schema,
|
|
1184
|
+
type: types.includes("null") ? types : [...types, "null"],
|
|
1185
|
+
...schema.enum ? { enum: [...schema.enum, null] } : {}
|
|
1186
|
+
};
|
|
1187
|
+
}, "nullable");
|
|
1188
|
+
var objectOf = /* @__PURE__ */ __name((properties, { required, description } = {}) => ({
|
|
1189
|
+
type: "object",
|
|
1190
|
+
...description ? { description } : {},
|
|
1191
|
+
properties: Object.fromEntries(Object.entries(properties).map(([key, schema]) => [key, required?.includes(key) ? schema : nullable(schema)])),
|
|
1192
|
+
...required?.length ? { required } : {},
|
|
1193
|
+
additionalProperties: true
|
|
1194
|
+
}), "objectOf");
|
|
1195
|
+
var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
1196
|
+
type: "array",
|
|
1197
|
+
items: item,
|
|
1198
|
+
maxItems,
|
|
1199
|
+
description
|
|
1200
|
+
}), "arrayOf");
|
|
1201
|
+
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
1202
|
+
|
|
1203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
1204
|
+
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
1205
|
+
var PARTY = ["person", "organization"];
|
|
1206
|
+
var ORGANIZATION = ["organization"];
|
|
1207
|
+
var lineItem = objectOf({
|
|
1208
|
+
description: text("What the line is for; the product's name when left out", 2e3),
|
|
1209
|
+
quantity: decimal("A decimal, 1 when left out"),
|
|
1210
|
+
unit_price: decimal("A decimal in the parent's currency"),
|
|
1211
|
+
amount: decimal("A decimal in the parent's currency: quantity \xD7 unit price"),
|
|
1212
|
+
// Untyped: with options.lines text an invoice line's product is data, whatever v1 sent in it.
|
|
1213
|
+
product: { description: "The product record's external id in this account, read with options.lines products" },
|
|
1214
|
+
product_ref: { type: "string", pattern: "^product:[1-9][0-9]*$", description: "A product: ref of the store" }
|
|
1215
|
+
});
|
|
1216
|
+
var SMS_DIRECTIONS = ["in", "out"];
|
|
1217
|
+
var CALL_DIRECTIONS = ["in", "out", "missed"];
|
|
1218
|
+
var phoneFields = {
|
|
1219
|
+
phone: text("The other side's number as the phone shows it: read to E.164 with the store's phone_countries", 64),
|
|
1220
|
+
name: text("The other side's name as the phone shows it", 200)
|
|
1221
|
+
};
|
|
1222
|
+
var COUNTERPART = { counterpart: { targets: ["person"], linked: true } };
|
|
1223
|
+
var linesIn = /* @__PURE__ */ __name((table, parent) => ({ table, parent, references: { product: "product" }, refs: { product_ref: "product" } }), "linesIn");
|
|
1224
|
+
var dealFields = /* @__PURE__ */ __name((kind) => objectOf({
|
|
1225
|
+
title: text(`The ${kind}'s title`, 200),
|
|
1226
|
+
pipeline: text("The pipeline record's external id in this account", 512),
|
|
1227
|
+
stage: text("The stage's external id in that pipeline", 512),
|
|
1228
|
+
status: enumOf(DEAL_STATUSES, "Left out, the stage's outcome says it"),
|
|
1229
|
+
amount: decimal("A decimal in currency"),
|
|
1230
|
+
currency,
|
|
1231
|
+
close_date: day("When it is expected to close"),
|
|
1232
|
+
closed_date: day("When it was won or lost"),
|
|
1233
|
+
closed_reason: text("Why it was won or lost", 2e3),
|
|
1234
|
+
url: text("The source's page for it", 2e3)
|
|
1235
|
+
}, { required: ["title", "pipeline", "stage"] }), "dealFields");
|
|
1236
|
+
var RECORD_TYPES = {
|
|
1237
|
+
invoice: {
|
|
1238
|
+
table: "invoices",
|
|
1239
|
+
review: "proposal",
|
|
1240
|
+
update: "flag",
|
|
1241
|
+
tombstone: true,
|
|
1242
|
+
fields: objectOf({
|
|
1243
|
+
direction: enumOf(INVOICE_DIRECTIONS),
|
|
1244
|
+
number: text("The invoice's number", 80),
|
|
1245
|
+
currency,
|
|
1246
|
+
issue_date: day("The day it was issued"),
|
|
1247
|
+
due_date: day("The day it is due"),
|
|
1248
|
+
total: decimal("The printed total: refused when it is not the sum of the lines"),
|
|
1249
|
+
lines: arrayOf(lineItem, 500, "The invoice's lines")
|
|
1250
|
+
}),
|
|
1251
|
+
roles: {
|
|
1252
|
+
issuer: { targets: PARTY, v1: true, column: "issuer", pair: true },
|
|
1253
|
+
counterparty: { targets: PARTY, v1: true, column: "counterparty", pair: true },
|
|
1254
|
+
project: { targets: ["project"], v1: true, column: "project_id" },
|
|
1255
|
+
contract: { targets: ["contract"], column: "contract_id" },
|
|
1256
|
+
subscription: { targets: ["subscription"], column: "subscription_id" }
|
|
1257
|
+
},
|
|
1258
|
+
nested: { lines: linesIn("invoice_lines", "invoice_id") }
|
|
1259
|
+
},
|
|
1260
|
+
payment: {
|
|
1261
|
+
table: "payments",
|
|
1262
|
+
review: "proposal",
|
|
1263
|
+
update: "re-settle",
|
|
1264
|
+
tombstone: true,
|
|
1265
|
+
fields: objectOf({
|
|
1266
|
+
direction: enumOf(MONEY_DIRECTIONS),
|
|
1267
|
+
amount: decimal("A decimal in currency"),
|
|
1268
|
+
currency,
|
|
1269
|
+
date: day("The day it was paid"),
|
|
1270
|
+
reference: text("The payment's reference", 2e3)
|
|
1271
|
+
}),
|
|
1272
|
+
roles: {
|
|
1273
|
+
payer: { targets: PARTY, v1: true, column: "payer", pair: true },
|
|
1274
|
+
payee: { targets: PARTY, v1: true, column: "payee", pair: true },
|
|
1275
|
+
project: { targets: ["project"], v1: true, column: "project_id" },
|
|
1276
|
+
settles: { targets: ["invoice"], many: true, amount: true, v1: true },
|
|
1277
|
+
refund_of: { targets: ["payment"], column: "refund_of" },
|
|
1278
|
+
subscription: { targets: ["subscription"], column: "subscription_id" }
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
person: {
|
|
1282
|
+
table: "persons",
|
|
1283
|
+
review: "identity",
|
|
1284
|
+
update: "in-place",
|
|
1285
|
+
tombstone: false,
|
|
1286
|
+
fields: objectOf({
|
|
1287
|
+
name: kept("The person's name"),
|
|
1288
|
+
email: kept("E-mail addresses, one or a list: an exact one links the record to the one person who has it"),
|
|
1289
|
+
phone: kept("Phone numbers, one or a list: an exact one, read to E.164, links like an e-mail"),
|
|
1290
|
+
position: kept("The job title, kept beside each member-of as its position: never the role")
|
|
1291
|
+
}),
|
|
1292
|
+
roles: { "member-of": { targets: ORGANIZATION, relationship: "member-of", kept: true } }
|
|
1293
|
+
},
|
|
1294
|
+
organization: {
|
|
1295
|
+
table: "organizations",
|
|
1296
|
+
review: "identity",
|
|
1297
|
+
update: "in-place",
|
|
1298
|
+
tombstone: true,
|
|
1299
|
+
fields: objectOf({
|
|
1300
|
+
name: kept("The organization's name"),
|
|
1301
|
+
identifiers: kept("Strong identifiers, a list of {scheme, value}: scheme email, domain, tax-id:<cc> or registration:<cc>. One that another organization has links the record to it; any other item is kept as data")
|
|
1302
|
+
}),
|
|
1303
|
+
roles: {
|
|
1304
|
+
"customer-of": { targets: ORGANIZATION, relationship: "customer-of", kept: true },
|
|
1305
|
+
"partner-of": { targets: ORGANIZATION, relationship: "partner-of", kept: true }
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
project: {
|
|
1309
|
+
table: "projects",
|
|
1310
|
+
review: "identity",
|
|
1311
|
+
update: "in-place",
|
|
1312
|
+
tombstone: true,
|
|
1313
|
+
fields: objectOf({
|
|
1314
|
+
name: kept("The project's name"),
|
|
1315
|
+
key: kept("The project's key: an existing project with it is this one"),
|
|
1316
|
+
description: kept("What the project is")
|
|
1317
|
+
}),
|
|
1318
|
+
roles: { organization: { targets: ORGANIZATION, column: "organization_id" } }
|
|
1319
|
+
},
|
|
1320
|
+
order: {
|
|
1321
|
+
table: "orders",
|
|
1322
|
+
review: "proposal",
|
|
1323
|
+
update: "re-propose",
|
|
1324
|
+
tombstone: true,
|
|
1325
|
+
fields: objectOf({
|
|
1326
|
+
number: text("The order's number at the supplier", 80),
|
|
1327
|
+
direction: enumOf(ORDER_DIRECTIONS, "purchase when left out; in a sale the owner is the supplier"),
|
|
1328
|
+
purpose: enumOf(ORDER_PURPOSES, "business when left out"),
|
|
1329
|
+
status: enumOf(ORDER_STATUSES, "placed when left out"),
|
|
1330
|
+
supplier_name: text("The shop or supplier as the source names it", 200),
|
|
1331
|
+
order_date: day("The day it was ordered"),
|
|
1332
|
+
fulfilled_date: day("The day it was delivered"),
|
|
1333
|
+
currency,
|
|
1334
|
+
total: decimal("With lines, their sum"),
|
|
1335
|
+
source_url: text("The order's page at the shop", 2e3),
|
|
1336
|
+
lines: arrayOf(lineItem, 500, "The order's lines")
|
|
1337
|
+
}),
|
|
1338
|
+
roles: {
|
|
1339
|
+
customer: { targets: PARTY, column: "customer", pair: true },
|
|
1340
|
+
supplier: { targets: PARTY, column: "supplier", pair: true },
|
|
1341
|
+
project: { targets: ["project"], column: "project_id" },
|
|
1342
|
+
contract: { targets: ["contract"], column: "contract_id" },
|
|
1343
|
+
deal: { targets: ["deal"], column: "deal_id" },
|
|
1344
|
+
invoice: { targets: ["invoice"], column: "invoice_id" },
|
|
1345
|
+
payment: { targets: ["payment"], column: "payment_id" }
|
|
1346
|
+
},
|
|
1347
|
+
nested: { lines: linesIn("order_lines", "order_id") }
|
|
1348
|
+
},
|
|
1349
|
+
product: {
|
|
1350
|
+
table: "catalog_items",
|
|
1351
|
+
review: "direct",
|
|
1352
|
+
update: "in-place",
|
|
1353
|
+
tombstone: true,
|
|
1354
|
+
fields: objectOf({
|
|
1355
|
+
kind: enumOf(CATALOG_KINDS, "product when left out"),
|
|
1356
|
+
name: text("The product's name", 200),
|
|
1357
|
+
sku: text("The supplier's code for it", 80),
|
|
1358
|
+
unit: text("hour, pcs, month: free text", 40),
|
|
1359
|
+
unit_price: decimal("A decimal in currency"),
|
|
1360
|
+
currency,
|
|
1361
|
+
description: text("What it is", 2e3),
|
|
1362
|
+
archived_date: day("No longer sold from this day")
|
|
1363
|
+
}, { required: ["name"] }),
|
|
1364
|
+
roles: { supplier: { targets: PARTY, column: "supplier", pair: true } }
|
|
1365
|
+
},
|
|
1366
|
+
contract: {
|
|
1367
|
+
table: "contracts",
|
|
1368
|
+
review: "valued-proposal",
|
|
1369
|
+
update: "re-propose",
|
|
1370
|
+
tombstone: true,
|
|
1371
|
+
fields: objectOf({
|
|
1372
|
+
name: text("The contract's name", 200),
|
|
1373
|
+
number: text("The contract's number", 80),
|
|
1374
|
+
kind: enumOf(CONTRACT_KINDS),
|
|
1375
|
+
status: enumOf(CONTRACT_STATUSES, "active when left out"),
|
|
1376
|
+
signed_date: day("The day it was signed"),
|
|
1377
|
+
effective_date: day("The day it starts"),
|
|
1378
|
+
expiration_date: day("The day it ends; open-ended when left out"),
|
|
1379
|
+
auto_renew: { type: "boolean", description: "Whether it renews itself" },
|
|
1380
|
+
renewal: { type: "string", pattern: "^[1-9][0-9]{0,2}-(day|week|month|year)$", description: "1-year" },
|
|
1381
|
+
notice_days: { type: "integer", minimum: 0, maximum: 3650, description: "Days of notice before it ends" },
|
|
1382
|
+
terms: text("Renewal, cancellation and other terms, as text", 2e4),
|
|
1383
|
+
value: decimal("A decimal in currency: the contract is then a proposal"),
|
|
1384
|
+
currency
|
|
1385
|
+
}, { required: ["name", "kind"] }),
|
|
1386
|
+
roles: {
|
|
1387
|
+
project: { targets: ["project"], column: "project_id" },
|
|
1388
|
+
deal: { targets: ["deal"], column: "deal_id" },
|
|
1389
|
+
party: { targets: PARTY, many: true, relationship: "related-to", kept: true },
|
|
1390
|
+
document: { targets: ["document"], many: true, kept: true }
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
subscription: {
|
|
1394
|
+
table: "subscriptions",
|
|
1395
|
+
review: "proposal",
|
|
1396
|
+
update: "re-propose",
|
|
1397
|
+
tombstone: true,
|
|
1398
|
+
fields: objectOf({
|
|
1399
|
+
name: text("Its name; the product's when left out", 200),
|
|
1400
|
+
direction: enumOf(INVOICE_DIRECTIONS, "receivable: the owner bills it; payable: the owner pays it"),
|
|
1401
|
+
status: enumOf(SUBSCRIPTION_STATUSES),
|
|
1402
|
+
interval: { type: "string", pattern: "^[1-9][0-9]{0,2}-(day|week|month|year)$", description: "1-month" },
|
|
1403
|
+
start_date: day("The first day"),
|
|
1404
|
+
trial_end_date: day("The trial's last day"),
|
|
1405
|
+
next_renewal_date: day("The next renewal"),
|
|
1406
|
+
cancelled_date: day("The day it was cancelled"),
|
|
1407
|
+
end_date: day("The last day"),
|
|
1408
|
+
prices: arrayOf(objectOf({
|
|
1409
|
+
amount: decimal("A decimal in currency"),
|
|
1410
|
+
currency,
|
|
1411
|
+
effective_from: day("The day the price starts; the subscription's start when left out")
|
|
1412
|
+
}, { required: ["amount", "currency"] }), 100, "Its prices, each from a day; a price is never overwritten")
|
|
1413
|
+
}, { required: ["direction", "interval", "start_date"] }),
|
|
1414
|
+
roles: {
|
|
1415
|
+
supplier: { targets: PARTY, column: "supplier", pair: true },
|
|
1416
|
+
customer: { targets: PARTY, column: "customer", pair: true },
|
|
1417
|
+
product: { targets: ["product"], column: "catalog_item_id" },
|
|
1418
|
+
contract: { targets: ["contract"], column: "contract_id" },
|
|
1419
|
+
project: { targets: ["project"], column: "project_id" }
|
|
1420
|
+
},
|
|
1421
|
+
nested: { prices: { table: "subscription_prices", parent: "subscription_id" } }
|
|
1422
|
+
},
|
|
1423
|
+
wallet: {
|
|
1424
|
+
table: "financial_accounts",
|
|
1425
|
+
review: "direct",
|
|
1426
|
+
update: "in-place",
|
|
1427
|
+
tombstone: true,
|
|
1428
|
+
fields: objectOf({
|
|
1429
|
+
name: text("The account's name", 200),
|
|
1430
|
+
kind: enumOf(WALLET_KINDS, "bank when left out"),
|
|
1431
|
+
currency,
|
|
1432
|
+
institution: text("The bank, as text", 200),
|
|
1433
|
+
number_hint: text("The last 4 characters of its number; a whole IBAN or card number is refused", 4),
|
|
1434
|
+
opening_balance: signedDecimal("Kept in the record only: the owner sets the wallet's opening balance"),
|
|
1435
|
+
opening_date: day("The day of that balance")
|
|
1436
|
+
}, { required: ["name", "currency"] }),
|
|
1437
|
+
roles: { holder: { targets: PARTY, column: "holder", pair: true } }
|
|
1438
|
+
},
|
|
1439
|
+
transaction: {
|
|
1440
|
+
table: "financial_transactions",
|
|
1441
|
+
review: "proposal",
|
|
1442
|
+
update: "re-propose",
|
|
1443
|
+
tombstone: true,
|
|
1444
|
+
fields: objectOf({
|
|
1445
|
+
direction: enumOf(MONEY_DIRECTIONS),
|
|
1446
|
+
amount: decimal("A decimal above 0 in the wallet's currency"),
|
|
1447
|
+
currency,
|
|
1448
|
+
status: enumOf(TRANSACTION_STATUSES, "booked when left out"),
|
|
1449
|
+
date: day("The day the statement shows"),
|
|
1450
|
+
booked_date: day("The day it was booked; the statement day when left out"),
|
|
1451
|
+
description: text("As the statement says it", 2e3),
|
|
1452
|
+
counterparty_name: text("As the statement names the other side", 200),
|
|
1453
|
+
reference: text("The statement's reference", 200),
|
|
1454
|
+
splits: arrayOf(objectOf({
|
|
1455
|
+
amount: decimal("A decimal above 0"),
|
|
1456
|
+
category: text("Free text, such as rent", 200),
|
|
1457
|
+
note: text("A note", 2e3)
|
|
1458
|
+
}, { required: ["amount", "category"] }), 100, "Categories of its amount; what they leave is uncategorized")
|
|
1459
|
+
}, { required: ["direction", "amount", "date"] }),
|
|
1460
|
+
roles: {
|
|
1461
|
+
wallet: { targets: ["wallet"], required: true, column: "financial_account_id" },
|
|
1462
|
+
counterparty: { targets: PARTY, column: "counterparty", pair: true },
|
|
1463
|
+
payment: { targets: ["payment"], column: "payment_id" },
|
|
1464
|
+
project: { targets: ["project"], column: "project_id" }
|
|
1465
|
+
},
|
|
1466
|
+
nested: { splits: { table: "transaction_splits", parent: "transaction_id" } }
|
|
1467
|
+
},
|
|
1468
|
+
deal: {
|
|
1469
|
+
table: "deals",
|
|
1470
|
+
review: "direct",
|
|
1471
|
+
update: "in-place",
|
|
1472
|
+
tombstone: true,
|
|
1473
|
+
fields: dealFields("deal"),
|
|
1474
|
+
references: { pipeline: "pipeline" },
|
|
1475
|
+
roles: {
|
|
1476
|
+
organization: { targets: ORGANIZATION, column: "organization_id" },
|
|
1477
|
+
person: { targets: ["person"], many: true, relationship: "related-to", kept: true },
|
|
1478
|
+
project: { targets: ["project"], column: "project_id" }
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
lead: {
|
|
1482
|
+
table: "leads",
|
|
1483
|
+
review: "direct",
|
|
1484
|
+
update: "in-place",
|
|
1485
|
+
tombstone: true,
|
|
1486
|
+
fields: dealFields("lead"),
|
|
1487
|
+
references: { pipeline: "pipeline" },
|
|
1488
|
+
roles: {
|
|
1489
|
+
organization: { targets: ORGANIZATION, column: "organization_id" },
|
|
1490
|
+
person: { targets: ["person"], many: true, relationship: "related-to", kept: true },
|
|
1491
|
+
project: { targets: ["project"], column: "project_id" },
|
|
1492
|
+
deal: { targets: ["deal"], column: "deal_id" }
|
|
1493
|
+
}
|
|
1494
|
+
},
|
|
1495
|
+
message: {
|
|
1496
|
+
table: "messages",
|
|
1497
|
+
review: "direct",
|
|
1498
|
+
update: "in-place",
|
|
1499
|
+
tombstone: true,
|
|
1500
|
+
importOnly: true,
|
|
1501
|
+
sheet: false,
|
|
1502
|
+
fields: objectOf({
|
|
1503
|
+
kind: enumOf(["sms"], "sms: a text message of the phone"),
|
|
1504
|
+
direction: enumOf(SMS_DIRECTIONS, "in: the other side wrote it; out: the owner did"),
|
|
1505
|
+
...phoneFields,
|
|
1506
|
+
thread: text("The phone's thread id; the number when left out", 512),
|
|
1507
|
+
body: { type: "string", maxLength: 2e4, description: "The text" },
|
|
1508
|
+
sent_at: instant("When it was sent"),
|
|
1509
|
+
read: { type: "boolean", description: "An incoming message the owner opened" }
|
|
1510
|
+
}, { required: ["kind", "direction", "phone", "body", "sent_at"] }),
|
|
1511
|
+
roles: COUNTERPART
|
|
1512
|
+
},
|
|
1513
|
+
event: {
|
|
1514
|
+
table: "events",
|
|
1515
|
+
review: "direct",
|
|
1516
|
+
update: "in-place",
|
|
1517
|
+
tombstone: true,
|
|
1518
|
+
importOnly: true,
|
|
1519
|
+
sheet: false,
|
|
1520
|
+
fields: objectOf({
|
|
1521
|
+
kind: enumOf(["call"], "call: a phone call"),
|
|
1522
|
+
direction: enumOf(CALL_DIRECTIONS, "in, out, or missed: a call the owner did not take"),
|
|
1523
|
+
...phoneFields,
|
|
1524
|
+
started_at: instant("When it rang"),
|
|
1525
|
+
duration: { type: "integer", minimum: 0, maximum: 604800, description: "Seconds talked; 0 when missed" }
|
|
1526
|
+
}, { required: ["kind", "direction", "phone", "started_at"] }),
|
|
1527
|
+
roles: COUNTERPART
|
|
1528
|
+
},
|
|
1529
|
+
document: {
|
|
1530
|
+
table: "documents",
|
|
1531
|
+
review: "direct",
|
|
1532
|
+
update: "in-place",
|
|
1533
|
+
tombstone: true,
|
|
1534
|
+
importOnly: true,
|
|
1535
|
+
fieldsBytes: 1048576,
|
|
1536
|
+
fields: objectOf({
|
|
1537
|
+
title: text("What the document is called; its external id when left out", 500),
|
|
1538
|
+
text: { type: "string", maxLength: 1e6, description: "The text search reads" },
|
|
1539
|
+
created_at: instant("When the source made it"),
|
|
1540
|
+
updated_at: instant("When the source last changed it: what date: reads"),
|
|
1541
|
+
url: text("Where the original is", 4096),
|
|
1542
|
+
metadata: { type: "object", description: "Anything else the source knows about it, kept as sent" }
|
|
1543
|
+
}, { required: ["text"] }),
|
|
1544
|
+
roles: {
|
|
1545
|
+
about: { targets: ["person", "organization", "deal", "event"], many: true }
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
pipeline: {
|
|
1549
|
+
table: "pipelines",
|
|
1550
|
+
review: "direct",
|
|
1551
|
+
update: "in-place",
|
|
1552
|
+
tombstone: false,
|
|
1553
|
+
fields: objectOf({
|
|
1554
|
+
kind: enumOf(DEAL_KINDS, "deal when left out"),
|
|
1555
|
+
name: text("The pipeline's name", 80),
|
|
1556
|
+
stages: arrayOf(objectOf({
|
|
1557
|
+
external_id: text("The stage's id at the source", 512),
|
|
1558
|
+
name: text("The stage's name", 80),
|
|
1559
|
+
position: { type: "integer", minimum: 0, maximum: 1e3 },
|
|
1560
|
+
outcome: enumOf(DEAL_STATUSES, "open when left out")
|
|
1561
|
+
}, { required: ["external_id", "name"] }), 30, "The stages in order")
|
|
1562
|
+
}, { required: ["name", "stages"] }),
|
|
1563
|
+
roles: {},
|
|
1564
|
+
nested: { stages: { table: "pipeline_stages", parent: "pipeline_id" } }
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
var isRecordType = /* @__PURE__ */ __name((type) => Object.hasOwn(RECORD_TYPES, type), "isRecordType");
|
|
1568
|
+
var isBusinessType = /* @__PURE__ */ __name((type) => isRecordType(type) && RECORD_TYPES[type].review !== "identity" && type !== "document", "isBusinessType");
|
|
1569
|
+
var isIdentityType = /* @__PURE__ */ __name((type) => typeof type === "string" && isRecordType(type) && RECORD_TYPES[type].review === "identity", "isIdentityType");
|
|
1570
|
+
var RECORD_ENTITY_TYPES = Object.keys(RECORD_TYPES);
|
|
1571
|
+
var RECORD_TABLES = Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, spec]) => [type, spec.table]));
|
|
1572
|
+
var decidedOf = /* @__PURE__ */ __name((types) => Object.fromEntries(Object.entries(types).flatMap(([type, spec]) => spec.review === "proposal" || spec.review === "valued-proposal" ? [[type, spec.table]] : [])), "decidedOf");
|
|
1573
|
+
var DECIDED_TABLES = {
|
|
1574
|
+
...decidedOf(RECORD_TYPES),
|
|
1575
|
+
subscription_price: "subscription_prices"
|
|
1576
|
+
};
|
|
1577
|
+
var WORD_BODY = "[a-z0-9][a-z0-9_-]{0,62}";
|
|
1578
|
+
var TYPE_PATTERN = `^(${RECORD_ENTITY_TYPES.join("|")}|custom:${WORD_BODY})$`;
|
|
1579
|
+
var TYPE_RULE = `a type is one of ${RECORD_ENTITY_TYPES.join(", ")} or custom:<name>`;
|
|
1580
|
+
var rolesOf = /* @__PURE__ */ __name((type) => Object.entries(RECORD_TYPES[type].roles), "rolesOf");
|
|
1581
|
+
var roleOf = /* @__PURE__ */ __name((type, role) => {
|
|
1582
|
+
if (!isRecordType(type))
|
|
1583
|
+
return void 0;
|
|
1584
|
+
const roles = RECORD_TYPES[type].roles;
|
|
1585
|
+
return Object.hasOwn(roles, role) ? roles[role] : void 0;
|
|
1586
|
+
}, "roleOf");
|
|
1587
|
+
var nestedOf = /* @__PURE__ */ __name((type) => Object.entries(RECORD_TYPES[type].nested ?? {}), "nestedOf");
|
|
1588
|
+
var referencesOf = /* @__PURE__ */ __name((type) => Object.entries(RECORD_TYPES[type].references ?? {}), "referencesOf");
|
|
1589
|
+
var roleNames = /* @__PURE__ */ __name((types, keep) => [
|
|
1590
|
+
...new Set(types.flatMap((type) => rolesOf(type).flatMap(([name, role]) => keep(role) ? [name] : [])))
|
|
1591
|
+
], "roleNames");
|
|
1592
|
+
var AMOUNT_ROLES = roleNames(RECORD_ENTITY_TYPES, (role) => role.amount);
|
|
1593
|
+
var FIELD_REFERENCE_ROLES = roleNames(RECORD_ENTITY_TYPES, (role) => role.v1 && !role.many);
|
|
1594
|
+
var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf(type).some(([, role]) => role.v1), "hasV1Roles");
|
|
1595
|
+
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
1596
|
+
var article2 = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
1597
|
+
|
|
1598
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
1599
|
+
import { createHash } from "node:crypto";
|
|
1600
|
+
var RECORDS_SCHEMA_VERSION = 1;
|
|
1601
|
+
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
1602
|
+
var LINE_OPTIONS = ["text", "products"];
|
|
1603
|
+
var WORD = `^${WORD_BODY}$`;
|
|
1604
|
+
var MAX_ID = 512;
|
|
1605
|
+
var MAX_RELATIONS = 100;
|
|
1606
|
+
var DECIMAL = DECIMAL_PATTERN;
|
|
1607
|
+
var REF = "^[a-z]+:[^\\s]{1,500}$";
|
|
1608
|
+
var fieldsDef = /* @__PURE__ */ __name((type) => `fields-${type}`, "fieldsDef");
|
|
1609
|
+
var RECORDS_ENVELOPE_SCHEMA = {
|
|
1610
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1611
|
+
title: "WireCat records envelope, version 1",
|
|
1612
|
+
description: "Records one source sends to the store. JSONL is the same model: the first line holds schema_version, source and options, each further line one record.",
|
|
1613
|
+
type: "object",
|
|
1614
|
+
required: ["schema_version", "source", "records"],
|
|
1615
|
+
additionalProperties: false,
|
|
1616
|
+
properties: {
|
|
1617
|
+
schema_version: { const: RECORDS_SCHEMA_VERSION },
|
|
1618
|
+
source: { $ref: "#/$defs/source" },
|
|
1619
|
+
options: { $ref: "#/$defs/options" },
|
|
1620
|
+
records: { type: "array", items: { $ref: "#/$defs/record" } }
|
|
1621
|
+
},
|
|
1622
|
+
$defs: {
|
|
1623
|
+
source: {
|
|
1624
|
+
type: "object",
|
|
1625
|
+
required: ["provider", "account", "batch_id"],
|
|
1626
|
+
additionalProperties: false,
|
|
1627
|
+
properties: {
|
|
1628
|
+
provider: { type: "string", pattern: WORD, description: "The system the records come from" },
|
|
1629
|
+
account: { type: "string", minLength: 1, maxLength: MAX_ID, description: "The account in that system" },
|
|
1630
|
+
batch_id: { type: "string", minLength: 1, maxLength: MAX_ID, description: "This import, for the receipt" }
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
options: {
|
|
1634
|
+
type: "object",
|
|
1635
|
+
additionalProperties: false,
|
|
1636
|
+
properties: {
|
|
1637
|
+
lines: {
|
|
1638
|
+
enum: [...LINE_OPTIONS],
|
|
1639
|
+
description: "products: an invoice line's product (an external id) names its product; text, the default, keeps it as data. Order lines always read it, and product_ref (a product: ref) is read on every line."
|
|
1640
|
+
},
|
|
1641
|
+
phone_region: {
|
|
1642
|
+
type: "string",
|
|
1643
|
+
pattern: "^[A-Za-z]{2}$",
|
|
1644
|
+
description: "The country a person's phone without + is read in. Without it such a number is an identifier only when exactly one country of the store's phone_countries setting reads it as valid"
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
},
|
|
1648
|
+
record: {
|
|
1649
|
+
type: "object",
|
|
1650
|
+
required: ["key", "type", "external_id", "operation"],
|
|
1651
|
+
additionalProperties: false,
|
|
1652
|
+
properties: {
|
|
1653
|
+
key: { type: "string", minLength: 1, maxLength: MAX_ID },
|
|
1654
|
+
type: { type: "string", pattern: TYPE_PATTERN },
|
|
1655
|
+
external_id: { type: "string", minLength: 1, maxLength: MAX_ID },
|
|
1656
|
+
operation: { enum: [...RECORD_OPERATIONS] },
|
|
1657
|
+
fields: {
|
|
1658
|
+
type: "object",
|
|
1659
|
+
description: "What the source says, as data: never secrets, never instructions"
|
|
1660
|
+
},
|
|
1661
|
+
revision: { type: "integer", minimum: 0, maximum: Number.MAX_SAFE_INTEGER },
|
|
1662
|
+
relations: { type: "array", maxItems: MAX_RELATIONS, items: { $ref: "#/$defs/relation" } }
|
|
1663
|
+
},
|
|
1664
|
+
allOf: RECORD_ENTITY_TYPES.map((type) => ({
|
|
1665
|
+
if: { properties: { type: { const: type } }, required: ["type"] },
|
|
1666
|
+
// biome-ignore lint/suspicious/noThenProperty: JSON Schema's own if/then keyword, never awaited.
|
|
1667
|
+
then: { properties: { fields: { $ref: `#/$defs/${fieldsDef(type)}` } } }
|
|
1668
|
+
}))
|
|
1669
|
+
},
|
|
1670
|
+
relation: {
|
|
1671
|
+
type: "object",
|
|
1672
|
+
required: ["role"],
|
|
1673
|
+
additionalProperties: false,
|
|
1674
|
+
oneOf: [{ required: ["type", "external_id"] }, { required: ["ref"] }],
|
|
1675
|
+
properties: {
|
|
1676
|
+
role: { type: "string", pattern: WORD },
|
|
1677
|
+
type: { type: "string", pattern: TYPE_PATTERN },
|
|
1678
|
+
external_id: { type: "string", minLength: 1, maxLength: MAX_ID },
|
|
1679
|
+
ref: { type: "string", pattern: REF, description: "A store entity, such as organization:12" },
|
|
1680
|
+
as: {
|
|
1681
|
+
type: "string",
|
|
1682
|
+
pattern: WORD,
|
|
1683
|
+
description: "On a relationship role: the part the target plays, such as decision-maker"
|
|
1684
|
+
},
|
|
1685
|
+
amount: {
|
|
1686
|
+
type: "string",
|
|
1687
|
+
pattern: DECIMAL,
|
|
1688
|
+
description: "A settles relation's share of the payment, a decimal in its currency"
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
...Object.fromEntries(RECORD_ENTITY_TYPES.map((type) => [fieldsDef(type), RECORD_TYPES[type].fields]))
|
|
1693
|
+
}
|
|
1694
|
+
};
|
|
1695
|
+
var wordPattern = new RegExp(WORD);
|
|
1696
|
+
var typePattern = new RegExp(TYPE_PATTERN);
|
|
1697
|
+
var decimalPattern = new RegExp(DECIMAL);
|
|
1698
|
+
var refPattern = new RegExp(REF);
|
|
1699
|
+
var escapePointer = /* @__PURE__ */ __name((segment) => String(segment).replaceAll("~", "~0").replaceAll("/", "~1"), "escapePointer");
|
|
1700
|
+
var pointerOf = /* @__PURE__ */ __name((...segments) => segments.map((s) => `/${escapePointer(s)}`).join(""), "pointerOf");
|
|
1701
|
+
var canonical = /* @__PURE__ */ __name((value) => {
|
|
1702
|
+
if (Array.isArray(value))
|
|
1703
|
+
return value.map(canonical);
|
|
1704
|
+
if (!isObject(value))
|
|
1705
|
+
return value;
|
|
1706
|
+
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonical(value[key])]));
|
|
1707
|
+
}, "canonical");
|
|
1708
|
+
var recordFingerprint = /* @__PURE__ */ __name((fields, relations) => createHash("sha256").update(JSON.stringify(canonical({
|
|
1709
|
+
fields,
|
|
1710
|
+
relations: relations.map((relation) => [
|
|
1711
|
+
relation.role,
|
|
1712
|
+
...relation.ref === void 0 ? [relation.type, relation.external_id] : [`ref=${relation.ref}`],
|
|
1713
|
+
...relation.amount === void 0 ? [] : [relation.amount],
|
|
1714
|
+
...relation.as === void 0 ? [] : [`as=${relation.as}`]
|
|
1715
|
+
]).sort((a, b) => a.join("\0").localeCompare(b.join("\0")))
|
|
1716
|
+
}))).digest("hex"), "recordFingerprint");
|
|
1717
|
+
var fieldReferences = /* @__PURE__ */ __name((record, options = {}) => {
|
|
1718
|
+
if (record.operation !== "upsert" || !isRecordType(record.type))
|
|
1719
|
+
return [];
|
|
1720
|
+
const fields = record.fields ?? {};
|
|
1721
|
+
const found = [];
|
|
1722
|
+
for (const [key, type] of referencesOf(record.type))
|
|
1723
|
+
if (typeof fields[key] === "string")
|
|
1724
|
+
found.push({ role: `fields.${key}`, type, external_id: fields[key] });
|
|
1725
|
+
if (record.type === "invoice" && options.lines !== "products")
|
|
1726
|
+
return found;
|
|
1727
|
+
for (const [list, spec] of nestedOf(record.type)) {
|
|
1728
|
+
const items = fields[list];
|
|
1729
|
+
if (!Array.isArray(items))
|
|
1730
|
+
continue;
|
|
1731
|
+
for (const item of items)
|
|
1732
|
+
for (const [key, type] of Object.entries(spec.references ?? {}))
|
|
1733
|
+
if (isObject(item) && typeof item[key] === "string")
|
|
1734
|
+
found.push({ role: `fields.${list}.${key}`, type, external_id: item[key] });
|
|
1735
|
+
}
|
|
1736
|
+
return found;
|
|
1737
|
+
}, "fieldReferences");
|
|
1738
|
+
|
|
1739
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
1740
|
+
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
1741
|
+
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
1742
|
+
var counterObservationTime = /* @__PURE__ */ __name((observation, now) => {
|
|
1743
|
+
const at = Date.parse(observation.observedAt);
|
|
1744
|
+
if (!validCounter(observation.value) || !Number.isSafeInteger(at) || at < 0 || at > now || !["remote_fetch", "remote_update"].includes(observation.source))
|
|
1745
|
+
throw new CliError("validation_error", "counter observation needs a valid value, source and nonfuture observation time");
|
|
1746
|
+
if (observation.reactions && (!validCounter(observation.reactions.total) || observation.reactions.total !== observation.value))
|
|
1747
|
+
throw new CliError("validation_error", "reaction observation payload and total disagree");
|
|
1748
|
+
return at;
|
|
1749
|
+
}, "counterObservationTime");
|
|
1750
|
+
var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
1751
|
+
if (!states.length || states.every((one) => one.freshness === "unknown"))
|
|
1752
|
+
return "unknown";
|
|
1753
|
+
if (states.some((one) => one.freshness === "unknown"))
|
|
1754
|
+
return "partial";
|
|
1755
|
+
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
1756
|
+
}, "counterFreshness");
|
|
1757
|
+
|
|
1758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
1759
|
+
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
1760
|
+
var AUTHOR_MEASURES = [
|
|
1761
|
+
"messages",
|
|
1762
|
+
"words",
|
|
1763
|
+
"reactions",
|
|
1764
|
+
"replies",
|
|
1765
|
+
"answers",
|
|
1766
|
+
"answer-time",
|
|
1767
|
+
"threads",
|
|
1768
|
+
"active-days"
|
|
1769
|
+
];
|
|
1770
|
+
var CONTEXT = /* @__PURE__ */ new Set([
|
|
1771
|
+
"replies",
|
|
1772
|
+
"replies-from-others",
|
|
1773
|
+
"replies-from-others-per-message",
|
|
1774
|
+
"thread-size",
|
|
1775
|
+
"threads",
|
|
1776
|
+
"answers",
|
|
1777
|
+
"answer-time"
|
|
1778
|
+
]);
|
|
1779
|
+
var needsRankingContext = /* @__PURE__ */ __name((options) => options.components.some((name) => CONTEXT.has(name)), "needsRankingContext");
|
|
1780
|
+
var presets = {
|
|
1781
|
+
helpful: { answers: 0.5, "replies-from-others": 0.25, reactions: 0.25 },
|
|
1782
|
+
active: { "active-days": 0.6, messages: 0.4 },
|
|
1783
|
+
engaging: { "reactions-per-message": 0.5, "replies-from-others-per-message": 0.5 }
|
|
1784
|
+
};
|
|
1785
|
+
function invalid(message) {
|
|
1786
|
+
throw new CliError("validation_error", message, { reason: "ranking.invalid" });
|
|
1787
|
+
}
|
|
1788
|
+
__name(invalid, "invalid");
|
|
1789
|
+
var rankingOptions = /* @__PURE__ */ __name((target, input) => {
|
|
1790
|
+
const measures = target === "messages" ? MESSAGE_MEASURES : AUTHOR_MEASURES;
|
|
1791
|
+
const { measure, score, weights: given2, minMessages } = input;
|
|
1792
|
+
const messageKind = input.messageKind ?? "all";
|
|
1793
|
+
if (!["all", "posts", "comments"].includes(messageKind))
|
|
1794
|
+
invalid("message_kind takes all, posts or comments");
|
|
1795
|
+
if (target === "messages" && minMessages !== void 0)
|
|
1796
|
+
invalid("min_messages applies to stats contacts top");
|
|
1797
|
+
if (minMessages !== void 0 && (!Number.isSafeInteger(minMessages) || minMessages < 1))
|
|
1798
|
+
invalid("min_messages takes a positive integer");
|
|
1799
|
+
if (measure !== void 0 && !measures.includes(measure))
|
|
1800
|
+
invalid(`--measure takes ${measures.join(", ")}`);
|
|
1801
|
+
if (measure !== void 0 && (score !== void 0 || given2 !== void 0))
|
|
1802
|
+
invalid("--measure cannot be combined with --score or --weights");
|
|
1803
|
+
if (score !== void 0 && !["helpful", "active", "engaging"].includes(score))
|
|
1804
|
+
invalid("--score takes helpful, active or engaging");
|
|
1805
|
+
if (target === "messages" && score !== void 0 && score !== "engaging")
|
|
1806
|
+
invalid("helpful and active scores apply to authors only");
|
|
1807
|
+
const scoring = score !== void 0 || given2 !== void 0;
|
|
1808
|
+
const preset = score;
|
|
1809
|
+
let weights = null;
|
|
1810
|
+
if (scoring) {
|
|
1811
|
+
let raw = given2 !== void 0 ? given2 : target === "messages" ? { reactions: 0.5, "replies-from-others": 0.5 } : presets[preset];
|
|
1812
|
+
if (typeof raw === "string") {
|
|
1813
|
+
try {
|
|
1814
|
+
raw = JSON.parse(raw);
|
|
1815
|
+
} catch {
|
|
1816
|
+
invalid("--weights takes a JSON object of component weights");
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
1820
|
+
invalid("--weights takes a JSON object of component weights");
|
|
1821
|
+
const allowed = target === "messages" ? [...MESSAGE_MEASURES, "replies-from-others"] : [
|
|
1822
|
+
...AUTHOR_MEASURES.filter((name) => name !== "answer-time"),
|
|
1823
|
+
"replies-from-others",
|
|
1824
|
+
"reactions-per-message",
|
|
1825
|
+
"replies-from-others-per-message"
|
|
1826
|
+
];
|
|
1827
|
+
const entries = Object.entries(raw);
|
|
1828
|
+
for (const [name, weight] of entries) {
|
|
1829
|
+
if (!allowed.includes(name))
|
|
1830
|
+
invalid(`unknown ${target} score component: ${name}`);
|
|
1831
|
+
if (typeof weight !== "number" || !Number.isFinite(weight) || weight < 0)
|
|
1832
|
+
invalid(`weight for ${name} must be a finite nonnegative number`);
|
|
1833
|
+
}
|
|
1834
|
+
if (!entries.some(([, weight]) => weight > 0))
|
|
1835
|
+
invalid("--weights needs at least one positive weight");
|
|
1836
|
+
weights = Object.fromEntries(entries);
|
|
1837
|
+
}
|
|
1838
|
+
const selected = measure ?? (target === "messages" ? "reactions" : "messages");
|
|
1839
|
+
return {
|
|
1840
|
+
target,
|
|
1841
|
+
messageKind,
|
|
1842
|
+
minMessages: minMessages ?? (target === "contacts" && score === "engaging" ? 5 : 1),
|
|
1843
|
+
measure: scoring ? "score" : selected,
|
|
1844
|
+
order: !scoring && selected === "answer-time" ? "ascending" : "descending",
|
|
1845
|
+
weights,
|
|
1846
|
+
preset: scoring ? preset ?? "custom" : null,
|
|
1847
|
+
components: weights === null ? [selected] : Object.entries(weights).filter(([, weight]) => weight > 0).map(([name]) => name)
|
|
1848
|
+
};
|
|
1849
|
+
}, "rankingOptions");
|
|
1850
|
+
var rankingScore = /* @__PURE__ */ __name((raw, maxima, weights) => {
|
|
1851
|
+
const entries = Object.entries(weights).filter(([, weight]) => weight > 0);
|
|
1852
|
+
const scale = Math.max(...entries.map(([, weight]) => weight));
|
|
1853
|
+
const denominator = entries.reduce((sum2, [, weight]) => sum2 + weight / scale, 0);
|
|
1854
|
+
if (!Number.isFinite(scale) || scale <= 0 || !Number.isFinite(denominator) || denominator <= 0)
|
|
1855
|
+
return null;
|
|
1856
|
+
const normalized = {};
|
|
1857
|
+
const contributions = {};
|
|
1858
|
+
let sum = 0;
|
|
1859
|
+
for (const [name, weight] of entries) {
|
|
1860
|
+
const value = raw[name];
|
|
1861
|
+
const maximum = maxima[name];
|
|
1862
|
+
if (value == null || !Number.isFinite(value) || value < 0 || maximum === void 0 || !Number.isFinite(maximum) || maximum < value)
|
|
1863
|
+
return null;
|
|
1864
|
+
const part = maximum === 0 ? 0 : value / maximum;
|
|
1865
|
+
normalized[name] = part;
|
|
1866
|
+
contributions[name] = 100 * part * (weight / scale) / denominator;
|
|
1867
|
+
sum += contributions[name];
|
|
1868
|
+
}
|
|
1869
|
+
return { score: Math.min(100, sum), normalized, contributions };
|
|
1870
|
+
}, "rankingScore");
|
|
1871
|
+
var RANKING_TOKENIZER_VERSION = 1;
|
|
1872
|
+
var withoutUrls = /* @__PURE__ */ __name((text2) => text2.replace(/\S+/gu, (token) => {
|
|
1873
|
+
for (let offset = 0; ; ) {
|
|
1874
|
+
const marker = token.indexOf("://", offset);
|
|
1875
|
+
if (marker < 0)
|
|
1876
|
+
break;
|
|
1877
|
+
let start = marker;
|
|
1878
|
+
while (start > 0 && /[a-z0-9+.-]/iu.test(token[start - 1]))
|
|
1879
|
+
start--;
|
|
1880
|
+
if (/^[a-z][a-z0-9+.-]*$/iu.test(token.slice(start, marker)) && (start === 0 || !/\w/u.test(token[start - 1])))
|
|
1881
|
+
return token.slice(0, start);
|
|
1882
|
+
offset = marker + 3;
|
|
1883
|
+
}
|
|
1884
|
+
const folded = token.toLowerCase();
|
|
1885
|
+
for (let offset = 0; ; ) {
|
|
1886
|
+
const start = folded.indexOf("www.", offset);
|
|
1887
|
+
if (start < 0)
|
|
1888
|
+
break;
|
|
1889
|
+
if (start === 0 || !/\w/u.test(token[start - 1]))
|
|
1890
|
+
return token.slice(0, start);
|
|
1891
|
+
offset = start + 4;
|
|
1892
|
+
}
|
|
1893
|
+
return token;
|
|
1894
|
+
}), "withoutUrls");
|
|
1895
|
+
var rankingWords = /* @__PURE__ */ __name((text2) => withoutUrls(text2).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
1896
|
+
var rankingQuestion = /* @__PURE__ */ __name((text2) => withoutUrls(text2).includes("?"), "rankingQuestion");
|
|
1897
|
+
|
|
1898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
1899
|
+
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
1900
|
+
var ROLE_LABELS = {
|
|
1901
|
+
organization: {
|
|
1902
|
+
employee: label("Employee", "\u0421\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A", "Empleado"),
|
|
1903
|
+
contractor: label("Contractor", "\u041F\u043E\u0434\u0440\u044F\u0434\u0447\u0438\u043A", "Contratista"),
|
|
1904
|
+
founder: label("Founder", "\u041E\u0441\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C", "Fundador"),
|
|
1905
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
1906
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
1907
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
1908
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto")
|
|
1909
|
+
},
|
|
1910
|
+
project: {
|
|
1911
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
1912
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
1913
|
+
contributor: label("Contributor", "\u0423\u0447\u0430\u0441\u0442\u043D\u0438\u043A", "Colaborador"),
|
|
1914
|
+
"client-contact": label("Client contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442 \u043A\u043B\u0438\u0435\u043D\u0442\u0430", "Contacto del cliente"),
|
|
1915
|
+
approver: label("Approver", "\u0421\u043E\u0433\u043B\u0430\u0441\u0443\u044E\u0449\u0438\u0439", "Aprobador")
|
|
1916
|
+
},
|
|
1917
|
+
deal: {
|
|
1918
|
+
owner: label("Responsible", "\u041E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439", "Responsable"),
|
|
1919
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto"),
|
|
1920
|
+
"decision-maker": label("Decision-maker", "\u041F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Responsable de decidir"),
|
|
1921
|
+
influencer: label("Influencer", "\u0412\u043B\u0438\u044F\u0435\u0442 \u043D\u0430 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Influye en la decisi\xF3n")
|
|
1922
|
+
},
|
|
1923
|
+
contract: {
|
|
1924
|
+
customer: label("Customer", "\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A", "Cliente"),
|
|
1925
|
+
supplier: label("Supplier", "\u041F\u043E\u0441\u0442\u0430\u0432\u0449\u0438\u043A", "Proveedor"),
|
|
1926
|
+
signatory: label("Signatory", "\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0442", "Firmante"),
|
|
1927
|
+
guarantor: label("Guarantor", "\u041F\u043E\u0440\u0443\u0447\u0438\u0442\u0435\u043B\u044C", "Garante")
|
|
1928
|
+
},
|
|
1929
|
+
related: {
|
|
1930
|
+
colleague: label("Colleague", "\u041A\u043E\u043B\u043B\u0435\u0433\u0430", "Colega"),
|
|
1931
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
1932
|
+
investor: label("Investor", "\u0418\u043D\u0432\u0435\u0441\u0442\u043E\u0440", "Inversor"),
|
|
1933
|
+
mentor: label("Mentor", "\u041D\u0430\u0441\u0442\u0430\u0432\u043D\u0438\u043A", "Mentor"),
|
|
1934
|
+
family: label("Family", "\u0421\u0435\u043C\u044C\u044F", "Familia"),
|
|
1935
|
+
friend: label("Friend", "\u0414\u0440\u0443\u0433", "Amigo")
|
|
1936
|
+
}
|
|
1937
|
+
};
|
|
1938
|
+
|
|
1939
|
+
export {
|
|
1940
|
+
isEmailAddress,
|
|
1941
|
+
isRoleAddress,
|
|
1942
|
+
isPersonLikeRoleAddress,
|
|
1943
|
+
isNoReplyAddress,
|
|
1944
|
+
COUNTER_FIELDS,
|
|
1945
|
+
validCounter,
|
|
1946
|
+
counterObservationTime,
|
|
1947
|
+
counterFreshness,
|
|
1948
|
+
chatReferenceOf,
|
|
1949
|
+
wrongAccount,
|
|
1950
|
+
ensureAccount,
|
|
1951
|
+
compileAutomaton,
|
|
1952
|
+
wildcardPattern,
|
|
1953
|
+
foldRegex,
|
|
1954
|
+
trigrams,
|
|
1955
|
+
isId,
|
|
1956
|
+
foldName,
|
|
1957
|
+
pickChat,
|
|
1958
|
+
pickPerson,
|
|
1959
|
+
peopleMatching,
|
|
1960
|
+
chatsMatching,
|
|
1961
|
+
nearest,
|
|
1962
|
+
displayName,
|
|
1963
|
+
takeFallbacks,
|
|
1964
|
+
noFallbacks,
|
|
1965
|
+
nameKey,
|
|
1966
|
+
isReadable,
|
|
1967
|
+
DEFAULT_PHONE_COUNTRIES,
|
|
1968
|
+
parsePhoneCountries,
|
|
1969
|
+
nationalPhone,
|
|
1970
|
+
typedPhone,
|
|
1971
|
+
e164Of,
|
|
1972
|
+
isMobilePhone,
|
|
1973
|
+
BARE_INTERNATIONAL_PROVIDERS,
|
|
1974
|
+
storedPhone,
|
|
1975
|
+
MESSAGE_MEASURES,
|
|
1976
|
+
AUTHOR_MEASURES,
|
|
1977
|
+
needsRankingContext,
|
|
1978
|
+
rankingOptions,
|
|
1979
|
+
rankingScore,
|
|
1980
|
+
RANKING_TOKENIZER_VERSION,
|
|
1981
|
+
rankingWords,
|
|
1982
|
+
rankingQuestion,
|
|
1983
|
+
isObject,
|
|
1984
|
+
RECORD_TYPES,
|
|
1985
|
+
isRecordType,
|
|
1986
|
+
isBusinessType,
|
|
1987
|
+
isIdentityType,
|
|
1988
|
+
RECORD_TABLES,
|
|
1989
|
+
DECIDED_TABLES,
|
|
1990
|
+
WORD_BODY,
|
|
1991
|
+
rolesOf,
|
|
1992
|
+
roleOf,
|
|
1993
|
+
nestedOf,
|
|
1994
|
+
AMOUNT_ROLES,
|
|
1995
|
+
FIELD_REFERENCE_ROLES,
|
|
1996
|
+
hasV1Roles,
|
|
1997
|
+
IDENTITY_TYPES,
|
|
1998
|
+
article2 as article,
|
|
1999
|
+
pointerOf,
|
|
2000
|
+
recordFingerprint,
|
|
2001
|
+
fieldReferences,
|
|
2002
|
+
ROLE_LABELS
|
|
2003
|
+
};
|