terse-types 0.1.1 → 0.1.3
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/ApiRouteBuilder.d.ts +3 -0
- package/dist/ApiRoutes.json +3 -0
- package/dist/Configs.d.ts +31 -1
- package/dist/Configs.js +35 -4
- package/dist/Integrations.d.ts +13 -0
- package/dist/Integrations.js +13 -2
- package/dist/InvalidationKeys.d.ts +1 -0
- package/dist/InvalidationKeys.js +1 -0
- package/dist/ToolDisplayUtils.js +89 -0
- package/dist/Tools.d.ts +781 -0
- package/dist/Tools.js +187 -5
- package/dist/types.d.ts +64 -0
- package/package.json +1 -1
package/dist/ApiRoutes.json
CHANGED
package/dist/Configs.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export declare enum ConfigType {
|
|
|
26
26
|
WEBHOOK_INPUT = "webhook_input",
|
|
27
27
|
WEBMONITOR = "webmonitor",
|
|
28
28
|
HEY_REACH_INPUT = "hey_reach_input",
|
|
29
|
-
RESEND_OUTPUT = "resend_output"
|
|
29
|
+
RESEND_OUTPUT = "resend_output",
|
|
30
|
+
APOLLO_OUTPUT = "apollo_output"
|
|
30
31
|
}
|
|
31
32
|
export declare const configTypeEnum: z.ZodEnum<typeof ConfigType>;
|
|
32
33
|
export declare const frequencyUnitSchema: z.ZodEnum<{
|
|
@@ -243,6 +244,14 @@ export declare const ResendOutputConfigMetadata: {
|
|
|
243
244
|
readonly isInput: false;
|
|
244
245
|
readonly isOutput: true;
|
|
245
246
|
};
|
|
247
|
+
export declare const ApolloOutputConfigMetadata: {
|
|
248
|
+
readonly configType: ConfigType.APOLLO_OUTPUT;
|
|
249
|
+
readonly name: "Apollo";
|
|
250
|
+
readonly description: "Enrich people and companies and search for prospects using Apollo.io";
|
|
251
|
+
readonly integrationType: IntegrationType.APOLLO;
|
|
252
|
+
readonly isInput: false;
|
|
253
|
+
readonly isOutput: true;
|
|
254
|
+
};
|
|
246
255
|
export type ConfigDetailsMap = Record<ConfigType, ConfigDetails>;
|
|
247
256
|
export declare const CONFIG_DETAILS: ConfigDetailsMap;
|
|
248
257
|
export declare const SlackEventType: {
|
|
@@ -1383,6 +1392,18 @@ export declare class ResendOutputConfig extends BaseConfigInstance<IntegrationTy
|
|
|
1383
1392
|
isComplete(): boolean;
|
|
1384
1393
|
formatForAgent(): string;
|
|
1385
1394
|
}
|
|
1395
|
+
export declare const ApolloOutputConfigSchema: z.ZodObject<{
|
|
1396
|
+
integrationId: z.ZodString;
|
|
1397
|
+
integrationType: z.ZodLiteral<IntegrationType.APOLLO>;
|
|
1398
|
+
configType: z.ZodLiteral<ConfigType.APOLLO_OUTPUT>;
|
|
1399
|
+
}, z.core.$strip>;
|
|
1400
|
+
export type ApolloOutputConfigData = z.infer<typeof ApolloOutputConfigSchema>;
|
|
1401
|
+
export type ApolloOutputConfigInstance = ApolloOutputConfigData & ConfigBehavior;
|
|
1402
|
+
export declare class ApolloOutputConfig extends BaseConfigInstance<IntegrationType.APOLLO, ConfigType.APOLLO_OUTPUT> implements ApolloOutputConfigInstance {
|
|
1403
|
+
constructor(integrationId: string);
|
|
1404
|
+
isComplete(): boolean;
|
|
1405
|
+
formatForAgent(): string;
|
|
1406
|
+
}
|
|
1386
1407
|
export declare const WebhookInputConfigSchema: z.ZodObject<{
|
|
1387
1408
|
integrationId: z.ZodLiteral<"system">;
|
|
1388
1409
|
integrationType: z.ZodLiteral<IntegrationType.WEBHOOK>;
|
|
@@ -2106,6 +2127,10 @@ export declare const configDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2106
2127
|
integrationId: z.ZodString;
|
|
2107
2128
|
integrationType: z.ZodLiteral<IntegrationType.RESEND>;
|
|
2108
2129
|
configType: z.ZodLiteral<ConfigType.RESEND_OUTPUT>;
|
|
2130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2131
|
+
integrationId: z.ZodString;
|
|
2132
|
+
integrationType: z.ZodLiteral<IntegrationType.APOLLO>;
|
|
2133
|
+
configType: z.ZodLiteral<ConfigType.APOLLO_OUTPUT>;
|
|
2109
2134
|
}, z.core.$strip>]>;
|
|
2110
2135
|
export type ConfigData = z.infer<typeof configDataSchema>;
|
|
2111
2136
|
/** Configs that can serve as triggers (event sources). */
|
|
@@ -2779,6 +2804,10 @@ export declare const skillConfigDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2779
2804
|
integrationId: z.ZodString;
|
|
2780
2805
|
integrationType: z.ZodLiteral<IntegrationType.RESEND>;
|
|
2781
2806
|
configType: z.ZodLiteral<ConfigType.RESEND_OUTPUT>;
|
|
2807
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2808
|
+
integrationId: z.ZodString;
|
|
2809
|
+
integrationType: z.ZodLiteral<IntegrationType.APOLLO>;
|
|
2810
|
+
configType: z.ZodLiteral<ConfigType.APOLLO_OUTPUT>;
|
|
2782
2811
|
}, z.core.$strip>]>;
|
|
2783
2812
|
export type SkillConfigData = z.infer<typeof skillConfigDataSchema>;
|
|
2784
2813
|
export declare function isConfigComplete(config: ConfigData | undefined): boolean;
|
|
@@ -2810,6 +2839,7 @@ export type ConfigMetadataMap = EnsureExhaustiveMetadata<{
|
|
|
2810
2839
|
[ConfigType.WEBMONITOR]: typeof WebMonitorConfig;
|
|
2811
2840
|
[ConfigType.HEY_REACH_INPUT]: typeof HeyReachInputConfig;
|
|
2812
2841
|
[ConfigType.RESEND_OUTPUT]: typeof ResendOutputConfig;
|
|
2842
|
+
[ConfigType.APOLLO_OUTPUT]: typeof ApolloOutputConfig;
|
|
2813
2843
|
}>;
|
|
2814
2844
|
export declare const CONFIG_METADATA: ConfigMetadataMap;
|
|
2815
2845
|
export {};
|
package/dist/Configs.js
CHANGED
|
@@ -28,6 +28,7 @@ export var ConfigType;
|
|
|
28
28
|
ConfigType["WEBMONITOR"] = "webmonitor";
|
|
29
29
|
ConfigType["HEY_REACH_INPUT"] = "hey_reach_input";
|
|
30
30
|
ConfigType["RESEND_OUTPUT"] = "resend_output";
|
|
31
|
+
ConfigType["APOLLO_OUTPUT"] = "apollo_output";
|
|
31
32
|
})(ConfigType || (ConfigType = {}));
|
|
32
33
|
export const configTypeEnum = z.enum(ConfigType);
|
|
33
34
|
export const frequencyUnitSchema = z.enum(["hour", "day", "week"]);
|
|
@@ -232,6 +233,14 @@ export const ResendOutputConfigMetadata = {
|
|
|
232
233
|
isInput: false,
|
|
233
234
|
isOutput: true
|
|
234
235
|
};
|
|
236
|
+
export const ApolloOutputConfigMetadata = {
|
|
237
|
+
configType: ConfigType.APOLLO_OUTPUT,
|
|
238
|
+
name: "Apollo",
|
|
239
|
+
description: "Enrich people and companies and search for prospects using Apollo.io",
|
|
240
|
+
integrationType: IntegrationType.APOLLO,
|
|
241
|
+
isInput: false,
|
|
242
|
+
isOutput: true
|
|
243
|
+
};
|
|
235
244
|
export const CONFIG_DETAILS = {
|
|
236
245
|
[ConfigType.GMAIL]: GmailConfigMetadata,
|
|
237
246
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfigMetadata,
|
|
@@ -257,7 +266,8 @@ export const CONFIG_DETAILS = {
|
|
|
257
266
|
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfigMetadata,
|
|
258
267
|
[ConfigType.WEBMONITOR]: WebMonitorConfigMetadata,
|
|
259
268
|
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfigMetadata,
|
|
260
|
-
[ConfigType.RESEND_OUTPUT]: ResendOutputConfigMetadata
|
|
269
|
+
[ConfigType.RESEND_OUTPUT]: ResendOutputConfigMetadata,
|
|
270
|
+
[ConfigType.APOLLO_OUTPUT]: ApolloOutputConfigMetadata
|
|
261
271
|
};
|
|
262
272
|
// MARK: Event Types — specific events within each integration trigger
|
|
263
273
|
export const SlackEventType = {
|
|
@@ -946,6 +956,21 @@ export class ResendOutputConfig extends BaseConfigInstance {
|
|
|
946
956
|
return `Type: Resend Output\nIntegration ID: ${this.integrationId}`;
|
|
947
957
|
}
|
|
948
958
|
}
|
|
959
|
+
export const ApolloOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
960
|
+
integrationType: z.literal(IntegrationType.APOLLO),
|
|
961
|
+
configType: z.literal(ConfigType.APOLLO_OUTPUT)
|
|
962
|
+
});
|
|
963
|
+
export class ApolloOutputConfig extends BaseConfigInstance {
|
|
964
|
+
constructor(integrationId) {
|
|
965
|
+
super(integrationId, IntegrationType.APOLLO, ConfigType.APOLLO_OUTPUT);
|
|
966
|
+
}
|
|
967
|
+
isComplete() {
|
|
968
|
+
return !!this.integrationId;
|
|
969
|
+
}
|
|
970
|
+
formatForAgent() {
|
|
971
|
+
return `Type: Apollo Output\nIntegration ID: ${this.integrationId}`;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
949
974
|
export const WebhookInputConfigSchema = ConfigInstanceSchema.extend({
|
|
950
975
|
integrationId: z.literal("system"),
|
|
951
976
|
integrationType: z.literal(IntegrationType.WEBHOOK),
|
|
@@ -1062,7 +1087,8 @@ export const configDataSchema = z.union([
|
|
|
1062
1087
|
WebhookInputConfigSchema,
|
|
1063
1088
|
WebMonitorConfigSchema,
|
|
1064
1089
|
HeyReachInputConfigSchema,
|
|
1065
|
-
ResendOutputConfigSchema
|
|
1090
|
+
ResendOutputConfigSchema,
|
|
1091
|
+
ApolloOutputConfigSchema
|
|
1066
1092
|
]);
|
|
1067
1093
|
/** Configs that can serve as triggers (event sources). */
|
|
1068
1094
|
export const triggerConfigDataSchema = z.union([
|
|
@@ -1094,7 +1120,8 @@ export const skillConfigDataSchema = z.union([
|
|
|
1094
1120
|
WorkOSOutputConfigSchema,
|
|
1095
1121
|
AttioOutputConfigSchema,
|
|
1096
1122
|
SnowflakeOutputConfigSchema,
|
|
1097
|
-
ResendOutputConfigSchema
|
|
1123
|
+
ResendOutputConfigSchema,
|
|
1124
|
+
ApolloOutputConfigSchema
|
|
1098
1125
|
]);
|
|
1099
1126
|
export function isConfigComplete(config) {
|
|
1100
1127
|
if (!config) {
|
|
@@ -1122,6 +1149,7 @@ export function isConfigComplete(config) {
|
|
|
1122
1149
|
case ConfigType.WORKOS_OUTPUT:
|
|
1123
1150
|
case ConfigType.SNOWFLAKE_OUTPUT:
|
|
1124
1151
|
case ConfigType.RESEND_OUTPUT:
|
|
1152
|
+
case ConfigType.APOLLO_OUTPUT:
|
|
1125
1153
|
return !!config.integrationId;
|
|
1126
1154
|
case ConfigType.GITHUB:
|
|
1127
1155
|
return (config.repositoryIds?.length ?? 0) > 0;
|
|
@@ -1287,6 +1315,8 @@ export function formatConfigForAgent(config) {
|
|
|
1287
1315
|
return `Type: Snowflake Output\nIntegration ID: ${config.integrationId}`;
|
|
1288
1316
|
case ConfigType.RESEND_OUTPUT:
|
|
1289
1317
|
return `Type: Resend Output\nIntegration ID: ${config.integrationId}`;
|
|
1318
|
+
case ConfigType.APOLLO_OUTPUT:
|
|
1319
|
+
return `Type: Apollo Output\nIntegration ID: ${config.integrationId}`;
|
|
1290
1320
|
case ConfigType.WEBHOOK_INPUT:
|
|
1291
1321
|
return "Type: Webhook Trigger";
|
|
1292
1322
|
case ConfigType.WEBMONITOR: {
|
|
@@ -1328,5 +1358,6 @@ export const CONFIG_METADATA = {
|
|
|
1328
1358
|
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfig,
|
|
1329
1359
|
[ConfigType.WEBMONITOR]: WebMonitorConfig,
|
|
1330
1360
|
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfig,
|
|
1331
|
-
[ConfigType.RESEND_OUTPUT]: ResendOutputConfig
|
|
1361
|
+
[ConfigType.RESEND_OUTPUT]: ResendOutputConfig,
|
|
1362
|
+
[ConfigType.APOLLO_OUTPUT]: ApolloOutputConfig
|
|
1332
1363
|
};
|
package/dist/Integrations.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare enum IntegrationType {
|
|
|
3
3
|
GITHUB = "github",
|
|
4
4
|
HEY_REACH = "hey_reach",
|
|
5
5
|
RESEND = "resend",
|
|
6
|
+
APOLLO = "apollo",
|
|
6
7
|
GMAIL = "gmail",
|
|
7
8
|
LINEAR = "linear",
|
|
8
9
|
SLACK = "slack",
|
|
@@ -151,6 +152,13 @@ export declare const ResendIntegrationMetadata: {
|
|
|
151
152
|
readonly isInput: false;
|
|
152
153
|
readonly isOutput: true;
|
|
153
154
|
};
|
|
155
|
+
export declare const ApolloIntegrationMetadata: {
|
|
156
|
+
readonly type: IntegrationType.APOLLO;
|
|
157
|
+
readonly name: "Apollo";
|
|
158
|
+
readonly description: "Enrich people and companies and search for prospects using Apollo.io";
|
|
159
|
+
readonly isInput: false;
|
|
160
|
+
readonly isOutput: true;
|
|
161
|
+
};
|
|
154
162
|
export type IntegrationMetadataMap = Record<IntegrationType, IntegrationDetails>;
|
|
155
163
|
export declare const INTEGRATION_METADATA: IntegrationMetadataMap;
|
|
156
164
|
export declare const IntegrationInstanceSchema: z.ZodObject<{
|
|
@@ -184,6 +192,7 @@ export declare const InstallationOptionsSchemas: {
|
|
|
184
192
|
readonly webmonitor: z.ZodObject<{}, z.core.$strict>;
|
|
185
193
|
readonly hey_reach: z.ZodObject<{}, z.core.$strict>;
|
|
186
194
|
readonly resend: z.ZodObject<{}, z.core.$strict>;
|
|
195
|
+
readonly apollo: z.ZodObject<{}, z.core.$strict>;
|
|
187
196
|
};
|
|
188
197
|
export type InstallationOptionsFor<T extends IntegrationType> = z.infer<(typeof InstallationOptionsSchemas)[T]>;
|
|
189
198
|
export declare const SlackIntegrationSchema: z.ZodObject<{
|
|
@@ -231,6 +240,10 @@ export declare const ResendIntegrationSchema: z.ZodObject<{
|
|
|
231
240
|
id: z.ZodString;
|
|
232
241
|
}, z.core.$strip>;
|
|
233
242
|
export type ResendIntegration = z.infer<typeof ResendIntegrationSchema>;
|
|
243
|
+
export declare const ApolloIntegrationSchema: z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
export type ApolloIntegration = z.infer<typeof ApolloIntegrationSchema>;
|
|
234
247
|
export declare const ResendTemplateVariableSchema: z.ZodObject<{
|
|
235
248
|
key: z.ZodString;
|
|
236
249
|
type: z.ZodEnum<{
|
package/dist/Integrations.js
CHANGED
|
@@ -5,6 +5,7 @@ export var IntegrationType;
|
|
|
5
5
|
IntegrationType["GITHUB"] = "github";
|
|
6
6
|
IntegrationType["HEY_REACH"] = "hey_reach";
|
|
7
7
|
IntegrationType["RESEND"] = "resend";
|
|
8
|
+
IntegrationType["APOLLO"] = "apollo";
|
|
8
9
|
IntegrationType["GMAIL"] = "gmail";
|
|
9
10
|
IntegrationType["LINEAR"] = "linear";
|
|
10
11
|
IntegrationType["SLACK"] = "slack";
|
|
@@ -150,6 +151,13 @@ export const ResendIntegrationMetadata = {
|
|
|
150
151
|
isInput: false,
|
|
151
152
|
isOutput: true
|
|
152
153
|
};
|
|
154
|
+
export const ApolloIntegrationMetadata = {
|
|
155
|
+
type: IntegrationType.APOLLO,
|
|
156
|
+
name: "Apollo",
|
|
157
|
+
description: "Enrich people and companies and search for prospects using Apollo.io",
|
|
158
|
+
isInput: false,
|
|
159
|
+
isOutput: true
|
|
160
|
+
};
|
|
153
161
|
export const INTEGRATION_METADATA = {
|
|
154
162
|
[IntegrationType.GMAIL]: GmailIntegrationMetadata,
|
|
155
163
|
[IntegrationType.NOTION]: NotionIntegrationMetadata,
|
|
@@ -167,7 +175,8 @@ export const INTEGRATION_METADATA = {
|
|
|
167
175
|
[IntegrationType.WEBHOOK]: WebhookIntegrationMetadata,
|
|
168
176
|
[IntegrationType.WEBMONITOR]: WebMonitorIntegrationMetadata,
|
|
169
177
|
[IntegrationType.HEY_REACH]: HeyReachIntegrationMetadata,
|
|
170
|
-
[IntegrationType.RESEND]: ResendIntegrationMetadata
|
|
178
|
+
[IntegrationType.RESEND]: ResendIntegrationMetadata,
|
|
179
|
+
[IntegrationType.APOLLO]: ApolloIntegrationMetadata
|
|
171
180
|
};
|
|
172
181
|
// MARK: Integration Details
|
|
173
182
|
export const IntegrationInstanceSchema = z.object({
|
|
@@ -198,7 +207,8 @@ export const InstallationOptionsSchemas = {
|
|
|
198
207
|
[IntegrationType.WEBHOOK]: NoInstallationOptionsSchema,
|
|
199
208
|
[IntegrationType.WEBMONITOR]: NoInstallationOptionsSchema,
|
|
200
209
|
[IntegrationType.HEY_REACH]: NoInstallationOptionsSchema,
|
|
201
|
-
[IntegrationType.RESEND]: NoInstallationOptionsSchema
|
|
210
|
+
[IntegrationType.RESEND]: NoInstallationOptionsSchema,
|
|
211
|
+
[IntegrationType.APOLLO]: NoInstallationOptionsSchema
|
|
202
212
|
};
|
|
203
213
|
export const SlackIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
204
214
|
teamId: z.string().optional(),
|
|
@@ -227,6 +237,7 @@ export const PosthogIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
|
227
237
|
});
|
|
228
238
|
export const HeyReachIntegrationSchema = IntegrationInstanceSchema;
|
|
229
239
|
export const ResendIntegrationSchema = IntegrationInstanceSchema;
|
|
240
|
+
export const ApolloIntegrationSchema = IntegrationInstanceSchema;
|
|
230
241
|
export const ResendTemplateVariableSchema = z.object({
|
|
231
242
|
key: z.string(),
|
|
232
243
|
type: z.enum(["string", "number"]),
|
|
@@ -28,6 +28,7 @@ export declare const attioIntegrationsKey: () => readonly [string];
|
|
|
28
28
|
export declare const snowflakeIntegrationsKey: () => readonly [string];
|
|
29
29
|
export declare const heyReachIntegrationsKey: () => readonly [string];
|
|
30
30
|
export declare const resendIntegrationsKey: () => readonly [string];
|
|
31
|
+
export declare const apolloIntegrationsKey: () => readonly [string];
|
|
31
32
|
export declare const attioObjectsKey: (integrationId: string | null | undefined) => readonly [string, string] | null;
|
|
32
33
|
export declare const allRunHistoryKey: (params?: GetRunHistoryParams) => readonly [string, string] | readonly [string];
|
|
33
34
|
export declare const runHistoryKey: (agentId: string, params?: GetRunHistoryParams) => readonly [string, string, string] | readonly [string, string];
|
package/dist/InvalidationKeys.js
CHANGED
|
@@ -74,6 +74,7 @@ export const heyReachIntegrationsKey = () => {
|
|
|
74
74
|
return ["heyReachIntegrations"];
|
|
75
75
|
};
|
|
76
76
|
export const resendIntegrationsKey = () => ["resendIntegrations"];
|
|
77
|
+
export const apolloIntegrationsKey = () => ["apolloIntegrations"];
|
|
77
78
|
export const attioObjectsKey = (integrationId) => {
|
|
78
79
|
if (!integrationId) {
|
|
79
80
|
return null;
|
package/dist/ToolDisplayUtils.js
CHANGED
|
@@ -976,6 +976,95 @@ const TOOL_DISPLAY_CONFIG = {
|
|
|
976
976
|
return `Query plan retrieved (${rowCount} step${rowCount !== 1 ? "s" : ""})`;
|
|
977
977
|
return "Query plan retrieved";
|
|
978
978
|
}
|
|
979
|
+
},
|
|
980
|
+
// ===================
|
|
981
|
+
// Apollo Tools
|
|
982
|
+
// ===================
|
|
983
|
+
apollo_enrich_person: {
|
|
984
|
+
preparing: "Preparing person enrichment",
|
|
985
|
+
executing: params => {
|
|
986
|
+
const target = (params?.email ?? params?.name);
|
|
987
|
+
return target ? `Enriching ${truncate(target)}` : "Enriching person";
|
|
988
|
+
},
|
|
989
|
+
complete: (params, result) => {
|
|
990
|
+
const parsed = safeParseResult(result);
|
|
991
|
+
const person = parsed?.person;
|
|
992
|
+
if (person?.name)
|
|
993
|
+
return `Enriched ${truncate(person.name)}`;
|
|
994
|
+
if (parsed && parsed.found === false)
|
|
995
|
+
return "No match found";
|
|
996
|
+
const target = (params?.email ?? params?.name);
|
|
997
|
+
return target ? `Enriched ${truncate(target)}` : "Person enrichment complete";
|
|
998
|
+
},
|
|
999
|
+
approval: params => {
|
|
1000
|
+
const target = (params?.email ?? params?.name);
|
|
1001
|
+
return target ? `Enrich ${truncate(target)} via Apollo (uses a credit)?` : "Enrich this person via Apollo (uses a credit)?";
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
apollo_bulk_enrich_people: {
|
|
1005
|
+
preparing: "Preparing bulk enrichment",
|
|
1006
|
+
executing: params => {
|
|
1007
|
+
const people = params?.people;
|
|
1008
|
+
return people ? `Enriching ${people.length} people` : "Enriching people";
|
|
1009
|
+
},
|
|
1010
|
+
complete: (_params, result) => {
|
|
1011
|
+
const parsed = safeParseResult(result);
|
|
1012
|
+
const matched = parsed?.matchedCount;
|
|
1013
|
+
const requested = parsed?.requestedCount;
|
|
1014
|
+
if (matched !== undefined && requested !== undefined)
|
|
1015
|
+
return `Enriched ${matched} of ${requested} people`;
|
|
1016
|
+
return "Bulk enrichment complete";
|
|
1017
|
+
},
|
|
1018
|
+
approval: params => {
|
|
1019
|
+
const people = params?.people;
|
|
1020
|
+
return people ? `Enrich ${people.length} people via Apollo (uses credits)?` : "Bulk enrich people via Apollo (uses credits)?";
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
apollo_enrich_organization: {
|
|
1024
|
+
preparing: "Preparing company enrichment",
|
|
1025
|
+
executing: params => {
|
|
1026
|
+
const domain = params?.domain;
|
|
1027
|
+
return domain ? `Enriching ${truncate(domain)}` : "Enriching company";
|
|
1028
|
+
},
|
|
1029
|
+
complete: (params, result) => {
|
|
1030
|
+
const parsed = safeParseResult(result);
|
|
1031
|
+
const organization = parsed?.organization;
|
|
1032
|
+
if (organization?.name)
|
|
1033
|
+
return `Enriched ${truncate(organization.name)}`;
|
|
1034
|
+
if (parsed && parsed.found === false)
|
|
1035
|
+
return "No match found";
|
|
1036
|
+
const domain = params?.domain;
|
|
1037
|
+
return domain ? `Enriched ${truncate(domain)}` : "Company enrichment complete";
|
|
1038
|
+
},
|
|
1039
|
+
approval: params => {
|
|
1040
|
+
const domain = params?.domain;
|
|
1041
|
+
return domain ? `Enrich ${truncate(domain)} via Apollo (uses a credit)?` : "Enrich this company via Apollo (uses a credit)?";
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
apollo_search_people: {
|
|
1045
|
+
preparing: "Preparing prospect search",
|
|
1046
|
+
executing: () => "Searching Apollo for people",
|
|
1047
|
+
complete: (_params, result) => {
|
|
1048
|
+
const parsed = safeParseResult(result);
|
|
1049
|
+
const total = parsed?.totalEntries;
|
|
1050
|
+
if (total !== undefined)
|
|
1051
|
+
return `Found ${total} matching ${total === 1 ? "person" : "people"}`;
|
|
1052
|
+
return "People search complete";
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
apollo_list_job_postings: {
|
|
1056
|
+
preparing: "Preparing job posting lookup",
|
|
1057
|
+
executing: params => {
|
|
1058
|
+
const organizationId = params?.organizationId;
|
|
1059
|
+
return organizationId ? `Loading job postings for ${truncate(organizationId)}` : "Loading job postings";
|
|
1060
|
+
},
|
|
1061
|
+
complete: (_params, result) => {
|
|
1062
|
+
const parsed = safeParseResult(result);
|
|
1063
|
+
const total = parsed?.totalPostings;
|
|
1064
|
+
if (total !== undefined)
|
|
1065
|
+
return `Found ${total} job posting${total !== 1 ? "s" : ""}`;
|
|
1066
|
+
return "Job postings loaded";
|
|
1067
|
+
}
|
|
979
1068
|
}
|
|
980
1069
|
};
|
|
981
1070
|
/**
|