@general-input/cli 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2217 -960
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -37,9 +37,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
mod
|
|
38
38
|
));
|
|
39
39
|
|
|
40
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
40
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/forge.js
|
|
41
41
|
var require_forge = __commonJS({
|
|
42
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
42
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/forge.js"(exports, module) {
|
|
43
43
|
"use strict";
|
|
44
44
|
module.exports = {
|
|
45
45
|
// default options
|
|
@@ -50,9 +50,9 @@ var require_forge = __commonJS({
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
53
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/baseN.js
|
|
54
54
|
var require_baseN = __commonJS({
|
|
55
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
55
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/baseN.js"(exports, module) {
|
|
56
56
|
"use strict";
|
|
57
57
|
var api = {};
|
|
58
58
|
module.exports = api;
|
|
@@ -165,9 +165,9 @@ var require_baseN = __commonJS({
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
168
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/util.js
|
|
169
169
|
var require_util = __commonJS({
|
|
170
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
170
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/util.js"(exports, module) {
|
|
171
171
|
"use strict";
|
|
172
172
|
var forge2 = require_forge();
|
|
173
173
|
var baseN = require_baseN();
|
|
@@ -1547,9 +1547,9 @@ var require_util = __commonJS({
|
|
|
1547
1547
|
}
|
|
1548
1548
|
});
|
|
1549
1549
|
|
|
1550
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
1550
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/cipher.js
|
|
1551
1551
|
var require_cipher = __commonJS({
|
|
1552
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
1552
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/cipher.js"(exports, module) {
|
|
1553
1553
|
"use strict";
|
|
1554
1554
|
var forge2 = require_forge();
|
|
1555
1555
|
require_util();
|
|
@@ -1665,9 +1665,9 @@ var require_cipher = __commonJS({
|
|
|
1665
1665
|
}
|
|
1666
1666
|
});
|
|
1667
1667
|
|
|
1668
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
1668
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/cipherModes.js
|
|
1669
1669
|
var require_cipherModes = __commonJS({
|
|
1670
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
1670
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/cipherModes.js"(exports, module) {
|
|
1671
1671
|
"use strict";
|
|
1672
1672
|
var forge2 = require_forge();
|
|
1673
1673
|
require_util();
|
|
@@ -1718,10 +1718,18 @@ var require_cipherModes = __commonJS({
|
|
|
1718
1718
|
return false;
|
|
1719
1719
|
}
|
|
1720
1720
|
var len = output.length();
|
|
1721
|
+
if (len === 0) {
|
|
1722
|
+
return true;
|
|
1723
|
+
}
|
|
1721
1724
|
var count = output.at(len - 1);
|
|
1722
|
-
if (count > this.blockSize
|
|
1725
|
+
if (count === 0 || count > this.blockSize || count > len) {
|
|
1723
1726
|
return false;
|
|
1724
1727
|
}
|
|
1728
|
+
for (var i = 2; i <= count; ++i) {
|
|
1729
|
+
if (output.at(len - i) !== count) {
|
|
1730
|
+
return false;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1725
1733
|
output.truncate(count);
|
|
1726
1734
|
return true;
|
|
1727
1735
|
};
|
|
@@ -1783,10 +1791,18 @@ var require_cipherModes = __commonJS({
|
|
|
1783
1791
|
return false;
|
|
1784
1792
|
}
|
|
1785
1793
|
var len = output.length();
|
|
1794
|
+
if (len === 0) {
|
|
1795
|
+
return true;
|
|
1796
|
+
}
|
|
1786
1797
|
var count = output.at(len - 1);
|
|
1787
|
-
if (count > this.blockSize
|
|
1798
|
+
if (count === 0 || count > this.blockSize || count > len) {
|
|
1788
1799
|
return false;
|
|
1789
1800
|
}
|
|
1801
|
+
for (var i = 2; i <= count; ++i) {
|
|
1802
|
+
if (output.at(len - i) !== count) {
|
|
1803
|
+
return false;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1790
1806
|
output.truncate(count);
|
|
1791
1807
|
return true;
|
|
1792
1808
|
};
|
|
@@ -2044,11 +2060,14 @@ var require_cipherModes = __commonJS({
|
|
|
2044
2060
|
} else {
|
|
2045
2061
|
additionalData = forge2.util.createBuffer();
|
|
2046
2062
|
}
|
|
2047
|
-
if (
|
|
2048
|
-
this._tagLength = options.tagLength;
|
|
2063
|
+
if (options.tagLength !== void 0 && options.tagLength !== null) {
|
|
2064
|
+
this._tagLength = Number(options.tagLength);
|
|
2049
2065
|
} else {
|
|
2050
2066
|
this._tagLength = 128;
|
|
2051
2067
|
}
|
|
2068
|
+
if ([128, 120, 112, 104, 96, 64, 32].indexOf(this._tagLength) === -1) {
|
|
2069
|
+
throw new Error("Invalid tag length.");
|
|
2070
|
+
}
|
|
2052
2071
|
this._tag = null;
|
|
2053
2072
|
if (options.decrypt) {
|
|
2054
2073
|
this._tag = forge2.util.createBuffer(options.tag).getBytes();
|
|
@@ -2217,17 +2236,17 @@ var require_cipherModes = __commonJS({
|
|
|
2217
2236
|
}
|
|
2218
2237
|
};
|
|
2219
2238
|
modes.gcm.prototype.tableMultiply = function(x) {
|
|
2220
|
-
var
|
|
2239
|
+
var z50 = [0, 0, 0, 0];
|
|
2221
2240
|
for (var i = 0; i < 32; ++i) {
|
|
2222
2241
|
var idx = i / 8 | 0;
|
|
2223
2242
|
var x_i = x[idx] >>> (7 - i % 8) * 4 & 15;
|
|
2224
2243
|
var ah = this._m[i][x_i];
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2244
|
+
z50[0] ^= ah[0];
|
|
2245
|
+
z50[1] ^= ah[1];
|
|
2246
|
+
z50[2] ^= ah[2];
|
|
2247
|
+
z50[3] ^= ah[3];
|
|
2229
2248
|
}
|
|
2230
|
-
return
|
|
2249
|
+
return z50;
|
|
2231
2250
|
};
|
|
2232
2251
|
modes.gcm.prototype.ghash = function(h, y, x) {
|
|
2233
2252
|
y[0] ^= x[0];
|
|
@@ -2316,9 +2335,9 @@ var require_cipherModes = __commonJS({
|
|
|
2316
2335
|
}
|
|
2317
2336
|
});
|
|
2318
2337
|
|
|
2319
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
2338
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/aes.js
|
|
2320
2339
|
var require_aes = __commonJS({
|
|
2321
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
2340
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/aes.js"(exports, module) {
|
|
2322
2341
|
"use strict";
|
|
2323
2342
|
var forge2 = require_forge();
|
|
2324
2343
|
require_cipher();
|
|
@@ -2592,9 +2611,9 @@ var require_aes = __commonJS({
|
|
|
2592
2611
|
}
|
|
2593
2612
|
});
|
|
2594
2613
|
|
|
2595
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
2614
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/oids.js
|
|
2596
2615
|
var require_oids = __commonJS({
|
|
2597
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
2616
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/oids.js"(exports, module) {
|
|
2598
2617
|
"use strict";
|
|
2599
2618
|
var forge2 = require_forge();
|
|
2600
2619
|
forge2.pki = forge2.pki || {};
|
|
@@ -2738,9 +2757,9 @@ var require_oids = __commonJS({
|
|
|
2738
2757
|
}
|
|
2739
2758
|
});
|
|
2740
2759
|
|
|
2741
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
2760
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/asn1.js
|
|
2742
2761
|
var require_asn1 = __commonJS({
|
|
2743
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
2762
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/asn1.js"(exports, module) {
|
|
2744
2763
|
"use strict";
|
|
2745
2764
|
var forge2 = require_forge();
|
|
2746
2765
|
require_util();
|
|
@@ -3002,7 +3021,10 @@ var require_asn1 = __commonJS({
|
|
|
3002
3021
|
var subOptions = {
|
|
3003
3022
|
// enforce strict mode to avoid parsing ASN.1 from plain data
|
|
3004
3023
|
strict: true,
|
|
3005
|
-
|
|
3024
|
+
// only decode one level of BIT STRINGs, nested decoding has
|
|
3025
|
+
// quadratic cost due to copies for change detection
|
|
3026
|
+
decodeBitStrings: false,
|
|
3027
|
+
maxDepth: options.maxDepth
|
|
3006
3028
|
};
|
|
3007
3029
|
var composed = _fromDer(bytes, remaining, depth + 1, subOptions);
|
|
3008
3030
|
var used = start - bytes.length();
|
|
@@ -3106,12 +3128,16 @@ var require_asn1 = __commonJS({
|
|
|
3106
3128
|
asn1.oidToDer = function(oid) {
|
|
3107
3129
|
var values = oid.split(".");
|
|
3108
3130
|
var bytes = forge2.util.createBuffer();
|
|
3109
|
-
|
|
3131
|
+
var first = parseInt(values[0], 10);
|
|
3132
|
+
var second = parseInt(values[1], 10);
|
|
3133
|
+
if (!(first >= 0 && first <= 2 && second >= 0) || first < 2 && second > 39) {
|
|
3134
|
+
throw new Error("Invalid OID; the first two arcs are out of range.");
|
|
3135
|
+
}
|
|
3110
3136
|
var last, valueBytes, value, b;
|
|
3111
|
-
for (var i =
|
|
3137
|
+
for (var i = 1; i < values.length; ++i) {
|
|
3112
3138
|
last = true;
|
|
3113
3139
|
valueBytes = [];
|
|
3114
|
-
value = parseInt(values[i], 10);
|
|
3140
|
+
value = i === 1 ? 40 * first + second : parseInt(values[i], 10);
|
|
3115
3141
|
if (value > 4294967295) {
|
|
3116
3142
|
throw new Error("OID value too large; max is 32-bits.");
|
|
3117
3143
|
}
|
|
@@ -3135,9 +3161,9 @@ var require_asn1 = __commonJS({
|
|
|
3135
3161
|
if (typeof bytes === "string") {
|
|
3136
3162
|
bytes = forge2.util.createBuffer(bytes);
|
|
3137
3163
|
}
|
|
3138
|
-
var b
|
|
3139
|
-
oid = Math.floor(b / 40) + "." + b % 40;
|
|
3164
|
+
var b;
|
|
3140
3165
|
var value = 0;
|
|
3166
|
+
var first = true;
|
|
3141
3167
|
while (bytes.length() > 0) {
|
|
3142
3168
|
if (value > 70368744177663) {
|
|
3143
3169
|
throw new Error("OID value too large; max is 53-bits.");
|
|
@@ -3147,7 +3173,13 @@ var require_asn1 = __commonJS({
|
|
|
3147
3173
|
if (b & 128) {
|
|
3148
3174
|
value += b & 127;
|
|
3149
3175
|
} else {
|
|
3150
|
-
|
|
3176
|
+
value += b;
|
|
3177
|
+
if (first) {
|
|
3178
|
+
oid = value < 80 ? Math.floor(value / 40) + "." + value % 40 : "2." + (value - 80);
|
|
3179
|
+
first = false;
|
|
3180
|
+
} else {
|
|
3181
|
+
oid += "." + value;
|
|
3182
|
+
}
|
|
3151
3183
|
value = 0;
|
|
3152
3184
|
}
|
|
3153
3185
|
}
|
|
@@ -3558,9 +3590,9 @@ var require_asn1 = __commonJS({
|
|
|
3558
3590
|
}
|
|
3559
3591
|
});
|
|
3560
3592
|
|
|
3561
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
3593
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md.js
|
|
3562
3594
|
var require_md = __commonJS({
|
|
3563
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
3595
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md.js"(exports, module) {
|
|
3564
3596
|
"use strict";
|
|
3565
3597
|
var forge2 = require_forge();
|
|
3566
3598
|
module.exports = forge2.md = forge2.md || {};
|
|
@@ -3568,9 +3600,9 @@ var require_md = __commonJS({
|
|
|
3568
3600
|
}
|
|
3569
3601
|
});
|
|
3570
3602
|
|
|
3571
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
3603
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/hmac.js
|
|
3572
3604
|
var require_hmac = __commonJS({
|
|
3573
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
3605
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/hmac.js"(exports, module) {
|
|
3574
3606
|
"use strict";
|
|
3575
3607
|
var forge2 = require_forge();
|
|
3576
3608
|
require_md();
|
|
@@ -3651,9 +3683,9 @@ var require_hmac = __commonJS({
|
|
|
3651
3683
|
}
|
|
3652
3684
|
});
|
|
3653
3685
|
|
|
3654
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
3686
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md5.js
|
|
3655
3687
|
var require_md5 = __commonJS({
|
|
3656
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
3688
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md5.js"(exports, module) {
|
|
3657
3689
|
"use strict";
|
|
3658
3690
|
var forge2 = require_forge();
|
|
3659
3691
|
require_md();
|
|
@@ -3944,9 +3976,9 @@ var require_md5 = __commonJS({
|
|
|
3944
3976
|
}
|
|
3945
3977
|
});
|
|
3946
3978
|
|
|
3947
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
3979
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pem.js
|
|
3948
3980
|
var require_pem = __commonJS({
|
|
3949
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
3981
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pem.js"(exports, module) {
|
|
3950
3982
|
"use strict";
|
|
3951
3983
|
var forge2 = require_forge();
|
|
3952
3984
|
require_util();
|
|
@@ -3987,12 +4019,13 @@ var require_pem = __commonJS({
|
|
|
3987
4019
|
};
|
|
3988
4020
|
pem.decode = function(str) {
|
|
3989
4021
|
var rval = [];
|
|
3990
|
-
|
|
3991
|
-
var
|
|
4022
|
+
str = String(str);
|
|
4023
|
+
var messages = _pemMessageScanner(str);
|
|
4024
|
+
var rHeader = /(?:^|[^\x21-\x7e])([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
|
|
3992
4025
|
var rCRLF = /\r?\n/;
|
|
3993
4026
|
var match;
|
|
3994
4027
|
while (true) {
|
|
3995
|
-
match =
|
|
4028
|
+
match = messages.next();
|
|
3996
4029
|
if (!match) {
|
|
3997
4030
|
break;
|
|
3998
4031
|
}
|
|
@@ -4015,7 +4048,7 @@ var require_pem = __commonJS({
|
|
|
4015
4048
|
var lines = match[2].split(rCRLF);
|
|
4016
4049
|
var li = 0;
|
|
4017
4050
|
while (match && li < lines.length) {
|
|
4018
|
-
var line = lines[li]
|
|
4051
|
+
var line = rtrim(lines[li]);
|
|
4019
4052
|
for (var nl = li + 1; nl < lines.length; ++nl) {
|
|
4020
4053
|
var next = lines[nl];
|
|
4021
4054
|
if (!/\s/.test(next[0])) {
|
|
@@ -4093,12 +4126,146 @@ var require_pem = __commonJS({
|
|
|
4093
4126
|
function ltrim(str) {
|
|
4094
4127
|
return str.replace(/^\s+/, "");
|
|
4095
4128
|
}
|
|
4129
|
+
function rtrim(str) {
|
|
4130
|
+
var end = str.length;
|
|
4131
|
+
while (end > 0 && /\s/.test(str.charAt(end - 1))) {
|
|
4132
|
+
--end;
|
|
4133
|
+
}
|
|
4134
|
+
return str.substring(0, end);
|
|
4135
|
+
}
|
|
4136
|
+
function _pemMessageScanner(str) {
|
|
4137
|
+
var rBody = /[:A-Za-z0-9+\/=\s]/;
|
|
4138
|
+
var rNotBody = /[^:A-Za-z0-9+\/=\s]/g;
|
|
4139
|
+
var rNotHeader = /[^\x21-\x7e\s]/g;
|
|
4140
|
+
var rLabel = /[A-Z0-9- ]/;
|
|
4141
|
+
function indexOfRegex(regex, i) {
|
|
4142
|
+
regex.lastIndex = i;
|
|
4143
|
+
var match = regex.exec(str);
|
|
4144
|
+
return match ? match.index : str.length;
|
|
4145
|
+
}
|
|
4146
|
+
function labelAt(i) {
|
|
4147
|
+
for (var j = i; j < str.length && rLabel.test(str.charAt(j)); ++j) {
|
|
4148
|
+
if (j > i && str.substr(j, 5) === "-----") {
|
|
4149
|
+
return str.substring(i, j);
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
return null;
|
|
4153
|
+
}
|
|
4154
|
+
function blankLineEnd(i) {
|
|
4155
|
+
if (str.charAt(i) === "\r") {
|
|
4156
|
+
++i;
|
|
4157
|
+
}
|
|
4158
|
+
if (str.charAt(i) !== "\n") {
|
|
4159
|
+
return -1;
|
|
4160
|
+
}
|
|
4161
|
+
if (str.charAt(++i) === "\r") {
|
|
4162
|
+
++i;
|
|
4163
|
+
}
|
|
4164
|
+
return str.charAt(i) === "\n" ? i + 1 : -1;
|
|
4165
|
+
}
|
|
4166
|
+
function firstBlankLine(start2, end2) {
|
|
4167
|
+
for (var i = start2; i < end2; ++i) {
|
|
4168
|
+
var v = blankLineEnd(i);
|
|
4169
|
+
if (v !== -1 && v < end2) {
|
|
4170
|
+
return i;
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
return -1;
|
|
4174
|
+
}
|
|
4175
|
+
var ends = {};
|
|
4176
|
+
for (var end = str.indexOf("-----END "); end !== -1; end = str.indexOf("-----END ", end + 1)) {
|
|
4177
|
+
var endLabel = labelAt(end + 9);
|
|
4178
|
+
var start = end;
|
|
4179
|
+
while (start > 0 && rBody.test(str.charAt(start - 1))) {
|
|
4180
|
+
--start;
|
|
4181
|
+
}
|
|
4182
|
+
var blank = firstBlankLine(start, end);
|
|
4183
|
+
if (endLabel !== null && blank !== -1) {
|
|
4184
|
+
var key = "$" + endLabel;
|
|
4185
|
+
(ends[key] = ends[key] || []).push({ end, blank });
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
var pos = 0;
|
|
4189
|
+
var headerEnd = -1;
|
|
4190
|
+
return {
|
|
4191
|
+
next: function() {
|
|
4192
|
+
var begin;
|
|
4193
|
+
while ((begin = str.indexOf("-----BEGIN ", pos)) !== -1) {
|
|
4194
|
+
pos = begin + 1;
|
|
4195
|
+
var label = labelAt(begin + 11);
|
|
4196
|
+
if (label === null) {
|
|
4197
|
+
continue;
|
|
4198
|
+
}
|
|
4199
|
+
var q = begin + 16 + label.length;
|
|
4200
|
+
var bodyEnd = indexOfRegex(rNotBody, q);
|
|
4201
|
+
var bodyEndOk = str.substr(bodyEnd, 9) === "-----END " && labelAt(bodyEnd + 9) === label;
|
|
4202
|
+
if (q > headerEnd) {
|
|
4203
|
+
headerEnd = indexOfRegex(rNotHeader, q);
|
|
4204
|
+
}
|
|
4205
|
+
var later = null;
|
|
4206
|
+
var list = ends["$" + label];
|
|
4207
|
+
if (list) {
|
|
4208
|
+
var lo = 0;
|
|
4209
|
+
var hi = list.length;
|
|
4210
|
+
while (lo < hi) {
|
|
4211
|
+
var mid = lo + hi >> 1;
|
|
4212
|
+
if (list[mid].end > bodyEnd) {
|
|
4213
|
+
hi = mid;
|
|
4214
|
+
} else {
|
|
4215
|
+
lo = mid + 1;
|
|
4216
|
+
}
|
|
4217
|
+
}
|
|
4218
|
+
later = list[lo] || null;
|
|
4219
|
+
}
|
|
4220
|
+
var starts = [];
|
|
4221
|
+
if (str.charAt(q) === "\r") {
|
|
4222
|
+
if (str.charAt(q + 1) === "\n") {
|
|
4223
|
+
starts.push(q + 2);
|
|
4224
|
+
}
|
|
4225
|
+
starts.push(q + 1);
|
|
4226
|
+
} else if (str.charAt(q) === "\n") {
|
|
4227
|
+
starts.push(q + 1);
|
|
4228
|
+
}
|
|
4229
|
+
starts.push(q);
|
|
4230
|
+
for (var i = 0; i < starts.length; ++i) {
|
|
4231
|
+
var t = starts[i];
|
|
4232
|
+
var blank2 = bodyEndOk ? firstBlankLine(t + 1, bodyEnd) : -1;
|
|
4233
|
+
var end2 = bodyEnd;
|
|
4234
|
+
if (blank2 === -1 && later) {
|
|
4235
|
+
blank2 = later.blank;
|
|
4236
|
+
end2 = later.end;
|
|
4237
|
+
}
|
|
4238
|
+
if (blank2 !== -1 && blank2 <= headerEnd) {
|
|
4239
|
+
var v = blankLineEnd(blank2);
|
|
4240
|
+
pos = end2 + 14 + label.length;
|
|
4241
|
+
return [
|
|
4242
|
+
str.substring(begin, pos),
|
|
4243
|
+
label,
|
|
4244
|
+
str.substring(t, v),
|
|
4245
|
+
str.substring(v, end2)
|
|
4246
|
+
];
|
|
4247
|
+
}
|
|
4248
|
+
if (bodyEndOk && t < bodyEnd) {
|
|
4249
|
+
pos = bodyEnd + 14 + label.length;
|
|
4250
|
+
return [
|
|
4251
|
+
str.substring(begin, pos),
|
|
4252
|
+
label,
|
|
4253
|
+
void 0,
|
|
4254
|
+
str.substring(t, bodyEnd)
|
|
4255
|
+
];
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
return null;
|
|
4260
|
+
}
|
|
4261
|
+
};
|
|
4262
|
+
}
|
|
4096
4263
|
}
|
|
4097
4264
|
});
|
|
4098
4265
|
|
|
4099
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
4266
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/des.js
|
|
4100
4267
|
var require_des = __commonJS({
|
|
4101
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
4268
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/des.js"(exports, module) {
|
|
4102
4269
|
"use strict";
|
|
4103
4270
|
var forge2 = require_forge();
|
|
4104
4271
|
require_cipher();
|
|
@@ -4335,9 +4502,9 @@ var require_des = __commonJS({
|
|
|
4335
4502
|
}
|
|
4336
4503
|
});
|
|
4337
4504
|
|
|
4338
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
4505
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pbkdf2.js
|
|
4339
4506
|
var require_pbkdf2 = __commonJS({
|
|
4340
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
4507
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pbkdf2.js"(exports, module) {
|
|
4341
4508
|
"use strict";
|
|
4342
4509
|
var forge2 = require_forge();
|
|
4343
4510
|
require_hmac();
|
|
@@ -4451,9 +4618,9 @@ var require_pbkdf2 = __commonJS({
|
|
|
4451
4618
|
}
|
|
4452
4619
|
});
|
|
4453
4620
|
|
|
4454
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
4621
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha256.js
|
|
4455
4622
|
var require_sha256 = __commonJS({
|
|
4456
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
4623
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha256.js"(exports, module) {
|
|
4457
4624
|
"use strict";
|
|
4458
4625
|
var forge2 = require_forge();
|
|
4459
4626
|
require_md();
|
|
@@ -4685,9 +4852,9 @@ var require_sha256 = __commonJS({
|
|
|
4685
4852
|
}
|
|
4686
4853
|
});
|
|
4687
4854
|
|
|
4688
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
4855
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/prng.js
|
|
4689
4856
|
var require_prng = __commonJS({
|
|
4690
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
4857
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/prng.js"(exports, module) {
|
|
4691
4858
|
"use strict";
|
|
4692
4859
|
var forge2 = require_forge();
|
|
4693
4860
|
require_util();
|
|
@@ -4926,9 +5093,9 @@ var require_prng = __commonJS({
|
|
|
4926
5093
|
}
|
|
4927
5094
|
});
|
|
4928
5095
|
|
|
4929
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
5096
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/random.js
|
|
4930
5097
|
var require_random = __commonJS({
|
|
4931
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
5098
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/random.js"(exports, module) {
|
|
4932
5099
|
"use strict";
|
|
4933
5100
|
var forge2 = require_forge();
|
|
4934
5101
|
require_aes();
|
|
@@ -5035,9 +5202,9 @@ var require_random = __commonJS({
|
|
|
5035
5202
|
}
|
|
5036
5203
|
});
|
|
5037
5204
|
|
|
5038
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
5205
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/rc2.js
|
|
5039
5206
|
var require_rc2 = __commonJS({
|
|
5040
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
5207
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/rc2.js"(exports, module) {
|
|
5041
5208
|
"use strict";
|
|
5042
5209
|
var forge2 = require_forge();
|
|
5043
5210
|
require_util();
|
|
@@ -5497,9 +5664,9 @@ var require_rc2 = __commonJS({
|
|
|
5497
5664
|
}
|
|
5498
5665
|
});
|
|
5499
5666
|
|
|
5500
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
5667
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/jsbn.js
|
|
5501
5668
|
var require_jsbn = __commonJS({
|
|
5502
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
5669
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/jsbn.js"(exports, module) {
|
|
5503
5670
|
"use strict";
|
|
5504
5671
|
var forge2 = require_forge();
|
|
5505
5672
|
module.exports = forge2.jsbn = forge2.jsbn || {};
|
|
@@ -5972,26 +6139,26 @@ var require_jsbn = __commonJS({
|
|
|
5972
6139
|
function bnpIsEven() {
|
|
5973
6140
|
return (this.t > 0 ? this.data[0] & 1 : this.s) == 0;
|
|
5974
6141
|
}
|
|
5975
|
-
function bnpExp(e,
|
|
6142
|
+
function bnpExp(e, z50) {
|
|
5976
6143
|
if (e > 4294967295 || e < 1) return BigInteger.ONE;
|
|
5977
|
-
var r = nbi(), r2 = nbi(), g =
|
|
6144
|
+
var r = nbi(), r2 = nbi(), g = z50.convert(this), i = nbits(e) - 1;
|
|
5978
6145
|
g.copyTo(r);
|
|
5979
6146
|
while (--i >= 0) {
|
|
5980
|
-
|
|
5981
|
-
if ((e & 1 << i) > 0)
|
|
6147
|
+
z50.sqrTo(r, r2);
|
|
6148
|
+
if ((e & 1 << i) > 0) z50.mulTo(r2, g, r);
|
|
5982
6149
|
else {
|
|
5983
6150
|
var t = r;
|
|
5984
6151
|
r = r2;
|
|
5985
6152
|
r2 = t;
|
|
5986
6153
|
}
|
|
5987
6154
|
}
|
|
5988
|
-
return
|
|
6155
|
+
return z50.revert(r);
|
|
5989
6156
|
}
|
|
5990
6157
|
function bnModPowInt(e, m) {
|
|
5991
|
-
var
|
|
5992
|
-
if (e < 256 || m.isEven())
|
|
5993
|
-
else
|
|
5994
|
-
return this.exp(e,
|
|
6158
|
+
var z50;
|
|
6159
|
+
if (e < 256 || m.isEven()) z50 = new Classic(m);
|
|
6160
|
+
else z50 = new Montgomery(m);
|
|
6161
|
+
return this.exp(e, z50);
|
|
5995
6162
|
}
|
|
5996
6163
|
BigInteger.prototype.copyTo = bnpCopyTo;
|
|
5997
6164
|
BigInteger.prototype.fromInt = bnpFromInt;
|
|
@@ -6049,13 +6216,13 @@ var require_jsbn = __commonJS({
|
|
|
6049
6216
|
if (this.signum() == 0 || b < 2 || b > 36) return "0";
|
|
6050
6217
|
var cs = this.chunkSize(b);
|
|
6051
6218
|
var a = Math.pow(b, cs);
|
|
6052
|
-
var d = nbv(a), y = nbi(),
|
|
6053
|
-
this.divRemTo(d, y,
|
|
6219
|
+
var d = nbv(a), y = nbi(), z50 = nbi(), r = "";
|
|
6220
|
+
this.divRemTo(d, y, z50);
|
|
6054
6221
|
while (y.signum() > 0) {
|
|
6055
|
-
r = (a +
|
|
6056
|
-
y.divRemTo(d, y,
|
|
6222
|
+
r = (a + z50.intValue()).toString(b).substr(1) + r;
|
|
6223
|
+
y.divRemTo(d, y, z50);
|
|
6057
6224
|
}
|
|
6058
|
-
return
|
|
6225
|
+
return z50.intValue().toString(b) + r;
|
|
6059
6226
|
}
|
|
6060
6227
|
function bnpFromRadix(s, b) {
|
|
6061
6228
|
this.fromInt(0);
|
|
@@ -6428,7 +6595,7 @@ var require_jsbn = __commonJS({
|
|
|
6428
6595
|
Barrett.prototype.mulTo = barrettMulTo;
|
|
6429
6596
|
Barrett.prototype.sqrTo = barrettSqrTo;
|
|
6430
6597
|
function bnModPow(e, m) {
|
|
6431
|
-
var i = e.bitLength(), k, r = nbv(1),
|
|
6598
|
+
var i = e.bitLength(), k, r = nbv(1), z50;
|
|
6432
6599
|
if (i <= 0) return r;
|
|
6433
6600
|
else if (i < 18) k = 1;
|
|
6434
6601
|
else if (i < 48) k = 3;
|
|
@@ -6436,19 +6603,19 @@ var require_jsbn = __commonJS({
|
|
|
6436
6603
|
else if (i < 768) k = 5;
|
|
6437
6604
|
else k = 6;
|
|
6438
6605
|
if (i < 8)
|
|
6439
|
-
|
|
6606
|
+
z50 = new Classic(m);
|
|
6440
6607
|
else if (m.isEven())
|
|
6441
|
-
|
|
6608
|
+
z50 = new Barrett(m);
|
|
6442
6609
|
else
|
|
6443
|
-
|
|
6610
|
+
z50 = new Montgomery(m);
|
|
6444
6611
|
var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;
|
|
6445
|
-
g[1] =
|
|
6612
|
+
g[1] = z50.convert(this);
|
|
6446
6613
|
if (k > 1) {
|
|
6447
6614
|
var g2 = nbi();
|
|
6448
|
-
|
|
6615
|
+
z50.sqrTo(g[1], g2);
|
|
6449
6616
|
while (n <= km) {
|
|
6450
6617
|
g[n] = nbi();
|
|
6451
|
-
|
|
6618
|
+
z50.mulTo(g2, g[n - 2], g[n]);
|
|
6452
6619
|
n += 2;
|
|
6453
6620
|
}
|
|
6454
6621
|
}
|
|
@@ -6474,20 +6641,20 @@ var require_jsbn = __commonJS({
|
|
|
6474
6641
|
is1 = false;
|
|
6475
6642
|
} else {
|
|
6476
6643
|
while (n > 1) {
|
|
6477
|
-
|
|
6478
|
-
|
|
6644
|
+
z50.sqrTo(r, r2);
|
|
6645
|
+
z50.sqrTo(r2, r);
|
|
6479
6646
|
n -= 2;
|
|
6480
6647
|
}
|
|
6481
|
-
if (n > 0)
|
|
6648
|
+
if (n > 0) z50.sqrTo(r, r2);
|
|
6482
6649
|
else {
|
|
6483
6650
|
t = r;
|
|
6484
6651
|
r = r2;
|
|
6485
6652
|
r2 = t;
|
|
6486
6653
|
}
|
|
6487
|
-
|
|
6654
|
+
z50.mulTo(r2, g[w], r);
|
|
6488
6655
|
}
|
|
6489
6656
|
while (j >= 0 && (e.data[j] & 1 << i) == 0) {
|
|
6490
|
-
|
|
6657
|
+
z50.sqrTo(r, r2);
|
|
6491
6658
|
t = r;
|
|
6492
6659
|
r = r2;
|
|
6493
6660
|
r2 = t;
|
|
@@ -6497,7 +6664,7 @@ var require_jsbn = __commonJS({
|
|
|
6497
6664
|
}
|
|
6498
6665
|
}
|
|
6499
6666
|
}
|
|
6500
|
-
return
|
|
6667
|
+
return z50.revert(r);
|
|
6501
6668
|
}
|
|
6502
6669
|
function bnGCD(a) {
|
|
6503
6670
|
var x = this.s < 0 ? this.negate() : this.clone();
|
|
@@ -6537,7 +6704,7 @@ var require_jsbn = __commonJS({
|
|
|
6537
6704
|
return r;
|
|
6538
6705
|
}
|
|
6539
6706
|
function bnModInverse(m) {
|
|
6540
|
-
if (this.signum()
|
|
6707
|
+
if (this.signum() <= 0 || m.signum() <= 0) {
|
|
6541
6708
|
return BigInteger.ZERO;
|
|
6542
6709
|
}
|
|
6543
6710
|
var ac = m.isEven();
|
|
@@ -6686,9 +6853,9 @@ var require_jsbn = __commonJS({
|
|
|
6686
6853
|
}
|
|
6687
6854
|
});
|
|
6688
6855
|
|
|
6689
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
6856
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha1.js
|
|
6690
6857
|
var require_sha1 = __commonJS({
|
|
6691
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
6858
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha1.js"(exports, module) {
|
|
6692
6859
|
"use strict";
|
|
6693
6860
|
var forge2 = require_forge();
|
|
6694
6861
|
require_md();
|
|
@@ -6883,9 +7050,9 @@ var require_sha1 = __commonJS({
|
|
|
6883
7050
|
}
|
|
6884
7051
|
});
|
|
6885
7052
|
|
|
6886
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
7053
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs1.js
|
|
6887
7054
|
var require_pkcs1 = __commonJS({
|
|
6888
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
7055
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs1.js"(exports, module) {
|
|
6889
7056
|
"use strict";
|
|
6890
7057
|
var forge2 = require_forge();
|
|
6891
7058
|
require_util();
|
|
@@ -7036,9 +7203,9 @@ var require_pkcs1 = __commonJS({
|
|
|
7036
7203
|
}
|
|
7037
7204
|
});
|
|
7038
7205
|
|
|
7039
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
7206
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/prime.js
|
|
7040
7207
|
var require_prime = __commonJS({
|
|
7041
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
7208
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/prime.js"(exports, module) {
|
|
7042
7209
|
"use strict";
|
|
7043
7210
|
var forge2 = require_forge();
|
|
7044
7211
|
require_util();
|
|
@@ -7199,9 +7366,9 @@ var require_prime = __commonJS({
|
|
|
7199
7366
|
}
|
|
7200
7367
|
});
|
|
7201
7368
|
|
|
7202
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
7369
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/rsa.js
|
|
7203
7370
|
var require_rsa = __commonJS({
|
|
7204
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
7371
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/rsa.js"(exports, module) {
|
|
7205
7372
|
"use strict";
|
|
7206
7373
|
var forge2 = require_forge();
|
|
7207
7374
|
require_asn1();
|
|
@@ -7420,6 +7587,41 @@ var require_rsa = __commonJS({
|
|
|
7420
7587
|
capture: "digest"
|
|
7421
7588
|
}]
|
|
7422
7589
|
};
|
|
7590
|
+
var _encodeDigestInfo = function(oid, digest, withParameters) {
|
|
7591
|
+
var digestAlgorithm = [asn1.create(
|
|
7592
|
+
asn1.Class.UNIVERSAL,
|
|
7593
|
+
asn1.Type.OID,
|
|
7594
|
+
false,
|
|
7595
|
+
asn1.oidToDer(oid).getBytes()
|
|
7596
|
+
)];
|
|
7597
|
+
if (withParameters) {
|
|
7598
|
+
digestAlgorithm.push(asn1.create(
|
|
7599
|
+
asn1.Class.UNIVERSAL,
|
|
7600
|
+
asn1.Type.NULL,
|
|
7601
|
+
false,
|
|
7602
|
+
""
|
|
7603
|
+
));
|
|
7604
|
+
}
|
|
7605
|
+
return asn1.toDer(asn1.create(
|
|
7606
|
+
asn1.Class.UNIVERSAL,
|
|
7607
|
+
asn1.Type.SEQUENCE,
|
|
7608
|
+
true,
|
|
7609
|
+
[
|
|
7610
|
+
asn1.create(
|
|
7611
|
+
asn1.Class.UNIVERSAL,
|
|
7612
|
+
asn1.Type.SEQUENCE,
|
|
7613
|
+
true,
|
|
7614
|
+
digestAlgorithm
|
|
7615
|
+
),
|
|
7616
|
+
asn1.create(
|
|
7617
|
+
asn1.Class.UNIVERSAL,
|
|
7618
|
+
asn1.Type.OCTETSTRING,
|
|
7619
|
+
false,
|
|
7620
|
+
digest
|
|
7621
|
+
)
|
|
7622
|
+
]
|
|
7623
|
+
)).getBytes();
|
|
7624
|
+
};
|
|
7423
7625
|
var emsaPkcs1v15encode = function(md) {
|
|
7424
7626
|
var oid;
|
|
7425
7627
|
if (md.algorithm in pki.oids) {
|
|
@@ -7901,7 +8103,7 @@ var require_rsa = __commonJS({
|
|
|
7901
8103
|
});
|
|
7902
8104
|
var capture = {};
|
|
7903
8105
|
var errors = [];
|
|
7904
|
-
if (!asn1.validate(obj, digestInfoValidator, capture, errors) || obj.value.length !== 2
|
|
8106
|
+
if (!asn1.validate(obj, digestInfoValidator, capture, errors) || obj.value.length !== 2) {
|
|
7905
8107
|
var error = new Error(
|
|
7906
8108
|
"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."
|
|
7907
8109
|
);
|
|
@@ -7923,6 +8125,13 @@ var require_rsa = __commonJS({
|
|
|
7923
8125
|
);
|
|
7924
8126
|
}
|
|
7925
8127
|
}
|
|
8128
|
+
var withParameters = _encodeDigestInfo(oid, capture.digest, true);
|
|
8129
|
+
var withoutParameters = _encodeDigestInfo(oid, capture.digest, false);
|
|
8130
|
+
if (d2.substring(0, withParameters.length) !== withParameters && d2.substring(0, withoutParameters.length) !== withoutParameters) {
|
|
8131
|
+
throw new Error(
|
|
8132
|
+
"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."
|
|
8133
|
+
);
|
|
8134
|
+
}
|
|
7926
8135
|
return digest2 === capture.digest;
|
|
7927
8136
|
}
|
|
7928
8137
|
};
|
|
@@ -8401,9 +8610,9 @@ var require_rsa = __commonJS({
|
|
|
8401
8610
|
}
|
|
8402
8611
|
});
|
|
8403
8612
|
|
|
8404
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
8613
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pbe.js
|
|
8405
8614
|
var require_pbe = __commonJS({
|
|
8406
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
8615
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pbe.js"(exports, module) {
|
|
8407
8616
|
"use strict";
|
|
8408
8617
|
var forge2 = require_forge();
|
|
8409
8618
|
require_aes();
|
|
@@ -8884,6 +9093,9 @@ var require_pbe = __commonJS({
|
|
|
8884
9093
|
};
|
|
8885
9094
|
pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) {
|
|
8886
9095
|
var j, l;
|
|
9096
|
+
if (!(iter >= 1)) {
|
|
9097
|
+
throw new Error("PKCS#12 key derivation iteration count must be >= 1.");
|
|
9098
|
+
}
|
|
8887
9099
|
if (typeof md === "undefined" || md === null) {
|
|
8888
9100
|
if (!("sha1" in forge2.md)) {
|
|
8889
9101
|
throw new Error('"sha1" hash algorithm unavailable.');
|
|
@@ -9179,9 +9391,9 @@ var require_pbe = __commonJS({
|
|
|
9179
9391
|
}
|
|
9180
9392
|
});
|
|
9181
9393
|
|
|
9182
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
9394
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs7asn1.js
|
|
9183
9395
|
var require_pkcs7asn1 = __commonJS({
|
|
9184
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
9396
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs7asn1.js"(exports, module) {
|
|
9185
9397
|
"use strict";
|
|
9186
9398
|
var forge2 = require_forge();
|
|
9187
9399
|
require_asn1();
|
|
@@ -9481,9 +9693,9 @@ var require_pkcs7asn1 = __commonJS({
|
|
|
9481
9693
|
}
|
|
9482
9694
|
});
|
|
9483
9695
|
|
|
9484
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
9696
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/mgf1.js
|
|
9485
9697
|
var require_mgf1 = __commonJS({
|
|
9486
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
9698
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/mgf1.js"(exports, module) {
|
|
9487
9699
|
"use strict";
|
|
9488
9700
|
var forge2 = require_forge();
|
|
9489
9701
|
require_util();
|
|
@@ -9517,9 +9729,9 @@ var require_mgf1 = __commonJS({
|
|
|
9517
9729
|
}
|
|
9518
9730
|
});
|
|
9519
9731
|
|
|
9520
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
9732
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/mgf.js
|
|
9521
9733
|
var require_mgf = __commonJS({
|
|
9522
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
9734
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/mgf.js"(exports, module) {
|
|
9523
9735
|
"use strict";
|
|
9524
9736
|
var forge2 = require_forge();
|
|
9525
9737
|
require_mgf1();
|
|
@@ -9528,9 +9740,9 @@ var require_mgf = __commonJS({
|
|
|
9528
9740
|
}
|
|
9529
9741
|
});
|
|
9530
9742
|
|
|
9531
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
9743
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pss.js
|
|
9532
9744
|
var require_pss = __commonJS({
|
|
9533
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
9745
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pss.js"(exports, module) {
|
|
9534
9746
|
"use strict";
|
|
9535
9747
|
var forge2 = require_forge();
|
|
9536
9748
|
require_random();
|
|
@@ -9648,9 +9860,9 @@ var require_pss = __commonJS({
|
|
|
9648
9860
|
}
|
|
9649
9861
|
});
|
|
9650
9862
|
|
|
9651
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
9863
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/x509.js
|
|
9652
9864
|
var require_x509 = __commonJS({
|
|
9653
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
9865
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/x509.js"(exports, module) {
|
|
9654
9866
|
"use strict";
|
|
9655
9867
|
var forge2 = require_forge();
|
|
9656
9868
|
require_aes();
|
|
@@ -10174,6 +10386,7 @@ var require_x509 = __commonJS({
|
|
|
10174
10386
|
};
|
|
10175
10387
|
var _verifySignature = function(options) {
|
|
10176
10388
|
var cert = options.certificate;
|
|
10389
|
+
var publicKey = options.publicKey || cert.publicKey;
|
|
10177
10390
|
var scheme;
|
|
10178
10391
|
switch (cert.signatureOid) {
|
|
10179
10392
|
case oids.sha1WithRSAEncryption:
|
|
@@ -10211,7 +10424,7 @@ var require_x509 = __commonJS({
|
|
|
10211
10424
|
);
|
|
10212
10425
|
break;
|
|
10213
10426
|
}
|
|
10214
|
-
return
|
|
10427
|
+
return publicKey.verify(
|
|
10215
10428
|
options.md.digest().getBytes(),
|
|
10216
10429
|
options.signature,
|
|
10217
10430
|
scheme
|
|
@@ -10431,7 +10644,8 @@ var require_x509 = __commonJS({
|
|
|
10431
10644
|
}
|
|
10432
10645
|
if (md !== null) {
|
|
10433
10646
|
rval = _verifySignature({
|
|
10434
|
-
certificate:
|
|
10647
|
+
certificate: child,
|
|
10648
|
+
publicKey: cert.publicKey,
|
|
10435
10649
|
md,
|
|
10436
10650
|
signature: child.signature
|
|
10437
10651
|
});
|
|
@@ -11666,10 +11880,7 @@ var require_x509 = __commonJS({
|
|
|
11666
11880
|
}
|
|
11667
11881
|
}
|
|
11668
11882
|
if (parent) {
|
|
11669
|
-
var parents = parent;
|
|
11670
|
-
if (!forge2.util.isArray(parents)) {
|
|
11671
|
-
parents = [parents];
|
|
11672
|
-
}
|
|
11883
|
+
var parents = forge2.util.isArray(parent) ? parent.slice() : [parent];
|
|
11673
11884
|
var verified = false;
|
|
11674
11885
|
while (!verified && parents.length > 0) {
|
|
11675
11886
|
parent = parents.shift();
|
|
@@ -11714,7 +11925,7 @@ var require_x509 = __commonJS({
|
|
|
11714
11925
|
}
|
|
11715
11926
|
}
|
|
11716
11927
|
if (error === null && (!first || chain.length === 0 && (!parent || selfSigned))) {
|
|
11717
|
-
var bcExt = cert.getExtension("
|
|
11928
|
+
var bcExt = cert.getExtension({ id: "2.5.29.19" });
|
|
11718
11929
|
var keyUsageExt = cert.getExtension("keyUsage");
|
|
11719
11930
|
if (keyUsageExt !== null) {
|
|
11720
11931
|
if (!keyUsageExt.keyCertSign || bcExt === null) {
|
|
@@ -11736,7 +11947,7 @@ var require_x509 = __commonJS({
|
|
|
11736
11947
|
error: pki.certificateError.bad_certificate
|
|
11737
11948
|
};
|
|
11738
11949
|
}
|
|
11739
|
-
if (error === null &&
|
|
11950
|
+
if (error === null && bcExt !== null && "pathLenConstraint" in bcExt) {
|
|
11740
11951
|
var pathLen = depth - 1;
|
|
11741
11952
|
if (pathLen > bcExt.pathLenConstraint) {
|
|
11742
11953
|
error = {
|
|
@@ -11779,9 +11990,9 @@ var require_x509 = __commonJS({
|
|
|
11779
11990
|
}
|
|
11780
11991
|
});
|
|
11781
11992
|
|
|
11782
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
11993
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs12.js
|
|
11783
11994
|
var require_pkcs12 = __commonJS({
|
|
11784
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
11995
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs12.js"(exports, module) {
|
|
11785
11996
|
"use strict";
|
|
11786
11997
|
var forge2 = require_forge();
|
|
11787
11998
|
require_asn1();
|
|
@@ -12121,6 +12332,9 @@ var require_pkcs12 = __commonJS({
|
|
|
12121
12332
|
}
|
|
12122
12333
|
var macSalt = new forge2.util.ByteBuffer(capture.macSalt);
|
|
12123
12334
|
var macIterations = "macIterations" in capture ? parseInt(forge2.util.bytesToHex(capture.macIterations), 16) : 1;
|
|
12335
|
+
if (!(macIterations >= 1)) {
|
|
12336
|
+
throw new Error("PKCS#12 MAC iteration count must be >= 1.");
|
|
12337
|
+
}
|
|
12124
12338
|
var macKey = p12.generateKey(
|
|
12125
12339
|
password,
|
|
12126
12340
|
macSalt,
|
|
@@ -12643,9 +12857,9 @@ var require_pkcs12 = __commonJS({
|
|
|
12643
12857
|
}
|
|
12644
12858
|
});
|
|
12645
12859
|
|
|
12646
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
12860
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pki.js
|
|
12647
12861
|
var require_pki = __commonJS({
|
|
12648
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
12862
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pki.js"(exports, module) {
|
|
12649
12863
|
"use strict";
|
|
12650
12864
|
var forge2 = require_forge();
|
|
12651
12865
|
require_asn1();
|
|
@@ -12697,9 +12911,9 @@ var require_pki = __commonJS({
|
|
|
12697
12911
|
}
|
|
12698
12912
|
});
|
|
12699
12913
|
|
|
12700
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
12914
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/tls.js
|
|
12701
12915
|
var require_tls = __commonJS({
|
|
12702
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
12916
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/tls.js"(exports, module) {
|
|
12703
12917
|
"use strict";
|
|
12704
12918
|
var forge2 = require_forge();
|
|
12705
12919
|
require_asn1();
|
|
@@ -13384,7 +13598,7 @@ var require_tls = __commonJS({
|
|
|
13384
13598
|
}
|
|
13385
13599
|
});
|
|
13386
13600
|
}
|
|
13387
|
-
if (c.serverCertificate === null) {
|
|
13601
|
+
if (c.session.serverCertificate === null) {
|
|
13388
13602
|
var error = {
|
|
13389
13603
|
message: "No server certificate provided. Not enough security.",
|
|
13390
13604
|
send: true,
|
|
@@ -13408,8 +13622,8 @@ var require_tls = __commonJS({
|
|
|
13408
13622
|
error.alert.description = ret;
|
|
13409
13623
|
}
|
|
13410
13624
|
}
|
|
13411
|
-
return c.error(c, error);
|
|
13412
13625
|
}
|
|
13626
|
+
return c.error(c, error);
|
|
13413
13627
|
}
|
|
13414
13628
|
if (c.session.certificateRequest !== null) {
|
|
13415
13629
|
record = tls5.createRecord(c, {
|
|
@@ -13665,7 +13879,7 @@ var require_tls = __commonJS({
|
|
|
13665
13879
|
var length = b.getInt16();
|
|
13666
13880
|
var payload = b.getBytes(length);
|
|
13667
13881
|
if (type === tls5.HeartbeatMessageType.heartbeat_request) {
|
|
13668
|
-
if (c.handshaking || length > payload.length) {
|
|
13882
|
+
if (c.handshakes === 0 || c.handshaking || length > payload.length) {
|
|
13669
13883
|
return c.process();
|
|
13670
13884
|
}
|
|
13671
13885
|
tls5.queue(c, tls5.createRecord(c, {
|
|
@@ -14580,6 +14794,7 @@ var require_tls = __commonJS({
|
|
|
14580
14794
|
description: tls5.Alert.Description.unexpected_message
|
|
14581
14795
|
}
|
|
14582
14796
|
});
|
|
14797
|
+
return rval;
|
|
14583
14798
|
}
|
|
14584
14799
|
}
|
|
14585
14800
|
c2.record.ready = true;
|
|
@@ -14644,24 +14859,48 @@ var require_tls = __commonJS({
|
|
|
14644
14859
|
tls5.flush(c);
|
|
14645
14860
|
}
|
|
14646
14861
|
};
|
|
14862
|
+
var _processing = false;
|
|
14863
|
+
var _processNext = false;
|
|
14864
|
+
var _processRecord = function(c2) {
|
|
14865
|
+
var rval = 0;
|
|
14866
|
+
if (!c2.fail) {
|
|
14867
|
+
if (c2.record !== null && c2.record.ready && c2.record.fragment.isEmpty()) {
|
|
14868
|
+
c2.record = null;
|
|
14869
|
+
}
|
|
14870
|
+
if (c2.record === null) {
|
|
14871
|
+
rval = _readRecordHeader(c2);
|
|
14872
|
+
}
|
|
14873
|
+
if (!c2.fail && c2.record !== null && !c2.record.ready) {
|
|
14874
|
+
rval = _readRecord(c2);
|
|
14875
|
+
}
|
|
14876
|
+
if (!c2.fail && c2.record !== null && c2.record.ready) {
|
|
14877
|
+
_update(c2, c2.record);
|
|
14878
|
+
}
|
|
14879
|
+
}
|
|
14880
|
+
return rval;
|
|
14881
|
+
};
|
|
14647
14882
|
c.process = function(data) {
|
|
14648
14883
|
var rval = 0;
|
|
14649
14884
|
if (data) {
|
|
14650
14885
|
c.input.putBytes(data);
|
|
14651
14886
|
}
|
|
14652
|
-
if (
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14663
|
-
|
|
14887
|
+
if (_processing && typeof data === "undefined") {
|
|
14888
|
+
_processNext = true;
|
|
14889
|
+
return rval;
|
|
14890
|
+
}
|
|
14891
|
+
var processing = _processing;
|
|
14892
|
+
var processNext = _processNext;
|
|
14893
|
+
_processing = true;
|
|
14894
|
+
_processNext = false;
|
|
14895
|
+
try {
|
|
14896
|
+
rval = _processRecord(c);
|
|
14897
|
+
while (_processNext) {
|
|
14898
|
+
_processNext = false;
|
|
14899
|
+
_processRecord(c);
|
|
14664
14900
|
}
|
|
14901
|
+
} finally {
|
|
14902
|
+
_processing = processing;
|
|
14903
|
+
_processNext = processNext;
|
|
14665
14904
|
}
|
|
14666
14905
|
return rval;
|
|
14667
14906
|
};
|
|
@@ -14731,9 +14970,9 @@ var require_tls = __commonJS({
|
|
|
14731
14970
|
}
|
|
14732
14971
|
});
|
|
14733
14972
|
|
|
14734
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
14973
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/aesCipherSuites.js
|
|
14735
14974
|
var require_aesCipherSuites = __commonJS({
|
|
14736
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
14975
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/aesCipherSuites.js"(exports, module) {
|
|
14737
14976
|
"use strict";
|
|
14738
14977
|
var forge2 = require_forge();
|
|
14739
14978
|
require_aes();
|
|
@@ -14876,9 +15115,9 @@ var require_aesCipherSuites = __commonJS({
|
|
|
14876
15115
|
}
|
|
14877
15116
|
});
|
|
14878
15117
|
|
|
14879
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
15118
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha512.js
|
|
14880
15119
|
var require_sha512 = __commonJS({
|
|
14881
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
15120
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/sha512.js"(exports, module) {
|
|
14882
15121
|
"use strict";
|
|
14883
15122
|
var forge2 = require_forge();
|
|
14884
15123
|
require_md();
|
|
@@ -15285,9 +15524,9 @@ var require_sha512 = __commonJS({
|
|
|
15285
15524
|
}
|
|
15286
15525
|
});
|
|
15287
15526
|
|
|
15288
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
15527
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/asn1-validator.js
|
|
15289
15528
|
var require_asn1_validator = __commonJS({
|
|
15290
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
15529
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/asn1-validator.js"(exports) {
|
|
15291
15530
|
"use strict";
|
|
15292
15531
|
var forge2 = require_forge();
|
|
15293
15532
|
require_asn1();
|
|
@@ -15378,9 +15617,9 @@ var require_asn1_validator = __commonJS({
|
|
|
15378
15617
|
}
|
|
15379
15618
|
});
|
|
15380
15619
|
|
|
15381
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
15620
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/ed25519.js
|
|
15382
15621
|
var require_ed25519 = __commonJS({
|
|
15383
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
15622
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/ed25519.js"(exports, module) {
|
|
15384
15623
|
"use strict";
|
|
15385
15624
|
var forge2 = require_forge();
|
|
15386
15625
|
require_jsbn();
|
|
@@ -16492,9 +16731,9 @@ var require_ed25519 = __commonJS({
|
|
|
16492
16731
|
}
|
|
16493
16732
|
});
|
|
16494
16733
|
|
|
16495
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
16734
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/kem.js
|
|
16496
16735
|
var require_kem = __commonJS({
|
|
16497
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
16736
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/kem.js"(exports, module) {
|
|
16498
16737
|
"use strict";
|
|
16499
16738
|
var forge2 = require_forge();
|
|
16500
16739
|
require_util();
|
|
@@ -16556,9 +16795,9 @@ var require_kem = __commonJS({
|
|
|
16556
16795
|
}
|
|
16557
16796
|
});
|
|
16558
16797
|
|
|
16559
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
16798
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/log.js
|
|
16560
16799
|
var require_log = __commonJS({
|
|
16561
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
16800
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/log.js"(exports, module) {
|
|
16562
16801
|
"use strict";
|
|
16563
16802
|
var forge2 = require_forge();
|
|
16564
16803
|
require_util();
|
|
@@ -16732,9 +16971,9 @@ var require_log = __commonJS({
|
|
|
16732
16971
|
}
|
|
16733
16972
|
});
|
|
16734
16973
|
|
|
16735
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
16974
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md.all.js
|
|
16736
16975
|
var require_md_all = __commonJS({
|
|
16737
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
16976
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/md.all.js"(exports, module) {
|
|
16738
16977
|
"use strict";
|
|
16739
16978
|
module.exports = require_md();
|
|
16740
16979
|
require_md5();
|
|
@@ -16744,9 +16983,9 @@ var require_md_all = __commonJS({
|
|
|
16744
16983
|
}
|
|
16745
16984
|
});
|
|
16746
16985
|
|
|
16747
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
16986
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs7.js
|
|
16748
16987
|
var require_pkcs7 = __commonJS({
|
|
16749
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
16988
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/pkcs7.js"(exports, module) {
|
|
16750
16989
|
"use strict";
|
|
16751
16990
|
var forge2 = require_forge();
|
|
16752
16991
|
require_aes();
|
|
@@ -17734,9 +17973,9 @@ var require_pkcs7 = __commonJS({
|
|
|
17734
17973
|
}
|
|
17735
17974
|
});
|
|
17736
17975
|
|
|
17737
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
17976
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/ssh.js
|
|
17738
17977
|
var require_ssh = __commonJS({
|
|
17739
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
17978
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/ssh.js"(exports, module) {
|
|
17740
17979
|
"use strict";
|
|
17741
17980
|
var forge2 = require_forge();
|
|
17742
17981
|
require_aes();
|
|
@@ -17871,9 +18110,9 @@ var require_ssh = __commonJS({
|
|
|
17871
18110
|
}
|
|
17872
18111
|
});
|
|
17873
18112
|
|
|
17874
|
-
// ../../node_modules/.pnpm/node-forge@1.4.
|
|
18113
|
+
// ../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/index.js
|
|
17875
18114
|
var require_lib = __commonJS({
|
|
17876
|
-
"../../node_modules/.pnpm/node-forge@1.4.
|
|
18115
|
+
"../../node_modules/.pnpm/node-forge@1.4.2/node_modules/node-forge/lib/index.js"(exports, module) {
|
|
17877
18116
|
"use strict";
|
|
17878
18117
|
module.exports = require_forge();
|
|
17879
18118
|
require_aes();
|
|
@@ -18065,13 +18304,61 @@ var CLIENT_KNOWN_TYPE_ROWS = {
|
|
|
18065
18304
|
{ rows: ["apps", "*"], field: ["type"], known: ["app"] }
|
|
18066
18305
|
],
|
|
18067
18306
|
"GlobalSearchApiClient.search": [
|
|
18307
|
+
{
|
|
18308
|
+
rows: ["results", "*", "item", "card", "previewItems", "*"],
|
|
18309
|
+
field: ["kind"],
|
|
18310
|
+
known: ["app", "design", "skill", "workflow"]
|
|
18311
|
+
},
|
|
18312
|
+
{
|
|
18313
|
+
rows: ["results", "*"],
|
|
18314
|
+
field: ["item", "capabilities", "open", "resourceKind"],
|
|
18315
|
+
known: ["app", "design", "skill", "workflow"]
|
|
18316
|
+
},
|
|
18317
|
+
{
|
|
18318
|
+
rows: ["results", "*"],
|
|
18319
|
+
field: ["item", "capabilities", "pin", "kind"],
|
|
18320
|
+
known: ["app", "chat", "design", "project", "skill", "workflow"]
|
|
18321
|
+
},
|
|
18322
|
+
{
|
|
18323
|
+
rows: ["results", "*"],
|
|
18324
|
+
field: ["item", "card", "kind"],
|
|
18325
|
+
known: ["app", "design", "project", "skill", "workflow"]
|
|
18326
|
+
},
|
|
18327
|
+
{
|
|
18328
|
+
rows: ["results", "*"],
|
|
18329
|
+
field: ["item", "card", "resource", "workflowType"],
|
|
18330
|
+
known: ["agent", "app", "code", "design"]
|
|
18331
|
+
},
|
|
18332
|
+
{
|
|
18333
|
+
rows: ["results", "*"],
|
|
18334
|
+
field: ["item", "execution", "workflowType"],
|
|
18335
|
+
known: ["agent", "app", "code", "design"]
|
|
18336
|
+
},
|
|
18337
|
+
{
|
|
18338
|
+
rows: ["results", "*"],
|
|
18339
|
+
field: ["item", "subject", "kind"],
|
|
18340
|
+
known: ["app", "chat", "design", "project", "skill", "workflow"]
|
|
18341
|
+
},
|
|
18342
|
+
{
|
|
18343
|
+
rows: ["results", "*"],
|
|
18344
|
+
field: ["item", "thread", "workflowType"],
|
|
18345
|
+
known: ["agent", "app", "code", "design"]
|
|
18346
|
+
},
|
|
18068
18347
|
{
|
|
18069
18348
|
rows: ["results", "*"],
|
|
18070
18349
|
field: ["type"],
|
|
18071
18350
|
known: [
|
|
18072
18351
|
"app",
|
|
18352
|
+
"conversation",
|
|
18353
|
+
"crmCard",
|
|
18354
|
+
"crmCompany",
|
|
18355
|
+
"crmList",
|
|
18356
|
+
"crmPerson",
|
|
18357
|
+
"crmPipeline",
|
|
18073
18358
|
"database",
|
|
18074
18359
|
"design",
|
|
18360
|
+
"file",
|
|
18361
|
+
"folder",
|
|
18075
18362
|
"integration",
|
|
18076
18363
|
"member",
|
|
18077
18364
|
"memoryFile",
|
|
@@ -18572,7 +18859,8 @@ var PlatformServiceSchema = z.enum([
|
|
|
18572
18859
|
"transcribe",
|
|
18573
18860
|
"user-database",
|
|
18574
18861
|
"user-storage",
|
|
18575
|
-
"workspace-members"
|
|
18862
|
+
"workspace-members",
|
|
18863
|
+
"notifications"
|
|
18576
18864
|
]);
|
|
18577
18865
|
var PlatformResourceKindSchema = z.enum([
|
|
18578
18866
|
"user-database",
|
|
@@ -19313,6 +19601,8 @@ var OrgPermission = {
|
|
|
19313
19601
|
MEMBERS_RESEND_INVITE: "members:resend_invite",
|
|
19314
19602
|
MEMBERS_CANCEL_INVITE: "members:cancel_invite",
|
|
19315
19603
|
MEMBERS_UPDATE_ROLE: "members:update_role",
|
|
19604
|
+
// Set another member's name in this workspace; everyone may set their own.
|
|
19605
|
+
MEMBERS_RENAME: "members:rename",
|
|
19316
19606
|
MEMBERS_ARCHIVE: "members:archive",
|
|
19317
19607
|
MEMBERS_DEMOTE_ADMIN: "members:demote_admin",
|
|
19318
19608
|
MEMBERS_TRANSFER_OWNERSHIP: "members:transfer_ownership",
|
|
@@ -19374,6 +19664,7 @@ var ORG_PERMISSIONS = [
|
|
|
19374
19664
|
{ id: OrgPermission.MEMBERS_RESEND_INVITE, label: "Resend invites" },
|
|
19375
19665
|
{ id: OrgPermission.MEMBERS_CANCEL_INVITE, label: "Cancel invites" },
|
|
19376
19666
|
{ id: OrgPermission.MEMBERS_UPDATE_ROLE, label: "Change member roles" },
|
|
19667
|
+
{ id: OrgPermission.MEMBERS_RENAME, label: "Change members' names" },
|
|
19377
19668
|
{ id: OrgPermission.MEMBERS_ARCHIVE, label: "Deactivate members" },
|
|
19378
19669
|
{ id: OrgPermission.MEMBERS_DEMOTE_ADMIN, label: "Demote admins" },
|
|
19379
19670
|
{ id: OrgPermission.MEMBERS_TRANSFER_OWNERSHIP, label: "Transfer ownership" },
|
|
@@ -19455,6 +19746,7 @@ var ROLES_BY_PERMISSION = {
|
|
|
19455
19746
|
[OrgPermission.MEMBERS_RESEND_INVITE]: ["Admin", "Owner"],
|
|
19456
19747
|
[OrgPermission.MEMBERS_CANCEL_INVITE]: ["Admin", "Owner"],
|
|
19457
19748
|
[OrgPermission.MEMBERS_UPDATE_ROLE]: ["Admin", "Owner"],
|
|
19749
|
+
[OrgPermission.MEMBERS_RENAME]: ["Admin", "Owner"],
|
|
19458
19750
|
[OrgPermission.MEMBERS_ARCHIVE]: ["Admin", "Owner"],
|
|
19459
19751
|
[OrgPermission.MEMBERS_DEMOTE_ADMIN]: ["Owner"],
|
|
19460
19752
|
[OrgPermission.MEMBERS_TRANSFER_OWNERSHIP]: ["Owner"],
|
|
@@ -19504,38 +19796,6 @@ var WORKSPACE_MODEL_MANAGER_RULES = {
|
|
|
19504
19796
|
}
|
|
19505
19797
|
};
|
|
19506
19798
|
|
|
19507
|
-
// ../../packages/utils/dist/projectAvatar.js
|
|
19508
|
-
function resolveProjectAvatar(project) {
|
|
19509
|
-
if (project.workerColor)
|
|
19510
|
-
return {
|
|
19511
|
-
kind: "figure",
|
|
19512
|
-
color: project.workerColor,
|
|
19513
|
-
accessories: project.workerAccessories
|
|
19514
|
-
};
|
|
19515
|
-
return { kind: "initial", letter: projectInitial(project.name) };
|
|
19516
|
-
}
|
|
19517
|
-
function projectInitial(name) {
|
|
19518
|
-
const [first] = [...name.trim()];
|
|
19519
|
-
return first ? first.toUpperCase() : "?";
|
|
19520
|
-
}
|
|
19521
|
-
|
|
19522
|
-
// ../../packages/utils/dist/dateBuckets.js
|
|
19523
|
-
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
19524
|
-
|
|
19525
|
-
// ../../packages/utils/dist/workerColor.js
|
|
19526
|
-
var WORKER_COLORS = [
|
|
19527
|
-
"black",
|
|
19528
|
-
"red",
|
|
19529
|
-
"blue",
|
|
19530
|
-
"yellow",
|
|
19531
|
-
"green",
|
|
19532
|
-
"orange",
|
|
19533
|
-
"purple"
|
|
19534
|
-
];
|
|
19535
|
-
function isWorkerColor(value) {
|
|
19536
|
-
return WORKER_COLORS.some((color) => color === value);
|
|
19537
|
-
}
|
|
19538
|
-
|
|
19539
19799
|
// ../../packages/utils/dist/workerAccessories.js
|
|
19540
19800
|
var WORKER_ACCESSORY_CATALOG = {
|
|
19541
19801
|
head: {
|
|
@@ -19629,6 +19889,38 @@ function soloWorkerAccessory(id) {
|
|
|
19629
19889
|
return null;
|
|
19630
19890
|
}
|
|
19631
19891
|
|
|
19892
|
+
// ../../packages/utils/dist/projectAvatar.js
|
|
19893
|
+
function resolveProjectAvatar(project) {
|
|
19894
|
+
if (project.workerColor)
|
|
19895
|
+
return {
|
|
19896
|
+
kind: "figure",
|
|
19897
|
+
color: project.workerColor,
|
|
19898
|
+
accessories: project.workerAccessories
|
|
19899
|
+
};
|
|
19900
|
+
return { kind: "initial", letter: projectInitial(project.name) };
|
|
19901
|
+
}
|
|
19902
|
+
function projectInitial(name) {
|
|
19903
|
+
const [first] = [...name.trim()];
|
|
19904
|
+
return first ? first.toUpperCase() : "?";
|
|
19905
|
+
}
|
|
19906
|
+
|
|
19907
|
+
// ../../packages/utils/dist/dateBuckets.js
|
|
19908
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
19909
|
+
|
|
19910
|
+
// ../../packages/utils/dist/workerColor.js
|
|
19911
|
+
var WORKER_COLORS = [
|
|
19912
|
+
"black",
|
|
19913
|
+
"red",
|
|
19914
|
+
"blue",
|
|
19915
|
+
"yellow",
|
|
19916
|
+
"green",
|
|
19917
|
+
"orange",
|
|
19918
|
+
"purple"
|
|
19919
|
+
];
|
|
19920
|
+
function isWorkerColor(value) {
|
|
19921
|
+
return WORKER_COLORS.some((color) => color === value);
|
|
19922
|
+
}
|
|
19923
|
+
|
|
19632
19924
|
// ../../packages/api/dist/types/accountDeletion.js
|
|
19633
19925
|
var WORKSPACE_DEPARTURE_OWNED_KINDS = [
|
|
19634
19926
|
"specialists",
|
|
@@ -19776,6 +20068,18 @@ function fillLegacyCredentialOutage(value) {
|
|
|
19776
20068
|
}
|
|
19777
20069
|
}
|
|
19778
20070
|
|
|
20071
|
+
// ../../packages/api/dist/types/legacyCredentialConnection.js
|
|
20072
|
+
function fillLegacyCredentialConnection(value) {
|
|
20073
|
+
if (!("secretBackend" in value) || !("introspectedAt" in value))
|
|
20074
|
+
return;
|
|
20075
|
+
if (!("connectionState" in value)) {
|
|
20076
|
+
Reflect.set(value, "connectionState", "connected");
|
|
20077
|
+
Reflect.set(value, "disconnectReason", null);
|
|
20078
|
+
Reflect.set(value, "disconnectedAt", null);
|
|
20079
|
+
Reflect.set(value, "canReconnect", false);
|
|
20080
|
+
}
|
|
20081
|
+
}
|
|
20082
|
+
|
|
19779
20083
|
// ../../packages/api/dist/types/legacyWorkspaceModelPolicy.js
|
|
19780
20084
|
function fillLegacyWorkspaceModelPolicy(value) {
|
|
19781
20085
|
const isMembership = "modelDefaults" in value && "organizationId" in value;
|
|
@@ -19860,6 +20164,36 @@ function fillLegacySpecialistFolders(value) {
|
|
|
19860
20164
|
}
|
|
19861
20165
|
}
|
|
19862
20166
|
|
|
20167
|
+
// ../../packages/api/dist/types/legacyMemberNames.js
|
|
20168
|
+
function fillLegacyMemberNames(value) {
|
|
20169
|
+
if ("nameSource" in value)
|
|
20170
|
+
return;
|
|
20171
|
+
if ("memberRoles" in value && "specialists" in value && "name" in value) {
|
|
20172
|
+
Reflect.set(value, "profileName", value.name);
|
|
20173
|
+
Reflect.set(value, "nameSource", "profile");
|
|
20174
|
+
}
|
|
20175
|
+
if ("modelDefaults" in value && "organizationId" in value && !("name" in value)) {
|
|
20176
|
+
Reflect.set(value, "name", null);
|
|
20177
|
+
Reflect.set(value, "nameSource", "profile");
|
|
20178
|
+
}
|
|
20179
|
+
}
|
|
20180
|
+
|
|
20181
|
+
// ../../packages/api/dist/types/legacyGettingStartedShown.js
|
|
20182
|
+
function fillLegacyGettingStartedShown(value) {
|
|
20183
|
+
if ("steps" in value && "completedCount" in value && "totalCount" in value && !("isShown" in value) && typeof value.completedCount === "number" && typeof value.totalCount === "number") {
|
|
20184
|
+
Reflect.set(value, "isShown", value.completedCount < value.totalCount);
|
|
20185
|
+
}
|
|
20186
|
+
}
|
|
20187
|
+
|
|
20188
|
+
// ../../packages/api/dist/types/legacySpecialistConversationSnoozes.js
|
|
20189
|
+
function fillLegacySpecialistConversationSnoozes(value) {
|
|
20190
|
+
if ("order" in value && "snoozedSpecialists" in value && "conversations" in value && !("conversationsSnoozedWith" in value) && typeof value.snoozedSpecialists === "object" && value.snoozedSpecialists !== null) {
|
|
20191
|
+
Reflect.set(value, "conversationsSnoozedWith", {
|
|
20192
|
+
...value.snoozedSpecialists
|
|
20193
|
+
});
|
|
20194
|
+
}
|
|
20195
|
+
}
|
|
20196
|
+
|
|
19863
20197
|
// ../../packages/api/dist/types/legacyApiFields.js
|
|
19864
20198
|
var LEGACY_FILLS = [
|
|
19865
20199
|
fillLegacyProjectAvatar,
|
|
@@ -19869,6 +20203,7 @@ var LEGACY_FILLS = [
|
|
|
19869
20203
|
fillLegacySpecialistTemplateCatalog,
|
|
19870
20204
|
fillLegacyTriggerState,
|
|
19871
20205
|
fillLegacyCredentialOutage,
|
|
20206
|
+
fillLegacyCredentialConnection,
|
|
19872
20207
|
fillLegacyWorkspaceModelPolicy,
|
|
19873
20208
|
fillLegacyHostedTunnelShareBlocker,
|
|
19874
20209
|
fillLegacyDesignCounts,
|
|
@@ -19876,7 +20211,10 @@ var LEGACY_FILLS = [
|
|
|
19876
20211
|
fillLegacyInferenceFeedSwitch,
|
|
19877
20212
|
fillLegacyThumbnailPicture,
|
|
19878
20213
|
fillLegacyDesignVideo,
|
|
19879
|
-
fillLegacySpecialistFolders
|
|
20214
|
+
fillLegacySpecialistFolders,
|
|
20215
|
+
fillLegacyMemberNames,
|
|
20216
|
+
fillLegacyGettingStartedShown,
|
|
20217
|
+
fillLegacySpecialistConversationSnoozes
|
|
19880
20218
|
];
|
|
19881
20219
|
function fillLegacyApiFields(value) {
|
|
19882
20220
|
if (Array.isArray(value)) {
|
|
@@ -20318,7 +20656,10 @@ var V1HttpClient = class {
|
|
|
20318
20656
|
timeoutMs: options.timeoutMs,
|
|
20319
20657
|
init: {
|
|
20320
20658
|
method: options.method ?? "GET",
|
|
20321
|
-
headers:
|
|
20659
|
+
headers: {
|
|
20660
|
+
...options.body !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
20661
|
+
...options.headers
|
|
20662
|
+
},
|
|
20322
20663
|
body: options.body !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
20323
20664
|
signal: options.signal
|
|
20324
20665
|
},
|
|
@@ -20468,7 +20809,10 @@ var V1IntegrationsApiClient = class {
|
|
|
20468
20809
|
this.http.requireAuthed();
|
|
20469
20810
|
return this.http.fetch("/v1/mobile/connections", {
|
|
20470
20811
|
method: "POST",
|
|
20471
|
-
body: {
|
|
20812
|
+
body: {
|
|
20813
|
+
service: args.service,
|
|
20814
|
+
reconnectCredentialId: args.reconnectCredentialId
|
|
20815
|
+
}
|
|
20472
20816
|
});
|
|
20473
20817
|
}
|
|
20474
20818
|
getConnection(args) {
|
|
@@ -20478,11 +20822,30 @@ var V1IntegrationsApiClient = class {
|
|
|
20478
20822
|
};
|
|
20479
20823
|
|
|
20480
20824
|
// ../../packages/api/dist/clients/v1/V1MemoryApiClient.js
|
|
20825
|
+
function wikiPath(owner) {
|
|
20826
|
+
return `/v1/memory/wiki/${owner.ownerType}/${encodeURIComponent(owner.ownerId)}`;
|
|
20827
|
+
}
|
|
20481
20828
|
var V1MemoryApiClient = class {
|
|
20482
20829
|
http;
|
|
20483
20830
|
constructor(http2) {
|
|
20484
20831
|
this.http = http2;
|
|
20485
20832
|
}
|
|
20833
|
+
/** Every page and file in one memory, as the wiki lists them. */
|
|
20834
|
+
async getWikiTree(owner, signal) {
|
|
20835
|
+
this.http.requireAuthed();
|
|
20836
|
+
return this.http.fetch(wikiPath(owner), { signal });
|
|
20837
|
+
}
|
|
20838
|
+
/** One page, with short-lived links to the files it shows. */
|
|
20839
|
+
async getWikiPage(args) {
|
|
20840
|
+
this.http.requireAuthed();
|
|
20841
|
+
return this.http.fetch(`${wikiPath(args.owner)}/pages/${args.pageId}`, {
|
|
20842
|
+
signal: args.signal
|
|
20843
|
+
});
|
|
20844
|
+
}
|
|
20845
|
+
async getWikiFileLink(args) {
|
|
20846
|
+
this.http.requireAuthed();
|
|
20847
|
+
return this.http.fetch(`${wikiPath(args.owner)}/files/${args.pageId}/link`);
|
|
20848
|
+
}
|
|
20486
20849
|
async read(ownerType) {
|
|
20487
20850
|
this.http.requireAuthed();
|
|
20488
20851
|
return this.http.fetch(`/v1/memory/${ownerType}`);
|
|
@@ -21038,6 +21401,59 @@ var V1WorkflowsApiClient = class {
|
|
|
21038
21401
|
const query = new URLSearchParams({ path: args.path });
|
|
21039
21402
|
return this.http.fetch(`/v1/workflows/${encodeURIComponent(args.workflowId)}/file-url?${query}`);
|
|
21040
21403
|
}
|
|
21404
|
+
/** Wires a connection into one of the workflow's slots; null clears it. */
|
|
21405
|
+
async updateCredentialSelection(args) {
|
|
21406
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/credentials`, {
|
|
21407
|
+
method: "PATCH",
|
|
21408
|
+
headers: ifMatch(args.version),
|
|
21409
|
+
body: { inputKey: args.inputKey, credentialId: args.credentialId }
|
|
21410
|
+
});
|
|
21411
|
+
}
|
|
21412
|
+
/** Sets a variable; null clears it back to unset, which runs on its default. */
|
|
21413
|
+
async updateConstValue(args) {
|
|
21414
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/const`, {
|
|
21415
|
+
method: "PUT",
|
|
21416
|
+
headers: ifMatch(args.version),
|
|
21417
|
+
body: { key: args.key, value: args.value }
|
|
21418
|
+
});
|
|
21419
|
+
}
|
|
21420
|
+
async updateAgentConfig(args) {
|
|
21421
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/agent-config`, {
|
|
21422
|
+
method: "PUT",
|
|
21423
|
+
headers: ifMatch(args.version),
|
|
21424
|
+
body: args.config
|
|
21425
|
+
});
|
|
21426
|
+
}
|
|
21427
|
+
/** How a paused run can reach the workflow's owner. */
|
|
21428
|
+
getHumanInLoopChannels(workflowId) {
|
|
21429
|
+
return this.http.fetch(`${workflowPath(workflowId)}/human-in-loop-channels`);
|
|
21430
|
+
}
|
|
21431
|
+
/** Replaces an agent workflow's instructions.md. */
|
|
21432
|
+
async updateInstructions(args) {
|
|
21433
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/instructions`, {
|
|
21434
|
+
method: "PUT",
|
|
21435
|
+
headers: ifMatch(args.version),
|
|
21436
|
+
body: { content: args.content }
|
|
21437
|
+
});
|
|
21438
|
+
}
|
|
21439
|
+
async updateTrigger(args) {
|
|
21440
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/triggers/${encodeURIComponent(args.triggerId)}`, {
|
|
21441
|
+
method: "PATCH",
|
|
21442
|
+
headers: ifMatch(args.version),
|
|
21443
|
+
body: { triggerConfig: args.triggerConfig }
|
|
21444
|
+
});
|
|
21445
|
+
}
|
|
21446
|
+
async removeTrigger(args) {
|
|
21447
|
+
await this.http.fetch(`${workflowPath(args.workflowId)}/triggers/${encodeURIComponent(args.triggerId)}`, { method: "DELETE", headers: ifMatch(args.version) });
|
|
21448
|
+
}
|
|
21449
|
+
/** One test poll against a proposed config; saves nothing. */
|
|
21450
|
+
testPollTrigger(args) {
|
|
21451
|
+
return this.http.fetch(`${workflowPath(args.workflowId)}/triggers/${encodeURIComponent(args.triggerId)}/test-poll`, { method: "POST", body: { triggerConfig: args.triggerConfig } });
|
|
21452
|
+
}
|
|
21453
|
+
/** What the workflow's filter recently let through and kept out. */
|
|
21454
|
+
getFilterActivity(workflowId) {
|
|
21455
|
+
return this.http.fetch(`${workflowPath(workflowId)}/filter/activity`);
|
|
21456
|
+
}
|
|
21041
21457
|
getExecutionView(workflowId, executionId, signal) {
|
|
21042
21458
|
return this.http.fetch(`${executionPath({ workflowId, executionId })}/view`, { signal });
|
|
21043
21459
|
}
|
|
@@ -21086,6 +21502,12 @@ var V1WorkflowsApiClient = class {
|
|
|
21086
21502
|
function executionPath(args) {
|
|
21087
21503
|
return `/v1/workflows/${encodeURIComponent(args.workflowId)}/executions/${encodeURIComponent(args.executionId)}`;
|
|
21088
21504
|
}
|
|
21505
|
+
function workflowPath(workflowId) {
|
|
21506
|
+
return `/v1/workflows/${encodeURIComponent(workflowId)}`;
|
|
21507
|
+
}
|
|
21508
|
+
function ifMatch(version) {
|
|
21509
|
+
return { "If-Match": String(version) };
|
|
21510
|
+
}
|
|
21089
21511
|
|
|
21090
21512
|
// ../../packages/api/dist/clients/v1/V1WorkspacesApiClient.js
|
|
21091
21513
|
var V1WorkspacesApiClient = class {
|
|
@@ -22929,25 +23351,143 @@ var CrmService = class {
|
|
|
22929
23351
|
async reorderAttributionSources(body) {
|
|
22930
23352
|
return (await this.crm()).reorderAttributionSources(body);
|
|
22931
23353
|
}
|
|
22932
|
-
// ──
|
|
22933
|
-
async
|
|
22934
|
-
return (await this.crm()).
|
|
23354
|
+
// ── Activities ─────────────────────────────────────────────────────
|
|
23355
|
+
async listActivities(args) {
|
|
23356
|
+
return (await this.crm()).listActivities(args);
|
|
22935
23357
|
}
|
|
22936
|
-
async
|
|
22937
|
-
return (await this.crm()).
|
|
23358
|
+
async getActivity(id) {
|
|
23359
|
+
return (await this.crm()).getActivity(id);
|
|
22938
23360
|
}
|
|
22939
|
-
async
|
|
22940
|
-
return (await this.crm()).
|
|
23361
|
+
async createActivity(body) {
|
|
23362
|
+
return (await this.crm()).createActivity(body);
|
|
22941
23363
|
}
|
|
22942
|
-
async
|
|
22943
|
-
return (await this.crm()).
|
|
23364
|
+
async upsertActivity(body) {
|
|
23365
|
+
return (await this.crm()).upsertActivity(body);
|
|
22944
23366
|
}
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
23367
|
+
async updateActivity(id, body) {
|
|
23368
|
+
return (await this.crm()).updateActivity(id, body);
|
|
23369
|
+
}
|
|
23370
|
+
async deleteActivity(id) {
|
|
23371
|
+
return (await this.crm()).deleteActivity(id);
|
|
23372
|
+
}
|
|
23373
|
+
// ── Files ──────────────────────────────────────────────────────────
|
|
23374
|
+
async listRecordFiles(entityType, entityId) {
|
|
23375
|
+
return (await this.crm()).listRecordFiles(entityType, entityId);
|
|
23376
|
+
}
|
|
23377
|
+
/** Puts the bytes at a direct upload link, then files them onto the record. */
|
|
23378
|
+
async uploadRecordFile(args) {
|
|
23379
|
+
const crm = await this.crm();
|
|
23380
|
+
const ticket = await crm.prepareFileUpload({
|
|
23381
|
+
entityType: args.entityType,
|
|
23382
|
+
entityId: args.entityId,
|
|
23383
|
+
mimeType: args.mimeType
|
|
23384
|
+
});
|
|
23385
|
+
const response = await fetch(ticket.uploadUrl, {
|
|
23386
|
+
method: "PUT",
|
|
23387
|
+
headers: { "Content-Type": args.mimeType },
|
|
23388
|
+
body: new Uint8Array(args.content)
|
|
23389
|
+
});
|
|
23390
|
+
if (!response.ok) {
|
|
23391
|
+
throw new Error(`Upload failed with HTTP ${String(response.status)}`);
|
|
23392
|
+
}
|
|
23393
|
+
return crm.commitFileUpload({
|
|
23394
|
+
uploadId: ticket.uploadId,
|
|
23395
|
+
entityType: args.entityType,
|
|
23396
|
+
entityId: args.entityId,
|
|
23397
|
+
name: args.name,
|
|
23398
|
+
mimeType: args.mimeType,
|
|
23399
|
+
kind: args.kind
|
|
23400
|
+
});
|
|
23401
|
+
}
|
|
23402
|
+
async getFileDownload(id) {
|
|
23403
|
+
return (await this.crm()).getFileDownload(id);
|
|
23404
|
+
}
|
|
23405
|
+
async getFileText(id) {
|
|
23406
|
+
return (await this.crm()).getFileText(id);
|
|
23407
|
+
}
|
|
23408
|
+
async deleteFile(id) {
|
|
23409
|
+
return (await this.crm()).deleteFile(id);
|
|
23410
|
+
}
|
|
23411
|
+
// ── Saved views ────────────────────────────────────────────────────
|
|
23412
|
+
async listSavedViews(args) {
|
|
23413
|
+
return (await this.crm()).listSavedViews(args);
|
|
23414
|
+
}
|
|
23415
|
+
async createSavedView(body) {
|
|
23416
|
+
return (await this.crm()).createSavedView(body);
|
|
23417
|
+
}
|
|
23418
|
+
async updateSavedView(id, body) {
|
|
23419
|
+
return (await this.crm()).updateSavedView(id, body);
|
|
23420
|
+
}
|
|
23421
|
+
async deleteSavedView(id) {
|
|
23422
|
+
return (await this.crm()).deleteSavedView(id);
|
|
23423
|
+
}
|
|
23424
|
+
// ── Record lifecycle ───────────────────────────────────────────────
|
|
23425
|
+
async mergeRecords(entityType, body) {
|
|
23426
|
+
return (await this.crm()).mergeRecords(entityType, body);
|
|
23427
|
+
}
|
|
23428
|
+
async setDoNotContact(personId, body) {
|
|
23429
|
+
return (await this.crm()).setDoNotContact(personId, body);
|
|
23430
|
+
}
|
|
23431
|
+
async setContactPointOptOut(contactPointId, body) {
|
|
23432
|
+
return (await this.crm()).setContactPointOptOut(contactPointId, body);
|
|
23433
|
+
}
|
|
23434
|
+
async checkConsent(args) {
|
|
23435
|
+
return (await this.crm()).checkConsent(args);
|
|
23436
|
+
}
|
|
23437
|
+
async exportPerson(personId) {
|
|
23438
|
+
return (await this.crm()).exportPerson(personId);
|
|
23439
|
+
}
|
|
23440
|
+
async erasePerson(personId) {
|
|
23441
|
+
return (await this.crm()).erasePerson(personId);
|
|
23442
|
+
}
|
|
23443
|
+
async listCardCredits(cardId) {
|
|
23444
|
+
return (await this.crm()).listCardCredits(cardId);
|
|
23445
|
+
}
|
|
23446
|
+
async setCardCredits(cardId, body) {
|
|
23447
|
+
return (await this.crm()).setCardCredits(cardId, body);
|
|
23448
|
+
}
|
|
23449
|
+
// ── Imports and matching ───────────────────────────────────────────
|
|
23450
|
+
async previewImport(body) {
|
|
23451
|
+
return (await this.crm()).previewImport(body);
|
|
23452
|
+
}
|
|
23453
|
+
async startImport(body) {
|
|
23454
|
+
return (await this.crm()).startImport(body);
|
|
23455
|
+
}
|
|
23456
|
+
async getImport(importId) {
|
|
23457
|
+
return (await this.crm()).getImport(importId);
|
|
23458
|
+
}
|
|
23459
|
+
async listImports() {
|
|
23460
|
+
return (await (await this.crm()).listImports()).imports;
|
|
23461
|
+
}
|
|
23462
|
+
async matchPeople(emails) {
|
|
23463
|
+
return (await this.crm()).matchPeople(emails);
|
|
23464
|
+
}
|
|
23465
|
+
// ── History ────────────────────────────────────────────────────────
|
|
23466
|
+
async listRecordHistory(entityType, entityId) {
|
|
23467
|
+
return (await this.crm()).listRecordHistory(entityType, entityId);
|
|
23468
|
+
}
|
|
23469
|
+
async listRecordEvents(args) {
|
|
23470
|
+
return (await this.crm()).listRecordEvents(args);
|
|
23471
|
+
}
|
|
23472
|
+
// ── Notes ──────────────────────────────────────────────────────────
|
|
23473
|
+
async listNotes(entityType, entityId) {
|
|
23474
|
+
return (await this.crm()).listNotes(entityType, entityId);
|
|
23475
|
+
}
|
|
23476
|
+
async createNote(entityType, entityId, body) {
|
|
23477
|
+
return (await this.crm()).createNote(entityType, entityId, body);
|
|
23478
|
+
}
|
|
23479
|
+
async updateNote(entityType, id, body) {
|
|
23480
|
+
return (await this.crm()).updateNote(entityType, id, body);
|
|
23481
|
+
}
|
|
23482
|
+
async deleteNote(entityType, id) {
|
|
23483
|
+
return (await this.crm()).deleteNote(entityType, id);
|
|
23484
|
+
}
|
|
23485
|
+
// ── Tasks ──────────────────────────────────────────────────────────
|
|
23486
|
+
async listTasks(args) {
|
|
23487
|
+
return (await this.crm()).listTasks({
|
|
23488
|
+
statuses: args.includeClosed ? void 0 : ["open"],
|
|
23489
|
+
owner: args.mine ? "me" : void 0
|
|
23490
|
+
});
|
|
22951
23491
|
}
|
|
22952
23492
|
async getTask(id) {
|
|
22953
23493
|
return (await this.crm()).getTask(id);
|
|
@@ -23269,22 +23809,61 @@ var EnrichmentOutcomeSchema = z14.enum([
|
|
|
23269
23809
|
"inconclusive",
|
|
23270
23810
|
"error"
|
|
23271
23811
|
]);
|
|
23272
|
-
|
|
23273
|
-
|
|
23274
|
-
|
|
23275
|
-
|
|
23276
|
-
"
|
|
23812
|
+
|
|
23813
|
+
// ../../packages/crm-api/dist/types/entity.js
|
|
23814
|
+
import { z as z15 } from "zod";
|
|
23815
|
+
var CrmEntityTypeSchema = z15.enum([
|
|
23816
|
+
"person",
|
|
23817
|
+
"company",
|
|
23818
|
+
"pipeline_card"
|
|
23819
|
+
]);
|
|
23820
|
+
var CRM_ENTITY_TYPES = CrmEntityTypeSchema.options;
|
|
23821
|
+
|
|
23822
|
+
// ../../packages/crm-api/dist/types/recordEvent.js
|
|
23823
|
+
import { z as z16 } from "zod";
|
|
23824
|
+
var CrmActorKindSchema = z16.enum([
|
|
23825
|
+
"user",
|
|
23826
|
+
"agent",
|
|
23827
|
+
"automation",
|
|
23828
|
+
"system"
|
|
23829
|
+
]);
|
|
23830
|
+
var CrmRecordEventKindSchema = z16.enum([
|
|
23831
|
+
"created",
|
|
23832
|
+
"field_changed",
|
|
23833
|
+
"stage_changed",
|
|
23834
|
+
"status_changed",
|
|
23835
|
+
"contact_added",
|
|
23836
|
+
"contact_removed",
|
|
23837
|
+
"archived",
|
|
23838
|
+
"deleted",
|
|
23839
|
+
"merged",
|
|
23840
|
+
"tag_added",
|
|
23841
|
+
"tag_removed",
|
|
23842
|
+
"list_added",
|
|
23843
|
+
"list_removed",
|
|
23844
|
+
"file_added",
|
|
23845
|
+
"file_removed",
|
|
23846
|
+
"task_created",
|
|
23847
|
+
"task_completed",
|
|
23848
|
+
"task_reopened",
|
|
23849
|
+
"task_dismissed",
|
|
23850
|
+
"task_deleted"
|
|
23277
23851
|
]);
|
|
23852
|
+
var CrmRecordEventFeedQuerySchema = z16.object({
|
|
23853
|
+
/** The cursor a previous read returned; omitted, the read returns the latest events. */
|
|
23854
|
+
after: z16.string().regex(/^\d+$/).optional(),
|
|
23855
|
+
limit: z16.coerce.number().int().min(1).max(500).default(100)
|
|
23856
|
+
});
|
|
23278
23857
|
|
|
23279
23858
|
// ../../packages/crm-api/dist/types/concurrency.js
|
|
23280
|
-
import { z as
|
|
23281
|
-
var ExpectedUpdatedAtSchema =
|
|
23282
|
-
expectedUpdatedAt:
|
|
23859
|
+
import { z as z17 } from "zod";
|
|
23860
|
+
var ExpectedUpdatedAtSchema = z17.object({
|
|
23861
|
+
expectedUpdatedAt: z17.string()
|
|
23283
23862
|
});
|
|
23284
23863
|
|
|
23285
23864
|
// ../../packages/crm-api/dist/types/company.js
|
|
23286
|
-
import { z as
|
|
23287
|
-
var CompanyTypeSchema =
|
|
23865
|
+
import { z as z18 } from "zod";
|
|
23866
|
+
var CompanyTypeSchema = z18.enum([
|
|
23288
23867
|
"public",
|
|
23289
23868
|
"private",
|
|
23290
23869
|
"nonprofit",
|
|
@@ -23294,12 +23873,11 @@ var CompanyTypeSchema = z16.enum([
|
|
|
23294
23873
|
]);
|
|
23295
23874
|
|
|
23296
23875
|
// ../../packages/crm-api/dist/types/customField.js
|
|
23297
|
-
import { z as
|
|
23876
|
+
import { z as z20 } from "zod";
|
|
23298
23877
|
|
|
23299
23878
|
// ../../packages/crm-api/dist/types/tag.js
|
|
23300
|
-
import { z as
|
|
23301
|
-
var
|
|
23302
|
-
var TagColorSchema = z17.enum([
|
|
23879
|
+
import { z as z19 } from "zod";
|
|
23880
|
+
var TagColorSchema = z19.enum([
|
|
23303
23881
|
"stone",
|
|
23304
23882
|
"charcoal",
|
|
23305
23883
|
"red",
|
|
@@ -23331,140 +23909,126 @@ var TagColorSchema = z17.enum([
|
|
|
23331
23909
|
"plum",
|
|
23332
23910
|
"tyrian"
|
|
23333
23911
|
]);
|
|
23334
|
-
var CreateTagRequestSchema =
|
|
23335
|
-
name:
|
|
23912
|
+
var CreateTagRequestSchema = z19.object({
|
|
23913
|
+
name: z19.string().min(1).max(100),
|
|
23336
23914
|
color: TagColorSchema.default("stone"),
|
|
23337
|
-
entityType:
|
|
23915
|
+
entityType: CrmEntityTypeSchema
|
|
23338
23916
|
});
|
|
23339
|
-
var UpdateTagRequestSchema =
|
|
23340
|
-
name:
|
|
23917
|
+
var UpdateTagRequestSchema = z19.object({
|
|
23918
|
+
name: z19.string().min(1).max(100).optional(),
|
|
23341
23919
|
color: TagColorSchema.optional()
|
|
23342
23920
|
}).refine((req) => req.name !== void 0 || req.color !== void 0, {
|
|
23343
23921
|
message: "Nothing to update"
|
|
23344
23922
|
});
|
|
23345
|
-
var TagEntitiesRequestSchema =
|
|
23346
|
-
entityIds:
|
|
23923
|
+
var TagEntitiesRequestSchema = z19.object({
|
|
23924
|
+
entityIds: z19.array(z19.uuid()).min(1).max(1e3)
|
|
23347
23925
|
});
|
|
23348
23926
|
|
|
23349
23927
|
// ../../packages/crm-api/dist/types/customField.js
|
|
23350
|
-
var CustomFieldTypeSchema =
|
|
23928
|
+
var CustomFieldTypeSchema = z20.enum([
|
|
23351
23929
|
"text",
|
|
23352
23930
|
"long_text",
|
|
23353
23931
|
"number",
|
|
23932
|
+
"currency",
|
|
23354
23933
|
"boolean",
|
|
23355
23934
|
"date",
|
|
23935
|
+
"datetime",
|
|
23356
23936
|
"single_select",
|
|
23357
23937
|
"multi_select",
|
|
23358
|
-
"
|
|
23938
|
+
"status",
|
|
23939
|
+
"url",
|
|
23940
|
+
"email",
|
|
23941
|
+
"phone",
|
|
23942
|
+
"member"
|
|
23359
23943
|
]);
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23944
|
+
function customFieldScopeKind(entityType) {
|
|
23945
|
+
return entityType === "pipeline_card" ? "pipeline" : null;
|
|
23946
|
+
}
|
|
23947
|
+
var CustomFieldOptionSchema = z20.object({
|
|
23948
|
+
value: z20.string().min(1).max(120),
|
|
23949
|
+
label: z20.string().min(1).max(120),
|
|
23364
23950
|
color: TagColorSchema.optional()
|
|
23365
23951
|
});
|
|
23366
|
-
var CustomFieldOptionInputSchema =
|
|
23367
|
-
value:
|
|
23368
|
-
label:
|
|
23952
|
+
var CustomFieldOptionInputSchema = z20.object({
|
|
23953
|
+
value: z20.string().max(120).optional(),
|
|
23954
|
+
label: z20.string().min(1).max(120),
|
|
23369
23955
|
color: TagColorSchema.optional()
|
|
23370
23956
|
});
|
|
23371
|
-
var CreateCustomFieldRequestSchema =
|
|
23372
|
-
entityType:
|
|
23373
|
-
scopeId:
|
|
23374
|
-
label:
|
|
23957
|
+
var CreateCustomFieldRequestSchema = z20.object({
|
|
23958
|
+
entityType: CrmEntityTypeSchema,
|
|
23959
|
+
scopeId: z20.uuid().nullish(),
|
|
23960
|
+
label: z20.string().min(1).max(80),
|
|
23375
23961
|
fieldType: CustomFieldTypeSchema,
|
|
23376
|
-
options:
|
|
23377
|
-
isRequired:
|
|
23378
|
-
helpText:
|
|
23379
|
-
description:
|
|
23380
|
-
}).refine((req) => req.entityType
|
|
23381
|
-
message: "
|
|
23962
|
+
options: z20.array(CustomFieldOptionInputSchema).max(100).optional(),
|
|
23963
|
+
isRequired: z20.boolean().optional(),
|
|
23964
|
+
helpText: z20.string().max(200).nullish(),
|
|
23965
|
+
description: z20.string().max(1e3).nullish()
|
|
23966
|
+
}).refine((req) => customFieldScopeKind(req.entityType) === "pipeline" === !!req.scopeId, {
|
|
23967
|
+
message: "A pipeline_card field needs its pipeline; no other field takes one"
|
|
23382
23968
|
});
|
|
23383
|
-
var UpdateCustomFieldRequestSchema =
|
|
23384
|
-
label:
|
|
23385
|
-
options:
|
|
23386
|
-
isRequired:
|
|
23387
|
-
helpText:
|
|
23388
|
-
description:
|
|
23389
|
-
position:
|
|
23969
|
+
var UpdateCustomFieldRequestSchema = z20.object({
|
|
23970
|
+
label: z20.string().min(1).max(80).optional(),
|
|
23971
|
+
options: z20.array(CustomFieldOptionInputSchema).max(100).optional(),
|
|
23972
|
+
isRequired: z20.boolean().optional(),
|
|
23973
|
+
helpText: z20.string().max(200).nullish(),
|
|
23974
|
+
description: z20.string().max(1e3).nullish(),
|
|
23975
|
+
position: z20.number().int().min(0).optional()
|
|
23390
23976
|
}).refine((req) => Object.keys(req).length > 0, {
|
|
23391
23977
|
message: "Nothing to update"
|
|
23392
23978
|
});
|
|
23393
|
-
var ReorderCustomFieldsRequestSchema =
|
|
23394
|
-
orderedIds:
|
|
23979
|
+
var ReorderCustomFieldsRequestSchema = z20.object({
|
|
23980
|
+
orderedIds: z20.array(z20.uuid()).min(1)
|
|
23395
23981
|
});
|
|
23396
|
-
var CustomFieldValuesSchema =
|
|
23982
|
+
var CustomFieldValuesSchema = z20.record(z20.string(), z20.unknown());
|
|
23397
23983
|
|
|
23398
23984
|
// ../../packages/crm-api/dist/types/list.js
|
|
23399
|
-
import { z as
|
|
23400
|
-
var
|
|
23401
|
-
var ListSearchSortSchema = z19.enum([
|
|
23985
|
+
import { z as z21 } from "zod";
|
|
23986
|
+
var ListSearchSortSchema = z21.enum([
|
|
23402
23987
|
"relevance",
|
|
23403
23988
|
"recent",
|
|
23404
23989
|
"updated",
|
|
23405
23990
|
"name",
|
|
23406
23991
|
"members"
|
|
23407
23992
|
]);
|
|
23408
|
-
var ListSearchFiltersSchema =
|
|
23409
|
-
|
|
23993
|
+
var ListSearchFiltersSchema = z21.object({
|
|
23994
|
+
entityType: CrmEntityTypeSchema.optional()
|
|
23410
23995
|
});
|
|
23411
|
-
var ListSearchRequestSchema =
|
|
23412
|
-
query:
|
|
23996
|
+
var ListSearchRequestSchema = z21.object({
|
|
23997
|
+
query: z21.string().optional(),
|
|
23413
23998
|
filters: ListSearchFiltersSchema.optional(),
|
|
23414
23999
|
sort: ListSearchSortSchema.default("relevance"),
|
|
23415
24000
|
// Direction for the column sort; omitted falls back to the sort's default.
|
|
23416
24001
|
direction: LeadSortDirectionSchema.optional(),
|
|
23417
|
-
cursor:
|
|
23418
|
-
limit:
|
|
24002
|
+
cursor: z21.string().nullable().optional(),
|
|
24003
|
+
limit: z21.number().int().min(1).max(100).default(25)
|
|
23419
24004
|
});
|
|
23420
|
-
var CreateListRequestSchema =
|
|
23421
|
-
name:
|
|
23422
|
-
purpose:
|
|
23423
|
-
|
|
24005
|
+
var CreateListRequestSchema = z21.object({
|
|
24006
|
+
name: z21.string().min(1).max(200),
|
|
24007
|
+
purpose: z21.string().max(2e3).nullish(),
|
|
24008
|
+
entityType: CrmEntityTypeSchema
|
|
23424
24009
|
});
|
|
23425
|
-
var UpdateListRequestSchema =
|
|
23426
|
-
name:
|
|
23427
|
-
purpose:
|
|
24010
|
+
var UpdateListRequestSchema = z21.object({
|
|
24011
|
+
name: z21.string().min(1).max(200).optional(),
|
|
24012
|
+
purpose: z21.string().max(2e3).nullable().optional()
|
|
23428
24013
|
}).refine((req) => req.name !== void 0 || req.purpose !== void 0, {
|
|
23429
24014
|
message: "Nothing to update"
|
|
23430
24015
|
});
|
|
23431
|
-
var AddListMembersRequestSchema =
|
|
23432
|
-
entityIds:
|
|
24016
|
+
var AddListMembersRequestSchema = z21.object({
|
|
24017
|
+
entityIds: z21.array(z21.uuid()).min(1).max(1e3)
|
|
23433
24018
|
});
|
|
23434
|
-
var DeleteListsRequestSchema =
|
|
23435
|
-
ids:
|
|
24019
|
+
var DeleteListsRequestSchema = z21.object({
|
|
24020
|
+
ids: z21.array(z21.uuid()).min(1).max(100)
|
|
23436
24021
|
});
|
|
23437
24022
|
|
|
23438
24023
|
// ../../packages/crm-api/dist/types/pipeline.js
|
|
23439
|
-
import { z as
|
|
23440
|
-
var PipelineKindSchema =
|
|
23441
|
-
var PipelineTemplateKindSchema =
|
|
23442
|
-
var StagePhaseSchema =
|
|
23443
|
-
var BallInCourtSchema =
|
|
23444
|
-
var StageOutcomeSchema =
|
|
23445
|
-
var CardStatusSchema =
|
|
23446
|
-
var
|
|
23447
|
-
"user",
|
|
23448
|
-
"agent",
|
|
23449
|
-
"automation",
|
|
23450
|
-
"system"
|
|
23451
|
-
]);
|
|
23452
|
-
var CardEventKindSchema = z20.enum([
|
|
23453
|
-
"created",
|
|
23454
|
-
"stage_changed",
|
|
23455
|
-
"field_changed",
|
|
23456
|
-
"status_changed",
|
|
23457
|
-
"contact_added",
|
|
23458
|
-
"contact_removed",
|
|
23459
|
-
"archived",
|
|
23460
|
-
// Lifecycle of tasks linked to the card (to_label carries the task title).
|
|
23461
|
-
"task_created",
|
|
23462
|
-
"task_completed",
|
|
23463
|
-
"task_reopened",
|
|
23464
|
-
"task_dismissed",
|
|
23465
|
-
"task_deleted"
|
|
23466
|
-
]);
|
|
23467
|
-
var CardEventFieldSchema = z20.enum([
|
|
24024
|
+
import { z as z22 } from "zod";
|
|
24025
|
+
var PipelineKindSchema = z22.enum(["sales", "recruiting", "custom"]);
|
|
24026
|
+
var PipelineTemplateKindSchema = z22.enum(["sales", "recruiting"]);
|
|
24027
|
+
var StagePhaseSchema = z22.enum(["acquisition", "fulfillment"]);
|
|
24028
|
+
var BallInCourtSchema = z22.enum(["us", "them", "mutual"]);
|
|
24029
|
+
var StageOutcomeSchema = z22.enum(["won", "lost"]);
|
|
24030
|
+
var CardStatusSchema = z22.enum(["open", "won", "lost"]);
|
|
24031
|
+
var CardEventFieldSchema = z22.enum([
|
|
23468
24032
|
"title",
|
|
23469
24033
|
"amount",
|
|
23470
24034
|
"currency",
|
|
@@ -23473,203 +24037,261 @@ var CardEventFieldSchema = z20.enum([
|
|
|
23473
24037
|
"close_date",
|
|
23474
24038
|
"attribution"
|
|
23475
24039
|
]);
|
|
23476
|
-
var
|
|
24040
|
+
var CardLinkedEntityTypeSchema = z22.enum(["person", "company"]);
|
|
24041
|
+
var CreatePipelineFromTemplateRequestSchema = z22.object({
|
|
23477
24042
|
kind: PipelineTemplateKindSchema,
|
|
23478
|
-
name:
|
|
24043
|
+
name: z22.string().min(1).max(200).optional()
|
|
23479
24044
|
});
|
|
23480
|
-
var StageInputSchema =
|
|
23481
|
-
name:
|
|
24045
|
+
var StageInputSchema = z22.object({
|
|
24046
|
+
name: z22.string().min(1).max(80),
|
|
23482
24047
|
phase: StagePhaseSchema.default("acquisition"),
|
|
23483
24048
|
ballInCourt: BallInCourtSchema.default("us"),
|
|
23484
|
-
isCommitted:
|
|
24049
|
+
isCommitted: z22.boolean().default(false),
|
|
23485
24050
|
outcome: StageOutcomeSchema.nullish(),
|
|
23486
|
-
weight:
|
|
24051
|
+
weight: z22.number().int().min(0).max(100).default(0),
|
|
23487
24052
|
color: TagColorSchema.default("stone")
|
|
23488
24053
|
});
|
|
23489
|
-
var CreatePipelineRequestSchema =
|
|
23490
|
-
name:
|
|
23491
|
-
cardLabel:
|
|
23492
|
-
stages:
|
|
24054
|
+
var CreatePipelineRequestSchema = z22.object({
|
|
24055
|
+
name: z22.string().min(1).max(200),
|
|
24056
|
+
cardLabel: z22.string().min(1).max(60),
|
|
24057
|
+
stages: z22.array(StageInputSchema).min(1).max(20)
|
|
23493
24058
|
});
|
|
23494
|
-
var UpdatePipelineRequestSchema =
|
|
23495
|
-
name:
|
|
23496
|
-
cardLabel:
|
|
23497
|
-
archived:
|
|
24059
|
+
var UpdatePipelineRequestSchema = z22.object({
|
|
24060
|
+
name: z22.string().min(1).max(200).optional(),
|
|
24061
|
+
cardLabel: z22.string().min(1).max(60).optional(),
|
|
24062
|
+
archived: z22.boolean().optional()
|
|
23498
24063
|
}).refine((req) => req.name !== void 0 || req.cardLabel !== void 0 || req.archived !== void 0, { message: "Nothing to update" });
|
|
23499
24064
|
var AddStageRequestSchema = StageInputSchema.extend({
|
|
23500
24065
|
// 0-indexed insert position; appended when omitted.
|
|
23501
|
-
position:
|
|
24066
|
+
position: z22.number().int().min(0).optional()
|
|
23502
24067
|
});
|
|
23503
|
-
var UpdateStageRequestSchema =
|
|
23504
|
-
name:
|
|
24068
|
+
var UpdateStageRequestSchema = z22.object({
|
|
24069
|
+
name: z22.string().min(1).max(80).optional(),
|
|
23505
24070
|
phase: StagePhaseSchema.optional(),
|
|
23506
24071
|
ballInCourt: BallInCourtSchema.optional(),
|
|
23507
|
-
isCommitted:
|
|
24072
|
+
isCommitted: z22.boolean().optional(),
|
|
23508
24073
|
outcome: StageOutcomeSchema.nullable().optional(),
|
|
23509
|
-
weight:
|
|
24074
|
+
weight: z22.number().int().min(0).max(100).optional(),
|
|
23510
24075
|
color: TagColorSchema.optional()
|
|
23511
24076
|
}).refine((req) => Object.keys(req).length > 0, {
|
|
23512
24077
|
message: "Nothing to update"
|
|
23513
24078
|
});
|
|
23514
|
-
var ReorderStagesRequestSchema =
|
|
23515
|
-
stageIds:
|
|
24079
|
+
var ReorderStagesRequestSchema = z22.object({
|
|
24080
|
+
stageIds: z22.array(z22.uuid()).min(1)
|
|
23516
24081
|
});
|
|
23517
|
-
var CardPersonInputSchema =
|
|
23518
|
-
personId:
|
|
23519
|
-
role:
|
|
23520
|
-
isPrimary:
|
|
24082
|
+
var CardPersonInputSchema = z22.object({
|
|
24083
|
+
personId: z22.uuid(),
|
|
24084
|
+
role: z22.string().max(120).nullish(),
|
|
24085
|
+
isPrimary: z22.boolean().default(false)
|
|
23521
24086
|
});
|
|
23522
|
-
var CreateCardRequestSchema =
|
|
23523
|
-
title:
|
|
24087
|
+
var CreateCardRequestSchema = z22.object({
|
|
24088
|
+
title: z22.string().min(1).max(200),
|
|
23524
24089
|
// Defaults to the pipeline's first stage when omitted.
|
|
23525
|
-
stageId:
|
|
23526
|
-
ownerMembershipId:
|
|
23527
|
-
primaryCompanyId:
|
|
23528
|
-
people:
|
|
23529
|
-
amount:
|
|
23530
|
-
currency:
|
|
23531
|
-
expectedCloseAt:
|
|
23532
|
-
attributionSourceId:
|
|
24090
|
+
stageId: z22.uuid().optional(),
|
|
24091
|
+
ownerMembershipId: z22.uuid().nullish(),
|
|
24092
|
+
primaryCompanyId: z22.uuid().nullish(),
|
|
24093
|
+
people: z22.array(CardPersonInputSchema).max(50).default([]),
|
|
24094
|
+
amount: z22.number().min(0).nullish(),
|
|
24095
|
+
currency: z22.string().max(8).nullish(),
|
|
24096
|
+
expectedCloseAt: z22.string().nullish(),
|
|
24097
|
+
attributionSourceId: z22.uuid().nullish()
|
|
23533
24098
|
});
|
|
23534
|
-
var UpdateCardRequestSchema =
|
|
23535
|
-
title:
|
|
23536
|
-
ownerMembershipId:
|
|
23537
|
-
primaryCompanyId:
|
|
23538
|
-
amount:
|
|
23539
|
-
currency:
|
|
23540
|
-
expectedCloseAt:
|
|
23541
|
-
attributionSourceId:
|
|
24099
|
+
var UpdateCardRequestSchema = z22.object({
|
|
24100
|
+
title: z22.string().min(1).max(200).optional(),
|
|
24101
|
+
ownerMembershipId: z22.uuid().nullable().optional(),
|
|
24102
|
+
primaryCompanyId: z22.uuid().nullable().optional(),
|
|
24103
|
+
amount: z22.number().min(0).nullable().optional(),
|
|
24104
|
+
currency: z22.string().max(8).nullable().optional(),
|
|
24105
|
+
expectedCloseAt: z22.string().nullable().optional(),
|
|
24106
|
+
attributionSourceId: z22.uuid().nullable().optional(),
|
|
23542
24107
|
// Registry-defined custom fields; validated + merged server-side.
|
|
23543
24108
|
custom: CustomFieldValuesSchema.optional()
|
|
23544
24109
|
}).refine((req) => Object.keys(req).length > 0, {
|
|
23545
24110
|
message: "Nothing to update"
|
|
23546
24111
|
});
|
|
23547
|
-
var MoveCardRequestSchema =
|
|
23548
|
-
toStageId:
|
|
23549
|
-
boardPosition:
|
|
24112
|
+
var MoveCardRequestSchema = z22.object({
|
|
24113
|
+
toStageId: z22.uuid(),
|
|
24114
|
+
boardPosition: z22.number().optional()
|
|
23550
24115
|
});
|
|
23551
|
-
var SetCardStatusRequestSchema =
|
|
24116
|
+
var SetCardStatusRequestSchema = z22.object({
|
|
23552
24117
|
status: CardStatusSchema,
|
|
23553
|
-
lostReason:
|
|
24118
|
+
lostReason: z22.string().max(2e3).nullish()
|
|
23554
24119
|
});
|
|
23555
|
-
var AddCardContactRequestSchema =
|
|
23556
|
-
personId:
|
|
24120
|
+
var AddCardContactRequestSchema = z22.object({
|
|
24121
|
+
personId: z22.uuid()
|
|
23557
24122
|
});
|
|
23558
24123
|
var CARD_BATCH_MAX = 100;
|
|
23559
|
-
var DeleteCardsRequestSchema =
|
|
23560
|
-
ids:
|
|
24124
|
+
var DeleteCardsRequestSchema = z22.strictObject({
|
|
24125
|
+
ids: z22.array(z22.uuid()).min(1).max(CARD_BATCH_MAX)
|
|
24126
|
+
});
|
|
24127
|
+
var SetCardCreditsRequestSchema = z22.object({
|
|
24128
|
+
/** Replaces every credit. Shares add up to 100, or the list is empty. */
|
|
24129
|
+
credits: z22.array(z22.object({
|
|
24130
|
+
membershipId: z22.uuid(),
|
|
24131
|
+
role: z22.string().min(1).max(50),
|
|
24132
|
+
percent: z22.number().positive().max(100)
|
|
24133
|
+
})).max(10)
|
|
23561
24134
|
});
|
|
23562
24135
|
|
|
23563
24136
|
// ../../packages/crm-api/dist/types/attribution.js
|
|
23564
|
-
import { z as
|
|
23565
|
-
var CreateAttributionSourceRequestSchema =
|
|
23566
|
-
name:
|
|
24137
|
+
import { z as z23 } from "zod";
|
|
24138
|
+
var CreateAttributionSourceRequestSchema = z23.object({
|
|
24139
|
+
name: z23.string().min(1).max(100)
|
|
23567
24140
|
});
|
|
23568
|
-
var UpdateAttributionSourceRequestSchema =
|
|
23569
|
-
name:
|
|
23570
|
-
isArchived:
|
|
24141
|
+
var UpdateAttributionSourceRequestSchema = z23.object({
|
|
24142
|
+
name: z23.string().min(1).max(100).optional(),
|
|
24143
|
+
isArchived: z23.boolean().optional()
|
|
23571
24144
|
}).refine((req) => req.name !== void 0 || req.isArchived !== void 0, {
|
|
23572
24145
|
message: "Nothing to update"
|
|
23573
24146
|
});
|
|
23574
|
-
var ReorderAttributionSourcesRequestSchema =
|
|
23575
|
-
orderedIds:
|
|
24147
|
+
var ReorderAttributionSourcesRequestSchema = z23.object({
|
|
24148
|
+
orderedIds: z23.array(z23.uuid()).min(1)
|
|
23576
24149
|
});
|
|
23577
24150
|
|
|
23578
24151
|
// ../../packages/crm-api/dist/types/note.js
|
|
23579
|
-
import { z as
|
|
23580
|
-
var
|
|
23581
|
-
|
|
23582
|
-
"company",
|
|
23583
|
-
"pipeline_card"
|
|
23584
|
-
]);
|
|
23585
|
-
var CreateNoteRequestSchema = z22.object({
|
|
23586
|
-
body: z22.string().min(1).max(1e4),
|
|
24152
|
+
import { z as z24 } from "zod";
|
|
24153
|
+
var CreateNoteRequestSchema = z24.object({
|
|
24154
|
+
body: z24.string().min(1).max(1e4),
|
|
23587
24155
|
// Stamped by the engine for agent writes — never user-supplied in the UI.
|
|
23588
|
-
draftedBy:
|
|
24156
|
+
draftedBy: z24.string().max(50).nullish()
|
|
23589
24157
|
});
|
|
23590
|
-
var UpdateNoteRequestSchema =
|
|
23591
|
-
body:
|
|
24158
|
+
var UpdateNoteRequestSchema = z24.object({
|
|
24159
|
+
body: z24.string().min(1).max(1e4)
|
|
23592
24160
|
});
|
|
23593
24161
|
|
|
23594
24162
|
// ../../packages/crm-api/dist/types/task.js
|
|
23595
|
-
import { z as
|
|
23596
|
-
var TaskStatusSchema =
|
|
23597
|
-
var TaskPrioritySchema =
|
|
23598
|
-
var
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
"pipeline_card"
|
|
23602
|
-
]);
|
|
23603
|
-
var TaskEntityRefRequestSchema = z23.object({
|
|
23604
|
-
type: TaskEntityTypeSchema,
|
|
23605
|
-
id: z23.uuid()
|
|
24163
|
+
import { z as z25 } from "zod";
|
|
24164
|
+
var TaskStatusSchema = z25.enum(["open", "done", "dismissed"]);
|
|
24165
|
+
var TaskPrioritySchema = z25.enum(["low", "medium", "high"]);
|
|
24166
|
+
var TaskEntityRefRequestSchema = z25.object({
|
|
24167
|
+
type: CrmEntityTypeSchema,
|
|
24168
|
+
id: z25.uuid()
|
|
23606
24169
|
});
|
|
23607
|
-
var CreateTaskRequestSchema =
|
|
23608
|
-
title:
|
|
23609
|
-
description:
|
|
23610
|
-
dueAt:
|
|
24170
|
+
var CreateTaskRequestSchema = z25.object({
|
|
24171
|
+
title: z25.string().min(1).max(500),
|
|
24172
|
+
description: z25.string().max(1e4).nullish(),
|
|
24173
|
+
dueAt: z25.iso.datetime().nullish(),
|
|
23611
24174
|
// Omitted or null = no priority.
|
|
23612
24175
|
priority: TaskPrioritySchema.nullish(),
|
|
23613
24176
|
// Defaults to the calling member when omitted.
|
|
23614
|
-
ownerMembershipId:
|
|
24177
|
+
ownerMembershipId: z25.uuid().nullish(),
|
|
23615
24178
|
entity: TaskEntityRefRequestSchema.nullish(),
|
|
23616
24179
|
// Stamped by the engine for agent writes — never user-supplied in the UI.
|
|
23617
|
-
createdByProvider:
|
|
24180
|
+
createdByProvider: z25.string().max(50).nullish()
|
|
23618
24181
|
});
|
|
23619
|
-
var UpdateTaskRequestSchema =
|
|
23620
|
-
title:
|
|
23621
|
-
description:
|
|
23622
|
-
dueAt:
|
|
24182
|
+
var UpdateTaskRequestSchema = z25.object({
|
|
24183
|
+
title: z25.string().min(1).max(500).optional(),
|
|
24184
|
+
description: z25.string().max(1e4).nullable().optional(),
|
|
24185
|
+
dueAt: z25.iso.datetime().nullable().optional(),
|
|
23623
24186
|
priority: TaskPrioritySchema.nullable().optional(),
|
|
23624
|
-
ownerMembershipId:
|
|
24187
|
+
ownerMembershipId: z25.uuid().optional()
|
|
23625
24188
|
});
|
|
23626
|
-
var SetTaskStatusRequestSchema =
|
|
24189
|
+
var SetTaskStatusRequestSchema = z25.object({
|
|
23627
24190
|
status: TaskStatusSchema
|
|
23628
24191
|
});
|
|
23629
24192
|
|
|
23630
|
-
// ../../packages/crm-api/dist/types/
|
|
23631
|
-
import { z as
|
|
23632
|
-
var
|
|
24193
|
+
// ../../packages/crm-api/dist/types/activity.js
|
|
24194
|
+
import { z as z26 } from "zod";
|
|
24195
|
+
var ActivityKindSchema = z26.enum([
|
|
24196
|
+
"note",
|
|
23633
24197
|
"email",
|
|
23634
24198
|
"slack",
|
|
23635
24199
|
"call",
|
|
23636
24200
|
"sms",
|
|
23637
24201
|
"meeting",
|
|
23638
24202
|
"linkedin",
|
|
23639
|
-
"note",
|
|
23640
24203
|
"other"
|
|
23641
24204
|
]);
|
|
23642
|
-
var
|
|
23643
|
-
var
|
|
23644
|
-
var
|
|
24205
|
+
var ActivityDirectionSchema = z26.enum(["inbound", "outbound"]);
|
|
24206
|
+
var ActivitySourceSchema = z26.enum(["manual", "agent", "sync"]);
|
|
24207
|
+
var ActivityUrlSchema = z26.url().max(2e3).refine((value) => /^https?:\/\//i.test(value), {
|
|
23645
24208
|
message: "Link must be an http or https URL"
|
|
23646
24209
|
});
|
|
23647
|
-
var
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
24210
|
+
var ActivityLinkRequestSchema = z26.object({
|
|
24211
|
+
type: CrmEntityTypeSchema,
|
|
24212
|
+
id: z26.uuid()
|
|
24213
|
+
});
|
|
24214
|
+
var ActivityFieldsSchema = z26.object({
|
|
24215
|
+
kind: ActivityKindSchema,
|
|
24216
|
+
direction: ActivityDirectionSchema.nullish(),
|
|
24217
|
+
/** When it happened; a future time is a scheduled meeting or call. Omitted, now. */
|
|
24218
|
+
occurredAt: z26.iso.datetime().nullish(),
|
|
24219
|
+
subject: z26.string().max(500).nullish(),
|
|
24220
|
+
body: z26.string().max(2e4).nullish(),
|
|
24221
|
+
externalUrl: ActivityUrlSchema.nullish(),
|
|
24222
|
+
links: z26.array(ActivityLinkRequestSchema).min(1).max(25),
|
|
24223
|
+
// Stamped by the engine for agent writes; never user-supplied in the UI.
|
|
24224
|
+
draftedBy: z26.string().max(50).nullish()
|
|
24225
|
+
});
|
|
24226
|
+
var CreateActivityRequestSchema = ActivityFieldsSchema.extend({
|
|
24227
|
+
externalRef: z26.string().min(1).max(500).nullish()
|
|
24228
|
+
});
|
|
24229
|
+
var UpsertActivityRequestSchema = ActivityFieldsSchema.extend({
|
|
24230
|
+
externalRef: z26.string().min(1).max(500)
|
|
24231
|
+
});
|
|
24232
|
+
var UpdateActivityRequestSchema = z26.object({
|
|
24233
|
+
kind: ActivityKindSchema.optional(),
|
|
24234
|
+
direction: ActivityDirectionSchema.nullable().optional(),
|
|
24235
|
+
occurredAt: z26.iso.datetime().optional(),
|
|
24236
|
+
subject: z26.string().max(500).nullable().optional(),
|
|
24237
|
+
body: z26.string().max(2e4).nullable().optional(),
|
|
24238
|
+
externalUrl: ActivityUrlSchema.nullable().optional(),
|
|
24239
|
+
/** Replaces every link. */
|
|
24240
|
+
links: z26.array(ActivityLinkRequestSchema).min(1).max(25).optional()
|
|
24241
|
+
});
|
|
24242
|
+
|
|
24243
|
+
// ../../packages/crm-api/dist/types/recordFile.js
|
|
24244
|
+
import { z as z27 } from "zod";
|
|
24245
|
+
var CrmFileKindSchema = z27.enum([
|
|
24246
|
+
"document",
|
|
24247
|
+
"resume",
|
|
24248
|
+
"contract",
|
|
24249
|
+
"image",
|
|
24250
|
+
"other"
|
|
24251
|
+
]);
|
|
24252
|
+
var CRM_FILE_MAX_BYTES = 25 * 1024 * 1024;
|
|
24253
|
+
var PrepareCrmFileUploadRequestSchema = z27.object({
|
|
24254
|
+
entityType: CrmEntityTypeSchema,
|
|
24255
|
+
entityId: z27.uuid(),
|
|
24256
|
+
mimeType: z27.string().min(1).max(200)
|
|
24257
|
+
});
|
|
24258
|
+
var CommitCrmFileUploadRequestSchema = z27.object({
|
|
24259
|
+
uploadId: z27.uuid(),
|
|
24260
|
+
entityType: CrmEntityTypeSchema,
|
|
24261
|
+
entityId: z27.uuid(),
|
|
24262
|
+
name: z27.string().min(1).max(255),
|
|
24263
|
+
mimeType: z27.string().min(1).max(200),
|
|
24264
|
+
kind: CrmFileKindSchema
|
|
24265
|
+
});
|
|
24266
|
+
|
|
24267
|
+
// ../../packages/crm-api/dist/types/touchpoint.js
|
|
24268
|
+
import { z as z28 } from "zod";
|
|
24269
|
+
var CreateTouchpointRequestSchema = z28.object({
|
|
24270
|
+
channel: ActivityKindSchema,
|
|
24271
|
+
direction: ActivityDirectionSchema.nullish(),
|
|
24272
|
+
occurredAt: z28.iso.datetime(),
|
|
24273
|
+
summary: z28.string().max(1e4).nullish(),
|
|
24274
|
+
subject: z28.string().max(500).nullish(),
|
|
23653
24275
|
// The contact this was with; company is derived from the card server-side.
|
|
23654
|
-
personId:
|
|
23655
|
-
externalRef:
|
|
23656
|
-
externalUrl:
|
|
24276
|
+
personId: z28.uuid().nullish(),
|
|
24277
|
+
externalRef: z28.string().max(500).nullish(),
|
|
24278
|
+
externalUrl: ActivityUrlSchema.nullish(),
|
|
23657
24279
|
// Stamped by the engine for agent writes — never user-supplied in the UI.
|
|
23658
|
-
loggedByProvider:
|
|
24280
|
+
loggedByProvider: z28.string().max(50).nullish()
|
|
23659
24281
|
});
|
|
23660
|
-
var UpdateTouchpointRequestSchema =
|
|
23661
|
-
channel:
|
|
23662
|
-
direction:
|
|
23663
|
-
occurredAt:
|
|
23664
|
-
summary:
|
|
23665
|
-
subject:
|
|
23666
|
-
personId:
|
|
23667
|
-
externalUrl:
|
|
24282
|
+
var UpdateTouchpointRequestSchema = z28.object({
|
|
24283
|
+
channel: ActivityKindSchema.optional(),
|
|
24284
|
+
direction: ActivityDirectionSchema.nullable().optional(),
|
|
24285
|
+
occurredAt: z28.iso.datetime().optional(),
|
|
24286
|
+
summary: z28.string().max(1e4).nullable().optional(),
|
|
24287
|
+
subject: z28.string().max(500).nullable().optional(),
|
|
24288
|
+
personId: z28.uuid().nullable().optional(),
|
|
24289
|
+
externalUrl: ActivityUrlSchema.nullable().optional()
|
|
23668
24290
|
});
|
|
23669
24291
|
|
|
23670
24292
|
// ../../packages/crm-api/dist/types/leadFilters.js
|
|
23671
|
-
import { z as
|
|
23672
|
-
var LeadFilterFieldTypeSchema =
|
|
24293
|
+
import { z as z29 } from "zod";
|
|
24294
|
+
var LeadFilterFieldTypeSchema = z29.enum([
|
|
23673
24295
|
"text",
|
|
23674
24296
|
"number",
|
|
23675
24297
|
"date",
|
|
@@ -23677,7 +24299,7 @@ var LeadFilterFieldTypeSchema = z25.enum([
|
|
|
23677
24299
|
"stringArray",
|
|
23678
24300
|
"boolean"
|
|
23679
24301
|
]);
|
|
23680
|
-
var LeadFilterOperatorSchema =
|
|
24302
|
+
var LeadFilterOperatorSchema = z29.enum([
|
|
23681
24303
|
// text
|
|
23682
24304
|
"contains",
|
|
23683
24305
|
"not_contains",
|
|
@@ -23710,16 +24332,16 @@ var LeadFilterOperatorSchema = z25.enum([
|
|
|
23710
24332
|
"is_empty",
|
|
23711
24333
|
"is_not_empty"
|
|
23712
24334
|
]);
|
|
23713
|
-
var LeadFilterConditionSchema =
|
|
23714
|
-
field:
|
|
24335
|
+
var LeadFilterConditionSchema = z29.object({
|
|
24336
|
+
field: z29.string().min(1).max(200),
|
|
23715
24337
|
operator: LeadFilterOperatorSchema,
|
|
23716
24338
|
// Single-value operators (contains, gt, before, in_last_days, …).
|
|
23717
|
-
value:
|
|
24339
|
+
value: z29.union([z29.string().max(500), z29.number()]).optional(),
|
|
23718
24340
|
// Multi-value operators (any_of, includes_any, …).
|
|
23719
|
-
values:
|
|
24341
|
+
values: z29.array(z29.string().max(500)).max(100).optional(),
|
|
23720
24342
|
// `between` bounds — numbers, or ISO dates for date fields.
|
|
23721
|
-
min:
|
|
23722
|
-
max:
|
|
24343
|
+
min: z29.union([z29.string().max(100), z29.number()]).optional(),
|
|
24344
|
+
max: z29.union([z29.string().max(100), z29.number()]).optional()
|
|
23723
24345
|
});
|
|
23724
24346
|
function staticOptions(values) {
|
|
23725
24347
|
return values.map((value) => ({
|
|
@@ -23755,34 +24377,6 @@ var PERSON_FILTER_FIELDS = [
|
|
|
23755
24377
|
group: "Location"
|
|
23756
24378
|
},
|
|
23757
24379
|
{ key: "timezone", label: "Timezone", type: "enum", group: "Location" },
|
|
23758
|
-
{
|
|
23759
|
-
key: "roleCategory",
|
|
23760
|
-
label: "Role category",
|
|
23761
|
-
type: "enum",
|
|
23762
|
-
group: "Segmentation"
|
|
23763
|
-
},
|
|
23764
|
-
{ key: "seniority", label: "Seniority", type: "enum", group: "Segmentation" },
|
|
23765
|
-
{ key: "industry", label: "Industry", type: "enum", group: "Segmentation" },
|
|
23766
|
-
{ key: "country", label: "Country", type: "enum", group: "Segmentation" },
|
|
23767
|
-
{
|
|
23768
|
-
key: "sizeBand",
|
|
23769
|
-
label: "Company size band",
|
|
23770
|
-
type: "enum",
|
|
23771
|
-
group: "Segmentation"
|
|
23772
|
-
},
|
|
23773
|
-
{
|
|
23774
|
-
key: "icpScore",
|
|
23775
|
-
label: "ICP score",
|
|
23776
|
-
type: "number",
|
|
23777
|
-
group: "Segmentation"
|
|
23778
|
-
},
|
|
23779
|
-
{
|
|
23780
|
-
key: "reachability",
|
|
23781
|
-
label: "Reachability",
|
|
23782
|
-
type: "enum",
|
|
23783
|
-
group: "Segmentation",
|
|
23784
|
-
options: staticOptions(ReachabilitySchema.options)
|
|
23785
|
-
},
|
|
23786
24380
|
{ key: "companyName", label: "Company name", type: "text", group: "Company" },
|
|
23787
24381
|
{
|
|
23788
24382
|
key: "companyDomain",
|
|
@@ -23922,35 +24516,108 @@ var COMPANY_FILTER_FIELDS = [
|
|
|
23922
24516
|
{ key: "createdAt", label: "Added", type: "date", group: "Activity" },
|
|
23923
24517
|
{ key: "updatedAt", label: "Updated", type: "date", group: "Activity" }
|
|
23924
24518
|
];
|
|
24519
|
+
var LeadFilterOptionsQuerySchema = z29.object({
|
|
24520
|
+
listId: z29.uuid().optional()
|
|
24521
|
+
});
|
|
23925
24522
|
function leadFilterConditionsDescription(fields) {
|
|
23926
24523
|
const summary = fields.map((field) => `${field.key} (${field.type})`).join(", ");
|
|
23927
24524
|
return `Column filter conditions (ANDed). Fields: ${summary}; org custom fields as custom.<key>. Operators by type \u2014 text: contains/not_contains/equals/not_equals/starts_with/ends_with; enum: any_of/none_of (values[]); number: equals/not_equals/gt/gte/lt/lte/between (min+max); date: before/after (value ISO date)/between/in_last_days/not_in_last_days (value days); stringArray: includes_any/includes_all/excludes_all (values[]); boolean: is_true/is_false; every field: is_empty/is_not_empty.`;
|
|
23928
24525
|
}
|
|
23929
24526
|
|
|
24527
|
+
// ../../packages/crm-api/dist/types/savedView.js
|
|
24528
|
+
import { z as z30 } from "zod";
|
|
24529
|
+
var SavedViewConfigSchema = z30.object({
|
|
24530
|
+
filters: z30.array(LeadFilterConditionSchema).max(50),
|
|
24531
|
+
sort: z30.object({
|
|
24532
|
+
field: z30.string().min(1).max(100),
|
|
24533
|
+
direction: LeadSortDirectionSchema
|
|
24534
|
+
}).nullable(),
|
|
24535
|
+
columns: z30.array(z30.string().min(1).max(100)).max(100).nullable(),
|
|
24536
|
+
layout: z30.enum(["table", "board"]).nullable()
|
|
24537
|
+
});
|
|
24538
|
+
var SavedViewListQuerySchema = z30.object({
|
|
24539
|
+
entityType: CrmEntityTypeSchema,
|
|
24540
|
+
pipelineId: z30.uuid().optional()
|
|
24541
|
+
});
|
|
24542
|
+
var CreateSavedViewRequestSchema = z30.object({
|
|
24543
|
+
entityType: CrmEntityTypeSchema,
|
|
24544
|
+
pipelineId: z30.uuid().nullish(),
|
|
24545
|
+
name: z30.string().min(1).max(100),
|
|
24546
|
+
isShared: z30.boolean(),
|
|
24547
|
+
config: SavedViewConfigSchema
|
|
24548
|
+
});
|
|
24549
|
+
var UpdateSavedViewRequestSchema = z30.object({
|
|
24550
|
+
name: z30.string().min(1).max(100).optional(),
|
|
24551
|
+
isShared: z30.boolean().optional(),
|
|
24552
|
+
config: SavedViewConfigSchema.optional(),
|
|
24553
|
+
position: z30.number().int().min(0).optional()
|
|
24554
|
+
});
|
|
24555
|
+
|
|
24556
|
+
// ../../packages/crm-api/dist/types/privacy.js
|
|
24557
|
+
import { z as z31 } from "zod";
|
|
24558
|
+
var MergeRecordsRequestSchema = z31.object({
|
|
24559
|
+
keepId: z31.uuid(),
|
|
24560
|
+
mergeIds: z31.array(z31.uuid()).min(1).max(20)
|
|
24561
|
+
});
|
|
24562
|
+
var SetDoNotContactRequestSchema = z31.object({
|
|
24563
|
+
isDoNotContact: z31.boolean(),
|
|
24564
|
+
reason: z31.string().max(500).nullish()
|
|
24565
|
+
});
|
|
24566
|
+
var SetContactPointOptOutRequestSchema = z31.object({
|
|
24567
|
+
isOptedOut: z31.boolean(),
|
|
24568
|
+
reason: z31.string().max(500).nullish()
|
|
24569
|
+
});
|
|
24570
|
+
var ContactChannelSchema = z31.enum(["email", "phone"]);
|
|
24571
|
+
var ContactConsentQuerySchema = z31.object({
|
|
24572
|
+
personId: z31.uuid(),
|
|
24573
|
+
channel: ContactChannelSchema
|
|
24574
|
+
});
|
|
24575
|
+
|
|
24576
|
+
// ../../packages/crm-api/dist/types/import.js
|
|
24577
|
+
import { z as z32 } from "zod";
|
|
24578
|
+
var CRM_IMPORT_MAX_BYTES = 10 * 1024 * 1024;
|
|
24579
|
+
var ImportEntityTypeSchema = z32.enum(["person", "company"]);
|
|
24580
|
+
var ImportMappingSchema = z32.record(z32.string(), z32.string().max(120));
|
|
24581
|
+
var PreviewImportRequestSchema = z32.object({
|
|
24582
|
+
entityType: ImportEntityTypeSchema,
|
|
24583
|
+
csv: z32.string().min(1).max(CRM_IMPORT_MAX_BYTES),
|
|
24584
|
+
/** Omitted, the preview suggests one from the column names. */
|
|
24585
|
+
mapping: ImportMappingSchema.optional()
|
|
24586
|
+
});
|
|
24587
|
+
var StartImportRequestSchema = z32.object({
|
|
24588
|
+
entityType: ImportEntityTypeSchema,
|
|
24589
|
+
csv: z32.string().min(1).max(CRM_IMPORT_MAX_BYTES),
|
|
24590
|
+
mapping: ImportMappingSchema,
|
|
24591
|
+
/** A list of the same record type each imported record joins. */
|
|
24592
|
+
listId: z32.uuid().nullish(),
|
|
24593
|
+
tagIds: z32.array(z32.uuid()).max(20).optional()
|
|
24594
|
+
});
|
|
24595
|
+
var ImportRunStatusSchema = z32.enum([
|
|
24596
|
+
"pending",
|
|
24597
|
+
"running",
|
|
24598
|
+
"completed",
|
|
24599
|
+
"failed"
|
|
24600
|
+
]);
|
|
24601
|
+
var MatchPeopleRequestSchema = z32.object({
|
|
24602
|
+
emails: z32.array(z32.string().min(3).max(320)).min(1).max(200)
|
|
24603
|
+
});
|
|
24604
|
+
|
|
23930
24605
|
// ../../packages/crm-api/dist/types/search.js
|
|
23931
|
-
import { z as
|
|
23932
|
-
var PersonSearchFiltersSchema =
|
|
24606
|
+
import { z as z33 } from "zod";
|
|
24607
|
+
var PersonSearchFiltersSchema = z33.object({
|
|
23933
24608
|
// Scope to one company's people (the company detail People tab).
|
|
23934
|
-
companyId:
|
|
24609
|
+
companyId: z33.uuid().optional(),
|
|
23935
24610
|
// Scope to a person list's members.
|
|
23936
|
-
listId:
|
|
24611
|
+
listId: z33.uuid().optional(),
|
|
23937
24612
|
// Carrying ANY of these tags (OR-within, like the other array facets).
|
|
23938
|
-
tagIds:
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
sizeBand: z26.array(z26.string()).optional(),
|
|
23942
|
-
industry: z26.array(z26.string()).optional(),
|
|
23943
|
-
country: z26.array(z26.string()).optional(),
|
|
23944
|
-
reachability: z26.array(ReachabilitySchema).optional(),
|
|
23945
|
-
minIcpScore: z26.number().min(0).max(100).optional(),
|
|
23946
|
-
minEmployeeCount: z26.number().int().min(0).optional(),
|
|
23947
|
-
maxEmployeeCount: z26.number().int().min(0).optional(),
|
|
24613
|
+
tagIds: z33.array(z33.uuid()).optional(),
|
|
24614
|
+
minEmployeeCount: z33.number().int().min(0).optional(),
|
|
24615
|
+
maxEmployeeCount: z33.number().int().min(0).optional(),
|
|
23948
24616
|
// Column conditions, ANDed together and with the keys above.
|
|
23949
|
-
conditions:
|
|
24617
|
+
conditions: z33.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(PERSON_FILTER_FIELDS))
|
|
23950
24618
|
});
|
|
23951
|
-
var PersonSearchSortSchema =
|
|
24619
|
+
var PersonSearchSortSchema = z33.enum([
|
|
23952
24620
|
"relevance",
|
|
23953
|
-
"icp_score",
|
|
23954
24621
|
"recent",
|
|
23955
24622
|
"updated",
|
|
23956
24623
|
"name",
|
|
@@ -23961,32 +24628,30 @@ var PersonSearchSortSchema = z26.enum([
|
|
|
23961
24628
|
"phone",
|
|
23962
24629
|
"linkedin"
|
|
23963
24630
|
]);
|
|
23964
|
-
var PersonSearchRequestSchema =
|
|
24631
|
+
var PersonSearchRequestSchema = z33.object({
|
|
23965
24632
|
// Free-text keyword query (FTS + fuzzy fallback). Omit for pure facet browse.
|
|
23966
|
-
query:
|
|
24633
|
+
query: z33.string().optional(),
|
|
23967
24634
|
filters: PersonSearchFiltersSchema.optional(),
|
|
23968
24635
|
sort: PersonSearchSortSchema.default("relevance"),
|
|
23969
24636
|
// Direction for the column sort; omitted falls back to the sort's default.
|
|
23970
24637
|
direction: LeadSortDirectionSchema.optional(),
|
|
23971
24638
|
// Keyset pagination — opaque cursor from the previous response.
|
|
23972
|
-
cursor:
|
|
23973
|
-
limit:
|
|
23974
|
-
// Whether to compute facet counts for this query (extra work; off for paging).
|
|
23975
|
-
includeFacets: z26.boolean().default(false)
|
|
24639
|
+
cursor: z33.string().nullable().optional(),
|
|
24640
|
+
limit: z33.number().int().min(1).max(100).default(25)
|
|
23976
24641
|
});
|
|
23977
|
-
var CompanySearchFiltersSchema =
|
|
24642
|
+
var CompanySearchFiltersSchema = z33.object({
|
|
23978
24643
|
// Scope to a company list's members.
|
|
23979
|
-
listId:
|
|
24644
|
+
listId: z33.uuid().optional(),
|
|
23980
24645
|
// Carrying ANY of these tags (OR-within, like the other array facets).
|
|
23981
|
-
tagIds:
|
|
23982
|
-
industry:
|
|
23983
|
-
hqCountry:
|
|
23984
|
-
minEmployeeCount:
|
|
23985
|
-
maxEmployeeCount:
|
|
24646
|
+
tagIds: z33.array(z33.uuid()).optional(),
|
|
24647
|
+
industry: z33.array(z33.string()).optional(),
|
|
24648
|
+
hqCountry: z33.array(z33.string()).optional(),
|
|
24649
|
+
minEmployeeCount: z33.number().int().min(0).optional(),
|
|
24650
|
+
maxEmployeeCount: z33.number().int().min(0).optional(),
|
|
23986
24651
|
// Column conditions, ANDed together and with the keys above.
|
|
23987
|
-
conditions:
|
|
24652
|
+
conditions: z33.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(COMPANY_FILTER_FIELDS))
|
|
23988
24653
|
});
|
|
23989
|
-
var CompanySearchSortSchema =
|
|
24654
|
+
var CompanySearchSortSchema = z33.enum([
|
|
23990
24655
|
"relevance",
|
|
23991
24656
|
"employee_count",
|
|
23992
24657
|
"recent",
|
|
@@ -23996,312 +24661,211 @@ var CompanySearchSortSchema = z26.enum([
|
|
|
23996
24661
|
"industry",
|
|
23997
24662
|
"hq"
|
|
23998
24663
|
]);
|
|
23999
|
-
var CompanySearchRequestSchema =
|
|
24000
|
-
query:
|
|
24664
|
+
var CompanySearchRequestSchema = z33.object({
|
|
24665
|
+
query: z33.string().optional(),
|
|
24001
24666
|
filters: CompanySearchFiltersSchema.optional(),
|
|
24002
24667
|
sort: CompanySearchSortSchema.default("relevance"),
|
|
24003
24668
|
direction: LeadSortDirectionSchema.optional(),
|
|
24004
|
-
cursor:
|
|
24005
|
-
limit:
|
|
24006
|
-
includeFacets:
|
|
24669
|
+
cursor: z33.string().nullable().optional(),
|
|
24670
|
+
limit: z33.number().int().min(1).max(100).default(25),
|
|
24671
|
+
includeFacets: z33.boolean().default(false)
|
|
24007
24672
|
});
|
|
24008
24673
|
|
|
24009
24674
|
// ../../packages/crm-api/dist/types/globalSearch.js
|
|
24010
|
-
import { z as
|
|
24011
|
-
var GlobalSearchRequestSchema =
|
|
24012
|
-
query:
|
|
24675
|
+
import { z as z34 } from "zod";
|
|
24676
|
+
var GlobalSearchRequestSchema = z34.object({
|
|
24677
|
+
query: z34.string().min(1).max(200),
|
|
24013
24678
|
// Per-entity cap; the response holds up to 3 × this many results.
|
|
24014
|
-
limitPerType:
|
|
24679
|
+
limitPerType: z34.number().int().min(1).max(20).default(6)
|
|
24015
24680
|
});
|
|
24016
24681
|
|
|
24017
24682
|
// ../../packages/crm-api/dist/types/leadTools.js
|
|
24018
|
-
import { z as
|
|
24683
|
+
import { z as z35 } from "zod";
|
|
24019
24684
|
var LEAD_BATCH_MAX = 100;
|
|
24020
24685
|
var companyEnrichmentFields = {
|
|
24021
|
-
legalName:
|
|
24022
|
-
tagline:
|
|
24023
|
-
linkedinUrl:
|
|
24024
|
-
logoUrl:
|
|
24686
|
+
legalName: z35.string().nullish(),
|
|
24687
|
+
tagline: z35.string().nullish(),
|
|
24688
|
+
linkedinUrl: z35.string().nullish(),
|
|
24689
|
+
logoUrl: z35.string().nullish(),
|
|
24025
24690
|
companyType: CompanyTypeSchema.nullish(),
|
|
24026
|
-
industry:
|
|
24027
|
-
subIndustry:
|
|
24028
|
-
keywords:
|
|
24029
|
-
description:
|
|
24030
|
-
employeeCount:
|
|
24031
|
-
foundedYear:
|
|
24032
|
-
ticker:
|
|
24033
|
-
annualRevenueUsd:
|
|
24034
|
-
totalFundingUsd:
|
|
24035
|
-
lastFundingRound:
|
|
24691
|
+
industry: z35.string().nullish(),
|
|
24692
|
+
subIndustry: z35.string().nullish(),
|
|
24693
|
+
keywords: z35.array(z35.string()).max(50).nullish(),
|
|
24694
|
+
description: z35.string().nullish(),
|
|
24695
|
+
employeeCount: z35.number().int().min(0).nullish(),
|
|
24696
|
+
foundedYear: z35.number().int().nullish(),
|
|
24697
|
+
ticker: z35.string().nullish(),
|
|
24698
|
+
annualRevenueUsd: z35.number().min(0).nullish(),
|
|
24699
|
+
totalFundingUsd: z35.number().min(0).nullish(),
|
|
24700
|
+
lastFundingRound: z35.string().nullish(),
|
|
24036
24701
|
// ISO date, e.g. 2025-03-01
|
|
24037
|
-
lastFundingAt:
|
|
24038
|
-
investors:
|
|
24039
|
-
hqCity:
|
|
24040
|
-
hqRegion:
|
|
24041
|
-
hqCountry:
|
|
24042
|
-
hqAddress:
|
|
24043
|
-
phone:
|
|
24044
|
-
twitterUrl:
|
|
24045
|
-
githubUrl:
|
|
24046
|
-
facebookUrl:
|
|
24047
|
-
youtubeUrl:
|
|
24048
|
-
instagramUrl:
|
|
24049
|
-
crunchbaseUrl:
|
|
24050
|
-
techStack:
|
|
24702
|
+
lastFundingAt: z35.string().nullish(),
|
|
24703
|
+
investors: z35.array(z35.string()).max(50).nullish(),
|
|
24704
|
+
hqCity: z35.string().nullish(),
|
|
24705
|
+
hqRegion: z35.string().nullish(),
|
|
24706
|
+
hqCountry: z35.string().nullish(),
|
|
24707
|
+
hqAddress: z35.string().nullish(),
|
|
24708
|
+
phone: z35.string().nullish(),
|
|
24709
|
+
twitterUrl: z35.string().nullish(),
|
|
24710
|
+
githubUrl: z35.string().nullish(),
|
|
24711
|
+
facebookUrl: z35.string().nullish(),
|
|
24712
|
+
youtubeUrl: z35.string().nullish(),
|
|
24713
|
+
instagramUrl: z35.string().nullish(),
|
|
24714
|
+
crunchbaseUrl: z35.string().nullish(),
|
|
24715
|
+
techStack: z35.array(z35.string()).max(100).nullish()
|
|
24051
24716
|
};
|
|
24052
|
-
var CreateLeadCompanyRequestSchema =
|
|
24053
|
-
name:
|
|
24054
|
-
domain:
|
|
24717
|
+
var CreateLeadCompanyRequestSchema = z35.strictObject({
|
|
24718
|
+
name: z35.string().min(1),
|
|
24719
|
+
domain: z35.string().optional(),
|
|
24055
24720
|
...companyEnrichmentFields
|
|
24056
24721
|
});
|
|
24057
|
-
var LeadPersonEducationInputSchema =
|
|
24058
|
-
school:
|
|
24059
|
-
degree:
|
|
24060
|
-
field:
|
|
24061
|
-
startYear:
|
|
24062
|
-
endYear:
|
|
24722
|
+
var LeadPersonEducationInputSchema = z35.strictObject({
|
|
24723
|
+
school: z35.string().min(1),
|
|
24724
|
+
degree: z35.string().optional(),
|
|
24725
|
+
field: z35.string().optional(),
|
|
24726
|
+
startYear: z35.number().int().optional(),
|
|
24727
|
+
endYear: z35.number().int().optional()
|
|
24063
24728
|
});
|
|
24064
24729
|
var personEnrichmentFields = {
|
|
24065
|
-
title:
|
|
24066
|
-
headline:
|
|
24067
|
-
bio:
|
|
24068
|
-
department:
|
|
24069
|
-
yearsExperience:
|
|
24070
|
-
skills:
|
|
24071
|
-
languages:
|
|
24072
|
-
photoUrl:
|
|
24073
|
-
linkedinUrl:
|
|
24074
|
-
twitterUrl:
|
|
24075
|
-
githubUrl:
|
|
24076
|
-
facebookUrl:
|
|
24077
|
-
youtubeUrl:
|
|
24078
|
-
instagramUrl:
|
|
24079
|
-
personalWebsiteUrl:
|
|
24080
|
-
email:
|
|
24081
|
-
locationCity:
|
|
24082
|
-
locationRegion:
|
|
24083
|
-
locationCountry:
|
|
24730
|
+
title: z35.string().nullish(),
|
|
24731
|
+
headline: z35.string().nullish(),
|
|
24732
|
+
bio: z35.string().nullish(),
|
|
24733
|
+
department: z35.string().nullish(),
|
|
24734
|
+
yearsExperience: z35.number().int().min(0).max(80).nullish(),
|
|
24735
|
+
skills: z35.array(z35.string()).max(50).nullish(),
|
|
24736
|
+
languages: z35.array(z35.string()).max(20).nullish(),
|
|
24737
|
+
photoUrl: z35.string().nullish(),
|
|
24738
|
+
linkedinUrl: z35.string().nullish(),
|
|
24739
|
+
twitterUrl: z35.string().nullish(),
|
|
24740
|
+
githubUrl: z35.string().nullish(),
|
|
24741
|
+
facebookUrl: z35.string().nullish(),
|
|
24742
|
+
youtubeUrl: z35.string().nullish(),
|
|
24743
|
+
instagramUrl: z35.string().nullish(),
|
|
24744
|
+
personalWebsiteUrl: z35.string().nullish(),
|
|
24745
|
+
email: z35.string().nullish(),
|
|
24746
|
+
locationCity: z35.string().nullish(),
|
|
24747
|
+
locationRegion: z35.string().nullish(),
|
|
24748
|
+
locationCountry: z35.string().nullish(),
|
|
24084
24749
|
// IANA timezone, e.g. America/New_York
|
|
24085
|
-
timezone:
|
|
24750
|
+
timezone: z35.string().nullish(),
|
|
24086
24751
|
// Full education history — REPLACES any previously saved entries.
|
|
24087
|
-
educations:
|
|
24752
|
+
educations: z35.array(LeadPersonEducationInputSchema).max(10).optional()
|
|
24088
24753
|
};
|
|
24089
|
-
var CreateLeadPersonRequestSchema =
|
|
24090
|
-
fullName:
|
|
24754
|
+
var CreateLeadPersonRequestSchema = z35.strictObject({
|
|
24755
|
+
fullName: z35.string().min(1),
|
|
24091
24756
|
...personEnrichmentFields,
|
|
24092
|
-
companyId:
|
|
24093
|
-
companyName:
|
|
24094
|
-
companyDomain:
|
|
24757
|
+
companyId: z35.string().optional(),
|
|
24758
|
+
companyName: z35.string().optional(),
|
|
24759
|
+
companyDomain: z35.string().optional()
|
|
24095
24760
|
});
|
|
24096
|
-
var UpdateLeadCompanyRequestSchema =
|
|
24097
|
-
id:
|
|
24098
|
-
name:
|
|
24099
|
-
domain:
|
|
24761
|
+
var UpdateLeadCompanyRequestSchema = z35.strictObject({
|
|
24762
|
+
id: z35.uuid(),
|
|
24763
|
+
name: z35.string().min(1).optional(),
|
|
24764
|
+
domain: z35.string().optional(),
|
|
24100
24765
|
...companyEnrichmentFields,
|
|
24101
24766
|
// Registry-defined custom fields; validated + merged server-side.
|
|
24102
24767
|
custom: CustomFieldValuesSchema.optional()
|
|
24103
24768
|
});
|
|
24104
|
-
var UpdateLeadPersonRequestSchema =
|
|
24105
|
-
id:
|
|
24106
|
-
fullName:
|
|
24769
|
+
var UpdateLeadPersonRequestSchema = z35.strictObject({
|
|
24770
|
+
id: z35.uuid(),
|
|
24771
|
+
fullName: z35.string().min(1).optional(),
|
|
24107
24772
|
...personEnrichmentFields,
|
|
24108
24773
|
// (re)assign current employment — companyId, or companyName/companyDomain
|
|
24109
24774
|
// to find-or-create the company first
|
|
24110
|
-
companyId:
|
|
24111
|
-
companyName:
|
|
24112
|
-
companyDomain:
|
|
24775
|
+
companyId: z35.string().optional(),
|
|
24776
|
+
companyName: z35.string().optional(),
|
|
24777
|
+
companyDomain: z35.string().optional(),
|
|
24113
24778
|
// Set the primary company directly (the people.current_company_id cache shown
|
|
24114
24779
|
// in lists/header). Independent of the employment rows that hold the full set
|
|
24115
24780
|
// of current roles; null clears it. Recompute overwrites it when the current
|
|
24116
24781
|
// employment set changes.
|
|
24117
|
-
primaryCompanyId:
|
|
24782
|
+
primaryCompanyId: z35.string().nullish(),
|
|
24118
24783
|
// Registry-defined custom fields; validated + merged server-side.
|
|
24119
24784
|
custom: CustomFieldValuesSchema.optional()
|
|
24120
24785
|
});
|
|
24121
|
-
var LeadEmploymentInputSchema =
|
|
24122
|
-
companyId:
|
|
24123
|
-
companyName:
|
|
24124
|
-
title:
|
|
24125
|
-
startDate:
|
|
24126
|
-
endDate:
|
|
24127
|
-
isCurrent:
|
|
24786
|
+
var LeadEmploymentInputSchema = z35.strictObject({
|
|
24787
|
+
companyId: z35.uuid().nullish(),
|
|
24788
|
+
companyName: z35.string().nullish(),
|
|
24789
|
+
title: z35.string().nullish(),
|
|
24790
|
+
startDate: z35.string().nullish(),
|
|
24791
|
+
endDate: z35.string().nullish(),
|
|
24792
|
+
isCurrent: z35.boolean().default(false)
|
|
24128
24793
|
});
|
|
24129
|
-
var UpdateLeadEmploymentRequestSchema =
|
|
24130
|
-
companyId:
|
|
24131
|
-
companyName:
|
|
24132
|
-
title:
|
|
24133
|
-
startDate:
|
|
24134
|
-
endDate:
|
|
24135
|
-
isCurrent:
|
|
24794
|
+
var UpdateLeadEmploymentRequestSchema = z35.strictObject({
|
|
24795
|
+
companyId: z35.uuid().nullish(),
|
|
24796
|
+
companyName: z35.string().nullish(),
|
|
24797
|
+
title: z35.string().nullish(),
|
|
24798
|
+
startDate: z35.string().nullish(),
|
|
24799
|
+
endDate: z35.string().nullish(),
|
|
24800
|
+
isCurrent: z35.boolean().optional()
|
|
24136
24801
|
});
|
|
24137
|
-
var LeadContactPointInputSchema =
|
|
24802
|
+
var LeadContactPointInputSchema = z35.strictObject({
|
|
24138
24803
|
kind: ContactPointKindSchema,
|
|
24139
|
-
value:
|
|
24804
|
+
value: z35.string().min(1),
|
|
24140
24805
|
status: ContactPointStatusSchema.optional(),
|
|
24141
|
-
isPrimary:
|
|
24806
|
+
isPrimary: z35.boolean().optional()
|
|
24142
24807
|
});
|
|
24143
|
-
var UpdateLeadContactPointRequestSchema =
|
|
24808
|
+
var UpdateLeadContactPointRequestSchema = z35.strictObject({
|
|
24144
24809
|
kind: ContactPointKindSchema.optional(),
|
|
24145
|
-
value:
|
|
24810
|
+
value: z35.string().min(1).optional(),
|
|
24146
24811
|
status: ContactPointStatusSchema.optional(),
|
|
24147
|
-
isPrimary:
|
|
24812
|
+
isPrimary: z35.boolean().optional()
|
|
24148
24813
|
});
|
|
24149
|
-
var LeadCompanyPeopleRequestSchema =
|
|
24150
|
-
limit:
|
|
24151
|
-
cursor:
|
|
24814
|
+
var LeadCompanyPeopleRequestSchema = z35.object({
|
|
24815
|
+
limit: z35.coerce.number().int().min(1).max(100).default(50),
|
|
24816
|
+
cursor: z35.string().optional(),
|
|
24152
24817
|
sort: PersonSearchSortSchema.default("recent"),
|
|
24153
24818
|
direction: LeadSortDirectionSchema.optional()
|
|
24154
24819
|
});
|
|
24155
|
-
var CreateLeadCompaniesRequestSchema =
|
|
24156
|
-
companies:
|
|
24157
|
-
});
|
|
24158
|
-
var CreateLeadPeopleRequestSchema = z28.strictObject({
|
|
24159
|
-
people: z28.array(CreateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24160
|
-
});
|
|
24161
|
-
var UpdateLeadCompaniesRequestSchema = z28.strictObject({
|
|
24162
|
-
companies: z28.array(UpdateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24163
|
-
});
|
|
24164
|
-
var UpdateLeadPeopleRequestSchema = z28.strictObject({
|
|
24165
|
-
people: z28.array(UpdateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24166
|
-
});
|
|
24167
|
-
var DeleteLeadCompaniesRequestSchema = z28.strictObject({
|
|
24168
|
-
ids: z28.array(z28.uuid()).min(1).max(LEAD_BATCH_MAX)
|
|
24169
|
-
});
|
|
24170
|
-
var DeleteLeadPeopleRequestSchema = z28.strictObject({
|
|
24171
|
-
ids: z28.array(z28.uuid()).min(1).max(LEAD_BATCH_MAX)
|
|
24172
|
-
});
|
|
24173
|
-
|
|
24174
|
-
// ../../packages/crm-api/dist/types/sequence.js
|
|
24175
|
-
import { z as z29 } from "zod";
|
|
24176
|
-
var SequenceListSortSchema = z29.enum([
|
|
24177
|
-
"recent",
|
|
24178
|
-
"person",
|
|
24179
|
-
"company",
|
|
24180
|
-
"to",
|
|
24181
|
-
"messages",
|
|
24182
|
-
"activity"
|
|
24183
|
-
]);
|
|
24184
|
-
var SequenceListRequestSchema = z29.object({
|
|
24185
|
-
query: z29.string().trim().min(1).optional(),
|
|
24186
|
-
campaignId: z29.uuid().optional(),
|
|
24187
|
-
sort: SequenceListSortSchema.default("recent"),
|
|
24188
|
-
// Direction for the column sort; omitted falls back to the sort's default.
|
|
24189
|
-
direction: LeadSortDirectionSchema.optional()
|
|
24190
|
-
});
|
|
24191
|
-
var SequenceStepInputSchema = z29.object({
|
|
24192
|
-
subject: z29.string().min(1).max(300).nullish(),
|
|
24193
|
-
body: z29.string().min(1).max(2e4),
|
|
24194
|
-
waitDays: z29.number().int().min(0).max(90)
|
|
24820
|
+
var CreateLeadCompaniesRequestSchema = z35.strictObject({
|
|
24821
|
+
companies: z35.array(CreateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24195
24822
|
});
|
|
24196
|
-
var
|
|
24197
|
-
|
|
24198
|
-
recipientContactPointId: z29.string().nullish()
|
|
24823
|
+
var CreateLeadPeopleRequestSchema = z35.strictObject({
|
|
24824
|
+
people: z35.array(CreateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24199
24825
|
});
|
|
24200
|
-
var
|
|
24201
|
-
|
|
24826
|
+
var UpdateLeadCompaniesRequestSchema = z35.strictObject({
|
|
24827
|
+
companies: z35.array(UpdateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24202
24828
|
});
|
|
24203
|
-
var
|
|
24204
|
-
|
|
24205
|
-
"no_email",
|
|
24206
|
-
"no_linkedin_url",
|
|
24207
|
-
"suppressed",
|
|
24208
|
-
"not_found"
|
|
24209
|
-
]);
|
|
24210
|
-
var SequenceExportDestinationIdSchema = z29.enum([
|
|
24211
|
-
"csv",
|
|
24212
|
-
"instantly",
|
|
24213
|
-
"smartlead",
|
|
24214
|
-
"apollo",
|
|
24215
|
-
"heyreach",
|
|
24216
|
-
"expandi"
|
|
24217
|
-
]);
|
|
24218
|
-
|
|
24219
|
-
// ../../packages/crm-api/dist/types/campaign.js
|
|
24220
|
-
import { z as z30 } from "zod";
|
|
24221
|
-
var CampaignListSortSchema = z30.enum([
|
|
24222
|
-
"recent",
|
|
24223
|
-
"name",
|
|
24224
|
-
"people",
|
|
24225
|
-
"activity"
|
|
24226
|
-
]);
|
|
24227
|
-
var CampaignListRequestSchema = z30.object({
|
|
24228
|
-
query: z30.string().trim().min(1).optional(),
|
|
24229
|
-
sort: CampaignListSortSchema.default("recent"),
|
|
24230
|
-
direction: LeadSortDirectionSchema.optional()
|
|
24231
|
-
});
|
|
24232
|
-
var SetCampaignRequestSchema = z30.object({
|
|
24233
|
-
name: z30.string().trim().min(1).max(120),
|
|
24234
|
-
purpose: z30.string().trim().max(2e3).nullish()
|
|
24235
|
-
});
|
|
24236
|
-
var BulkCampaignIdsRequestSchema = z30.object({
|
|
24237
|
-
ids: z30.array(z30.uuid()).min(1).max(200)
|
|
24238
|
-
});
|
|
24239
|
-
var CampaignSyncRequestSchema = z30.object({
|
|
24240
|
-
destination: SequenceExportDestinationIdSchema,
|
|
24241
|
-
/** File destinations only: 'new' downloads only sequences not yet exported
|
|
24242
|
-
* to this destination. Campaign destinations ignore it. */
|
|
24243
|
-
fileScope: z30.enum(["all", "new"]).default("all"),
|
|
24244
|
-
/** Names the external campaign created on first sync; defaults to the CRM
|
|
24245
|
-
* campaign's name. Ignored once linked. */
|
|
24246
|
-
campaignName: z30.string().trim().min(1).max(120).optional()
|
|
24247
|
-
});
|
|
24248
|
-
var CampaignMemberListSortSchema = z30.enum([
|
|
24249
|
-
"recent",
|
|
24250
|
-
"person",
|
|
24251
|
-
"company"
|
|
24252
|
-
]);
|
|
24253
|
-
var CampaignMemberListRequestSchema = z30.object({
|
|
24254
|
-
query: z30.string().trim().min(1).optional(),
|
|
24255
|
-
sort: CampaignMemberListSortSchema.default("recent"),
|
|
24256
|
-
direction: LeadSortDirectionSchema.optional()
|
|
24829
|
+
var UpdateLeadPeopleRequestSchema = z35.strictObject({
|
|
24830
|
+
people: z35.array(UpdateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
|
|
24257
24831
|
});
|
|
24258
|
-
var
|
|
24259
|
-
|
|
24832
|
+
var DeleteLeadCompaniesRequestSchema = z35.strictObject({
|
|
24833
|
+
ids: z35.array(z35.uuid()).min(1).max(LEAD_BATCH_MAX)
|
|
24260
24834
|
});
|
|
24261
|
-
|
|
24262
|
-
|
|
24263
|
-
import { z as z31 } from "zod";
|
|
24264
|
-
var SuppressionKindSchema = z31.enum(["email", "domain", "phone"]);
|
|
24265
|
-
var SuppressionReasonSchema = z31.enum([
|
|
24266
|
-
"unsubscribed",
|
|
24267
|
-
"complained",
|
|
24268
|
-
"hard_bounced",
|
|
24269
|
-
"manual"
|
|
24270
|
-
]);
|
|
24271
|
-
var CreateSuppressionRequestSchema = z31.object({
|
|
24272
|
-
kind: SuppressionKindSchema,
|
|
24273
|
-
value: z31.string().min(1).max(320),
|
|
24274
|
-
reason: SuppressionReasonSchema,
|
|
24275
|
-
sourcePersonId: z31.uuid().nullish()
|
|
24835
|
+
var DeleteLeadPeopleRequestSchema = z35.strictObject({
|
|
24836
|
+
ids: z35.array(z35.uuid()).min(1).max(LEAD_BATCH_MAX)
|
|
24276
24837
|
});
|
|
24277
24838
|
|
|
24278
24839
|
// ../../packages/crm-api/dist/types/enrichment.js
|
|
24279
|
-
import { z as
|
|
24840
|
+
import { z as z36 } from "zod";
|
|
24280
24841
|
var ENRICHMENT_BATCH_LIMIT = 25;
|
|
24281
|
-
var EnrichPeopleRequestSchema =
|
|
24282
|
-
personIds:
|
|
24842
|
+
var EnrichPeopleRequestSchema = z36.object({
|
|
24843
|
+
personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_BATCH_LIMIT),
|
|
24283
24844
|
// A person with only an UNVERIFIED contact reruns the chain, excluding the
|
|
24284
24845
|
// providers that sourced it. Verified contacts always short-circuit.
|
|
24285
|
-
retryUnverified:
|
|
24846
|
+
retryUnverified: z36.boolean().optional()
|
|
24286
24847
|
});
|
|
24287
24848
|
var ENRICHMENT_RUN_PERSON_LIMIT = 500;
|
|
24288
|
-
var EnrichmentRunActionSchema =
|
|
24849
|
+
var EnrichmentRunActionSchema = z36.enum([
|
|
24289
24850
|
"emails",
|
|
24290
24851
|
"validate",
|
|
24291
24852
|
"phones"
|
|
24292
24853
|
]);
|
|
24293
|
-
var StartEnrichmentRunRequestSchema =
|
|
24294
|
-
personIds:
|
|
24295
|
-
actions:
|
|
24296
|
-
retryUnverified:
|
|
24854
|
+
var StartEnrichmentRunRequestSchema = z36.object({
|
|
24855
|
+
personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT),
|
|
24856
|
+
actions: z36.array(EnrichmentRunActionSchema).min(1),
|
|
24857
|
+
retryUnverified: z36.boolean()
|
|
24297
24858
|
});
|
|
24298
|
-
var
|
|
24299
|
-
|
|
24859
|
+
var EnrichmentCoverageRequestSchema = z36.object({
|
|
24860
|
+
personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT)
|
|
24861
|
+
});
|
|
24862
|
+
var UpdateContactPointStatusRequestSchema = z36.object({
|
|
24863
|
+
status: z36.enum(["verified", "unverified"])
|
|
24300
24864
|
});
|
|
24301
24865
|
|
|
24302
24866
|
// ../../packages/crm-api/dist/types/providers.js
|
|
24303
|
-
import { z as
|
|
24304
|
-
var EmailEnrichmentProviderIdSchema =
|
|
24867
|
+
import { z as z37 } from "zod";
|
|
24868
|
+
var EmailEnrichmentProviderIdSchema = z37.enum([
|
|
24305
24869
|
"hunter",
|
|
24306
24870
|
"apollo",
|
|
24307
24871
|
"prospeo",
|
|
@@ -24316,7 +24880,7 @@ var EmailEnrichmentProviderIdSchema = z33.enum([
|
|
|
24316
24880
|
"wiza",
|
|
24317
24881
|
"crustdata"
|
|
24318
24882
|
]);
|
|
24319
|
-
var EmailValidationProviderIdSchema =
|
|
24883
|
+
var EmailValidationProviderIdSchema = z37.enum([
|
|
24320
24884
|
"zerobounce",
|
|
24321
24885
|
"neverbounce",
|
|
24322
24886
|
"hunter",
|
|
@@ -24324,7 +24888,7 @@ var EmailValidationProviderIdSchema = z33.enum([
|
|
|
24324
24888
|
"leadmagic",
|
|
24325
24889
|
"snov"
|
|
24326
24890
|
]);
|
|
24327
|
-
var PhoneEnrichmentProviderIdSchema =
|
|
24891
|
+
var PhoneEnrichmentProviderIdSchema = z37.enum([
|
|
24328
24892
|
"prospeo",
|
|
24329
24893
|
"findymail",
|
|
24330
24894
|
"leadmagic",
|
|
@@ -24336,7 +24900,7 @@ var PhoneEnrichmentProviderIdSchema = z33.enum([
|
|
|
24336
24900
|
"wiza",
|
|
24337
24901
|
"crustdata"
|
|
24338
24902
|
]);
|
|
24339
|
-
var IntegrationProviderIdSchema =
|
|
24903
|
+
var IntegrationProviderIdSchema = z37.enum([
|
|
24340
24904
|
"hunter",
|
|
24341
24905
|
"apollo",
|
|
24342
24906
|
"prospeo",
|
|
@@ -24351,14 +24915,12 @@ var IntegrationProviderIdSchema = z33.enum([
|
|
|
24351
24915
|
"snov",
|
|
24352
24916
|
"uplead",
|
|
24353
24917
|
"wiza",
|
|
24354
|
-
"crustdata"
|
|
24355
|
-
"instantly",
|
|
24356
|
-
"smartlead"
|
|
24918
|
+
"crustdata"
|
|
24357
24919
|
]);
|
|
24358
|
-
var UpdateEnrichmentWaterfallsRequestSchema =
|
|
24359
|
-
emailEnrichment:
|
|
24360
|
-
emailValidation:
|
|
24361
|
-
phoneEnrichment:
|
|
24920
|
+
var UpdateEnrichmentWaterfallsRequestSchema = z37.object({
|
|
24921
|
+
emailEnrichment: z37.array(EmailEnrichmentProviderIdSchema).optional(),
|
|
24922
|
+
emailValidation: z37.array(EmailValidationProviderIdSchema).optional(),
|
|
24923
|
+
phoneEnrichment: z37.array(PhoneEnrichmentProviderIdSchema).optional()
|
|
24362
24924
|
});
|
|
24363
24925
|
|
|
24364
24926
|
// ../../packages/crm-api/dist/clients/V1CrmApiClient.js
|
|
@@ -24392,9 +24954,9 @@ var V1CrmApiClient = class {
|
|
|
24392
24954
|
this.http.requireAuthed();
|
|
24393
24955
|
return this.http.fetch(`${CRM}/leads/companies/${enc(companyId)}`);
|
|
24394
24956
|
}
|
|
24395
|
-
async listLists(
|
|
24957
|
+
async listLists(entityType) {
|
|
24396
24958
|
this.http.requireAuthed();
|
|
24397
|
-
return this.http.fetch(`${CRM}/lists${
|
|
24959
|
+
return this.http.fetch(`${CRM}/lists${entityType ? `?entityType=${enc(entityType)}` : ""}`);
|
|
24398
24960
|
}
|
|
24399
24961
|
async getList(listId) {
|
|
24400
24962
|
this.http.requireAuthed();
|
|
@@ -24408,178 +24970,255 @@ var V1CrmApiClient = class {
|
|
|
24408
24970
|
this.http.requireAuthed();
|
|
24409
24971
|
return this.http.fetch(`${CRM}/notes/${enc(entityType)}/${enc(entityId)}`);
|
|
24410
24972
|
}
|
|
24411
|
-
async
|
|
24973
|
+
async listActivities(args) {
|
|
24412
24974
|
this.http.requireAuthed();
|
|
24413
24975
|
const params = new URLSearchParams();
|
|
24414
|
-
|
|
24415
|
-
params.
|
|
24416
|
-
if (filters.owner)
|
|
24417
|
-
params.set("owner", filters.owner);
|
|
24976
|
+
for (const kind of args.kinds)
|
|
24977
|
+
params.append("kind", kind);
|
|
24418
24978
|
const query = params.toString();
|
|
24419
|
-
return this.http.fetch(`${CRM}/
|
|
24979
|
+
return this.http.fetch(`${CRM}/activities/${enc(args.entityType)}/${enc(args.entityId)}${query ? `?${query}` : ""}`);
|
|
24420
24980
|
}
|
|
24421
|
-
async
|
|
24981
|
+
async getActivity(id) {
|
|
24422
24982
|
this.http.requireAuthed();
|
|
24423
|
-
return this.http.fetch(`${CRM}/
|
|
24983
|
+
return this.http.fetch(`${CRM}/activities/${enc(id)}`);
|
|
24424
24984
|
}
|
|
24425
|
-
async
|
|
24985
|
+
async createActivity(body) {
|
|
24426
24986
|
this.http.requireAuthed();
|
|
24427
|
-
return this.http.fetch(`${CRM}/
|
|
24987
|
+
return this.http.fetch(`${CRM}/activities`, { method: "POST", body });
|
|
24428
24988
|
}
|
|
24429
|
-
async
|
|
24989
|
+
async upsertActivity(body) {
|
|
24430
24990
|
this.http.requireAuthed();
|
|
24431
|
-
return this.http.fetch(`${CRM}/
|
|
24991
|
+
return this.http.fetch(`${CRM}/activities/external`, {
|
|
24992
|
+
method: "PUT",
|
|
24993
|
+
body
|
|
24994
|
+
});
|
|
24432
24995
|
}
|
|
24433
|
-
async
|
|
24996
|
+
async updateActivity(id, body) {
|
|
24434
24997
|
this.http.requireAuthed();
|
|
24435
|
-
return this.http.fetch(`${CRM}/
|
|
24998
|
+
return this.http.fetch(`${CRM}/activities/${enc(id)}`, {
|
|
24999
|
+
method: "PATCH",
|
|
25000
|
+
body
|
|
25001
|
+
});
|
|
24436
25002
|
}
|
|
24437
|
-
async
|
|
25003
|
+
async deleteActivity(id) {
|
|
24438
25004
|
this.http.requireAuthed();
|
|
24439
|
-
return this.http.fetch(`${CRM}/
|
|
25005
|
+
return this.http.fetch(`${CRM}/activities/${enc(id)}`, {
|
|
25006
|
+
method: "DELETE"
|
|
25007
|
+
});
|
|
24440
25008
|
}
|
|
24441
|
-
async
|
|
25009
|
+
async listRecordFiles(entityType, entityId) {
|
|
24442
25010
|
this.http.requireAuthed();
|
|
24443
|
-
return this.http.fetch(`${CRM}/
|
|
25011
|
+
return this.http.fetch(`${CRM}/files/${enc(entityType)}/${enc(entityId)}`);
|
|
24444
25012
|
}
|
|
24445
|
-
async
|
|
25013
|
+
async prepareFileUpload(body) {
|
|
24446
25014
|
this.http.requireAuthed();
|
|
24447
|
-
|
|
24448
|
-
if (scopeId)
|
|
24449
|
-
params.set("scopeId", scopeId);
|
|
24450
|
-
return this.http.fetch(`${CRM}/custom-fields?${params.toString()}`);
|
|
25015
|
+
return this.http.fetch(`${CRM}/files/uploads`, { method: "POST", body });
|
|
24451
25016
|
}
|
|
24452
|
-
async
|
|
25017
|
+
async commitFileUpload(body) {
|
|
24453
25018
|
this.http.requireAuthed();
|
|
24454
|
-
return this.http.fetch(`${CRM}/
|
|
25019
|
+
return this.http.fetch(`${CRM}/files`, { method: "POST", body });
|
|
24455
25020
|
}
|
|
24456
|
-
|
|
24457
|
-
async createPeople(people) {
|
|
25021
|
+
async getFileDownload(id) {
|
|
24458
25022
|
this.http.requireAuthed();
|
|
24459
|
-
return this.http.fetch(`${CRM}/
|
|
24460
|
-
|
|
24461
|
-
|
|
25023
|
+
return this.http.fetch(`${CRM}/files/${enc(id)}/download`);
|
|
25024
|
+
}
|
|
25025
|
+
async getFileText(id) {
|
|
25026
|
+
this.http.requireAuthed();
|
|
25027
|
+
return this.http.fetch(`${CRM}/files/${enc(id)}/text`);
|
|
25028
|
+
}
|
|
25029
|
+
async deleteFile(id) {
|
|
25030
|
+
this.http.requireAuthed();
|
|
25031
|
+
return this.http.fetch(`${CRM}/files/${enc(id)}`, { method: "DELETE" });
|
|
25032
|
+
}
|
|
25033
|
+
async listSavedViews(args) {
|
|
25034
|
+
this.http.requireAuthed();
|
|
25035
|
+
const params = new URLSearchParams({ entityType: args.entityType });
|
|
25036
|
+
if (args.pipelineId)
|
|
25037
|
+
params.set("pipelineId", args.pipelineId);
|
|
25038
|
+
return this.http.fetch(`${CRM}/views?${params.toString()}`);
|
|
25039
|
+
}
|
|
25040
|
+
async createSavedView(body) {
|
|
25041
|
+
this.http.requireAuthed();
|
|
25042
|
+
return this.http.fetch(`${CRM}/views`, { method: "POST", body });
|
|
25043
|
+
}
|
|
25044
|
+
async updateSavedView(id, body) {
|
|
25045
|
+
this.http.requireAuthed();
|
|
25046
|
+
return this.http.fetch(`${CRM}/views/${enc(id)}`, { method: "PATCH", body });
|
|
25047
|
+
}
|
|
25048
|
+
async deleteSavedView(id) {
|
|
25049
|
+
this.http.requireAuthed();
|
|
25050
|
+
return this.http.fetch(`${CRM}/views/${enc(id)}`, { method: "DELETE" });
|
|
25051
|
+
}
|
|
25052
|
+
async mergeRecords(entityType, body) {
|
|
25053
|
+
this.http.requireAuthed();
|
|
25054
|
+
const path = entityType === "person" ? "people" : "companies";
|
|
25055
|
+
return this.http.fetch(`${CRM}/merge/${path}`, { method: "POST", body });
|
|
25056
|
+
}
|
|
25057
|
+
async setDoNotContact(personId, body) {
|
|
25058
|
+
this.http.requireAuthed();
|
|
25059
|
+
return this.http.fetch(`${CRM}/consent/people/${enc(personId)}`, {
|
|
25060
|
+
method: "PUT",
|
|
25061
|
+
body
|
|
24462
25062
|
});
|
|
24463
25063
|
}
|
|
24464
|
-
async
|
|
25064
|
+
async setContactPointOptOut(contactPointId, body) {
|
|
24465
25065
|
this.http.requireAuthed();
|
|
24466
|
-
return this.http.fetch(`${CRM}/
|
|
24467
|
-
method: "
|
|
24468
|
-
body
|
|
25066
|
+
return this.http.fetch(`${CRM}/consent/contact-points/${enc(contactPointId)}`, {
|
|
25067
|
+
method: "PUT",
|
|
25068
|
+
body
|
|
24469
25069
|
});
|
|
24470
25070
|
}
|
|
24471
|
-
async
|
|
25071
|
+
async checkConsent(args) {
|
|
24472
25072
|
this.http.requireAuthed();
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
25073
|
+
const params = new URLSearchParams({
|
|
25074
|
+
personId: args.personId,
|
|
25075
|
+
channel: args.channel
|
|
24476
25076
|
});
|
|
25077
|
+
return this.http.fetch(`${CRM}/consent/check?${params.toString()}`);
|
|
24477
25078
|
}
|
|
24478
|
-
|
|
24479
|
-
async createCompanies(companies) {
|
|
25079
|
+
async exportPerson(personId) {
|
|
24480
25080
|
this.http.requireAuthed();
|
|
24481
|
-
return this.http.fetch(`${CRM}/
|
|
24482
|
-
|
|
24483
|
-
|
|
25081
|
+
return this.http.fetch(`${CRM}/privacy/people/${enc(personId)}/export`);
|
|
25082
|
+
}
|
|
25083
|
+
async erasePerson(personId) {
|
|
25084
|
+
this.http.requireAuthed();
|
|
25085
|
+
return this.http.fetch(`${CRM}/privacy/people/${enc(personId)}/erase`, {
|
|
25086
|
+
method: "POST"
|
|
24484
25087
|
});
|
|
24485
25088
|
}
|
|
24486
|
-
async
|
|
25089
|
+
async listCardCredits(cardId) {
|
|
24487
25090
|
this.http.requireAuthed();
|
|
24488
|
-
return this.http.fetch(`${CRM}/
|
|
24489
|
-
|
|
24490
|
-
|
|
25091
|
+
return this.http.fetch(`${CRM}/pipeline-cards/${enc(cardId)}/credits`);
|
|
25092
|
+
}
|
|
25093
|
+
async setCardCredits(cardId, body) {
|
|
25094
|
+
this.http.requireAuthed();
|
|
25095
|
+
return this.http.fetch(`${CRM}/pipeline-cards/${enc(cardId)}/credits`, {
|
|
25096
|
+
method: "PUT",
|
|
25097
|
+
body
|
|
24491
25098
|
});
|
|
24492
25099
|
}
|
|
24493
|
-
async
|
|
25100
|
+
async previewImport(body) {
|
|
24494
25101
|
this.http.requireAuthed();
|
|
24495
|
-
return this.http.fetch(`${CRM}/
|
|
25102
|
+
return this.http.fetch(`${CRM}/imports/preview`, { method: "POST", body });
|
|
25103
|
+
}
|
|
25104
|
+
async startImport(body) {
|
|
25105
|
+
this.http.requireAuthed();
|
|
25106
|
+
return this.http.fetch(`${CRM}/imports`, { method: "POST", body });
|
|
25107
|
+
}
|
|
25108
|
+
async getImport(importId) {
|
|
25109
|
+
this.http.requireAuthed();
|
|
25110
|
+
return this.http.fetch(`${CRM}/imports/${enc(importId)}`);
|
|
25111
|
+
}
|
|
25112
|
+
async listImports() {
|
|
25113
|
+
this.http.requireAuthed();
|
|
25114
|
+
return this.http.fetch(`${CRM}/imports`);
|
|
25115
|
+
}
|
|
25116
|
+
async matchPeople(emails) {
|
|
25117
|
+
this.http.requireAuthed();
|
|
25118
|
+
return this.http.fetch(`${CRM}/match/people`, {
|
|
24496
25119
|
method: "POST",
|
|
24497
|
-
body: {
|
|
25120
|
+
body: { emails }
|
|
24498
25121
|
});
|
|
24499
25122
|
}
|
|
24500
|
-
|
|
24501
|
-
|
|
25123
|
+
async listRecordHistory(entityType, entityId) {
|
|
25124
|
+
this.http.requireAuthed();
|
|
25125
|
+
return this.http.fetch(`${CRM}/events/${enc(entityType)}/${enc(entityId)}`);
|
|
25126
|
+
}
|
|
25127
|
+
async listRecordEvents(args) {
|
|
25128
|
+
this.http.requireAuthed();
|
|
25129
|
+
const params = new URLSearchParams({ limit: String(args.limit) });
|
|
25130
|
+
if (args.after !== null)
|
|
25131
|
+
params.set("after", args.after);
|
|
25132
|
+
return this.http.fetch(`${CRM}/events?${params.toString()}`);
|
|
25133
|
+
}
|
|
25134
|
+
async listTasks(filters) {
|
|
24502
25135
|
this.http.requireAuthed();
|
|
24503
25136
|
const params = new URLSearchParams();
|
|
24504
|
-
if (
|
|
24505
|
-
params.set("
|
|
24506
|
-
if (
|
|
24507
|
-
params.set("
|
|
24508
|
-
const
|
|
24509
|
-
return this.http.fetch(`${CRM}/
|
|
25137
|
+
if (filters.statuses?.length)
|
|
25138
|
+
params.set("status", filters.statuses.join(","));
|
|
25139
|
+
if (filters.owner)
|
|
25140
|
+
params.set("owner", filters.owner);
|
|
25141
|
+
const query = params.toString();
|
|
25142
|
+
return this.http.fetch(`${CRM}/tasks${query ? `?${query}` : ""}`);
|
|
24510
25143
|
}
|
|
24511
|
-
async
|
|
25144
|
+
async getTask(taskId) {
|
|
24512
25145
|
this.http.requireAuthed();
|
|
24513
|
-
return this.http.fetch(`${CRM}/
|
|
25146
|
+
return this.http.fetch(`${CRM}/tasks/${enc(taskId)}`);
|
|
24514
25147
|
}
|
|
24515
|
-
async
|
|
25148
|
+
async listPipelines() {
|
|
24516
25149
|
this.http.requireAuthed();
|
|
24517
|
-
return this.http.fetch(`${CRM}/
|
|
25150
|
+
return this.http.fetch(`${CRM}/pipelines`);
|
|
24518
25151
|
}
|
|
24519
|
-
async
|
|
25152
|
+
async getPipeline(pipelineId) {
|
|
24520
25153
|
this.http.requireAuthed();
|
|
24521
|
-
return this.http.fetch(`${CRM}/
|
|
24522
|
-
method: "POST",
|
|
24523
|
-
body
|
|
24524
|
-
});
|
|
25154
|
+
return this.http.fetch(`${CRM}/pipelines/${enc(pipelineId)}`);
|
|
24525
25155
|
}
|
|
24526
|
-
async
|
|
25156
|
+
async getBoard(pipelineId) {
|
|
24527
25157
|
this.http.requireAuthed();
|
|
24528
|
-
return this.http.fetch(`${CRM}/
|
|
24529
|
-
method: "PUT",
|
|
24530
|
-
body
|
|
24531
|
-
});
|
|
25158
|
+
return this.http.fetch(`${CRM}/pipelines/${enc(pipelineId)}/board`);
|
|
24532
25159
|
}
|
|
24533
|
-
async
|
|
25160
|
+
async getCard(cardId) {
|
|
24534
25161
|
this.http.requireAuthed();
|
|
24535
|
-
|
|
24536
|
-
method: "DELETE"
|
|
24537
|
-
});
|
|
25162
|
+
return this.http.fetch(`${CRM}/pipeline-cards/${enc(cardId)}`);
|
|
24538
25163
|
}
|
|
24539
|
-
|
|
24540
|
-
async listCampaigns(query) {
|
|
25164
|
+
async listMembers() {
|
|
24541
25165
|
this.http.requireAuthed();
|
|
24542
|
-
return this.http.fetch(`${CRM}/
|
|
25166
|
+
return this.http.fetch(`${CRM}/members`);
|
|
24543
25167
|
}
|
|
24544
|
-
async
|
|
25168
|
+
async listCustomFields(entityType, scopeId) {
|
|
24545
25169
|
this.http.requireAuthed();
|
|
24546
|
-
|
|
25170
|
+
const params = new URLSearchParams({ entityType });
|
|
25171
|
+
if (scopeId)
|
|
25172
|
+
params.set("scopeId", scopeId);
|
|
25173
|
+
return this.http.fetch(`${CRM}/custom-fields?${params.toString()}`);
|
|
24547
25174
|
}
|
|
24548
|
-
async
|
|
25175
|
+
async globalSearch(args) {
|
|
24549
25176
|
this.http.requireAuthed();
|
|
24550
|
-
return this.http.fetch(`${CRM}/
|
|
25177
|
+
return this.http.fetch(`${CRM}/search`, { method: "POST", body: args });
|
|
24551
25178
|
}
|
|
24552
|
-
|
|
25179
|
+
// ── People ─────────────────────────────────────────────────────────
|
|
25180
|
+
async createPeople(people) {
|
|
24553
25181
|
this.http.requireAuthed();
|
|
24554
|
-
return this.http.fetch(`${CRM}/
|
|
24555
|
-
method: "
|
|
24556
|
-
body
|
|
25182
|
+
return this.http.fetch(`${CRM}/leads/people`, {
|
|
25183
|
+
method: "POST",
|
|
25184
|
+
body: { people }
|
|
24557
25185
|
});
|
|
24558
25186
|
}
|
|
24559
|
-
async
|
|
25187
|
+
async updatePeople(people) {
|
|
24560
25188
|
this.http.requireAuthed();
|
|
24561
|
-
|
|
24562
|
-
method: "
|
|
25189
|
+
return this.http.fetch(`${CRM}/leads/people`, {
|
|
25190
|
+
method: "PATCH",
|
|
25191
|
+
body: { people }
|
|
24563
25192
|
});
|
|
24564
25193
|
}
|
|
24565
|
-
async
|
|
25194
|
+
async deletePeople(ids) {
|
|
24566
25195
|
this.http.requireAuthed();
|
|
24567
|
-
return this.http.fetch(`${CRM}/
|
|
25196
|
+
return this.http.fetch(`${CRM}/leads/people/delete`, {
|
|
25197
|
+
method: "POST",
|
|
25198
|
+
body: { ids }
|
|
25199
|
+
});
|
|
24568
25200
|
}
|
|
24569
|
-
|
|
25201
|
+
// ── Companies ──────────────────────────────────────────────────────
|
|
25202
|
+
async createCompanies(companies) {
|
|
24570
25203
|
this.http.requireAuthed();
|
|
24571
|
-
return this.http.fetch(`${CRM}/
|
|
25204
|
+
return this.http.fetch(`${CRM}/leads/companies`, {
|
|
24572
25205
|
method: "POST",
|
|
24573
|
-
body: {
|
|
25206
|
+
body: { companies }
|
|
24574
25207
|
});
|
|
24575
25208
|
}
|
|
24576
|
-
async
|
|
25209
|
+
async updateCompanies(companies) {
|
|
24577
25210
|
this.http.requireAuthed();
|
|
24578
|
-
return this.http.fetch(`${CRM}/
|
|
25211
|
+
return this.http.fetch(`${CRM}/leads/companies`, {
|
|
25212
|
+
method: "PATCH",
|
|
25213
|
+
body: { companies }
|
|
25214
|
+
});
|
|
24579
25215
|
}
|
|
24580
|
-
async
|
|
25216
|
+
async deleteCompanies(ids) {
|
|
24581
25217
|
this.http.requireAuthed();
|
|
24582
|
-
return this.http.fetch(`${CRM}/
|
|
25218
|
+
return this.http.fetch(`${CRM}/leads/companies/delete`, {
|
|
25219
|
+
method: "POST",
|
|
25220
|
+
body: { ids }
|
|
25221
|
+
});
|
|
24583
25222
|
}
|
|
24584
25223
|
// ── Employments (person sub-records) ───────────────────────────────
|
|
24585
25224
|
async addEmployment(personId, body) {
|
|
@@ -24913,7 +25552,7 @@ var V1CrmApiClient = class {
|
|
|
24913
25552
|
// package.json
|
|
24914
25553
|
var package_default = {
|
|
24915
25554
|
name: "@general-input/cli",
|
|
24916
|
-
version: "0.
|
|
25555
|
+
version: "0.21.0",
|
|
24917
25556
|
type: "module",
|
|
24918
25557
|
description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
|
|
24919
25558
|
license: "SEE LICENSE IN LICENSE",
|
|
@@ -25015,27 +25654,27 @@ var ApiClientFactory = class {
|
|
|
25015
25654
|
import { mkdir, readFile, writeFile, unlink, chmod } from "fs/promises";
|
|
25016
25655
|
|
|
25017
25656
|
// src/types/session.ts
|
|
25018
|
-
import { z as
|
|
25019
|
-
var RunnerSessionFileSchema =
|
|
25020
|
-
version:
|
|
25021
|
-
server:
|
|
25657
|
+
import { z as z38 } from "zod";
|
|
25658
|
+
var RunnerSessionFileSchema = z38.object({
|
|
25659
|
+
version: z38.literal(1),
|
|
25660
|
+
server: z38.url(),
|
|
25022
25661
|
/** Plaintext runner-session token (`geni_rs_…`). */
|
|
25023
|
-
token:
|
|
25024
|
-
user:
|
|
25025
|
-
id:
|
|
25026
|
-
email:
|
|
25027
|
-
name:
|
|
25662
|
+
token: z38.string().startsWith("geni_rs_"),
|
|
25663
|
+
user: z38.object({
|
|
25664
|
+
id: z38.string(),
|
|
25665
|
+
email: z38.string().nullable(),
|
|
25666
|
+
name: z38.string().nullable()
|
|
25028
25667
|
}),
|
|
25029
|
-
workspace:
|
|
25030
|
-
membershipId:
|
|
25031
|
-
organizationId:
|
|
25032
|
-
slug:
|
|
25033
|
-
name:
|
|
25034
|
-
profilePictureUrl:
|
|
25035
|
-
role:
|
|
25668
|
+
workspace: z38.object({
|
|
25669
|
+
membershipId: z38.string(),
|
|
25670
|
+
organizationId: z38.string(),
|
|
25671
|
+
slug: z38.string(),
|
|
25672
|
+
name: z38.string(),
|
|
25673
|
+
profilePictureUrl: z38.string().nullable().optional(),
|
|
25674
|
+
role: z38.string()
|
|
25036
25675
|
}),
|
|
25037
25676
|
/** ISO 8601 — when the file was last written by login or workspace switch. */
|
|
25038
|
-
savedAt:
|
|
25677
|
+
savedAt: z38.string()
|
|
25039
25678
|
});
|
|
25040
25679
|
|
|
25041
25680
|
// src/clients/SessionStore.ts
|
|
@@ -25124,16 +25763,16 @@ function isErrnoCode(err, expected) {
|
|
|
25124
25763
|
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, unlink as unlink2 } from "fs/promises";
|
|
25125
25764
|
|
|
25126
25765
|
// src/types/browserSession.ts
|
|
25127
|
-
import { z as
|
|
25128
|
-
var BrowserSessionFileSchema =
|
|
25129
|
-
token:
|
|
25130
|
-
cdpUrl:
|
|
25131
|
-
provider:
|
|
25132
|
-
liveViewUrl:
|
|
25766
|
+
import { z as z39 } from "zod";
|
|
25767
|
+
var BrowserSessionFileSchema = z39.object({
|
|
25768
|
+
token: z39.string(),
|
|
25769
|
+
cdpUrl: z39.string(),
|
|
25770
|
+
provider: z39.string(),
|
|
25771
|
+
liveViewUrl: z39.string().nullable(),
|
|
25133
25772
|
/** API server the session was opened against, for diagnostics. */
|
|
25134
|
-
server:
|
|
25135
|
-
openedAt:
|
|
25136
|
-
keepalivePid:
|
|
25773
|
+
server: z39.string(),
|
|
25774
|
+
openedAt: z39.string(),
|
|
25775
|
+
keepalivePid: z39.number().nullable()
|
|
25137
25776
|
});
|
|
25138
25777
|
|
|
25139
25778
|
// src/clients/BrowserSessionStore.ts
|
|
@@ -25388,7 +26027,9 @@ var import_node_forge = __toESM(require_lib(), 1);
|
|
|
25388
26027
|
import tls2 from "tls";
|
|
25389
26028
|
var YEAR_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
25390
26029
|
function randomSerial() {
|
|
25391
|
-
|
|
26030
|
+
const bytes = import_node_forge.default.random.getBytesSync(16);
|
|
26031
|
+
const first = bytes.charCodeAt(0) & 63 | 64;
|
|
26032
|
+
return import_node_forge.default.util.bytesToHex(String.fromCharCode(first) + bytes.slice(1));
|
|
25392
26033
|
}
|
|
25393
26034
|
function generateEgressCaMaterial() {
|
|
25394
26035
|
const caKeys = import_node_forge.default.pki.rsa.generateKeyPair(2048);
|
|
@@ -25442,7 +26083,7 @@ function createEgressCa(material) {
|
|
|
25442
26083
|
{ name: "authorityKeyIdentifier", keyIdentifier: caKeyIdentifier }
|
|
25443
26084
|
]);
|
|
25444
26085
|
leaf.sign(caPrivateKey, import_node_forge.default.md.sha256.create());
|
|
25445
|
-
return import_node_forge.default.pki.certificateToPem(leaf);
|
|
26086
|
+
return import_node_forge.default.pki.certificateToPem(leaf) + caCertPem;
|
|
25446
26087
|
}
|
|
25447
26088
|
const contextCache = /* @__PURE__ */ new Map();
|
|
25448
26089
|
function secureContextForHost(host) {
|
|
@@ -25603,13 +26244,13 @@ function createEgressProxy(args) {
|
|
|
25603
26244
|
// src/lib/egressCa.ts
|
|
25604
26245
|
import { existsSync as existsSync3, readFileSync as readFileSync5 } from "fs";
|
|
25605
26246
|
import { join as join4 } from "path";
|
|
25606
|
-
import { z as
|
|
26247
|
+
import { z as z40 } from "zod";
|
|
25607
26248
|
var EGRESS_CA_CACHE_VERSION = 3;
|
|
25608
|
-
var EgressCaCacheSchema =
|
|
25609
|
-
version:
|
|
25610
|
-
caKeyPem:
|
|
25611
|
-
caCertPem:
|
|
25612
|
-
leafKeyPem:
|
|
26249
|
+
var EgressCaCacheSchema = z40.object({
|
|
26250
|
+
version: z40.literal(EGRESS_CA_CACHE_VERSION),
|
|
26251
|
+
caKeyPem: z40.string().min(1),
|
|
26252
|
+
caCertPem: z40.string().min(1),
|
|
26253
|
+
leafKeyPem: z40.string().min(1)
|
|
25613
26254
|
});
|
|
25614
26255
|
function loadOrCreateEgressCa() {
|
|
25615
26256
|
const path = join4(ensureCacheDir(), "egress-ca.json");
|
|
@@ -27504,7 +28145,7 @@ function registerResourceLifecycle(parent) {
|
|
|
27504
28145
|
// src/commands/resource/create.ts
|
|
27505
28146
|
import { Option as Option2 } from "commander";
|
|
27506
28147
|
import { resolve as resolve4 } from "path";
|
|
27507
|
-
import { z as
|
|
28148
|
+
import { z as z41 } from "zod";
|
|
27508
28149
|
|
|
27509
28150
|
// src/lib/resourceTypeWords.ts
|
|
27510
28151
|
var RESOURCE_TYPE_FLAG = {
|
|
@@ -27527,9 +28168,9 @@ var RESOURCE_KIND_WORD = {
|
|
|
27527
28168
|
};
|
|
27528
28169
|
|
|
27529
28170
|
// src/commands/resource/create.ts
|
|
27530
|
-
var ResourceCreateTypeSchema =
|
|
28171
|
+
var ResourceCreateTypeSchema = z41.preprocess(
|
|
27531
28172
|
(value) => value === "deliverable" ? "design" : value,
|
|
27532
|
-
|
|
28173
|
+
z41.union([WorkflowTypeSchema, z41.literal("skill")])
|
|
27533
28174
|
);
|
|
27534
28175
|
function authoringSkillFor(workflowType) {
|
|
27535
28176
|
switch (workflowType) {
|
|
@@ -27880,7 +28521,7 @@ function printConfig(snapshot) {
|
|
|
27880
28521
|
|
|
27881
28522
|
// src/commands/resource/config/set.ts
|
|
27882
28523
|
import { resolve as resolve9 } from "path";
|
|
27883
|
-
import { z as
|
|
28524
|
+
import { z as z42 } from "zod";
|
|
27884
28525
|
function registerConfigSet(parent) {
|
|
27885
28526
|
parent.command("set [id]").description(
|
|
27886
28527
|
"Wire config. Repeat each flag as needed. Credentials: --cred <service>=<credentialId>. Consts: --const <key>=<value> (value JSON-parsed, else string). Schedules: --schedule <triggerId>=<cron>, --timezone <triggerId>=<tz>."
|
|
@@ -27998,7 +28639,7 @@ function buildPartial(opts) {
|
|
|
27998
28639
|
} catch {
|
|
27999
28640
|
inputValues = null;
|
|
28000
28641
|
}
|
|
28001
|
-
const parsed =
|
|
28642
|
+
const parsed = z42.record(z42.string(), z42.unknown()).safeParse(inputValues);
|
|
28002
28643
|
if (!parsed.success) {
|
|
28003
28644
|
printError("--trigger-input expects <triggerId>=<JSON object>.");
|
|
28004
28645
|
exit(ExitCode.InvalidArgs);
|
|
@@ -28216,7 +28857,7 @@ Commands accept the resource id as a positional, or infer it from the
|
|
|
28216
28857
|
|
|
28217
28858
|
// src/commands/workflow/executionControls.ts
|
|
28218
28859
|
import { resolve as resolve12 } from "path";
|
|
28219
|
-
import { z as
|
|
28860
|
+
import { z as z43 } from "zod";
|
|
28220
28861
|
function registerExecutionControls(parent) {
|
|
28221
28862
|
for (const action of [
|
|
28222
28863
|
"pending-input",
|
|
@@ -28261,7 +28902,7 @@ function registerExecutionControls(parent) {
|
|
|
28261
28902
|
if (action === "resume") {
|
|
28262
28903
|
const answers = parseJson(
|
|
28263
28904
|
options.answers,
|
|
28264
|
-
|
|
28905
|
+
z43.record(z43.string(), z43.string()),
|
|
28265
28906
|
"--answers"
|
|
28266
28907
|
);
|
|
28267
28908
|
await workflowAuthoringService.resumeExecution(
|
|
@@ -28299,7 +28940,7 @@ function registerExecutionControls(parent) {
|
|
|
28299
28940
|
|
|
28300
28941
|
// src/commands/workflow/previewFilter.ts
|
|
28301
28942
|
import { resolve as resolve13 } from "path";
|
|
28302
|
-
import { z as
|
|
28943
|
+
import { z as z44 } from "zod";
|
|
28303
28944
|
function registerPreviewFilter(parent) {
|
|
28304
28945
|
parent.command("preview-filter [id]").description(
|
|
28305
28946
|
"Run filter.ts once and inspect its decision, transformed input and logs. Uses live credentials and persists any dedup state it writes; does not run the workflow body."
|
|
@@ -28318,7 +28959,7 @@ function registerPreviewFilter(parent) {
|
|
|
28318
28959
|
const workflowId = resolveResourceId({ id, dir });
|
|
28319
28960
|
const triggerPayload = parseJson(
|
|
28320
28961
|
options.payload ?? "{}",
|
|
28321
|
-
|
|
28962
|
+
z44.record(z44.string(), z44.unknown()),
|
|
28322
28963
|
"--payload"
|
|
28323
28964
|
);
|
|
28324
28965
|
try {
|
|
@@ -28464,7 +29105,7 @@ function registerWorkflowSetType(parent) {
|
|
|
28464
29105
|
|
|
28465
29106
|
// src/commands/workflow/test.ts
|
|
28466
29107
|
import { resolve as resolve16 } from "path";
|
|
28467
|
-
import { z as
|
|
29108
|
+
import { z as z45 } from "zod";
|
|
28468
29109
|
var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled", "awaiting_input"]);
|
|
28469
29110
|
var POLL_INTERVAL_MS = 2e3;
|
|
28470
29111
|
function registerWorkflowTest(parent) {
|
|
@@ -28591,7 +29232,7 @@ function parsePayload(raw) {
|
|
|
28591
29232
|
printError("--payload must be a JSON object, not an array.");
|
|
28592
29233
|
exit(ExitCode.InvalidArgs);
|
|
28593
29234
|
}
|
|
28594
|
-
const result =
|
|
29235
|
+
const result = z45.record(z45.string(), z45.unknown()).safeParse(parsed);
|
|
28595
29236
|
if (!result.success) {
|
|
28596
29237
|
printError(`--payload must be a JSON object (e.g. '{"days":7}').`);
|
|
28597
29238
|
exit(ExitCode.InvalidArgs);
|
|
@@ -28946,7 +29587,7 @@ function registerAppBuildStatus(parent) {
|
|
|
28946
29587
|
|
|
28947
29588
|
// src/commands/app/runHandler.ts
|
|
28948
29589
|
import { resolve as resolve24 } from "path";
|
|
28949
|
-
import { z as
|
|
29590
|
+
import { z as z46 } from "zod";
|
|
28950
29591
|
function registerAppRunHandler(parent) {
|
|
28951
29592
|
parent.command("run-handler <name> [id]").description(
|
|
28952
29593
|
"Dispatch a handler against the live app with --input JSON (bypasses cache) and print the result. Publish first. Exits nonzero on handler error."
|
|
@@ -29001,7 +29642,7 @@ function parseInput(raw) {
|
|
|
29001
29642
|
printError("--input must be a JSON object, not an array.");
|
|
29002
29643
|
exit(ExitCode.InvalidArgs);
|
|
29003
29644
|
}
|
|
29004
|
-
const result =
|
|
29645
|
+
const result = z46.record(z46.string(), z46.unknown()).safeParse(parsed);
|
|
29005
29646
|
if (!result.success) {
|
|
29006
29647
|
printError(`--input must be a JSON object (e.g. '{"limit":50}').`);
|
|
29007
29648
|
exit(ExitCode.InvalidArgs);
|
|
@@ -29020,7 +29661,7 @@ function parseTimeout2(raw) {
|
|
|
29020
29661
|
|
|
29021
29662
|
// src/commands/app/runAgent.ts
|
|
29022
29663
|
import { resolve as resolve25 } from "path";
|
|
29023
|
-
import { z as
|
|
29664
|
+
import { z as z47 } from "zod";
|
|
29024
29665
|
function registerAppRunAgent(parent) {
|
|
29025
29666
|
parent.command("run-agent <name> [id]").description(
|
|
29026
29667
|
"Trigger a declared app agent (agents/<name>/ in app.json) as a test execution against the live app. Async: prints the execution id; poll `geni workflow executions [id]` and `geni workflow execution <executionId>` for the outcome. Publish first."
|
|
@@ -29072,7 +29713,7 @@ function parseVariables(raw) {
|
|
|
29072
29713
|
printError(`--variables must be valid JSON. Got: ${raw}`);
|
|
29073
29714
|
exit(ExitCode.InvalidArgs);
|
|
29074
29715
|
}
|
|
29075
|
-
const result =
|
|
29716
|
+
const result = z47.record(z47.string(), z47.unknown()).safeParse(parsed);
|
|
29076
29717
|
if (!result.success) {
|
|
29077
29718
|
printError(`--variables must be a JSON object (e.g. '{"limit":50}').`);
|
|
29078
29719
|
exit(ExitCode.InvalidArgs);
|
|
@@ -29407,7 +30048,7 @@ import {
|
|
|
29407
30048
|
var geni_default = "---\nname: geni\ndescription: Use the user's connected services (Slack, Gmail, GitHub, Stripe, anything they've authorized in General Input) to fulfill their request, or build them a saved workflow (scheduled or event-driven automation). Load this whenever the user wants you to take an action on their behalf against an external SaaS account, fetch data from one of their tools, wire something up that crosses service boundaries, or set up a recurring/triggered automation.\n---\n\n# geni\n\n`geni` is a CLI that gives you credentialed access to the user's\nconnected accounts. The cloud injects their tokens into a fresh bash\nsubprocess as env vars; you write the `curl`, you never see the\nsecret. Run `geni --help` for the full command surface.\n\n## How to talk about geni\n\nTreat geni as a colleague \u2014 the integration expert who picks the\nright operation and runs the credentialed call. You're the one\nsynthesizing and replying.\n\nIn summaries of multi-step work, credit geni naturally: \"Geni pulled\nthe last 30 days of charges from Stripe; I rolled them into the report\nbelow.\" Skip the credit on trivial single calls; don't manufacture\nteam language (\"with geni's help\u2026\") to fill space. Lowercase `geni`\nin commands; capitalize \"Geni\" when personifying.\n\n## Request flow\n\nDiscovery first. Don't guess URLs, params, or env var names \u2014 the\noperation docs have them.\n\n1. `geni credential list [--service <slug>]` \u2014 find a connected\n credential id. If nothing's connected for the service, run\n `geni integration list -q \"<keyword>\"` to confirm the slug, then\n `geni credential connect <service>` (see \"Connecting a missing\n credential\" below).\n2. `geni integration operations <service> [-q \"<keyword>\"]` \u2014 find\n the operation you need. Not sure which service does it?\n `geni integration search \"<capability>\"` searches operations across\n every integration at once, grouped by service.\n3. `geni integration operation <id> --format markdown` \u2014 read the\n HTTP shape, params, and **exact env var names** this call will set.\n4. `geni exec bash --cred <cred_id> --reason \"<what + why>\" -- '<curl>'`\n\nNeed a workspace member's exact email (to notify, assign, or share to)? `geni\nworkspace members -q \"<name>\"`. General Input notifies members only\n(`POST $PLATFORM_BASE_URL/notifications`); anyone else is emailed from a\nconnected Gmail or Outlook.\n\nFor connection health, introspection refresh, labels, notes, dependent\nworkflows, access history, or disconnecting an account, use the dedicated\ncommands in `geni credential --help`. Inspect dependents before disconnecting.\n`geni sharing --help` covers direct member and organization grants on\nspecialists, resources, and credentials; inherited specialist access remains\nwhen a direct resource grant is removed.\n\n## Complex commands: write a file, don't fight quotes\n\nThe `-- '<command>'` form goes through a shell-quoting layer. For a\none-line `curl` that's fine. The moment the command has nested quotes\nor newlines \u2014 a `curl` piped into `jq` or `python3 -c`, a JSON body\nwith `\"keys\"` \u2014 that quoting silently mangles and the call fails in\nconfusing ways. Don't escalate escaping. Write the script to a file\nwith your normal editor, then run it as data:\n\n```\ngeni exec bash --cred <id> --reason \"<why>\" --file ./query.sh\n```\n\n`--file -` reads the script from stdin (heredoc / `< script.sh`).\n`jq` is available in the exec environment \u2014 prefer it over inline\n`python3 -c` for shaping JSON.\n\n## Connecting a missing credential\n\n`geni credential connect <service>` opens the integration's\ndashboard page in the user's browser. Tell the user to\nfinish the connection there and come back \u2014 then re-run `geni\ncredential list --service <service>` to pick up the new id. Don't\npoll, don't loop. In non-interactive shells, add `--print-url` so\nthe URL prints to stdout instead.\n\n## Env vars\n\nRead the names off the operation docs; never derive them. Two flavors\nemitted per credential:\n\n- **Suffixed**: `<SERVICE>_<FIELD>_<id>` (e.g. `$SLACK_BOT_TOKEN_ABC`,\n `$SALESFORCE_INSTANCE_URL_KG`). The `<id>` is the credential id with\n `cred_` stripped, uppercased. Use these when fanning out across\n multiple credentials of the same service in one call.\n- **Canonical aliases**: well-known SDK names (`$GH_TOKEN`,\n `$SLACK_BOT_TOKEN`, `$OPENAI_API_KEY`, `$STRIPE_API_KEY`, \u2026) for\n tools that hardcode them.\n\nPlus `$PLATFORM_API_KEY` and `$PLATFORM_BASE_URL` on every exec \u2014 use\nthem to call General Input's first-party services (web search, image\ngen, weather, notifications) without `--cred`.\n\n## --reason is per-call\n\nEvery `geni exec bash --cred ...` requires `--reason`. It lands in\nthe user's audit log and is shown to them. Be specific\n(\"Posting daily digest to #engineering\"), not generic (\"Slack call\").\nRe-state it on every call \u2014 the log is per-call, not per-session.\n\n## Output is scrubbed\n\nstdout and stderr pass through a streaming scrubber that replaces\nevery registered secret with `[REDACTED:credential_<id>]`. Don't try\nto exfiltrate via `echo $TOKEN | base64`; common encodings are\ncaught too. You don't need to see the secret to use it \u2014 the\nsubprocess can.\n\n## Building resources (workflows, apps, and skills)\n\n`geni exec bash` is for one-off actions. When the user wants something\nsaved and reusable, build a **resource**. A resource is one of four\ntypes: a `code` **workflow** (deterministic, fixed steps, runs on a\nschedule or trigger), an `agent` **workflow** (LLM-driven, variable-length\ntasks like research or triage), an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool), or a\n`skill` (a SKILL.md instruction bundle the platform's cloud agents load\nas context \u2014 not executed). The shared lifecycle lives under `geni\nresource`; type-specific tools under `geni workflow` and `geni app`.\n\nYou author the files locally with your own editor; the cloud validates,\nconfigures, publishes, and runs them. This is the same build loop as a\nconversation with a specialist, just on the user's machine with your\nbrain driving it. Same\nloop for every type; apps add a build step and handler tools (see\n\"Building apps\" below), skills drop the config step (see \"Building\nskills\" below).\n\n**Load the authoring skill first.** `geni skills load\n<code-workflow|agent-workflow|app|skill-authoring>` writes the platform's\nauthoring skill for that type into `geni-skills/<name>/`: `SKILL.md` (the\nmethod), `references/spec.md` (the full contract \u2014 required files, the\nruntime API, allowed and forbidden patterns), and `references/example/`\n(a complete, validated example to mirror). Read SKILL.md and the spec,\nand copy shapes from the example. (`skill-authoring` is the one type\nwhose short spec is inline in SKILL.md, with no example.) Don't write a\nsingle file before loading it.\n\nThe loop:\n\n1. `geni resource create --type code --specialist <specialistId> --name \"Daily Digest\"`:\n creates the resource in that specialist (`geni specialist list` shows the ones\n you can edit, `geni specialist create` makes one) and scaffolds its files\n into the current directory, with a `.geni-resource.json` marker so later\n commands here resolve the id automatically.\n2. Edit the files (`workflow.json`, `main.ts`, `package.json`) with your\n normal Read/Write/Edit tools. **Don't run `npm install`, `tsc`, or\n `bun` locally**: `@general-input/core` only resolves server-side, so\n a local compile always fails on the missing module. That's not a real\n error.\n3. `geni resource validate`: server-side spec + wiring + (code\n workflows) TypeScript check. Exit 9 means invalid; fix what it\n reports and re-run. For apps the compile gate is the publish build,\n not validate.\n4. `geni resource config set`: wire what the workflow needs. Find\n credential ids with `geni credential list`; set them with\n `--cred <service>=<credentialId>`. Set consts with `--const k=v`,\n schedules with `--schedule <triggerId>=<cron>`. `geni resource config\nget` shows the current state. Find trigger providers with\n `geni trigger list`. Poll triggers also need `--trigger-cred\n <triggerId>=<credentialId>` and `--trigger-input '<triggerId>={...}'`;\n clear a poll binding with `--trigger-cred-clear <triggerId>`.\n Resource credential slots and poll trigger bindings are separate.\n5. `geni resource publish --summary \"<one plain sentence>\"`: promote\n your local files to the live version. Required before a test reflects\n your latest edits.\n6. `geni workflow test --trigger <key> --payload '{...}'`: run a real cloud test\n execution and wait for the result, output, and logs. Iterate from\n step 2 until it does what the user asked.\n7. `geni resource enable`: turn it on once it is verified. A workflow is\n validated first and the command exits 9 with the blockers when it is\n not ready; `geni resource disable` turns it off. Works for skills too.\n\nWhen a run misbehaves, `geni workflow execution <id> --download` writes\nits full trace to `executions/<id>/` (run.json, logs.txt, input.json, and\nthread.json). For an agent workflow, read `thread.json` to see every step\nthe agent took. Use `--thread` or `--input` to print those inline instead.\n\nFor a paused run, inspect `geni workflow pending-input <executionId>` and\nanswer every open question with `geni workflow resume <executionId>\n--answers '{\"toolCallId\":\"answer\"}'`. Finished and paused agent runs support\n`continue <executionId> --message \"...\"` (on a paused run it skips the open\nquestions); `cancel` stops active runs and `retry`\nrepeats a finished run with its original input and trigger. These commands\ninfer the workflow from the local marker or accept `--workflow <id>`.\n\n`geni resource versions` lists published snapshots; `geni resource revert\n<versionId>` restores one and rebuilds apps when needed. Pull fresh files\nbefore editing after a revert. `geni resource delete` archives one owned\nresource.\n\nUse the same discovery tools as exec: `geni integration operations\n<service>` and `geni integration operation <id>` to learn an API's shape\nbefore you write the `fetch` call in `main.ts`.\n\nFor a poll-triggered workflow, `geni workflow trigger-sample` returns\nlive sample records so you see the exact shape `input` receives before\nwriting `main.ts` (wire the trigger's credential and inputs with\n`config set` first). To test a file-type input, `geni workflow\nstage-input <file>` uploads a local file and prints a `store://` URI to\npass as that field's value in `--payload`.\n\nPass `--trigger <key>` to select the trigger for samples, tests and filter\npreviews. `geni workflow preview-filter --payload '{...}'` executes only\nthe filter; add `--draft` to preview local edits. It uses live credentials\nand can persist filter deduplication state. `trigger-activity` inspects live\npolling, filter decisions and captured events; `trigger-sync` polls now,\nand `trigger-replay` starts a real run from a captured event. Use each\ncommand's `--help` for selectors and pagination. Sync, retry and replay can\nrepeat external actions.\n\n## Building apps\n\nAn `app` workflow is a React SPA (rendered in the dashboard's iframe)\nthat calls server-side handlers. Create it with `geni resource create\n--type app --specialist <specialistId>`; load the authoring skill with `geni skills load app` (its\n`references/` hold the contract, the component catalog, and a complete\nexample app). The shared commands work the same (validate, config set\nfor credential slots, publish), with these differences:\n\n- The scaffold is a whole Vite project. Edit only `app.json`, `src/App.tsx`,\n `src/pages/*`, your own `src/components/*`, and `handlers/*.ts`. Leave\n the platform-owned files alone.\n- `geni resource publish` builds the app; the result's `build` reports\n whether the Vite build passed. `geni app screenshots` saves authenticated\n mobile and desktop captures; page loads can invoke live handlers.\n- `geni app run-handler <name> --input '{...}'` runs a handler\n against the live app (publish first). `geni app invocations`\n shows recent handler runs, `geni app errors` shows browser\n errors the iframe reported, `geni app build-status` shows the\n build, and `geni app clear-cache` flushes the handler cache.\n- `geni app run-agent <name> --variables '{...}'` triggers a declared\n app agent (`agents/<name>/` in app.json) as a test execution. Async:\n poll `geni workflow executions`, then `geni workflow execution <id>`.\n\nThe loop: create --type app -> edit handlers + pages -> validate ->\nconfig set (wire credential slots) -> publish (builds) -> app run-handler\nto verify -> tell the user to open it in their dashboard.\n\n## Building skills\n\nA `skill` is a SKILL.md bundle (frontmatter `name` slug + `description`,\nthen the instructions body; optional `scripts/`, `references/`,\n`assets/`) that the platform's cloud agents load as context. It is not\nexecuted, so the loop is shorter: create --type skill -> edit SKILL.md ->\nvalidate -> publish. No `config set` (nothing to wire) and publish needs\nno `--summary`. The frontmatter `description` is the only thing agents\nsee before deciding to load it, so it must say what the skill does AND\nwhen to use it. Skill ids are `skl_`-prefixed; pull/validate/publish\nwork on them like any resource.\n\nA skill is never run and has no triggers. Once published, tell the user\nit's in their dashboard Skills page, ready for their agents to load into\nfuture work. Commands accept the skill id as a positional or infer it\nfrom the marker in the current directory.\n\n## Building custom API integrations\n\nWhen the integration catalog has no service for an API-key or public REST\nAPI, load its authoring contract with `geni skills load custom-api`. Read that\nskill before creating anything. Gather the provider's official documentation,\nshow the user the proposed title and description, and wait for approval.\n\nCreate the private draft with\n`geni custom-api create --title \"...\" --description \"...\" --confirm`. The\n`--confirm` flag means the user approved those exact\ndetails. Then use `geni custom-api update`, `upsert-operation`,\n`delete-operation`, and `set-status`; each accepts the same fields as the\ncorresponding cloud-agent tool. Prefer `--file` for documentation-heavy JSON.\nPublish with `set-status <id> live --confirm` only after the user explicitly\nasks and the loaded skill's source inventory has no unresolved assumptions.\nOAuth-only services need an integration request in the dashboard instead.\n\n## Hosted browser (login-walled sites)\n\nFor sites with no API \u2014 or data behind a login wall \u2014 drive a hosted\nbrowser with a Playwright script, exactly like the platform's agents do.\n\n1. `geni browser profiles` \u2014 saved browsers and their logins. The\n user's own browser is always listed; shared ones appear too.\n2. `geni browser open [--profile <id>] [--url <url>]` \u2014 open a hosted session, on that page when given.\n With `--profile` it arrives signed in (cookies + storage); without,\n it's logged out. One session at a time.\n3. While it's open, `geni exec bash` exports `GI_BROWSER_CDP_URL`.\n Write a playwright-core script that\n `chromium.connectOverCDP(process.env.GI_BROWSER_CDP_URL)` and run it\n with `node` (not bun). No `--cred` needed for the browser itself.\n4. `geni browser close` \u2014 ALWAYS, including after failures: it saves\n the login back onto the profile and stops billing. A forgotten\n session auto-closes after 2 hours.\n\nWhen a script hits a real login wall (a restricted page bounced to a\nsign-in form \u2014 a homepage merely showing a Sign in button doesn't\ncount), first sign in with a provider: if the login is listed as\n\"signed in with github.com\", or the sign-in page offers a provider\nthe browser lists as signed in (\"Continue with GitHub\"), click that\nbutton once. If it lands signed in, carry on and record the way in\nwith `geni browser report-login <domain> active --signed-in-with\ngithub.com`. Stop at anything it asks for (a password, a code, an\nemail, a choice of account, approval for an app). Otherwise:\n\n- On the user's own browser: `geni browser request-login <domain>`\n opens a live view in their real browser; they sign in (2FA and all),\n the browser saves as they go, and the next `open --profile` arrives\n signed in.\n- On a shared browser: `geni browser report-login <domain> logged_out`\n and tell the user to ask its owner to reconnect it. Use\n `... active` when you confirmed a listed login works.\n\n## Workspace memory\n\nThe workspace carries a memory: standing instructions, conventions,\nand reference material the workspace's agents have accumulated. It is\nnot optional context \u2014 it holds decisions you would otherwise\nre-derive or contradict.\n\n**Read it at the start of any non-trivial task:**\n\n```\ngeni memory show # the workspace's\ngeni memory show --personal # the user's own preferences\n```\n\nUse `geni memory files` to list referenced files and `geni memory read\n<path>` to read one. `read <path> --out <file>` downloads an original\nupload without changing its bytes; `geni memory pull --dir <directory>`\ndownloads a side's guide, references and originals. Add `--personal` for\nthe user's own memory.\n\nStanding instructions there override your defaults. If memory says\nreports go in a specific format, or a service is off-limits, follow it\nwithout re-asking.\n\n**File what you learn back:**\n\n```\ngeni memory remember \"invoices are reconciled against Stripe, never the ledger\"\ngeni memory remember --personal \"prefers terse summaries, no preamble\"\n```\n\nThis does not edit memory. It queues the change for the workspace's\nmemory agent, which folds it in on its next run and reconciles it\nagainst everything else it knows. `geni memory show` lists what is\nalready queued, so you don't file the same thing twice.\n\nReach for `remember` when a correction or convention would still\nmatter next week and isn't already recorded. Skip it for one-off\ndetails, anything already in `geni memory show`, and anything you only\nhalf-know \u2014 a wrong memory is worse than a missing one. Most tasks\nneed no call at all. Phrase the note as the change you want made\n(\"deploys go out Tuesdays\"), not a summary of the session (\"we talked\nabout deploys\").\n\nWorkspace memory is shared with the whole team, so keep it about the\nbusiness and the work, never about a person. Anything specific to this\nuser goes to `--personal`. Workspace proposals require Admin or Owner;\nevery member can propose changes to their own personal memory.\n\n## Specialist files and portability\n\n`geni specialist files --help` covers shared text and binary files, and the\nfolders people see them in (`mkdir`, `mv`, `rename`, `rmdir`): a specialist's\nworkflows, apps, and skills sit in those folders beside its files. Specialist\nimport/export and template commands are listed in `geni specialist --help`.\nReview archive contents and template versions before installing. Exports\nand publications carry only the files and memory explicitly selected;\nchoose the intended publication audience before publishing a template.\n\n## Exit codes worth knowing\n\n- `0` \u2014 success; `1\u2013125` \u2014 subprocess's own exit (curl, jq, etc.)\n- `4` \u2014 resource not found (bad cred id, slug, operation id)\n- `77` \u2014 server refused to resolve a credential. Don't retry; surface\n to the user.\n- `78` \u2014 session expired. Tell the user to run `geni login`.\n- `79` \u2014 this geni is below the server's minimum version. Run\n `geni upgrade`, then `geni skills install`, and retry.\n\n## Don't\n\n- Don't construct a curl without reading the operation docs first.\n Guessing at URLs and env var names is the most common failure mode.\n- Don't hand-write resource files before loading the authoring skill\n (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`)\n and reading its spec + example. Don't try to compile or `npm install`\n them locally; let `geni resource validate` be the gate.\n- Don't create or publish a custom API before loading `custom-api`, reviewing\n sources, and getting the user's explicit approval.\n- Don't re-derive a convention `geni memory show` already states, and\n don't put anything about a named person into workspace memory.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
|
|
29408
30049
|
|
|
29409
30050
|
// src/skills/geni-crm.md
|
|
29410
|
-
var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the user\'s General Input CRM from the command line. Load this whenever the user wants you to look something up in their CRM, pull a list of people or companies, check a deal pipeline, find or verify someone\'s email or phone (enrichment), OR change CRM data (create or update people/companies, manage lists and tags, add notes, create and resolve tasks, move deals through stages, log touchpoints). Full read/write access to people, companies, pipelines, deals, lists, tags, notes, tasks, and enrichment.\n---\n\n# geni crm\n\n`geni crm` reads and writes the user\'s General Input CRM: the lead database\n(people and companies), deal pipelines and their cards, lists, tags, notes,\ntasks, touchpoints, and custom fields. It is part of the same `geni` CLI, so it\nuses the same session and active workspace. The workspace must have CRM access,\nor these commands return a 403. Run `geni crm --help` for the full surface, and\n`geni crm <noun> --help` for a noun\'s verbs.\n\nThe shape is `geni crm <noun> <verb>`. Each noun is a group: `people`,\n`companies`, `lists`, `tags`, `notes`, `tasks`, `pipelines`, `stages`, `cards`,\n`touchpoints`, `fields`, `employments`, `contact-points`, `waterfalls`,\n`enrich`, plus a top-level `search`.\n\n## Finding things, then acting on them\n\nThe same two-step flow as the rest of geni: find an id, then read or write it.\n\n1. Find by name with one query across everything:\n `geni crm search "<text>" [--type person|company|list|pipeline|card]`. Or\n list one kind: `geni crm people "<text>"`, `geni crm companies "<text>"`,\n `geni crm pipelines`, `geni crm lists`, `geni crm tags`, `geni crm tasks`.\n `people` and `companies` also take `--filter`, a JSON array of column\n conditions, e.g. `--filter \'[{"field":"title","operator":"contains","value":"vp"},{"field":"companyEmployeeCount","operator":"gte","value":50}]\'` \u2014\n see `--help` for the field and operator lists (custom fields filter as\n `custom.<key>`).\n2. Read one record: `geni crm people get <id>`, `geni crm companies get <id>`,\n `geni crm cards get <id>`, `geni crm pipelines get <id>` (add `--board` for\n its cards), `geni crm tasks get <id>`.\n\n## Writing\n\nCreates and updates take the record body as `--json`; the server validates it,\nso a 400 means the body was wrong (read the error and fix the JSON). Run\n`geni crm <noun> <verb> --help` to see the expected fields.\n\n- **Create / update records** (JSON body):\n - `geni crm people create --json \'[{"fullName":"Ada Lovelace","companyName":"Acme","email":"ada@acme.com"}]\'` (batch, find-or-create, deduped). `companies create` mirrors it. A `"created": false` result matched an existing record by identity key (email/LinkedIn; domain for companies) \u2014 the CLI warns on stderr when the matched name differs, e.g. a shared inbox collapsing distinct people.\n - `geni crm people update --json \'[{"id":"<id>","title":"VP Eng","linkedinUrl":"https://\u2026"}]\'` (batch, ids inline). `companies update` mirrors it. Writes take the create field names (`title`, `linkedinUrl`), not the read names you see on `get` (`currentTitle`, `primaryLinkedinUrl`); unknown keys are rejected with a 400 naming them.\n - `geni crm lists create --json \'{"name":"Q3 ICP","type":"company"}\'`, `geni crm tags create --json \'{"name":"Customer","entityType":"company"}\'`, `geni crm tasks create --json \'{"title":"Follow up","entity":{"type":"person","id":"<id>"}}\'`, `geni crm cards create <pipelineId> --json \'{"title":"Acme renewal","amount":50000}\'`.\n- **Notes** take the text directly: `geni crm notes create person <id> --body "Met at the conference"`.\n- **State-change verbs** (no JSON, just flags/ids):\n - Lists/tags: `geni crm lists add <listId> <entityIds...>`, `geni crm tags assign <tagId> <entityIds...>` (and `remove` / `unassign`).\n - Tasks: `geni crm tasks done <id>` (also `dismiss`, `reopen`, `delete`).\n - Cards: `geni crm cards move <id> --stage <stageId>`, `geni crm cards status <id> --status won|lost|open [--reason "..."]`, `geni crm cards archive <id>`, `geni crm cards add-contact <cardId> <personId>`.\n- **Deals/touchpoints**: `geni crm touchpoints log <cardId> --json \'{"channel":"call","occurredAt":"2026-07-01T15:00:00Z","summary":"Pricing call"}\'`.\n- **Delete** is `<noun> delete <id...>` (people/companies/lists/cards take multiple ids; most others take one). `geni crm cards delete <ids...>` is permanent \u2014 it takes the card\'s contacts, activity, notes, touchpoints, and tasks with it, and reports which ids it actually matched. Prefer `cards archive <id>` when the record should survive.\n\nCard edits, moves, and status changes use optimistic concurrency. Pass\n`--expected-updated-at <ts>` to enforce it; omit it and the CLI reads the card\'s\ncurrent version first (last-write-wins), which is usually what you want from a\nscript. With the token, a stale card fails with an HTTP 409 conflict; re-read\nthe card and retry.\n\n## Output\n\nList commands print a table; pass `--json` to parse. `get` commands and all\nwrites print the affected record as JSON (state-change verbs print a short\nconfirmation). The single-record `get` commands take `--field <path>` to pull\none value, e.g. `geni crm cards get <id> --field status`.\n\nJSON shapes vary by verb: searches print `{"results": [...]}` (people/companies\nadd `nextCursor`), `people get` prints `{person, company, contactPoints, ...}`,\nand bare noun lists wrap in a named key (e.g. `{"lists": [...]}`) \u2014 check before\npiping into a parser.\n\n## Enrichment\n\nFind and verify contact info for people through the workspace\'s configured\nprovider waterfalls. This is **paid** (it spends credits per provider call), so\nevery verb requires `--yes` and a run is capped at 25 people. Only enrich when\nthe user has asked you to. Found emails and numbers save onto the person\'s\ncontact points automatically.\n\n- See what\'s wired first: `geni crm waterfalls` lists the provider chain for each\n capability (email-enrichment, email-validation, phone-enrichment). An empty\n chain finds nothing and spends nothing.\n- `geni crm enrich emails <personIds...> --yes` finds work emails;\n `geni crm enrich phones <personIds...> --yes` finds mobile numbers (both take\n `--retry-unverified`).\n- `geni crm enrich validate <personIds...> --yes` checks deliverability \u2014 run it\n before any outreach so nothing goes to a bad address.\n\n## Composing with the rest of geni\n\nThe CRM is the source of who and what; connected credentials are how you act on\nthe outside world. To add contact info, prefer `geni crm enrich` (it runs the\nworkspace\'s provider waterfalls and saves results). For anything else, pull\npeople or a company from the CRM, reach a service through `geni exec bash` (send\nan email, update an external system), and write the result back to the CRM (a\nnote, a task, a touchpoint, a moved card). Credit each tool naturally in your\nsummary.\n\n## Exit codes worth knowing\n\n- `0` success.\n- `4` not found (bad id, or it is not in the active workspace).\n- `5` forbidden (the workspace lacks CRM access, or the record is out of scope).\n- `9` stale write (a card changed since you read it; re-read and retry, or pass `--expected-updated-at`).\n- `78` session expired. Tell the user to run `geni login`.\n';
|
|
30051
|
+
var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the user\'s General Input CRM from the command line. Load this whenever the user wants you to look something up in their CRM, pull a list of people or companies, check a deal pipeline, find or verify someone\'s email or phone (enrichment), OR change CRM data (create or update people/companies, manage lists and tags, add notes, create and resolve tasks, move deals through stages, log touchpoints). Full read/write access to people, companies, pipelines, deals, lists, tags, notes, tasks, and enrichment.\n---\n\n# geni crm\n\n`geni crm` reads and writes the user\'s General Input CRM: the lead database\n(people and companies), deal pipelines and their cards, lists, tags, notes,\ntasks, touchpoints, and custom fields. It is part of the same `geni` CLI, so it\nuses the same session and active workspace. The workspace must have CRM access,\nor these commands return a 403. Run `geni crm --help` for the full surface, and\n`geni crm <noun> --help` for a noun\'s verbs.\n\nThe shape is `geni crm <noun> <verb>`. Each noun is a group: `people`,\n`companies`, `lists`, `tags`, `notes`, `tasks`, `pipelines`, `stages`, `cards`,\n`touchpoints`, `fields`, `employments`, `contact-points`, `waterfalls`,\n`enrich`, `history`, `activities`, `files`, `views`, `merge`,\n`consent`, `privacy`, `credits`, `import`, plus top-level `search` and `match`.\n\nEvery command that names a record by type takes one of three record types:\n`person`, `company`, or `pipeline_card` (a card in any pipeline: a deal, or a\ncandidate in a recruiting pipeline). Tags, lists, notes, tasks, and custom\nfields work on all three.\n\nEveryone in the workspace sees and edits every person, company, and pipeline\ncard.\n\n## Finding things, then acting on them\n\nThe same two-step flow as the rest of geni: find an id, then read or write it.\n\n1. Find by name with one query across everything:\n `geni crm search "<text>" [--type person|company|list|pipeline|pipeline_card]`. Or\n list one kind: `geni crm people "<text>"`, `geni crm companies "<text>"`,\n `geni crm pipelines`, `geni crm lists`, `geni crm tags`, `geni crm tasks`.\n `people` and `companies` also take `--filter`, a JSON array of column\n conditions, e.g. `--filter \'[{"field":"title","operator":"contains","value":"vp"},{"field":"companyEmployeeCount","operator":"gte","value":50}]\'` \u2014\n see `--help` for the field and operator lists (custom fields filter as\n `custom.<key>`).\n2. Read one record: `geni crm people get <id>`, `geni crm companies get <id>`,\n `geni crm cards get <id>`, `geni crm pipelines get <id>` (add `--board` for\n its cards), `geni crm tasks get <id>`.\n\n## Activities\n\nNotes, calls, emails, meetings, Slack and LinkedIn messages are activities, and\none activity links to every record it concerns (a call with Ada about the\nAcme deal links Ada, Acme, and the deal card). Someone sees an activity only\nwhen they can see every record it links.\n\n- `geni crm activities list <entityType> <id> [--kind call email]` lists a record\'s activities, newest first.\n- `geni crm activities log --json \'{"kind":"call","direction":"outbound","body":"Walked through the offer","links":[{"type":"person","id":"<id>"},{"type":"pipeline_card","id":"<id>"}]}\'`. A future `occurredAt` schedules a meeting or call.\n- `geni crm activities sync --json \'{...,"externalRef":"<Message-ID>"}\'` creates or updates the activity that `externalRef` names and merges its links, so re-syncing a mailbox never duplicates a message. A message a teammate already logged stays as they logged it.\n- Only an activity\'s author edits or deletes it. Notes (`geni crm notes`) and card touchpoints are the same activities seen through one record.\n\n## Files\n\nA record can carry files (a resume on a person, a contract on a card), up to\n25 MB each. `geni crm files upload person <id> ./resume.pdf --kind resume`\nattaches one; `geni crm files list <entityType> <id>` lists them;\n`geni crm files text <fileId>` prints a text file\'s contents and\n`geni crm files download <fileId>` prints a short-lived link to any file.\nSomeone sees a file only when they can see its record.\n\n## Custom fields and saved views\n\nCustom fields (`geni crm fields`) can be text, long text, number, currency\n(`{"amount":1200,"currency":"USD"}`), checkbox, date, date and time (ISO),\nsingle select, multi-select, status, URL, email, phone, or member (a\nmembership id). Write values through the record\'s `custom` object.\n\nSaved views (`geni crm views`) are named filters, sort, and columns for one\nrecord type\'s table or board, personal or shared with the workspace.\n\n## Duplicates, consent, and privacy\n\n- **Merge duplicates**: `geni crm merge people <keepId> <dupeId...>` (and `companies`). The kept record takes every link, contact, file, and history line, and fills its empty fields from the duplicates.\n- **Before any outreach**, run `geni crm consent check <personId> --channel email` (or `phone`). Contact only the `reachable` values it returns, and nobody when `isAllowed` is false. Record a request with `geni crm consent do-not-contact <personId> --reason "..."` or `geni crm consent opt-out <contactPointId>`.\n- **Data requests**: `geni crm privacy export <personId>` returns everything held about them; `geni crm privacy erase <personId> --yes` deletes them for good, with anything merged into them.\n- **Credit splits** on a card: `geni crm credits set <cardId> --json \'{"credits":[{"membershipId":"<id>","role":"Recruiter","percent":60},{"membershipId":"<id>","role":"Account manager","percent":40}]}\'`.\n\n## Importing and syncing\n\n- **Import a CSV**: `geni crm import people leads.csv --dry-run` prints the suggested mapping (column to field, `custom.<key>` for a custom field) and the first rows that would fail. Then run it without `--dry-run`, optionally with `--map \'{...}\'`, `--list <listId>`, `--tag <tagId>`, and `--wait`. Rows match existing records by email, LinkedIn, or domain; a match only fills fields that are empty and never overwrites. `geni crm import status <importId>` shows counts and failed rows.\n- **Match addresses** before logging mail or meetings: `geni crm match a@x.com b@y.com` returns the person each address belongs to (any spelling, `+tags` ignored). Then log with `geni crm activities sync`.\n\n## History and triggers\n\nEvery change to a record is in its history: created, field changes (with the\nold and new value), stage and status moves, tags and lists, tasks, and\ndeletes. `geni crm history <entityType> <id>` prints one record\'s history,\nnewest first. `geni crm history feed [--after <cursor>]` reads the workspace\'s\nevents oldest first, and prints a cursor to pass back as `--after`.\n\nTo act when the CRM changes, build a workflow on a `general-input-crm` trigger\n(record created, field changed, card entered stage, tag added, task created,\nfile attached).\nIts payload is one history event: `entityType`, `entityId`, `kind`, `field`,\n`fromLabel`/`toLabel`, and `details` (stage ids for a stage move, the tag or\nlist id for a membership).\n\n## Writing\n\nCreates and updates take the record body as `--json`; the server validates it,\nso a 400 means the body was wrong (read the error and fix the JSON). Run\n`geni crm <noun> <verb> --help` to see the expected fields.\n\n- **Create / update records** (JSON body):\n - `geni crm people create --json \'[{"fullName":"Ada Lovelace","companyName":"Acme","email":"ada@acme.com"}]\'` (batch, find-or-create, deduped). `companies create` mirrors it. A `"created": false` result matched an existing record by identity key (email/LinkedIn; domain for companies) \u2014 the CLI warns on stderr when the matched name differs, e.g. a shared inbox collapsing distinct people.\n - `geni crm people update --json \'[{"id":"<id>","title":"VP Eng","linkedinUrl":"https://\u2026"}]\'` (batch, ids inline). `companies update` mirrors it. Writes take the create field names (`title`, `linkedinUrl`), not the read names you see on `get` (`currentTitle`, `primaryLinkedinUrl`); unknown keys are rejected with a 400 naming them.\n - `geni crm lists create --json \'{"name":"Q3 ICP","entityType":"company"}\'`, `geni crm tags create --json \'{"name":"Customer","entityType":"company"}\'`, `geni crm tasks create --json \'{"title":"Follow up","entity":{"type":"person","id":"<id>"}}\'`, `geni crm cards create <pipelineId> --json \'{"title":"Acme renewal","amount":50000}\'`.\n- **Notes** take the text directly: `geni crm notes create person <id> --body "Met at the conference"`.\n- **State-change verbs** (no JSON, just flags/ids):\n - Lists/tags: `geni crm lists add <listId> <entityIds...>`, `geni crm tags assign <tagId> <entityIds...>` (and `remove` / `unassign`).\n - Tasks: `geni crm tasks done <id>` (also `dismiss`, `reopen`, `delete`).\n - Cards: `geni crm cards move <id> --stage <stageId>`, `geni crm cards status <id> --status won|lost|open [--reason "..."]`, `geni crm cards archive <id>`, `geni crm cards add-contact <cardId> <personId>`.\n- **Deals/touchpoints**: `geni crm touchpoints log <cardId> --json \'{"channel":"call","occurredAt":"2026-07-01T15:00:00Z","summary":"Pricing call"}\'`.\n- **Delete** is `<noun> delete <id...>` (people/companies/lists/cards take multiple ids; most others take one). `geni crm cards delete <ids...>` is permanent \u2014 it takes the card\'s contacts, activity, notes, touchpoints, tasks, tags, and list entries with it, and reports which ids it actually matched. Prefer `cards archive <id>` when the record should survive.\n\nCard edits, moves, and status changes use optimistic concurrency. Pass\n`--expected-updated-at <ts>` to enforce it; omit it and the CLI reads the card\'s\ncurrent version first (last-write-wins), which is usually what you want from a\nscript. With the token, a stale card fails with an HTTP 409 conflict; re-read\nthe card and retry.\n\n## Output\n\nList commands print a table; pass `--json` to parse. `get` commands and all\nwrites print the affected record as JSON (state-change verbs print a short\nconfirmation). The single-record `get` commands take `--field <path>` to pull\none value, e.g. `geni crm cards get <id> --field status`.\n\nJSON shapes vary by verb: searches print `{"results": [...]}` (people/companies\nadd `nextCursor`), `people get` prints `{person, company, contactPoints, ...}`,\nand bare noun lists wrap in a named key (e.g. `{"lists": [...]}`) \u2014 check before\npiping into a parser.\n\n## Enrichment\n\nFind and verify contact info for people through the workspace\'s configured\nprovider waterfalls. This is **paid** (it spends credits per provider call), so\nevery verb requires `--yes` and a run is capped at 25 people. Only enrich when\nthe user has asked you to. Found emails and numbers save onto the person\'s\ncontact points automatically.\n\n- See what\'s wired first: `geni crm waterfalls` lists the provider chain for each\n capability (email-enrichment, email-validation, phone-enrichment). An empty\n chain finds nothing and spends nothing.\n- `geni crm enrich emails <personIds...> --yes` finds work emails;\n `geni crm enrich phones <personIds...> --yes` finds mobile numbers (both take\n `--retry-unverified`).\n- `geni crm enrich validate <personIds...> --yes` checks deliverability \u2014 run it\n before any outreach so nothing goes to a bad address.\n\n## Composing with the rest of geni\n\nThe CRM is the source of who and what; connected credentials are how you act on\nthe outside world. To add contact info, prefer `geni crm enrich` (it runs the\nworkspace\'s provider waterfalls and saves results). For anything else, pull\npeople or a company from the CRM, reach a service through `geni exec bash` (send\nan email, update an external system), and write the result back to the CRM (a\nnote, a task, a touchpoint, a moved card). Credit each tool naturally in your\nsummary.\n\n## Exit codes worth knowing\n\n- `0` success.\n- `4` not found (bad id, or it is not in the active workspace).\n- `5` forbidden (the workspace lacks CRM access, or the record is out of scope).\n- `9` stale write (a card changed since you read it; re-read and retry, or pass `--expected-updated-at`).\n- `78` session expired. Tell the user to run `geni login`.\n';
|
|
29411
30052
|
|
|
29412
30053
|
// src/lib/skills.ts
|
|
29413
30054
|
var GENI_SKILL_NAME = "geni";
|
|
@@ -29787,7 +30428,7 @@ var CRM_SEARCH_KINDS = {
|
|
|
29787
30428
|
company: true,
|
|
29788
30429
|
list: true,
|
|
29789
30430
|
pipeline: true,
|
|
29790
|
-
|
|
30431
|
+
pipeline_card: true
|
|
29791
30432
|
};
|
|
29792
30433
|
function isCrmSearchKind(value) {
|
|
29793
30434
|
return Object.prototype.hasOwnProperty.call(CRM_SEARCH_KINDS, value);
|
|
@@ -29797,7 +30438,7 @@ function registerCrmSearch(parent) {
|
|
|
29797
30438
|
"Search people, companies, lists, pipelines, and cards in one call. Use --type to narrow to one kind."
|
|
29798
30439
|
).option(
|
|
29799
30440
|
"--type <kind>",
|
|
29800
|
-
"Only this kind: person, company, list, pipeline, or
|
|
30441
|
+
"Only this kind: person, company, list, pipeline, or pipeline_card."
|
|
29801
30442
|
).option(
|
|
29802
30443
|
"--limit-per-type <n>",
|
|
29803
30444
|
"Max results per entity kind (1-20, default 6).",
|
|
@@ -29853,7 +30494,7 @@ function searchName(result) {
|
|
|
29853
30494
|
return result.name;
|
|
29854
30495
|
case "pipeline":
|
|
29855
30496
|
return result.name;
|
|
29856
|
-
case "
|
|
30497
|
+
case "pipeline_card":
|
|
29857
30498
|
return result.title;
|
|
29858
30499
|
}
|
|
29859
30500
|
}
|
|
@@ -29864,10 +30505,10 @@ function searchDetail(result) {
|
|
|
29864
30505
|
case "company":
|
|
29865
30506
|
return [result.industry, result.primaryDomain].filter(Boolean).join(" \xB7 ");
|
|
29866
30507
|
case "list":
|
|
29867
|
-
return `${result.
|
|
30508
|
+
return `${result.entityType} \xB7 ${result.memberCount} members`;
|
|
29868
30509
|
case "pipeline":
|
|
29869
30510
|
return `${result.kind} \xB7 ${result.cardCount} ${result.cardLabel}`;
|
|
29870
|
-
case "
|
|
30511
|
+
case "pipeline_card":
|
|
29871
30512
|
return `${result.pipelineName} / ${result.stageName}`;
|
|
29872
30513
|
}
|
|
29873
30514
|
}
|
|
@@ -29887,7 +30528,7 @@ function printJsonOrField(record, field) {
|
|
|
29887
30528
|
}
|
|
29888
30529
|
|
|
29889
30530
|
// src/lib/leadFilterArg.ts
|
|
29890
|
-
import { z as
|
|
30531
|
+
import { z as z48 } from "zod";
|
|
29891
30532
|
var FILTER_EXAMPLE = `--filter '[{"field":"title","operator":"contains","value":"vp"}]'`;
|
|
29892
30533
|
function parseLeadFilterArg(raw) {
|
|
29893
30534
|
let value;
|
|
@@ -29897,7 +30538,7 @@ function parseLeadFilterArg(raw) {
|
|
|
29897
30538
|
printError(`Invalid --filter: not valid JSON. Example: ${FILTER_EXAMPLE}`);
|
|
29898
30539
|
exit(ExitCode.InternalError);
|
|
29899
30540
|
}
|
|
29900
|
-
const parsed =
|
|
30541
|
+
const parsed = z48.array(LeadFilterConditionSchema).safeParse(value);
|
|
29901
30542
|
if (!parsed.success) {
|
|
29902
30543
|
const issue = parsed.error.issues[0];
|
|
29903
30544
|
const path = issue?.path.map(String).join(".");
|
|
@@ -30151,19 +30792,30 @@ async function executeCompaniesSearch(query, opts) {
|
|
|
30151
30792
|
}
|
|
30152
30793
|
}
|
|
30153
30794
|
|
|
30154
|
-
// src/
|
|
30155
|
-
|
|
30156
|
-
|
|
30157
|
-
|
|
30158
|
-
|
|
30795
|
+
// src/lib/crmEntityTypeArg.ts
|
|
30796
|
+
var CRM_ENTITY_TYPE_WORDS = `${CRM_ENTITY_TYPES.slice(0, -1).join(", ")}, or ${CRM_ENTITY_TYPES[CRM_ENTITY_TYPES.length - 1]}`;
|
|
30797
|
+
function crmEntityTypeOrExit(value) {
|
|
30798
|
+
const parsed = CrmEntityTypeSchema.safeParse(value);
|
|
30799
|
+
if (!parsed.success) {
|
|
30800
|
+
printError(
|
|
30801
|
+
`Unknown record type "${value}". Expected ${CRM_ENTITY_TYPE_WORDS}.`
|
|
30802
|
+
);
|
|
30159
30803
|
exit(ExitCode.InternalError);
|
|
30160
30804
|
}
|
|
30161
|
-
return
|
|
30805
|
+
return parsed.data;
|
|
30806
|
+
}
|
|
30807
|
+
function optionalCrmEntityTypeOrExit(value) {
|
|
30808
|
+
return value === void 0 ? void 0 : crmEntityTypeOrExit(value);
|
|
30162
30809
|
}
|
|
30810
|
+
|
|
30811
|
+
// src/commands/crm/lists.ts
|
|
30163
30812
|
function registerCrmLists(parent) {
|
|
30164
30813
|
const lists = parent.command("lists").description(
|
|
30165
30814
|
"List lead lists (default), or get / create / update / delete them and manage members."
|
|
30166
|
-
).option(
|
|
30815
|
+
).option(
|
|
30816
|
+
"--type <type>",
|
|
30817
|
+
`Only lists of one record type: ${CRM_ENTITY_TYPE_WORDS}.`
|
|
30818
|
+
).option("--json", "Machine-readable output.").action((opts) => executeListsList(opts));
|
|
30167
30819
|
lists.command("get").argument("<id>", "List id.").description("One list's record.").action(async (id) => {
|
|
30168
30820
|
try {
|
|
30169
30821
|
printJson(await crmService.getList(id));
|
|
@@ -30197,7 +30849,7 @@ function registerCrmLists(parent) {
|
|
|
30197
30849
|
exitOnApiError(error);
|
|
30198
30850
|
}
|
|
30199
30851
|
});
|
|
30200
|
-
lists.command("add").argument("<listId>", "List id.").argument("<entityIds...>", "Person or company ids to add.").description("Add
|
|
30852
|
+
lists.command("add").argument("<listId>", "List id.").argument("<entityIds...>", "Person or company ids to add.").description("Add records of the list's type to it.").action(async (listId, entityIds) => {
|
|
30201
30853
|
try {
|
|
30202
30854
|
const { added } = await crmService.addListMembers(listId, entityIds);
|
|
30203
30855
|
printSuccess(`Added ${added} member(s) to the list.`);
|
|
@@ -30215,7 +30867,7 @@ function registerCrmLists(parent) {
|
|
|
30215
30867
|
});
|
|
30216
30868
|
}
|
|
30217
30869
|
async function executeListsList(opts) {
|
|
30218
|
-
const type =
|
|
30870
|
+
const type = optionalCrmEntityTypeOrExit(opts.type);
|
|
30219
30871
|
try {
|
|
30220
30872
|
const lists = await crmService.listLists(type);
|
|
30221
30873
|
if (opts.json) {
|
|
@@ -30231,7 +30883,7 @@ async function executeListsList(opts) {
|
|
|
30231
30883
|
lists.map((list) => [
|
|
30232
30884
|
list.id,
|
|
30233
30885
|
list.name,
|
|
30234
|
-
list.
|
|
30886
|
+
list.entityType,
|
|
30235
30887
|
list.memberCount.toString(),
|
|
30236
30888
|
list.purpose ?? ""
|
|
30237
30889
|
]),
|
|
@@ -30243,18 +30895,13 @@ async function executeListsList(opts) {
|
|
|
30243
30895
|
}
|
|
30244
30896
|
|
|
30245
30897
|
// src/commands/crm/tags.ts
|
|
30246
|
-
function tagTypeOrExit(value) {
|
|
30247
|
-
if (value === void 0) return void 0;
|
|
30248
|
-
if (value !== "person" && value !== "company") {
|
|
30249
|
-
printError(`Unknown --type "${value}". Expected person or company.`);
|
|
30250
|
-
exit(ExitCode.InternalError);
|
|
30251
|
-
}
|
|
30252
|
-
return value;
|
|
30253
|
-
}
|
|
30254
30898
|
function registerCrmTags(parent) {
|
|
30255
30899
|
const tags = parent.command("tags").description(
|
|
30256
30900
|
"List tags (default), or create / update / delete them and assign to records."
|
|
30257
|
-
).option(
|
|
30901
|
+
).option(
|
|
30902
|
+
"--type <type>",
|
|
30903
|
+
`Only tags of one record type: ${CRM_ENTITY_TYPE_WORDS}.`
|
|
30904
|
+
).option("--json", "Machine-readable output.").action((opts) => executeTagsList(opts));
|
|
30258
30905
|
tags.command("create").description(
|
|
30259
30906
|
"Create a tag. --json: { name, entityType: person|company, color? }."
|
|
30260
30907
|
).requiredOption("--json <body>", "JSON tag definition.").action(async (opts) => {
|
|
@@ -30279,9 +30926,7 @@ function registerCrmTags(parent) {
|
|
|
30279
30926
|
exitOnApiError(error);
|
|
30280
30927
|
}
|
|
30281
30928
|
});
|
|
30282
|
-
tags.command("assign").argument("<tagId>", "Tag id.").argument("<entityIds...>", "Person or company ids to tag.").description(
|
|
30283
|
-
"Assign a tag to people or companies (ids must match the tag type)."
|
|
30284
|
-
).action(async (tagId, entityIds) => {
|
|
30929
|
+
tags.command("assign").argument("<tagId>", "Tag id.").argument("<entityIds...>", "Person or company ids to tag.").description("Assign a tag to records (ids must match the tag type).").action(async (tagId, entityIds) => {
|
|
30285
30930
|
try {
|
|
30286
30931
|
const { added } = await crmService.assignTag(tagId, entityIds);
|
|
30287
30932
|
printSuccess(`Tagged ${added} record(s).`);
|
|
@@ -30299,7 +30944,7 @@ function registerCrmTags(parent) {
|
|
|
30299
30944
|
});
|
|
30300
30945
|
}
|
|
30301
30946
|
async function executeTagsList(opts) {
|
|
30302
|
-
const entityType =
|
|
30947
|
+
const entityType = optionalCrmEntityTypeOrExit(opts.type);
|
|
30303
30948
|
try {
|
|
30304
30949
|
const tags = await crmService.listTags(entityType);
|
|
30305
30950
|
if (opts.json) {
|
|
@@ -30327,19 +30972,11 @@ async function executeTagsList(opts) {
|
|
|
30327
30972
|
}
|
|
30328
30973
|
|
|
30329
30974
|
// src/commands/crm/notes.ts
|
|
30330
|
-
var NOTE_ENTITY_TYPES = "person, company, or pipeline_card";
|
|
30331
|
-
function noteEntityTypeOrExit(value) {
|
|
30332
|
-
if (value !== "person" && value !== "company" && value !== "pipeline_card") {
|
|
30333
|
-
printError(`Unknown entity type "${value}". Expected ${NOTE_ENTITY_TYPES}.`);
|
|
30334
|
-
exit(ExitCode.InternalError);
|
|
30335
|
-
}
|
|
30336
|
-
return value;
|
|
30337
|
-
}
|
|
30338
30975
|
function registerCrmNotes(parent) {
|
|
30339
|
-
const notes = parent.command("notes").description(`Read and write notes on a record (${
|
|
30340
|
-
notes.command("list").argument("<entityType>",
|
|
30976
|
+
const notes = parent.command("notes").description(`Read and write notes on a record (${CRM_ENTITY_TYPE_WORDS}).`);
|
|
30977
|
+
notes.command("list").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<entityId>", "The record id.").description("A record's notes, newest first.").option("--json", "Machine-readable output.").action(
|
|
30341
30978
|
async (entityType, entityId, opts) => {
|
|
30342
|
-
const type =
|
|
30979
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
30343
30980
|
try {
|
|
30344
30981
|
const notesList = await crmService.listNotes(type, entityId);
|
|
30345
30982
|
if (opts.json) {
|
|
@@ -30365,9 +31002,9 @@ function registerCrmNotes(parent) {
|
|
|
30365
31002
|
}
|
|
30366
31003
|
}
|
|
30367
31004
|
);
|
|
30368
|
-
notes.command("create").argument("<entityType>",
|
|
31005
|
+
notes.command("create").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<entityId>", "The record id.").description("Add a note to a record.").requiredOption("--body <text>", "The note text.").action(
|
|
30369
31006
|
async (entityType, entityId, opts) => {
|
|
30370
|
-
const type =
|
|
31007
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
30371
31008
|
try {
|
|
30372
31009
|
printJson(
|
|
30373
31010
|
await crmService.createNote(type, entityId, { body: opts.body })
|
|
@@ -30377,16 +31014,16 @@ function registerCrmNotes(parent) {
|
|
|
30377
31014
|
}
|
|
30378
31015
|
}
|
|
30379
31016
|
);
|
|
30380
|
-
notes.command("update").argument("<entityType>",
|
|
30381
|
-
const type =
|
|
31017
|
+
notes.command("update").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<id>", "Note id.").description("Edit a note.").requiredOption("--body <text>", "The new note text.").action(async (entityType, id, opts) => {
|
|
31018
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
30382
31019
|
try {
|
|
30383
31020
|
printJson(await crmService.updateNote(type, id, { body: opts.body }));
|
|
30384
31021
|
} catch (error) {
|
|
30385
31022
|
exitOnApiError(error);
|
|
30386
31023
|
}
|
|
30387
31024
|
});
|
|
30388
|
-
notes.command("delete").argument("<entityType>",
|
|
30389
|
-
const type =
|
|
31025
|
+
notes.command("delete").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<id>", "Note id.").description("Delete a note.").action(async (entityType, id) => {
|
|
31026
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
30390
31027
|
try {
|
|
30391
31028
|
await crmService.deleteNote(type, id);
|
|
30392
31029
|
printSuccess(`Deleted note ${id}.`);
|
|
@@ -30912,23 +31549,16 @@ function registerCrmTouchpoints(parent) {
|
|
|
30912
31549
|
}
|
|
30913
31550
|
|
|
30914
31551
|
// src/commands/crm/fields.ts
|
|
30915
|
-
var FIELD_ENTITY_TYPES = "person, company, or card";
|
|
30916
|
-
function fieldEntityTypeOrExit(value) {
|
|
30917
|
-
if (value !== "person" && value !== "company" && value !== "card") {
|
|
30918
|
-
printError(
|
|
30919
|
-
`Unknown entity type "${value}". Expected ${FIELD_ENTITY_TYPES}.`
|
|
30920
|
-
);
|
|
30921
|
-
exit(ExitCode.InternalError);
|
|
30922
|
-
}
|
|
30923
|
-
return value;
|
|
30924
|
-
}
|
|
30925
31552
|
function registerCrmFields(parent) {
|
|
30926
31553
|
const fields = parent.command("fields").description("List and manage custom field definitions.");
|
|
30927
|
-
fields.command("list").argument("<entityType>",
|
|
31554
|
+
fields.command("list").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).description(
|
|
30928
31555
|
"A entity's custom field definitions. Card fields are per-pipeline."
|
|
30929
|
-
).option(
|
|
31556
|
+
).option(
|
|
31557
|
+
"--pipeline <id>",
|
|
31558
|
+
"Pipeline id (required for pipeline_card fields)."
|
|
31559
|
+
).option("--json", "Machine-readable output.").action(
|
|
30930
31560
|
async (entityType, opts) => {
|
|
30931
|
-
const type =
|
|
31561
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
30932
31562
|
try {
|
|
30933
31563
|
const definitions = await crmService.listCustomFields(
|
|
30934
31564
|
type,
|
|
@@ -30959,7 +31589,7 @@ function registerCrmFields(parent) {
|
|
|
30959
31589
|
}
|
|
30960
31590
|
);
|
|
30961
31591
|
fields.command("create").description(
|
|
30962
|
-
|
|
31592
|
+
`Create a custom field. --json: { entityType, label, fieldType, scopeId? (pipeline id, for pipeline_card fields), options? (select and status types), ... }. fieldType: ${CustomFieldTypeSchema.options.join(", ")}.`
|
|
30963
31593
|
).requiredOption("--json <body>", "JSON field definition.").action(async (opts) => {
|
|
30964
31594
|
try {
|
|
30965
31595
|
printJson(
|
|
@@ -31210,6 +31840,623 @@ function registerCrmEnrich(parent) {
|
|
|
31210
31840
|
});
|
|
31211
31841
|
}
|
|
31212
31842
|
|
|
31843
|
+
// src/commands/crm/history.ts
|
|
31844
|
+
function describeChange(event) {
|
|
31845
|
+
const field = event.field ? `${event.field} ` : "";
|
|
31846
|
+
const change = event.fromLabel || event.toLabel ? `${event.fromLabel ?? "\u2014"} \u2192 ${event.toLabel ?? "\u2014"}` : "";
|
|
31847
|
+
return `${field}${change}`.trim();
|
|
31848
|
+
}
|
|
31849
|
+
function printEvents(events) {
|
|
31850
|
+
printTable(
|
|
31851
|
+
["ID", "AT", "RECORD", "KIND", "CHANGE", "BY"],
|
|
31852
|
+
events.map((event) => [
|
|
31853
|
+
event.id,
|
|
31854
|
+
event.at.slice(0, 19).replace("T", " "),
|
|
31855
|
+
`${event.entityType} ${event.entityId}`,
|
|
31856
|
+
event.kind,
|
|
31857
|
+
describeChange(event).slice(0, 80),
|
|
31858
|
+
event.actorName ?? event.actorKind
|
|
31859
|
+
]),
|
|
31860
|
+
{ colorFn: dimColumn(0) }
|
|
31861
|
+
);
|
|
31862
|
+
}
|
|
31863
|
+
function registerCrmHistory(parent) {
|
|
31864
|
+
const history = parent.command("history").description(
|
|
31865
|
+
`A record's change history, or the workspace's event feed. Record types: ${CRM_ENTITY_TYPE_WORDS}.`
|
|
31866
|
+
).argument("[entityType]", CRM_ENTITY_TYPE_WORDS).argument("[entityId]", "The record id.").option("--json", "Machine-readable output.").action(
|
|
31867
|
+
async (entityType, entityId, opts) => {
|
|
31868
|
+
if (!entityType || !entityId) {
|
|
31869
|
+
printError(
|
|
31870
|
+
"Name a record: geni crm history <entityType> <entityId>, or read the feed with geni crm history feed."
|
|
31871
|
+
);
|
|
31872
|
+
exit(ExitCode.InternalError);
|
|
31873
|
+
}
|
|
31874
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
31875
|
+
try {
|
|
31876
|
+
const events = await crmService.listRecordHistory(type, entityId);
|
|
31877
|
+
if (opts.json) {
|
|
31878
|
+
printJson({ events });
|
|
31879
|
+
return;
|
|
31880
|
+
}
|
|
31881
|
+
if (events.length === 0) {
|
|
31882
|
+
process.stdout.write("No history yet.\n");
|
|
31883
|
+
return;
|
|
31884
|
+
}
|
|
31885
|
+
printEvents(events);
|
|
31886
|
+
} catch (error) {
|
|
31887
|
+
exitOnApiError(error);
|
|
31888
|
+
}
|
|
31889
|
+
}
|
|
31890
|
+
);
|
|
31891
|
+
history.command("feed").description(
|
|
31892
|
+
"The workspace's events after --after, oldest first. Without --after, the latest events. Pass the printed cursor back as --after to read on."
|
|
31893
|
+
).option("--after <cursor>", "The cursor a previous read printed.").option("--limit <n>", "Events to read (1-500).", "100").option("--json", "Machine-readable output.").action(async (opts) => {
|
|
31894
|
+
const limit = Number(opts.limit);
|
|
31895
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 500) {
|
|
31896
|
+
printError("--limit must be a whole number from 1 to 500.");
|
|
31897
|
+
exit(ExitCode.InternalError);
|
|
31898
|
+
}
|
|
31899
|
+
try {
|
|
31900
|
+
const feed = await crmService.listRecordEvents({
|
|
31901
|
+
after: opts.after ?? null,
|
|
31902
|
+
limit
|
|
31903
|
+
});
|
|
31904
|
+
if (opts.json) {
|
|
31905
|
+
printJson(feed);
|
|
31906
|
+
return;
|
|
31907
|
+
}
|
|
31908
|
+
if (feed.events.length > 0) printEvents(feed.events);
|
|
31909
|
+
process.stdout.write(
|
|
31910
|
+
`cursor: ${feed.cursor}${feed.hasMore ? " (more to read)" : ""}
|
|
31911
|
+
`
|
|
31912
|
+
);
|
|
31913
|
+
} catch (error) {
|
|
31914
|
+
exitOnApiError(error);
|
|
31915
|
+
}
|
|
31916
|
+
});
|
|
31917
|
+
}
|
|
31918
|
+
|
|
31919
|
+
// src/commands/crm/activities.ts
|
|
31920
|
+
var KIND_WORDS2 = ActivityKindSchema.options.join(", ");
|
|
31921
|
+
function kindsOrExit(values) {
|
|
31922
|
+
return values.map((value) => {
|
|
31923
|
+
const parsed = ActivityKindSchema.safeParse(value);
|
|
31924
|
+
if (!parsed.success) {
|
|
31925
|
+
printError(`Unknown --kind "${value}". Expected one of: ${KIND_WORDS2}.`);
|
|
31926
|
+
exit(ExitCode.InternalError);
|
|
31927
|
+
}
|
|
31928
|
+
return parsed.data;
|
|
31929
|
+
});
|
|
31930
|
+
}
|
|
31931
|
+
function registerCrmActivities(parent) {
|
|
31932
|
+
const activities = parent.command("activities").description(
|
|
31933
|
+
`Notes, calls, emails, and meetings on records (${CRM_ENTITY_TYPE_WORDS}). Kinds: ${KIND_WORDS2}.`
|
|
31934
|
+
);
|
|
31935
|
+
activities.command("list").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<entityId>", "The record id.").description("A record's activities, newest first.").option("--kind <kind...>", `Only these kinds: ${KIND_WORDS2}.`).option("--json", "Machine-readable output.").action(
|
|
31936
|
+
async (entityType, entityId, opts) => {
|
|
31937
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
31938
|
+
const kinds = kindsOrExit(opts.kind ?? []);
|
|
31939
|
+
try {
|
|
31940
|
+
const list = await crmService.listActivities({
|
|
31941
|
+
entityType: type,
|
|
31942
|
+
entityId,
|
|
31943
|
+
kinds
|
|
31944
|
+
});
|
|
31945
|
+
if (opts.json) {
|
|
31946
|
+
printJson({ activities: list });
|
|
31947
|
+
return;
|
|
31948
|
+
}
|
|
31949
|
+
if (list.length === 0) {
|
|
31950
|
+
process.stdout.write("No activities yet.\n");
|
|
31951
|
+
return;
|
|
31952
|
+
}
|
|
31953
|
+
printTable(
|
|
31954
|
+
["ID", "WHEN", "KIND", "SUBJECT / BODY", "LINKED", "BY"],
|
|
31955
|
+
list.map((activity) => [
|
|
31956
|
+
activity.id,
|
|
31957
|
+
activity.occurredAt.slice(0, 16).replace("T", " "),
|
|
31958
|
+
activity.kind,
|
|
31959
|
+
(activity.subject ?? activity.body ?? "").replace(/\s+/g, " ").slice(0, 60),
|
|
31960
|
+
activity.links.map((link) => link.label ?? link.type).join(", ").slice(0, 40),
|
|
31961
|
+
activity.authorName ?? ""
|
|
31962
|
+
]),
|
|
31963
|
+
{ colorFn: dimColumn(0) }
|
|
31964
|
+
);
|
|
31965
|
+
} catch (error) {
|
|
31966
|
+
exitOnApiError(error);
|
|
31967
|
+
}
|
|
31968
|
+
}
|
|
31969
|
+
);
|
|
31970
|
+
activities.command("get").argument("<id>", "Activity id.").description("One activity with its links.").action(async (id) => {
|
|
31971
|
+
try {
|
|
31972
|
+
printJson(await crmService.getActivity(id));
|
|
31973
|
+
} catch (error) {
|
|
31974
|
+
exitOnApiError(error);
|
|
31975
|
+
}
|
|
31976
|
+
});
|
|
31977
|
+
activities.command("log").description(
|
|
31978
|
+
"Log an activity. --json: { kind, links: [{ type, id }], occurredAt?, direction?, subject?, body?, externalRef?, externalUrl? }. A future occurredAt schedules it."
|
|
31979
|
+
).requiredOption("--json <body>", "JSON activity.").action(async (opts) => {
|
|
31980
|
+
try {
|
|
31981
|
+
printJson(await crmService.createActivity(parseJsonArg(opts.json)));
|
|
31982
|
+
} catch (error) {
|
|
31983
|
+
exitOnApiError(error);
|
|
31984
|
+
}
|
|
31985
|
+
});
|
|
31986
|
+
activities.command("sync").description(
|
|
31987
|
+
"Create or update the activity an externalRef names (an email Message-ID, a call id), merging its links. --json: the log body with externalRef required."
|
|
31988
|
+
).requiredOption("--json <body>", "JSON activity.").action(async (opts) => {
|
|
31989
|
+
try {
|
|
31990
|
+
printJson(await crmService.upsertActivity(parseJsonArg(opts.json)));
|
|
31991
|
+
} catch (error) {
|
|
31992
|
+
exitOnApiError(error);
|
|
31993
|
+
}
|
|
31994
|
+
});
|
|
31995
|
+
activities.command("update").argument("<id>", "Activity id.").description(
|
|
31996
|
+
"Edit an activity you wrote. --json: any of { kind, direction, occurredAt, subject, body, externalUrl, links } (links replaces every link)."
|
|
31997
|
+
).requiredOption("--json <body>", "JSON patch.").action(async (id, opts) => {
|
|
31998
|
+
try {
|
|
31999
|
+
printJson(await crmService.updateActivity(id, parseJsonArg(opts.json)));
|
|
32000
|
+
} catch (error) {
|
|
32001
|
+
exitOnApiError(error);
|
|
32002
|
+
}
|
|
32003
|
+
});
|
|
32004
|
+
activities.command("delete").argument("<id>", "Activity id.").description("Delete an activity you wrote.").action(async (id) => {
|
|
32005
|
+
try {
|
|
32006
|
+
await crmService.deleteActivity(id);
|
|
32007
|
+
printSuccess(`Deleted activity ${id}`);
|
|
32008
|
+
} catch (error) {
|
|
32009
|
+
exitOnApiError(error);
|
|
32010
|
+
}
|
|
32011
|
+
});
|
|
32012
|
+
}
|
|
32013
|
+
|
|
32014
|
+
// src/commands/crm/files.ts
|
|
32015
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
32016
|
+
import { basename as basename2, extname } from "path";
|
|
32017
|
+
var MIME_BY_EXTENSION = {
|
|
32018
|
+
".pdf": "application/pdf",
|
|
32019
|
+
".doc": "application/msword",
|
|
32020
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
32021
|
+
".txt": "text/plain",
|
|
32022
|
+
".md": "text/markdown",
|
|
32023
|
+
".csv": "text/csv",
|
|
32024
|
+
".json": "application/json",
|
|
32025
|
+
".png": "image/png",
|
|
32026
|
+
".jpg": "image/jpeg",
|
|
32027
|
+
".jpeg": "image/jpeg"
|
|
32028
|
+
};
|
|
32029
|
+
var KIND_WORDS3 = CrmFileKindSchema.options.join(", ");
|
|
32030
|
+
function registerCrmFiles(parent) {
|
|
32031
|
+
const files = parent.command("files").description(`Files on records (${CRM_ENTITY_TYPE_WORDS}).`);
|
|
32032
|
+
files.command("list").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<entityId>", "The record id.").description("A record's files, newest first.").option("--json", "Machine-readable output.").action(
|
|
32033
|
+
async (entityType, entityId, opts) => {
|
|
32034
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
32035
|
+
try {
|
|
32036
|
+
const list = await crmService.listRecordFiles(type, entityId);
|
|
32037
|
+
if (opts.json) {
|
|
32038
|
+
printJson({ files: list });
|
|
32039
|
+
return;
|
|
32040
|
+
}
|
|
32041
|
+
if (list.length === 0) {
|
|
32042
|
+
process.stdout.write("No files yet.\n");
|
|
32043
|
+
return;
|
|
32044
|
+
}
|
|
32045
|
+
printTable(
|
|
32046
|
+
["ID", "NAME", "KIND", "SIZE", "UPLOADED"],
|
|
32047
|
+
list.map((file) => [
|
|
32048
|
+
file.id,
|
|
32049
|
+
file.name,
|
|
32050
|
+
file.kind,
|
|
32051
|
+
`${Math.max(1, Math.round(file.sizeBytes / 1024))} KB`,
|
|
32052
|
+
file.createdAt.slice(0, 10)
|
|
32053
|
+
]),
|
|
32054
|
+
{ colorFn: dimColumn(0) }
|
|
32055
|
+
);
|
|
32056
|
+
} catch (error) {
|
|
32057
|
+
exitOnApiError(error);
|
|
32058
|
+
}
|
|
32059
|
+
}
|
|
32060
|
+
);
|
|
32061
|
+
files.command("upload").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).argument("<entityId>", "The record id.").argument("<path>", "The file to attach (up to 25 MB).").description("Attach a file to a record.").option("--kind <kind>", `One of: ${KIND_WORDS3}.`, "document").option("--name <name>", "The name to file it under (default: its own).").action(
|
|
32062
|
+
async (entityType, entityId, path, opts) => {
|
|
32063
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
32064
|
+
const kind = CrmFileKindSchema.safeParse(opts.kind);
|
|
32065
|
+
if (!kind.success) {
|
|
32066
|
+
printError(
|
|
32067
|
+
`Unknown --kind "${opts.kind}". Expected one of: ${KIND_WORDS3}.`
|
|
32068
|
+
);
|
|
32069
|
+
exit(ExitCode.InternalError);
|
|
32070
|
+
}
|
|
32071
|
+
const content = await readFile3(path);
|
|
32072
|
+
try {
|
|
32073
|
+
printJson(
|
|
32074
|
+
await crmService.uploadRecordFile({
|
|
32075
|
+
entityType: type,
|
|
32076
|
+
entityId,
|
|
32077
|
+
name: opts.name ?? basename2(path),
|
|
32078
|
+
mimeType: MIME_BY_EXTENSION[extname(path).toLowerCase()] ?? "application/octet-stream",
|
|
32079
|
+
kind: kind.data,
|
|
32080
|
+
content
|
|
32081
|
+
})
|
|
32082
|
+
);
|
|
32083
|
+
} catch (error) {
|
|
32084
|
+
exitOnApiError(error);
|
|
32085
|
+
}
|
|
32086
|
+
}
|
|
32087
|
+
);
|
|
32088
|
+
files.command("download").argument("<id>", "File id.").description("A short-lived link to the file.").action(async (id) => {
|
|
32089
|
+
try {
|
|
32090
|
+
process.stdout.write(`${(await crmService.getFileDownload(id)).url}
|
|
32091
|
+
`);
|
|
32092
|
+
} catch (error) {
|
|
32093
|
+
exitOnApiError(error);
|
|
32094
|
+
}
|
|
32095
|
+
});
|
|
32096
|
+
files.command("text").argument("<id>", "File id.").description("A text file's contents, as the server read them.").action(async (id) => {
|
|
32097
|
+
try {
|
|
32098
|
+
const { text } = await crmService.getFileText(id);
|
|
32099
|
+
if (text === null) {
|
|
32100
|
+
printError(
|
|
32101
|
+
"This file is not text the server could read. Download it instead."
|
|
32102
|
+
);
|
|
32103
|
+
exit(ExitCode.InternalError);
|
|
32104
|
+
}
|
|
32105
|
+
process.stdout.write(`${text}
|
|
32106
|
+
`);
|
|
32107
|
+
} catch (error) {
|
|
32108
|
+
exitOnApiError(error);
|
|
32109
|
+
}
|
|
32110
|
+
});
|
|
32111
|
+
files.command("delete").argument("<id>", "File id.").description("Delete a file you uploaded.").action(async (id) => {
|
|
32112
|
+
try {
|
|
32113
|
+
await crmService.deleteFile(id);
|
|
32114
|
+
printSuccess(`Deleted file ${id}`);
|
|
32115
|
+
} catch (error) {
|
|
32116
|
+
exitOnApiError(error);
|
|
32117
|
+
}
|
|
32118
|
+
});
|
|
32119
|
+
}
|
|
32120
|
+
|
|
32121
|
+
// src/commands/crm/views.ts
|
|
32122
|
+
function registerCrmViews(parent) {
|
|
32123
|
+
const views = parent.command("views").description(`Saved views of a record type (${CRM_ENTITY_TYPE_WORDS}).`);
|
|
32124
|
+
views.command("list").argument("<entityType>", CRM_ENTITY_TYPE_WORDS).option("--pipeline <id>", "The pipeline, for pipeline_card views.").option("--json", "Machine-readable output.").description("Your views and the shared ones.").action(
|
|
32125
|
+
async (entityType, opts) => {
|
|
32126
|
+
const type = crmEntityTypeOrExit(entityType);
|
|
32127
|
+
try {
|
|
32128
|
+
const list = await crmService.listSavedViews({
|
|
32129
|
+
entityType: type,
|
|
32130
|
+
pipelineId: opts.pipeline ?? null
|
|
32131
|
+
});
|
|
32132
|
+
if (opts.json) {
|
|
32133
|
+
printJson({ views: list });
|
|
32134
|
+
return;
|
|
32135
|
+
}
|
|
32136
|
+
if (list.length === 0) {
|
|
32137
|
+
process.stdout.write("No saved views yet.\n");
|
|
32138
|
+
return;
|
|
32139
|
+
}
|
|
32140
|
+
printTable(
|
|
32141
|
+
["ID", "NAME", "SHARED", "FILTERS", "BY"],
|
|
32142
|
+
list.map((view) => [
|
|
32143
|
+
view.id,
|
|
32144
|
+
view.name,
|
|
32145
|
+
view.isShared ? "yes" : "no",
|
|
32146
|
+
String(view.config.filters.length),
|
|
32147
|
+
view.ownerName ?? ""
|
|
32148
|
+
]),
|
|
32149
|
+
{ colorFn: dimColumn(0) }
|
|
32150
|
+
);
|
|
32151
|
+
} catch (error) {
|
|
32152
|
+
exitOnApiError(error);
|
|
32153
|
+
}
|
|
32154
|
+
}
|
|
32155
|
+
);
|
|
32156
|
+
views.command("create").description(
|
|
32157
|
+
'Save a view. --json: { entityType, pipelineId? (pipeline_card only), name, isShared, config: { filters: [{ field, operator, value }], sort: { field, direction } | null, columns: [..] | null, layout: "table" | "board" | null } }.'
|
|
32158
|
+
).requiredOption("--json <body>", "JSON view.").action(async (opts) => {
|
|
32159
|
+
try {
|
|
32160
|
+
printJson(await crmService.createSavedView(parseJsonArg(opts.json)));
|
|
32161
|
+
} catch (error) {
|
|
32162
|
+
exitOnApiError(error);
|
|
32163
|
+
}
|
|
32164
|
+
});
|
|
32165
|
+
views.command("update").argument("<id>", "View id.").description(
|
|
32166
|
+
"Change a view you made. --json: any of { name, isShared, config, position }."
|
|
32167
|
+
).requiredOption("--json <body>", "JSON patch.").action(async (id, opts) => {
|
|
32168
|
+
try {
|
|
32169
|
+
printJson(await crmService.updateSavedView(id, parseJsonArg(opts.json)));
|
|
32170
|
+
} catch (error) {
|
|
32171
|
+
exitOnApiError(error);
|
|
32172
|
+
}
|
|
32173
|
+
});
|
|
32174
|
+
views.command("delete").argument("<id>", "View id.").description("Delete a view you made.").action(async (id) => {
|
|
32175
|
+
try {
|
|
32176
|
+
await crmService.deleteSavedView(id);
|
|
32177
|
+
printSuccess(`Deleted view ${id}`);
|
|
32178
|
+
} catch (error) {
|
|
32179
|
+
exitOnApiError(error);
|
|
32180
|
+
}
|
|
32181
|
+
});
|
|
32182
|
+
}
|
|
32183
|
+
|
|
32184
|
+
// src/commands/crm/imports.ts
|
|
32185
|
+
import { readFile as readFile4 } from "fs/promises";
|
|
32186
|
+
var POLL_MS = 2e3;
|
|
32187
|
+
function registerCrmImport(parent) {
|
|
32188
|
+
const imports = parent.command("import").description(
|
|
32189
|
+
"Import people or companies from a CSV. Preview first with --dry-run; a matching row fills in what its record lacks and never overwrites it."
|
|
32190
|
+
);
|
|
32191
|
+
for (const [noun, entityType] of [
|
|
32192
|
+
["people", "person"],
|
|
32193
|
+
["companies", "company"]
|
|
32194
|
+
]) {
|
|
32195
|
+
imports.command(noun).argument("<file>", "Path to a CSV file with a header row.").description(`Import ${noun} from a CSV.`).option(
|
|
32196
|
+
"--map <json>",
|
|
32197
|
+
`Column to field, e.g. '{"Work Email":"email","Stage":"custom.stage"}'. "" skips a column. Defaults to the suggested mapping.`
|
|
32198
|
+
).option("--list <listId>", `A list of ${noun} every imported row joins.`).option(
|
|
32199
|
+
"--tag <tagId>",
|
|
32200
|
+
"A tag every imported row gets (repeatable).",
|
|
32201
|
+
(value, previous = []) => [...previous, value]
|
|
32202
|
+
).option(
|
|
32203
|
+
"--dry-run",
|
|
32204
|
+
"Show the mapping, the fields, and the first rows with any errors; import nothing."
|
|
32205
|
+
).option("--wait", "Wait for the import to finish and print the result.").option("--json", "Machine-readable output.").action(async (file, opts) => {
|
|
32206
|
+
let csv;
|
|
32207
|
+
try {
|
|
32208
|
+
csv = await readFile4(file, "utf-8");
|
|
32209
|
+
} catch {
|
|
32210
|
+
printError(`Could not read ${file}.`);
|
|
32211
|
+
exit(ExitCode.InternalError);
|
|
32212
|
+
}
|
|
32213
|
+
const mapping = opts.map ? parseJsonObjectArg(opts.map) : void 0;
|
|
32214
|
+
try {
|
|
32215
|
+
const preview = await crmService.previewImport({
|
|
32216
|
+
entityType,
|
|
32217
|
+
csv,
|
|
32218
|
+
mapping
|
|
32219
|
+
});
|
|
32220
|
+
if (opts.dryRun) {
|
|
32221
|
+
if (opts.json) printJson(preview);
|
|
32222
|
+
else printPreview(preview);
|
|
32223
|
+
return;
|
|
32224
|
+
}
|
|
32225
|
+
let run2 = await crmService.startImport({
|
|
32226
|
+
entityType,
|
|
32227
|
+
csv,
|
|
32228
|
+
mapping: preview.mapping,
|
|
32229
|
+
listId: opts.list,
|
|
32230
|
+
tagIds: opts.tag
|
|
32231
|
+
});
|
|
32232
|
+
while (opts.wait && isActive(run2)) {
|
|
32233
|
+
await new Promise((resolve32) => setTimeout(resolve32, POLL_MS));
|
|
32234
|
+
run2 = await crmService.getImport(run2.id);
|
|
32235
|
+
}
|
|
32236
|
+
if (opts.json) printJson(run2);
|
|
32237
|
+
else printRun(run2);
|
|
32238
|
+
} catch (error) {
|
|
32239
|
+
exitOnApiError(error);
|
|
32240
|
+
}
|
|
32241
|
+
});
|
|
32242
|
+
}
|
|
32243
|
+
imports.command("status").argument("<importId>", "Import id.").description("An import's progress, counts, and the rows that failed.").option("--json", "Machine-readable output.").action(async (importId, opts) => {
|
|
32244
|
+
try {
|
|
32245
|
+
const run2 = await crmService.getImport(importId);
|
|
32246
|
+
if (opts.json) printJson(run2);
|
|
32247
|
+
else printRun(run2);
|
|
32248
|
+
} catch (error) {
|
|
32249
|
+
exitOnApiError(error);
|
|
32250
|
+
}
|
|
32251
|
+
});
|
|
32252
|
+
imports.command("list").description("Your recent imports, newest first.").option("--json", "Machine-readable output.").action(async (opts) => {
|
|
32253
|
+
try {
|
|
32254
|
+
const runs = await crmService.listImports();
|
|
32255
|
+
if (opts.json) {
|
|
32256
|
+
printJson({ imports: runs });
|
|
32257
|
+
return;
|
|
32258
|
+
}
|
|
32259
|
+
if (runs.length === 0) {
|
|
32260
|
+
process.stdout.write("No imports yet.\n");
|
|
32261
|
+
return;
|
|
32262
|
+
}
|
|
32263
|
+
printTable(
|
|
32264
|
+
["ID", "TYPE", "STATUS", "ROWS", "CREATED", "MATCHED", "FAILED"],
|
|
32265
|
+
runs.map((run2) => [
|
|
32266
|
+
run2.id,
|
|
32267
|
+
run2.entityType,
|
|
32268
|
+
run2.status,
|
|
32269
|
+
`${run2.processedRows}/${run2.totalRows}`,
|
|
32270
|
+
String(run2.createdCount),
|
|
32271
|
+
String(run2.matchedCount),
|
|
32272
|
+
String(run2.failedCount)
|
|
32273
|
+
])
|
|
32274
|
+
);
|
|
32275
|
+
} catch (error) {
|
|
32276
|
+
exitOnApiError(error);
|
|
32277
|
+
}
|
|
32278
|
+
});
|
|
32279
|
+
}
|
|
32280
|
+
function registerCrmMatch(parent) {
|
|
32281
|
+
parent.command("match").argument("<emails...>", "Email addresses, any spelling.").description(
|
|
32282
|
+
"The people these addresses belong to, by email identity or any email contact point."
|
|
32283
|
+
).action(async (emails) => {
|
|
32284
|
+
try {
|
|
32285
|
+
printJson(await crmService.matchPeople(emails));
|
|
32286
|
+
} catch (error) {
|
|
32287
|
+
exitOnApiError(error);
|
|
32288
|
+
}
|
|
32289
|
+
});
|
|
32290
|
+
}
|
|
32291
|
+
function isActive(run2) {
|
|
32292
|
+
return run2.status === "pending" || run2.status === "running";
|
|
32293
|
+
}
|
|
32294
|
+
function printPreview(preview) {
|
|
32295
|
+
const labels = new Map(
|
|
32296
|
+
preview.fields.map((field) => [field.key, field.label])
|
|
32297
|
+
);
|
|
32298
|
+
process.stdout.write(`${preview.totalRows} rows. Mapping:
|
|
32299
|
+
`);
|
|
32300
|
+
printTable(
|
|
32301
|
+
["COLUMN", "FIELD"],
|
|
32302
|
+
preview.columns.map((column) => {
|
|
32303
|
+
const target = preview.mapping[column] ?? "";
|
|
32304
|
+
return [
|
|
32305
|
+
column,
|
|
32306
|
+
target ? `${labels.get(target) ?? target} (${target})` : "-"
|
|
32307
|
+
];
|
|
32308
|
+
})
|
|
32309
|
+
);
|
|
32310
|
+
const failing = preview.rows.filter((row) => row.error !== null);
|
|
32311
|
+
if (failing.length === 0) {
|
|
32312
|
+
process.stdout.write(
|
|
32313
|
+
`The first ${preview.rows.length} rows import cleanly.
|
|
32314
|
+
`
|
|
32315
|
+
);
|
|
32316
|
+
return;
|
|
32317
|
+
}
|
|
32318
|
+
process.stdout.write("Rows that would not import:\n");
|
|
32319
|
+
printTable(
|
|
32320
|
+
["ROW", "ERROR"],
|
|
32321
|
+
failing.map((row) => [String(row.rowNumber), row.error ?? ""])
|
|
32322
|
+
);
|
|
32323
|
+
}
|
|
32324
|
+
function printRun(run2) {
|
|
32325
|
+
process.stdout.write(
|
|
32326
|
+
`Import ${run2.id}: ${run2.status}, ${run2.processedRows}/${run2.totalRows} rows (${run2.createdCount} created, ${run2.matchedCount} matched, ${run2.failedCount} failed).
|
|
32327
|
+
`
|
|
32328
|
+
);
|
|
32329
|
+
if (run2.error) process.stdout.write(`${run2.error}
|
|
32330
|
+
`);
|
|
32331
|
+
if (run2.errors.length > 0) {
|
|
32332
|
+
printTable(
|
|
32333
|
+
["ROW", "ERROR"],
|
|
32334
|
+
run2.errors.map((row) => [String(row.rowNumber), row.error])
|
|
32335
|
+
);
|
|
32336
|
+
}
|
|
32337
|
+
if (isActive(run2)) {
|
|
32338
|
+
process.stdout.write(`Check on it with: geni crm import status ${run2.id}
|
|
32339
|
+
`);
|
|
32340
|
+
}
|
|
32341
|
+
}
|
|
32342
|
+
|
|
32343
|
+
// src/commands/crm/lifecycle.ts
|
|
32344
|
+
function registerCrmMerge(parent) {
|
|
32345
|
+
const merge = parent.command("merge").description(
|
|
32346
|
+
"Merge duplicates into one record, which takes their links, contacts, files, and history."
|
|
32347
|
+
);
|
|
32348
|
+
for (const [noun, entityType] of [
|
|
32349
|
+
["people", "person"],
|
|
32350
|
+
["companies", "company"]
|
|
32351
|
+
]) {
|
|
32352
|
+
merge.command(noun).argument("<keepId>", "The record to keep.").argument("<mergeIds...>", "The duplicates to merge into it.").description(`Merge duplicate ${noun} into the one kept.`).action(async (keepId, mergeIds) => {
|
|
32353
|
+
try {
|
|
32354
|
+
printJson(
|
|
32355
|
+
await crmService.mergeRecords(entityType, { keepId, mergeIds })
|
|
32356
|
+
);
|
|
32357
|
+
} catch (error) {
|
|
32358
|
+
exitOnApiError(error);
|
|
32359
|
+
}
|
|
32360
|
+
});
|
|
32361
|
+
}
|
|
32362
|
+
}
|
|
32363
|
+
function registerCrmConsent(parent) {
|
|
32364
|
+
const consent = parent.command("consent").description(
|
|
32365
|
+
"Who may be contacted. Check before any outreach: geni crm consent check <personId> --channel email."
|
|
32366
|
+
);
|
|
32367
|
+
consent.command("check").argument("<personId>", "Person id.").requiredOption("--channel <channel>", "email or phone.").description(
|
|
32368
|
+
"Whether outreach may contact a person on a channel, and at which addresses or numbers."
|
|
32369
|
+
).action(async (personId, opts) => {
|
|
32370
|
+
const channel = ContactChannelSchema.safeParse(opts.channel);
|
|
32371
|
+
if (!channel.success) {
|
|
32372
|
+
printError("--channel must be email or phone.");
|
|
32373
|
+
exit(ExitCode.InternalError);
|
|
32374
|
+
}
|
|
32375
|
+
try {
|
|
32376
|
+
printJson(
|
|
32377
|
+
await crmService.checkConsent({ personId, channel: channel.data })
|
|
32378
|
+
);
|
|
32379
|
+
} catch (error) {
|
|
32380
|
+
exitOnApiError(error);
|
|
32381
|
+
}
|
|
32382
|
+
});
|
|
32383
|
+
consent.command("do-not-contact").argument("<personId>", "Person id.").option("--reason <text>", 'Why, e.g. "Asked by reply".').option("--clear", "They may be contacted again.").description("Mark a person do not contact, or clear it.").action(
|
|
32384
|
+
async (personId, opts) => {
|
|
32385
|
+
try {
|
|
32386
|
+
printJson(
|
|
32387
|
+
await crmService.setDoNotContact(personId, {
|
|
32388
|
+
isDoNotContact: !opts.clear,
|
|
32389
|
+
reason: opts.reason ?? null
|
|
32390
|
+
})
|
|
32391
|
+
);
|
|
32392
|
+
} catch (error) {
|
|
32393
|
+
exitOnApiError(error);
|
|
32394
|
+
}
|
|
32395
|
+
}
|
|
32396
|
+
);
|
|
32397
|
+
consent.command("opt-out").argument("<contactPointId>", "Contact point id (an email or phone).").option("--reason <text>", 'Why, e.g. "Unsubscribed".').option("--clear", "It may be contacted again.").description("Opt one email or phone out of outreach, or back in.").action(
|
|
32398
|
+
async (contactPointId, opts) => {
|
|
32399
|
+
try {
|
|
32400
|
+
printJson(
|
|
32401
|
+
await crmService.setContactPointOptOut(contactPointId, {
|
|
32402
|
+
isOptedOut: !opts.clear,
|
|
32403
|
+
reason: opts.reason ?? null
|
|
32404
|
+
})
|
|
32405
|
+
);
|
|
32406
|
+
} catch (error) {
|
|
32407
|
+
exitOnApiError(error);
|
|
32408
|
+
}
|
|
32409
|
+
}
|
|
32410
|
+
);
|
|
32411
|
+
}
|
|
32412
|
+
function registerCrmPrivacy(parent) {
|
|
32413
|
+
const privacy = parent.command("privacy").description("A person's data: export it, or erase them for good.");
|
|
32414
|
+
privacy.command("export").argument("<personId>", "Person id.").description("Everything the CRM holds about a person, as JSON.").action(async (personId) => {
|
|
32415
|
+
try {
|
|
32416
|
+
printJson(await crmService.exportPerson(personId));
|
|
32417
|
+
} catch (error) {
|
|
32418
|
+
exitOnApiError(error);
|
|
32419
|
+
}
|
|
32420
|
+
});
|
|
32421
|
+
privacy.command("erase").argument("<personId>", "Person id.").option("--yes", "Confirm: this cannot be undone.").description(
|
|
32422
|
+
"Permanently delete a person, everyone merged into them, their files, and activities only they held."
|
|
32423
|
+
).action(async (personId, opts) => {
|
|
32424
|
+
if (!opts.yes) {
|
|
32425
|
+
printError("Erasing cannot be undone. Pass --yes to confirm.");
|
|
32426
|
+
exit(ExitCode.InternalError);
|
|
32427
|
+
}
|
|
32428
|
+
try {
|
|
32429
|
+
printJson(await crmService.erasePerson(personId));
|
|
32430
|
+
} catch (error) {
|
|
32431
|
+
exitOnApiError(error);
|
|
32432
|
+
}
|
|
32433
|
+
});
|
|
32434
|
+
}
|
|
32435
|
+
function registerCrmCredits(parent) {
|
|
32436
|
+
const credits = parent.command("credits").description("A card's credit splits.");
|
|
32437
|
+
credits.command("list").argument("<cardId>", "Card id.").action(async (cardId) => {
|
|
32438
|
+
try {
|
|
32439
|
+
printJson({ credits: await crmService.listCardCredits(cardId) });
|
|
32440
|
+
} catch (error) {
|
|
32441
|
+
exitOnApiError(error);
|
|
32442
|
+
}
|
|
32443
|
+
});
|
|
32444
|
+
credits.command("set").argument("<cardId>", "Card id.").description(
|
|
32445
|
+
"Replace the credits. --json: { credits: [{ membershipId, role, percent }] }; shares add up to 100, or [] clears."
|
|
32446
|
+
).requiredOption("--json <body>", "JSON credits.").action(async (cardId, opts) => {
|
|
32447
|
+
try {
|
|
32448
|
+
printJson({
|
|
32449
|
+
credits: await crmService.setCardCredits(
|
|
32450
|
+
cardId,
|
|
32451
|
+
parseJsonArg(opts.json)
|
|
32452
|
+
)
|
|
32453
|
+
});
|
|
32454
|
+
} catch (error) {
|
|
32455
|
+
exitOnApiError(error);
|
|
32456
|
+
}
|
|
32457
|
+
});
|
|
32458
|
+
}
|
|
32459
|
+
|
|
31213
32460
|
// src/commands/crm/index.ts
|
|
31214
32461
|
function registerCrmCommands(program2) {
|
|
31215
32462
|
const crm = program2.command("crm").description(
|
|
@@ -31221,6 +32468,16 @@ function registerCrmCommands(program2) {
|
|
|
31221
32468
|
registerCrmLists(crm);
|
|
31222
32469
|
registerCrmTags(crm);
|
|
31223
32470
|
registerCrmNotes(crm);
|
|
32471
|
+
registerCrmHistory(crm);
|
|
32472
|
+
registerCrmActivities(crm);
|
|
32473
|
+
registerCrmFiles(crm);
|
|
32474
|
+
registerCrmViews(crm);
|
|
32475
|
+
registerCrmMerge(crm);
|
|
32476
|
+
registerCrmConsent(crm);
|
|
32477
|
+
registerCrmPrivacy(crm);
|
|
32478
|
+
registerCrmCredits(crm);
|
|
32479
|
+
registerCrmImport(crm);
|
|
32480
|
+
registerCrmMatch(crm);
|
|
31224
32481
|
registerCrmTasks(crm);
|
|
31225
32482
|
registerCrmPipelines(crm);
|
|
31226
32483
|
registerCrmStages(crm);
|
|
@@ -31370,7 +32627,7 @@ function registerSpecialistCreate(parent) {
|
|
|
31370
32627
|
}
|
|
31371
32628
|
|
|
31372
32629
|
// src/commands/specialist/update.ts
|
|
31373
|
-
import { readFile as
|
|
32630
|
+
import { readFile as readFile5 } from "fs/promises";
|
|
31374
32631
|
function registerSpecialistUpdate(parent) {
|
|
31375
32632
|
parent.command("update <id>").description(
|
|
31376
32633
|
"Rename a specialist, change its description, or replace its memory."
|
|
@@ -31378,7 +32635,7 @@ function registerSpecialistUpdate(parent) {
|
|
|
31378
32635
|
"--memory-file <path>",
|
|
31379
32636
|
"A markdown file to become the memory: what the specialist is for, how it works, its rules."
|
|
31380
32637
|
).option("--clear-memory", "Remove the memory.").option("--json", "Machine-readable output.").action(async (id, opts) => {
|
|
31381
|
-
const memory = opts.clearMemory ? null : opts.memoryFile ? await
|
|
32638
|
+
const memory = opts.clearMemory ? null : opts.memoryFile ? await readFile5(opts.memoryFile, "utf-8") : void 0;
|
|
31382
32639
|
const hasDetails = opts.name !== void 0 || opts.description !== void 0;
|
|
31383
32640
|
if (!hasDetails && memory === void 0) {
|
|
31384
32641
|
printError(
|
|
@@ -31459,7 +32716,7 @@ function registerSpecialistDelete(parent) {
|
|
|
31459
32716
|
}
|
|
31460
32717
|
|
|
31461
32718
|
// src/commands/specialist/transfer.ts
|
|
31462
|
-
import { readFile as
|
|
32719
|
+
import { readFile as readFile6 } from "fs/promises";
|
|
31463
32720
|
import { Option as Option3 } from "commander";
|
|
31464
32721
|
function addExportOptions(command) {
|
|
31465
32722
|
return command.option(
|
|
@@ -31517,7 +32774,7 @@ function registerSpecialistTransfer(parent) {
|
|
|
31517
32774
|
).action(
|
|
31518
32775
|
(file) => execute3(async () => {
|
|
31519
32776
|
const { client } = await sessionContextService.requireAuthed();
|
|
31520
|
-
const content = await
|
|
32777
|
+
const content = await readFile6(file);
|
|
31521
32778
|
const target = await client.projects.createImportUploadTarget();
|
|
31522
32779
|
try {
|
|
31523
32780
|
if (content.byteLength > target.maxBytes)
|
|
@@ -32054,10 +33311,10 @@ function printReport(checks) {
|
|
|
32054
33311
|
import { spawn as spawn3, execFileSync } from "child_process";
|
|
32055
33312
|
import { realpathSync } from "fs";
|
|
32056
33313
|
import { sep as sep2 } from "path";
|
|
32057
|
-
import { z as
|
|
33314
|
+
import { z as z49 } from "zod";
|
|
32058
33315
|
import semver from "semver";
|
|
32059
33316
|
var PACKAGE_NAME = "@general-input/cli";
|
|
32060
|
-
var registryLatestSchema =
|
|
33317
|
+
var registryLatestSchema = z49.object({ version: z49.string() });
|
|
32061
33318
|
function registerUpgradeCommand(program2) {
|
|
32062
33319
|
program2.command("upgrade").description(
|
|
32063
33320
|
"Upgrade geni to the latest published version. Checks the npm registry and reinstalls via `npm install -g` when this install is npm-managed. Use --check to only report whether a newer version exists."
|