@outlit/cli 1.6.3 → 1.7.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 +266 -61
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -104,7 +104,7 @@ var package_default;
|
|
|
104
104
|
var init_package = __esm(() => {
|
|
105
105
|
package_default = {
|
|
106
106
|
name: "@outlit/cli",
|
|
107
|
-
version: "1.
|
|
107
|
+
version: "1.7.0",
|
|
108
108
|
description: "CLI for Outlit customer intelligence platform",
|
|
109
109
|
license: "Apache-2.0",
|
|
110
110
|
repository: {
|
|
@@ -135,7 +135,7 @@ var init_package = __esm(() => {
|
|
|
135
135
|
},
|
|
136
136
|
dependencies: {
|
|
137
137
|
"@clack/prompts": "^1.0.1",
|
|
138
|
-
"@outlit/tools": "^0.
|
|
138
|
+
"@outlit/tools": "^0.2.0",
|
|
139
139
|
citty: "^0.2.1"
|
|
140
140
|
},
|
|
141
141
|
devDependencies: {
|
|
@@ -1494,10 +1494,11 @@ function isCustomerToolName(value) {
|
|
|
1494
1494
|
return customerToolNameSet.has(value);
|
|
1495
1495
|
}
|
|
1496
1496
|
function normalizeCustomerSourceType(value) {
|
|
1497
|
-
|
|
1498
|
-
|
|
1497
|
+
const normalized = value.trim().toUpperCase();
|
|
1498
|
+
if (customerSourceTypeSet.has(normalized)) {
|
|
1499
|
+
return normalized;
|
|
1499
1500
|
}
|
|
1500
|
-
return customerSourceTypeAliasMap.get(
|
|
1501
|
+
return customerSourceTypeAliasMap.get(normalized) ?? null;
|
|
1501
1502
|
}
|
|
1502
1503
|
function resolveCustomerContextSearchInput(value) {
|
|
1503
1504
|
if (!value.query) {
|
|
@@ -1601,7 +1602,7 @@ function createOutlitClient(options) {
|
|
|
1601
1602
|
}
|
|
1602
1603
|
};
|
|
1603
1604
|
}
|
|
1604
|
-
var customerToolNames, customerSourceTypes, customerSourceTypeAliases, customerSourceTypeInputs, customerToolContracts, customerBillingStatuses, customerFactStatuses, customerFactTypes, unsupportedCustomerFactTypes, customerFactCategories, customerIncludeSections, customerTimeframes, notificationSeverityValues, timelineChannels, timelineTimeframes, userJourneyStages, customerToolNameSet, customerSourceTypeSet, customerSourceTypeAliasMap, iso8601UtcDateTimeRegex, DEFAULT_OUTLIT_API_URL = "https://app.outlit.ai", actionToolNames, defaultAgentToolNames, sqlToolNames, analyticalAgentToolNames;
|
|
1605
|
+
var customerToolNames, customerSourceTypes, customerSourceTypeAliases, customerSourceTypeInputs, notificationProviderValues, customerToolContracts, customerBillingStatuses, customerFactStatuses, customerFactTypes, unsupportedCustomerFactTypes, customerFactCategories, customerIncludeSections, customerTimeframes, notificationSeverityValues, timelineChannels, timelineTimeframes, userJourneyStages, customerToolNameSet, customerSourceTypeSet, customerSourceTypeAliasMap, iso8601UtcDateTimeRegex, DEFAULT_OUTLIT_API_URL = "https://app.outlit.ai", actionToolNames, defaultAgentToolNames, sqlToolNames, analyticalAgentToolNames;
|
|
1605
1606
|
var init_dist4 = __esm(() => {
|
|
1606
1607
|
customerToolNames = [
|
|
1607
1608
|
"outlit_list_customers",
|
|
@@ -1633,6 +1634,7 @@ var init_dist4 = __esm(() => {
|
|
|
1633
1634
|
"CRM",
|
|
1634
1635
|
"CRM_OPPORTUNITY"
|
|
1635
1636
|
];
|
|
1637
|
+
notificationProviderValues = ["slack"];
|
|
1636
1638
|
customerToolContracts = {
|
|
1637
1639
|
outlit_list_customers: {
|
|
1638
1640
|
toolName: "outlit_list_customers",
|
|
@@ -2153,7 +2155,7 @@ Returns column definitions and example queries for each view.`,
|
|
|
2153
2155
|
},
|
|
2154
2156
|
outlit_send_notification: {
|
|
2155
2157
|
toolName: "outlit_send_notification",
|
|
2156
|
-
description: "Send or post a
|
|
2158
|
+
description: "Send or post a notification. Use only when the user explicitly asks you to send, post, or notify. Slack is the default notifier when destinations are omitted.",
|
|
2157
2159
|
inputSchema: {
|
|
2158
2160
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
2159
2161
|
type: "object",
|
|
@@ -2164,41 +2166,18 @@ Returns column definitions and example queries for each view.`,
|
|
|
2164
2166
|
maxLength: 160,
|
|
2165
2167
|
description: "Notification title"
|
|
2166
2168
|
},
|
|
2169
|
+
markdown: {
|
|
2170
|
+
description: "Markdown notification body rendered for the target provider",
|
|
2171
|
+
type: "string",
|
|
2172
|
+
minLength: 1,
|
|
2173
|
+
maxLength: 1e5
|
|
2174
|
+
},
|
|
2167
2175
|
payload: {
|
|
2168
|
-
description: "JSON-compatible payload
|
|
2169
|
-
anyOf: [
|
|
2170
|
-
{
|
|
2171
|
-
type: "string"
|
|
2172
|
-
},
|
|
2173
|
-
{
|
|
2174
|
-
type: "number"
|
|
2175
|
-
},
|
|
2176
|
-
{
|
|
2177
|
-
type: "boolean"
|
|
2178
|
-
},
|
|
2179
|
-
{
|
|
2180
|
-
type: "null"
|
|
2181
|
-
},
|
|
2182
|
-
{
|
|
2183
|
-
type: "array",
|
|
2184
|
-
items: {
|
|
2185
|
-
$ref: "#/$defs/__schema0"
|
|
2186
|
-
}
|
|
2187
|
-
},
|
|
2188
|
-
{
|
|
2189
|
-
type: "object",
|
|
2190
|
-
propertyNames: {
|
|
2191
|
-
type: "string"
|
|
2192
|
-
},
|
|
2193
|
-
additionalProperties: {
|
|
2194
|
-
$ref: "#/$defs/__schema0"
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
],
|
|
2176
|
+
description: "Optional JSON-compatible payload. Serialized size must be 100,000 characters or fewer.",
|
|
2198
2177
|
$ref: "#/$defs/__schema0"
|
|
2199
2178
|
},
|
|
2200
2179
|
message: {
|
|
2201
|
-
description: "Optional
|
|
2180
|
+
description: "Optional summary message",
|
|
2202
2181
|
type: "string",
|
|
2203
2182
|
minLength: 1,
|
|
2204
2183
|
maxLength: 1200
|
|
@@ -2219,9 +2198,39 @@ Returns column definitions and example queries for each view.`,
|
|
|
2219
2198
|
type: "string",
|
|
2220
2199
|
minLength: 1,
|
|
2221
2200
|
maxLength: 240
|
|
2201
|
+
},
|
|
2202
|
+
destinations: {
|
|
2203
|
+
description: "Optional explicit notification destinations. Omit to use the default notifier.",
|
|
2204
|
+
minItems: 1,
|
|
2205
|
+
maxItems: 10,
|
|
2206
|
+
type: "array",
|
|
2207
|
+
items: {
|
|
2208
|
+
type: "object",
|
|
2209
|
+
properties: {
|
|
2210
|
+
provider: {
|
|
2211
|
+
description: "Notification provider",
|
|
2212
|
+
type: "string",
|
|
2213
|
+
enum: notificationProviderValues
|
|
2214
|
+
},
|
|
2215
|
+
channelId: {
|
|
2216
|
+
description: "Provider-specific destination channel ID",
|
|
2217
|
+
type: "string",
|
|
2218
|
+
minLength: 1,
|
|
2219
|
+
maxLength: 240
|
|
2220
|
+
},
|
|
2221
|
+
label: {
|
|
2222
|
+
description: "Optional destination label",
|
|
2223
|
+
type: "string",
|
|
2224
|
+
minLength: 1,
|
|
2225
|
+
maxLength: 120
|
|
2226
|
+
}
|
|
2227
|
+
},
|
|
2228
|
+
required: ["provider"],
|
|
2229
|
+
additionalProperties: false
|
|
2230
|
+
}
|
|
2222
2231
|
}
|
|
2223
2232
|
},
|
|
2224
|
-
required: ["title"
|
|
2233
|
+
required: ["title"],
|
|
2225
2234
|
additionalProperties: false,
|
|
2226
2235
|
$defs: {
|
|
2227
2236
|
__schema0: {
|
|
@@ -2629,7 +2638,8 @@ ${hint}`);
|
|
|
2629
2638
|
async function runTool(client, toolName, params, json, opts) {
|
|
2630
2639
|
const spinner = opts?.spinnerMessage ? createSpinner(opts.spinnerMessage) : null;
|
|
2631
2640
|
try {
|
|
2632
|
-
const
|
|
2641
|
+
const rawData = await client.callTool(toolName, params);
|
|
2642
|
+
const data = opts?.transform ? opts.transform(rawData) : rawData;
|
|
2633
2643
|
spinner?.stop("Done");
|
|
2634
2644
|
const table = opts?.table;
|
|
2635
2645
|
if (isJsonMode(json) || !table) {
|
|
@@ -2965,6 +2975,35 @@ var init_auth2 = __esm(() => {
|
|
|
2965
2975
|
});
|
|
2966
2976
|
|
|
2967
2977
|
// src/args/filters.ts
|
|
2978
|
+
function findRawStringFlagValue(rawArgs, flagName) {
|
|
2979
|
+
if (!rawArgs)
|
|
2980
|
+
return;
|
|
2981
|
+
const flag = `--${flagName}`;
|
|
2982
|
+
let found;
|
|
2983
|
+
for (let i = 0;i < rawArgs.length; i++) {
|
|
2984
|
+
const arg = rawArgs[i];
|
|
2985
|
+
if (!arg)
|
|
2986
|
+
continue;
|
|
2987
|
+
if (arg.startsWith(`${flag}=`)) {
|
|
2988
|
+
const value = arg.slice(flag.length + 1);
|
|
2989
|
+
if (value.length > 0)
|
|
2990
|
+
found = value;
|
|
2991
|
+
continue;
|
|
2992
|
+
}
|
|
2993
|
+
if (arg === flag) {
|
|
2994
|
+
const value = rawArgs[i + 1];
|
|
2995
|
+
if (value && !value.startsWith("-"))
|
|
2996
|
+
found = value;
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
return found;
|
|
3000
|
+
}
|
|
3001
|
+
function readStringArg(args, flagName, rawArgs) {
|
|
3002
|
+
const value = args[flagName];
|
|
3003
|
+
if (typeof value === "string" && value.length > 0)
|
|
3004
|
+
return value;
|
|
3005
|
+
return findRawStringFlagValue(rawArgs, flagName);
|
|
3006
|
+
}
|
|
2968
3007
|
function parseTraitFilterValue(value) {
|
|
2969
3008
|
if (value === "true")
|
|
2970
3009
|
return true;
|
|
@@ -2997,11 +3036,14 @@ function parseTraitFilters(input) {
|
|
|
2997
3036
|
}
|
|
2998
3037
|
return filters;
|
|
2999
3038
|
}
|
|
3000
|
-
function applyListFilters(params, args) {
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3039
|
+
function applyListFilters(params, args, rawArgs) {
|
|
3040
|
+
const argsRecord = args;
|
|
3041
|
+
const noActivityIn = readStringArg(argsRecord, "no-activity-in", rawArgs);
|
|
3042
|
+
const hasActivityIn = readStringArg(argsRecord, "has-activity-in", rawArgs);
|
|
3043
|
+
if (noActivityIn)
|
|
3044
|
+
params.noActivityInLast = noActivityIn;
|
|
3045
|
+
if (hasActivityIn)
|
|
3046
|
+
params.hasActivityInLast = hasActivityIn;
|
|
3005
3047
|
if (args.search)
|
|
3006
3048
|
params.search = args.search;
|
|
3007
3049
|
if (args["order-by"])
|
|
@@ -3130,6 +3172,33 @@ var exports_list = {};
|
|
|
3130
3172
|
__export(exports_list, {
|
|
3131
3173
|
default: () => list_default
|
|
3132
3174
|
});
|
|
3175
|
+
function normalizeCustomerListResult(data) {
|
|
3176
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
3177
|
+
return data;
|
|
3178
|
+
}
|
|
3179
|
+
const record = data;
|
|
3180
|
+
if (!Array.isArray(record.items)) {
|
|
3181
|
+
return data;
|
|
3182
|
+
}
|
|
3183
|
+
return {
|
|
3184
|
+
...record,
|
|
3185
|
+
items: record.items.map((item) => {
|
|
3186
|
+
if (typeof item !== "object" || item === null || Array.isArray(item)) {
|
|
3187
|
+
return item;
|
|
3188
|
+
}
|
|
3189
|
+
const customer = item;
|
|
3190
|
+
const daysSinceActivity = customer.daysSinceActivity;
|
|
3191
|
+
if (typeof daysSinceActivity !== "number" || daysSinceActivity >= 0) {
|
|
3192
|
+
return item;
|
|
3193
|
+
}
|
|
3194
|
+
return {
|
|
3195
|
+
...customer,
|
|
3196
|
+
lastActivityAt: null,
|
|
3197
|
+
daysSinceActivity: null
|
|
3198
|
+
};
|
|
3199
|
+
})
|
|
3200
|
+
};
|
|
3201
|
+
}
|
|
3133
3202
|
var list_default;
|
|
3134
3203
|
var init_list = __esm(() => {
|
|
3135
3204
|
init_dist4();
|
|
@@ -3187,7 +3256,7 @@ var init_list = __esm(() => {
|
|
|
3187
3256
|
description: "Search by customer name or domain"
|
|
3188
3257
|
}
|
|
3189
3258
|
},
|
|
3190
|
-
async run({ args }) {
|
|
3259
|
+
async run({ args, rawArgs }) {
|
|
3191
3260
|
const json = !!args.json;
|
|
3192
3261
|
const client = await getClientOrExit(args["api-key"], json);
|
|
3193
3262
|
const params = {};
|
|
@@ -3220,10 +3289,11 @@ var init_list = __esm(() => {
|
|
|
3220
3289
|
}, json);
|
|
3221
3290
|
}
|
|
3222
3291
|
}
|
|
3223
|
-
applyListFilters(params, args);
|
|
3292
|
+
applyListFilters(params, args, rawArgs);
|
|
3224
3293
|
applyPagination(params, args, json);
|
|
3225
3294
|
return runTool(client, customerToolContracts.outlit_list_customers.toolName, params, json, {
|
|
3226
3295
|
spinnerMessage: "Fetching customers...",
|
|
3296
|
+
transform: normalizeCustomerListResult,
|
|
3227
3297
|
table: {
|
|
3228
3298
|
columns: [
|
|
3229
3299
|
{ header: "Name", key: "name", format: (v) => truncate(v, 24) },
|
|
@@ -3499,7 +3569,7 @@ var init_list2 = __esm(() => {
|
|
|
3499
3569
|
description: "Search by user name or email"
|
|
3500
3570
|
}
|
|
3501
3571
|
},
|
|
3502
|
-
async run({ args }) {
|
|
3572
|
+
async run({ args, rawArgs }) {
|
|
3503
3573
|
const json = !!args.json;
|
|
3504
3574
|
const client = await getClientOrExit(args["api-key"], json);
|
|
3505
3575
|
const params = {};
|
|
@@ -3520,7 +3590,7 @@ var init_list2 = __esm(() => {
|
|
|
3520
3590
|
}, json);
|
|
3521
3591
|
}
|
|
3522
3592
|
}
|
|
3523
|
-
applyListFilters(params, args);
|
|
3593
|
+
applyListFilters(params, args, rawArgs);
|
|
3524
3594
|
applyPagination(params, args, json);
|
|
3525
3595
|
return runTool(client, customerToolContracts.outlit_list_users.toolName, params, json, {
|
|
3526
3596
|
spinnerMessage: "Fetching users...",
|
|
@@ -4531,6 +4601,34 @@ function normalizeSourceTypes(values) {
|
|
|
4531
4601
|
return;
|
|
4532
4602
|
return Array.from(new Set(values.map((value) => normalizeCustomerSourceType(value)))).filter((sourceType) => sourceType !== null);
|
|
4533
4603
|
}
|
|
4604
|
+
function isOneOf(values, value) {
|
|
4605
|
+
return typeof value === "string" && values.includes(value);
|
|
4606
|
+
}
|
|
4607
|
+
function annotateFactFilterability(data) {
|
|
4608
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
4609
|
+
return data;
|
|
4610
|
+
}
|
|
4611
|
+
const record = data;
|
|
4612
|
+
if (!Array.isArray(record.facts)) {
|
|
4613
|
+
return data;
|
|
4614
|
+
}
|
|
4615
|
+
return {
|
|
4616
|
+
...record,
|
|
4617
|
+
facts: record.facts.map((fact) => {
|
|
4618
|
+
if (typeof fact !== "object" || fact === null || Array.isArray(fact)) {
|
|
4619
|
+
return fact;
|
|
4620
|
+
}
|
|
4621
|
+
const factRecord = fact;
|
|
4622
|
+
return {
|
|
4623
|
+
...factRecord,
|
|
4624
|
+
filterability: {
|
|
4625
|
+
factType: isOneOf(customerFactTypes, factRecord.factType) ? "public" : "internal",
|
|
4626
|
+
factCategory: isOneOf(customerFactCategories, factRecord.factCategory) ? "public" : "internal"
|
|
4627
|
+
}
|
|
4628
|
+
};
|
|
4629
|
+
})
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4534
4632
|
var sourceTypeDescription, list_default3;
|
|
4535
4633
|
var init_list3 = __esm(() => {
|
|
4536
4634
|
init_dist4();
|
|
@@ -4680,7 +4778,9 @@ var init_list3 = __esm(() => {
|
|
|
4680
4778
|
if (args.before)
|
|
4681
4779
|
params.before = args.before;
|
|
4682
4780
|
applyPagination(params, args, json);
|
|
4683
|
-
return runTool(client, customerToolContracts.outlit_list_facts.toolName, params, json
|
|
4781
|
+
return runTool(client, customerToolContracts.outlit_list_facts.toolName, params, json, {
|
|
4782
|
+
transform: annotateFactFilterability
|
|
4783
|
+
});
|
|
4684
4784
|
}
|
|
4685
4785
|
});
|
|
4686
4786
|
});
|
|
@@ -5070,7 +5170,33 @@ function payloadSizeIsValid(payload) {
|
|
|
5070
5170
|
const serialized = JSON.stringify(payload);
|
|
5071
5171
|
return typeof serialized === "string" && serialized.length <= 1e5;
|
|
5072
5172
|
}
|
|
5073
|
-
|
|
5173
|
+
function parseDestinations(raw) {
|
|
5174
|
+
if (raw === undefined) {
|
|
5175
|
+
return;
|
|
5176
|
+
}
|
|
5177
|
+
const destinations = raw.split(",").map((entry) => entry.trim());
|
|
5178
|
+
if (destinations.length > MAX_DESTINATION_COUNT || destinations.some((entry) => entry.length === 0)) {
|
|
5179
|
+
return null;
|
|
5180
|
+
}
|
|
5181
|
+
const parsed = [];
|
|
5182
|
+
for (const destination of destinations) {
|
|
5183
|
+
const [providerInput, ...channelParts] = destination.split(":");
|
|
5184
|
+
const provider = providerInput?.trim().toLowerCase();
|
|
5185
|
+
const channelId = channelParts.join(":").trim();
|
|
5186
|
+
if (!notificationProviderValues.includes(provider)) {
|
|
5187
|
+
return null;
|
|
5188
|
+
}
|
|
5189
|
+
if (channelId.length > MAX_DESTINATION_CHANNEL_ID_LENGTH) {
|
|
5190
|
+
return null;
|
|
5191
|
+
}
|
|
5192
|
+
parsed.push({
|
|
5193
|
+
provider,
|
|
5194
|
+
...channelId.length > 0 ? { channelId } : {}
|
|
5195
|
+
});
|
|
5196
|
+
}
|
|
5197
|
+
return parsed;
|
|
5198
|
+
}
|
|
5199
|
+
var MAX_DESTINATION_COUNT = 10, MAX_DESTINATION_CHANNEL_ID_LENGTH = 240, notify_default;
|
|
5074
5200
|
var init_notify = __esm(() => {
|
|
5075
5201
|
init_dist4();
|
|
5076
5202
|
init_dist();
|
|
@@ -5082,14 +5208,16 @@ var init_notify = __esm(() => {
|
|
|
5082
5208
|
meta: {
|
|
5083
5209
|
name: "notify",
|
|
5084
5210
|
description: [
|
|
5085
|
-
"Send a
|
|
5211
|
+
"Send a notification through Outlit to the organization's configured notifier.",
|
|
5086
5212
|
"",
|
|
5087
|
-
"
|
|
5088
|
-
"When
|
|
5213
|
+
"Use --markdown or --markdown-file for the human-readable body; Outlit renders it for the destination platform.",
|
|
5214
|
+
"Add a JSON or raw payload when useful for structured context. When --destination is omitted, Outlit uses the default notifier.",
|
|
5089
5215
|
"",
|
|
5090
5216
|
"Examples:",
|
|
5217
|
+
" outlit notify --title 'Risk found' --markdown '**Risk found**\\n\\n- Customer: acme.com'",
|
|
5091
5218
|
` outlit notify --title 'Risk found' '{"customer":"acme.com"}'`,
|
|
5092
5219
|
" outlit notify --title 'Risk found' --payload-file ./payload.json",
|
|
5220
|
+
" outlit notify --title 'Escalation' --markdown '**Check this account**' --destination slack:C123",
|
|
5093
5221
|
` outlit notify --title 'Escalation' --severity HIGH --message 'Check this account' '{"customer":"acme.com"}'`,
|
|
5094
5222
|
"",
|
|
5095
5223
|
AGENT_JSON_HINT
|
|
@@ -5113,9 +5241,17 @@ var init_notify = __esm(() => {
|
|
|
5113
5241
|
type: "string",
|
|
5114
5242
|
description: "Path to a payload file to read (takes precedence over positional payload)"
|
|
5115
5243
|
},
|
|
5244
|
+
markdown: {
|
|
5245
|
+
type: "string",
|
|
5246
|
+
description: "Markdown body rendered for the destination platform."
|
|
5247
|
+
},
|
|
5248
|
+
"markdown-file": {
|
|
5249
|
+
type: "string",
|
|
5250
|
+
description: "Path to a markdown file to render for the destination platform."
|
|
5251
|
+
},
|
|
5116
5252
|
message: {
|
|
5117
5253
|
type: "string",
|
|
5118
|
-
description: "Optional
|
|
5254
|
+
description: "Optional summary message"
|
|
5119
5255
|
},
|
|
5120
5256
|
severity: {
|
|
5121
5257
|
type: "string",
|
|
@@ -5128,6 +5264,10 @@ var init_notify = __esm(() => {
|
|
|
5128
5264
|
subject: {
|
|
5129
5265
|
type: "string",
|
|
5130
5266
|
description: "Optional subject line"
|
|
5267
|
+
},
|
|
5268
|
+
destination: {
|
|
5269
|
+
type: "string",
|
|
5270
|
+
description: "Optional comma-separated destinations in provider[:channelId] form. Supported provider: slack"
|
|
5131
5271
|
}
|
|
5132
5272
|
},
|
|
5133
5273
|
async run({ args }) {
|
|
@@ -5142,6 +5282,24 @@ var init_notify = __esm(() => {
|
|
|
5142
5282
|
code: "invalid_input"
|
|
5143
5283
|
}, json);
|
|
5144
5284
|
}
|
|
5285
|
+
let markdownInput = args.markdown;
|
|
5286
|
+
if (args["markdown-file"]) {
|
|
5287
|
+
try {
|
|
5288
|
+
markdownInput = readFileSync5(args["markdown-file"], "utf-8");
|
|
5289
|
+
} catch (err) {
|
|
5290
|
+
return outputError({
|
|
5291
|
+
message: `Cannot read markdown file: ${errorMessage(err, "unknown error")}`,
|
|
5292
|
+
code: "file_error"
|
|
5293
|
+
}, json);
|
|
5294
|
+
}
|
|
5295
|
+
}
|
|
5296
|
+
const markdown = validateTrimmedText(markdownInput, 1e5);
|
|
5297
|
+
if (markdown === null) {
|
|
5298
|
+
return outputError({
|
|
5299
|
+
message: "--markdown must be between 1 and 100000 characters after trimming",
|
|
5300
|
+
code: "invalid_input"
|
|
5301
|
+
}, json);
|
|
5302
|
+
}
|
|
5145
5303
|
const message = validateTrimmedText(args.message, 1200);
|
|
5146
5304
|
if (message === null) {
|
|
5147
5305
|
return outputError({
|
|
@@ -5174,6 +5332,13 @@ var init_notify = __esm(() => {
|
|
|
5174
5332
|
}
|
|
5175
5333
|
severity = normalized;
|
|
5176
5334
|
}
|
|
5335
|
+
const destinations = parseDestinations(args.destination);
|
|
5336
|
+
if (destinations === null) {
|
|
5337
|
+
return outputError({
|
|
5338
|
+
message: `--destination must use provider[:channelId] with provider one of: ${notificationProviderValues.join(", ")}`,
|
|
5339
|
+
code: "invalid_input"
|
|
5340
|
+
}, json);
|
|
5341
|
+
}
|
|
5177
5342
|
let payloadInput;
|
|
5178
5343
|
if (args["payload-file"]) {
|
|
5179
5344
|
try {
|
|
@@ -5186,11 +5351,15 @@ var init_notify = __esm(() => {
|
|
|
5186
5351
|
}
|
|
5187
5352
|
} else if (typeof args.payload === "string" && args.payload.trim().length > 0) {
|
|
5188
5353
|
payloadInput = args.payload;
|
|
5189
|
-
} else {
|
|
5190
|
-
return outputError({ message: "Provide a payload or --payload-file", code: "missing_input" }, json);
|
|
5191
5354
|
}
|
|
5192
|
-
|
|
5193
|
-
|
|
5355
|
+
if (!payloadInput && markdown === undefined) {
|
|
5356
|
+
return outputError({
|
|
5357
|
+
message: "Provide --markdown, --markdown-file, a payload, or --payload-file",
|
|
5358
|
+
code: "missing_input"
|
|
5359
|
+
}, json);
|
|
5360
|
+
}
|
|
5361
|
+
const payload = payloadInput === undefined ? undefined : parsePayload(payloadInput);
|
|
5362
|
+
if (payload !== undefined && !payloadSizeIsValid(payload)) {
|
|
5194
5363
|
return outputError({
|
|
5195
5364
|
message: "Payload must serialize to 100000 characters or fewer",
|
|
5196
5365
|
code: "invalid_input"
|
|
@@ -5198,9 +5367,14 @@ var init_notify = __esm(() => {
|
|
|
5198
5367
|
}
|
|
5199
5368
|
const client = await getClientOrExit(args["api-key"], json);
|
|
5200
5369
|
const params = {
|
|
5201
|
-
title
|
|
5202
|
-
payload
|
|
5370
|
+
title
|
|
5203
5371
|
};
|
|
5372
|
+
if (markdown !== undefined) {
|
|
5373
|
+
params.markdown = markdown;
|
|
5374
|
+
}
|
|
5375
|
+
if (payload !== undefined) {
|
|
5376
|
+
params.payload = payload;
|
|
5377
|
+
}
|
|
5204
5378
|
if (message !== undefined) {
|
|
5205
5379
|
params.message = message;
|
|
5206
5380
|
}
|
|
@@ -5213,6 +5387,9 @@ var init_notify = __esm(() => {
|
|
|
5213
5387
|
if (subject !== undefined) {
|
|
5214
5388
|
params.subject = subject;
|
|
5215
5389
|
}
|
|
5390
|
+
if (destinations !== undefined) {
|
|
5391
|
+
params.destinations = destinations;
|
|
5392
|
+
}
|
|
5216
5393
|
return runTool(client, customerToolContracts.outlit_send_notification.toolName, params, json);
|
|
5217
5394
|
}
|
|
5218
5395
|
});
|
|
@@ -5301,14 +5478,22 @@ var INTEGRATION_PROVIDERS, PROVIDER_NAMES;
|
|
|
5301
5478
|
var init_providers = __esm(() => {
|
|
5302
5479
|
init_output();
|
|
5303
5480
|
INTEGRATION_PROVIDERS = {
|
|
5481
|
+
hubspot: { id: "hubspot", name: "HubSpot", category: "crm", authType: "oauth" },
|
|
5304
5482
|
slack: { id: "slack", name: "Slack", category: "communication", authType: "oauth" },
|
|
5305
5483
|
gmail: { id: "google-mail", name: "Gmail", category: "communication", authType: "oauth" },
|
|
5484
|
+
"google-mail": {
|
|
5485
|
+
id: "google-mail",
|
|
5486
|
+
name: "Gmail",
|
|
5487
|
+
category: "communication",
|
|
5488
|
+
authType: "oauth"
|
|
5489
|
+
},
|
|
5306
5490
|
"google-calendar": {
|
|
5307
5491
|
id: "google-calendar",
|
|
5308
5492
|
name: "Google Calendar",
|
|
5309
5493
|
category: "calendar",
|
|
5310
5494
|
authType: "oauth"
|
|
5311
5495
|
},
|
|
5496
|
+
granola: { id: "granola", name: "Granola", category: "calls", authType: "oauth" },
|
|
5312
5497
|
pylon: {
|
|
5313
5498
|
id: "pylon",
|
|
5314
5499
|
name: "Pylon",
|
|
@@ -5732,6 +5917,25 @@ var exports_status2 = {};
|
|
|
5732
5917
|
__export(exports_status2, {
|
|
5733
5918
|
default: () => status_default2
|
|
5734
5919
|
});
|
|
5920
|
+
function hideBlankModelSyncs(data) {
|
|
5921
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
5922
|
+
return data;
|
|
5923
|
+
}
|
|
5924
|
+
const record = data;
|
|
5925
|
+
if (!Array.isArray(record.syncs)) {
|
|
5926
|
+
return data;
|
|
5927
|
+
}
|
|
5928
|
+
return {
|
|
5929
|
+
...record,
|
|
5930
|
+
syncs: record.syncs.filter((sync) => {
|
|
5931
|
+
if (typeof sync !== "object" || sync === null || Array.isArray(sync)) {
|
|
5932
|
+
return false;
|
|
5933
|
+
}
|
|
5934
|
+
const model = sync.model;
|
|
5935
|
+
return typeof model === "string" && model.trim().length > 0;
|
|
5936
|
+
})
|
|
5937
|
+
};
|
|
5938
|
+
}
|
|
5735
5939
|
var status_default2;
|
|
5736
5940
|
var init_status2 = __esm(() => {
|
|
5737
5941
|
init_dist();
|
|
@@ -5772,6 +5976,7 @@ var init_status2 = __esm(() => {
|
|
|
5772
5976
|
const { provider } = resolveProviderOrExit(args.provider, json);
|
|
5773
5977
|
return runTool(client, "outlit_integration_sync_status", { provider: provider.id }, json, {
|
|
5774
5978
|
spinnerMessage: "Fetching sync status...",
|
|
5979
|
+
transform: hideBlankModelSyncs,
|
|
5775
5980
|
table: {
|
|
5776
5981
|
columns: [
|
|
5777
5982
|
{ header: "Model", key: "model" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outlit/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "CLI for Outlit customer intelligence platform",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@clack/prompts": "^1.0.1",
|
|
34
|
-
"@outlit/tools": "^0.
|
|
34
|
+
"@outlit/tools": "^0.2.0",
|
|
35
35
|
"citty": "^0.2.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|