terse-types 0.0.48 → 0.0.50
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/README.md +1 -1
- package/dist/Configs.d.ts +7 -1
- package/dist/Configs.js +8 -2
- package/dist/Events.d.ts +112 -0
- package/dist/Events.js +32 -0
- package/dist/Tools.d.ts +2 -0
- package/dist/Tools.js +2 -1
- package/dist/types.d.ts +16 -0
- package/package.json +1 -1
- package/dist/AttioRecordFlatten.d.ts +0 -19
- package/dist/AttioRecordFlatten.js +0 -71
- package/dist/OrganizationMetadata.d.ts +0 -6
- package/dist/OrganizationMetadata.js +0 -10
- package/dist/json-schema/terse-types.schema.json +0 -15994
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Internal shared types for the [Terse](https://useterse.ai) platform.
|
|
|
9
9
|
If you landed here while building a workflow, you almost certainly want one of these instead:
|
|
10
10
|
|
|
11
11
|
- **[`terse-cli`](https://www.npmjs.com/package/terse-cli)** to scaffold, test, and deploy workflows
|
|
12
|
-
- **[`terse-sdk`](https://www.npmjs.com/package/terse-sdk)** to write workflow code (`createJob`, `
|
|
12
|
+
- **[`terse-sdk`](https://www.npmjs.com/package/terse-sdk)** to write workflow code (`createJob`, `generateText`, trigger types)
|
|
13
13
|
- **[docs.useterse.ai](https://docs.useterse.ai)** for guides and reference
|
|
14
14
|
|
|
15
15
|
If a doc, post, or LLM pointed you at `terse-types` directly, that was probably a mistake on our end. [Let us know](mailto:support@useterse.ai) so we can fix it. The types you actually need are re-exported from `terse-sdk`.
|
package/dist/Configs.d.ts
CHANGED
|
@@ -678,11 +678,15 @@ export declare const WebConfigSchema: z.ZodObject<{
|
|
|
678
678
|
integrationId: z.ZodLiteral<"system">;
|
|
679
679
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
680
680
|
configType: z.ZodLiteral<ConfigType.WEB>;
|
|
681
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
681
682
|
}, z.core.$strip>;
|
|
682
683
|
export type WebConfigData = z.infer<typeof WebConfigSchema>;
|
|
683
684
|
export type WebConfigInstance = WebConfigData & ConfigBehavior;
|
|
684
685
|
export declare class WebConfig extends BaseConfigInstance<IntegrationType.TERSE, ConfigType.WEB, "system"> implements WebConfigInstance {
|
|
685
|
-
|
|
686
|
+
allowedDomains: string[] | null;
|
|
687
|
+
constructor(opts?: {
|
|
688
|
+
allowedDomains?: string[] | null;
|
|
689
|
+
});
|
|
686
690
|
isComplete(): boolean;
|
|
687
691
|
formatForAgent(): string;
|
|
688
692
|
}
|
|
@@ -1077,6 +1081,7 @@ export declare const configDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1077
1081
|
integrationId: z.ZodLiteral<"system">;
|
|
1078
1082
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1079
1083
|
configType: z.ZodLiteral<ConfigType.WEB>;
|
|
1084
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1080
1085
|
}, z.core.$strip>, z.ZodObject<{
|
|
1081
1086
|
integrationId: z.ZodLiteral<"system">;
|
|
1082
1087
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
@@ -1433,6 +1438,7 @@ export declare const skillConfigDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1433
1438
|
integrationId: z.ZodLiteral<"system">;
|
|
1434
1439
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1435
1440
|
configType: z.ZodLiteral<ConfigType.WEB>;
|
|
1441
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1436
1442
|
}, z.core.$strip>, z.ZodObject<{
|
|
1437
1443
|
integrationId: z.ZodLiteral<"system">;
|
|
1438
1444
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
package/dist/Configs.js
CHANGED
|
@@ -748,16 +748,22 @@ export class LaunchDarklyConfig extends BaseConfigInstance {
|
|
|
748
748
|
export const WebConfigSchema = ConfigInstanceSchema.extend({
|
|
749
749
|
integrationId: z.literal("system"),
|
|
750
750
|
integrationType: z.literal(IntegrationType.TERSE),
|
|
751
|
-
configType: z.literal(ConfigType.WEB)
|
|
751
|
+
configType: z.literal(ConfigType.WEB),
|
|
752
|
+
allowedDomains: z.array(z.string()).nullable().default(null)
|
|
752
753
|
});
|
|
753
754
|
export class WebConfig extends BaseConfigInstance {
|
|
754
|
-
|
|
755
|
+
allowedDomains;
|
|
756
|
+
constructor(opts = {}) {
|
|
755
757
|
super("system", IntegrationType.TERSE, ConfigType.WEB);
|
|
758
|
+
this.allowedDomains = opts.allowedDomains ?? null;
|
|
756
759
|
}
|
|
757
760
|
isComplete() {
|
|
758
761
|
return true;
|
|
759
762
|
}
|
|
760
763
|
formatForAgent() {
|
|
764
|
+
if (this.allowedDomains && this.allowedDomains.length > 0) {
|
|
765
|
+
return `Type: Web (search, extract, research)\nAllowed domains: ${this.allowedDomains.join(", ")}`;
|
|
766
|
+
}
|
|
761
767
|
return "Type: Web (search, extract, research)";
|
|
762
768
|
}
|
|
763
769
|
}
|
package/dist/Events.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const eventTypeSchema: z.ZodEnum<{
|
|
3
|
+
JOB_CREATED: "JOB_CREATED";
|
|
4
|
+
AUTOMATION_RAN: "AUTOMATION_RAN";
|
|
5
|
+
}>;
|
|
6
|
+
export type EventType = z.infer<typeof eventTypeSchema>;
|
|
7
|
+
declare const jobCreatedEventSchema: z.ZodObject<{
|
|
8
|
+
eventType: z.ZodLiteral<"JOB_CREATED">;
|
|
9
|
+
jobId: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type JobCreatedEvent = z.infer<typeof jobCreatedEventSchema>;
|
|
12
|
+
declare const automationSnapshotSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
organizationId: z.ZodString;
|
|
16
|
+
projectId: z.ZodString;
|
|
17
|
+
userId: z.ZodString;
|
|
18
|
+
requireApproval: z.ZodBoolean;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type AutomationSnapshot = z.infer<typeof automationSnapshotSchema>;
|
|
21
|
+
declare const runSnapshotSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
status: z.ZodEnum<{
|
|
24
|
+
readonly SUCCESS: "success";
|
|
25
|
+
readonly FAILED: "failed";
|
|
26
|
+
readonly CANCELLED: "cancelled";
|
|
27
|
+
readonly SKIPPED: "skipped";
|
|
28
|
+
readonly IN_PROGRESS: "in_progress";
|
|
29
|
+
readonly AWAITING_APPROVAL: "awaiting_approval";
|
|
30
|
+
}>;
|
|
31
|
+
isManuallyTriggered: z.ZodBoolean;
|
|
32
|
+
startedAt: z.ZodString;
|
|
33
|
+
trigger: z.ZodObject<{
|
|
34
|
+
event: z.ZodString;
|
|
35
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
36
|
+
source: z.ZodString;
|
|
37
|
+
title: z.ZodOptional<z.ZodString>;
|
|
38
|
+
subheader: z.ZodOptional<z.ZodString>;
|
|
39
|
+
url: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type RunSnapshot = z.infer<typeof runSnapshotSchema>;
|
|
43
|
+
declare const automationRanEventSchema: z.ZodObject<{
|
|
44
|
+
eventType: z.ZodLiteral<"AUTOMATION_RAN">;
|
|
45
|
+
automation: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
organizationId: z.ZodString;
|
|
49
|
+
projectId: z.ZodString;
|
|
50
|
+
userId: z.ZodString;
|
|
51
|
+
requireApproval: z.ZodBoolean;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
run: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
status: z.ZodEnum<{
|
|
56
|
+
readonly SUCCESS: "success";
|
|
57
|
+
readonly FAILED: "failed";
|
|
58
|
+
readonly CANCELLED: "cancelled";
|
|
59
|
+
readonly SKIPPED: "skipped";
|
|
60
|
+
readonly IN_PROGRESS: "in_progress";
|
|
61
|
+
readonly AWAITING_APPROVAL: "awaiting_approval";
|
|
62
|
+
}>;
|
|
63
|
+
isManuallyTriggered: z.ZodBoolean;
|
|
64
|
+
startedAt: z.ZodString;
|
|
65
|
+
trigger: z.ZodObject<{
|
|
66
|
+
event: z.ZodString;
|
|
67
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
68
|
+
source: z.ZodString;
|
|
69
|
+
title: z.ZodOptional<z.ZodString>;
|
|
70
|
+
subheader: z.ZodOptional<z.ZodString>;
|
|
71
|
+
url: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type AutomationRanEvent = z.infer<typeof automationRanEventSchema>;
|
|
76
|
+
export declare const domainEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
eventType: z.ZodLiteral<"JOB_CREATED">;
|
|
78
|
+
jobId: z.ZodString;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
eventType: z.ZodLiteral<"AUTOMATION_RAN">;
|
|
81
|
+
automation: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
organizationId: z.ZodString;
|
|
85
|
+
projectId: z.ZodString;
|
|
86
|
+
userId: z.ZodString;
|
|
87
|
+
requireApproval: z.ZodBoolean;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
run: z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
status: z.ZodEnum<{
|
|
92
|
+
readonly SUCCESS: "success";
|
|
93
|
+
readonly FAILED: "failed";
|
|
94
|
+
readonly CANCELLED: "cancelled";
|
|
95
|
+
readonly SKIPPED: "skipped";
|
|
96
|
+
readonly IN_PROGRESS: "in_progress";
|
|
97
|
+
readonly AWAITING_APPROVAL: "awaiting_approval";
|
|
98
|
+
}>;
|
|
99
|
+
isManuallyTriggered: z.ZodBoolean;
|
|
100
|
+
startedAt: z.ZodString;
|
|
101
|
+
trigger: z.ZodObject<{
|
|
102
|
+
event: z.ZodString;
|
|
103
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
104
|
+
source: z.ZodString;
|
|
105
|
+
title: z.ZodOptional<z.ZodString>;
|
|
106
|
+
subheader: z.ZodOptional<z.ZodString>;
|
|
107
|
+
url: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
}, z.core.$strip>], "eventType">;
|
|
111
|
+
export type DomainEvent = z.infer<typeof domainEventSchema>;
|
|
112
|
+
export {};
|
package/dist/Events.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runHistoryStatusSchema } from "./RunHistoryTypes.js";
|
|
3
|
+
import { runHistoryTriggerSchema } from "./types.js";
|
|
4
|
+
export const eventTypeSchema = z.enum(["JOB_CREATED", "AUTOMATION_RAN"]);
|
|
5
|
+
const baseEventSchema = z.object({
|
|
6
|
+
eventType: eventTypeSchema
|
|
7
|
+
});
|
|
8
|
+
const jobCreatedEventSchema = baseEventSchema.extend({
|
|
9
|
+
eventType: z.literal("JOB_CREATED"),
|
|
10
|
+
jobId: z.string()
|
|
11
|
+
});
|
|
12
|
+
const automationSnapshotSchema = z.object({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
organizationId: z.string(),
|
|
16
|
+
projectId: z.string(),
|
|
17
|
+
userId: z.string(),
|
|
18
|
+
requireApproval: z.boolean()
|
|
19
|
+
});
|
|
20
|
+
const runSnapshotSchema = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
status: runHistoryStatusSchema,
|
|
23
|
+
isManuallyTriggered: z.boolean(),
|
|
24
|
+
startedAt: z.string().datetime(),
|
|
25
|
+
trigger: runHistoryTriggerSchema
|
|
26
|
+
});
|
|
27
|
+
const automationRanEventSchema = baseEventSchema.extend({
|
|
28
|
+
eventType: z.literal("AUTOMATION_RAN"),
|
|
29
|
+
automation: automationSnapshotSchema,
|
|
30
|
+
run: runSnapshotSchema
|
|
31
|
+
});
|
|
32
|
+
export const domainEventSchema = z.discriminatedUnion("eventType", [jobCreatedEventSchema, automationRanEventSchema]);
|
package/dist/Tools.d.ts
CHANGED
|
@@ -5289,6 +5289,7 @@ export declare const webSearchTool: {
|
|
|
5289
5289
|
month: "month";
|
|
5290
5290
|
year: "year";
|
|
5291
5291
|
}>>;
|
|
5292
|
+
include_domains: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
5292
5293
|
}, z.core.$strip>;
|
|
5293
5294
|
outputSchema: z.ZodObject<{
|
|
5294
5295
|
query: z.ZodString;
|
|
@@ -8248,6 +8249,7 @@ export declare const ToolDefinitions: {
|
|
|
8248
8249
|
month: "month";
|
|
8249
8250
|
year: "year";
|
|
8250
8251
|
}>>;
|
|
8252
|
+
include_domains: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
8251
8253
|
}, z.core.$strip>;
|
|
8252
8254
|
outputSchema: z.ZodObject<{
|
|
8253
8255
|
query: z.ZodString;
|
package/dist/Tools.js
CHANGED
|
@@ -1828,7 +1828,8 @@ export const webSearchTool = defineTool({
|
|
|
1828
1828
|
search_depth: z.enum(["basic", "advanced"]).nullable().describe("'basic' is faster, 'advanced' is more thorough (default 'basic')"),
|
|
1829
1829
|
include_answer: z.boolean().nullable().describe("Include an LLM-generated answer summarizing the results (default false)"),
|
|
1830
1830
|
topic: z.enum(["general", "news"]).nullable().describe("'news' for recent news articles, 'general' for all web content (default 'general')"),
|
|
1831
|
-
time_range: z.enum(["day", "week", "month", "year"]).nullable().describe("Filter results by recency")
|
|
1831
|
+
time_range: z.enum(["day", "week", "month", "year"]).nullable().describe("Filter results by recency"),
|
|
1832
|
+
include_domains: z.array(z.string()).nullable().describe("Restrict results to these domains (e.g. ['example.com']). Required when web access is limited to an allowed list of domains.")
|
|
1832
1833
|
}),
|
|
1833
1834
|
outputSchema: webSearchOutputSchema
|
|
1834
1835
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -419,6 +419,7 @@ export declare const agentTriggerSchema: z.ZodObject<{
|
|
|
419
419
|
integrationId: z.ZodLiteral<"system">;
|
|
420
420
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
421
421
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
422
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
422
423
|
}, z.core.$strip>, z.ZodObject<{
|
|
423
424
|
integrationId: z.ZodLiteral<"system">;
|
|
424
425
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -664,6 +665,7 @@ export declare const agentOutputSchema: z.ZodObject<{
|
|
|
664
665
|
integrationId: z.ZodLiteral<"system">;
|
|
665
666
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
666
667
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
668
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
667
669
|
}, z.core.$strip>, z.ZodObject<{
|
|
668
670
|
integrationId: z.ZodLiteral<"system">;
|
|
669
671
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -910,6 +912,7 @@ export declare const transientAgentTriggerSchema: z.ZodObject<{
|
|
|
910
912
|
integrationId: z.ZodLiteral<"system">;
|
|
911
913
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
912
914
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
915
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
913
916
|
}, z.core.$strip>, z.ZodObject<{
|
|
914
917
|
integrationId: z.ZodLiteral<"system">;
|
|
915
918
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -1153,6 +1156,7 @@ export declare const transientAgentOutputSchema: z.ZodObject<{
|
|
|
1153
1156
|
integrationId: z.ZodLiteral<"system">;
|
|
1154
1157
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
1155
1158
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
1159
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1156
1160
|
}, z.core.$strip>, z.ZodObject<{
|
|
1157
1161
|
integrationId: z.ZodLiteral<"system">;
|
|
1158
1162
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -1605,6 +1609,7 @@ export declare const agentSchema: z.ZodObject<{
|
|
|
1605
1609
|
integrationId: z.ZodLiteral<"system">;
|
|
1606
1610
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
1607
1611
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
1612
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1608
1613
|
}, z.core.$strip>, z.ZodObject<{
|
|
1609
1614
|
integrationId: z.ZodLiteral<"system">;
|
|
1610
1615
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -1849,6 +1854,7 @@ export declare const agentSchema: z.ZodObject<{
|
|
|
1849
1854
|
integrationId: z.ZodLiteral<"system">;
|
|
1850
1855
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
1851
1856
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
1857
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1852
1858
|
}, z.core.$strip>, z.ZodObject<{
|
|
1853
1859
|
integrationId: z.ZodLiteral<"system">;
|
|
1854
1860
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -2113,6 +2119,7 @@ export declare const agentUpdateSchema: z.ZodObject<{
|
|
|
2113
2119
|
integrationId: z.ZodLiteral<"system">;
|
|
2114
2120
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
2115
2121
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
2122
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
2116
2123
|
}, z.core.$strip>, z.ZodObject<{
|
|
2117
2124
|
integrationId: z.ZodLiteral<"system">;
|
|
2118
2125
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -2357,6 +2364,7 @@ export declare const agentUpdateSchema: z.ZodObject<{
|
|
|
2357
2364
|
integrationId: z.ZodLiteral<"system">;
|
|
2358
2365
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
2359
2366
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
2367
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
2360
2368
|
}, z.core.$strip>, z.ZodObject<{
|
|
2361
2369
|
integrationId: z.ZodLiteral<"system">;
|
|
2362
2370
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -2632,6 +2640,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
2632
2640
|
integrationId: z.ZodLiteral<"system">;
|
|
2633
2641
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
2634
2642
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
2643
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
2635
2644
|
}, z.core.$strip>, z.ZodObject<{
|
|
2636
2645
|
integrationId: z.ZodLiteral<"system">;
|
|
2637
2646
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -2876,6 +2885,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
2876
2885
|
integrationId: z.ZodLiteral<"system">;
|
|
2877
2886
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
2878
2887
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
2888
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
2879
2889
|
}, z.core.$strip>, z.ZodObject<{
|
|
2880
2890
|
integrationId: z.ZodLiteral<"system">;
|
|
2881
2891
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -3153,6 +3163,7 @@ export declare const recentAgentSchema: z.ZodObject<{
|
|
|
3153
3163
|
integrationId: z.ZodLiteral<"system">;
|
|
3154
3164
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
3155
3165
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
3166
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
3156
3167
|
}, z.core.$strip>, z.ZodObject<{
|
|
3157
3168
|
integrationId: z.ZodLiteral<"system">;
|
|
3158
3169
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -3397,6 +3408,7 @@ export declare const recentAgentSchema: z.ZodObject<{
|
|
|
3397
3408
|
integrationId: z.ZodLiteral<"system">;
|
|
3398
3409
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
3399
3410
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
3411
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
3400
3412
|
}, z.core.$strip>, z.ZodObject<{
|
|
3401
3413
|
integrationId: z.ZodLiteral<"system">;
|
|
3402
3414
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -3992,6 +4004,7 @@ export declare const sdkAgentRunRequestBodySchema: z.ZodObject<{
|
|
|
3992
4004
|
integrationId: z.ZodLiteral<"system">;
|
|
3993
4005
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
3994
4006
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
4007
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
3995
4008
|
}, z.core.$strip>, z.ZodObject<{
|
|
3996
4009
|
integrationId: z.ZodLiteral<"system">;
|
|
3997
4010
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -6085,6 +6098,7 @@ export declare const sdkAgentRunNormalizedRequestSchema: z.ZodObject<{
|
|
|
6085
6098
|
integrationId: z.ZodLiteral<"system">;
|
|
6086
6099
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
6087
6100
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
6101
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
6088
6102
|
}, z.core.$strip>, z.ZodObject<{
|
|
6089
6103
|
integrationId: z.ZodLiteral<"system">;
|
|
6090
6104
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -8176,6 +8190,7 @@ export declare const sdkAgentRunResponseBodySchema: z.ZodObject<{
|
|
|
8176
8190
|
integrationId: z.ZodLiteral<"system">;
|
|
8177
8191
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
8178
8192
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
8193
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
8179
8194
|
}, z.core.$strip>, z.ZodObject<{
|
|
8180
8195
|
integrationId: z.ZodLiteral<"system">;
|
|
8181
8196
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
@@ -11113,6 +11128,7 @@ export declare const sdkSampleEventsRequestSchema: z.ZodObject<{
|
|
|
11113
11128
|
integrationId: z.ZodLiteral<"system">;
|
|
11114
11129
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
|
11115
11130
|
configType: z.ZodLiteral<import("./Configs.js").ConfigType.WEB>;
|
|
11131
|
+
allowedDomains: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
11116
11132
|
}, z.core.$strip>, z.ZodObject<{
|
|
11117
11133
|
integrationId: z.ZodLiteral<"system">;
|
|
11118
11134
|
integrationType: z.ZodLiteral<import("./Integrations.js").IntegrationType.TERSE>;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
3
|
-
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
4
|
-
*/
|
|
5
|
-
export declare function flattenAttioLeafValue(value: unknown): unknown;
|
|
6
|
-
/**
|
|
7
|
-
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
8
|
-
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
9
|
-
*/
|
|
10
|
-
export declare function flattenAttioAttributeValue(rawValue: unknown, preferArray: boolean): unknown;
|
|
11
|
-
/**
|
|
12
|
-
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
13
|
-
*/
|
|
14
|
-
export declare function flattenAttioRecordValues(values: Record<string, unknown>, isMultiValueAttribute: (attributeSlug: string) => boolean): Record<string, unknown>;
|
|
15
|
-
/**
|
|
16
|
-
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
17
|
-
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
18
|
-
*/
|
|
19
|
-
export declare function isProbablyAttioMultiValueAttributeSlug(attributeSlug: string): boolean;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/** Keys Attio nests on attribute timeline entries (not the semantic payload). */
|
|
2
|
-
const ATTIO_VALUE_METADATA_KEYS = new Set([
|
|
3
|
-
"active_from",
|
|
4
|
-
"active_until",
|
|
5
|
-
"attribute_type",
|
|
6
|
-
"created_by_actor"
|
|
7
|
-
]);
|
|
8
|
-
/**
|
|
9
|
-
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
10
|
-
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
11
|
-
*/
|
|
12
|
-
export function flattenAttioLeafValue(value) {
|
|
13
|
-
if (value === null || value === undefined)
|
|
14
|
-
return value;
|
|
15
|
-
if (Array.isArray(value))
|
|
16
|
-
return value.map(entry => flattenAttioLeafValue(entry));
|
|
17
|
-
if (typeof value !== "object")
|
|
18
|
-
return value;
|
|
19
|
-
const rawObject = value;
|
|
20
|
-
if (typeof rawObject.full_name === "string")
|
|
21
|
-
return rawObject.full_name;
|
|
22
|
-
if (typeof rawObject.email_address === "string")
|
|
23
|
-
return rawObject.email_address;
|
|
24
|
-
if (typeof rawObject.domain === "string")
|
|
25
|
-
return rawObject.domain;
|
|
26
|
-
if (typeof rawObject.phone_number === "string")
|
|
27
|
-
return rawObject.phone_number;
|
|
28
|
-
if ("value" in rawObject)
|
|
29
|
-
return flattenAttioLeafValue(rawObject.value);
|
|
30
|
-
const dataEntries = Object.entries(rawObject).filter(([key]) => !ATTIO_VALUE_METADATA_KEYS.has(key));
|
|
31
|
-
if (dataEntries.length === 0)
|
|
32
|
-
return rawObject;
|
|
33
|
-
if (dataEntries.length === 1)
|
|
34
|
-
return flattenAttioLeafValue(dataEntries[0][1]);
|
|
35
|
-
return Object.fromEntries(dataEntries.map(([key, entryValue]) => [key, flattenAttioLeafValue(entryValue)]));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
39
|
-
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
40
|
-
*/
|
|
41
|
-
export function flattenAttioAttributeValue(rawValue, preferArray) {
|
|
42
|
-
if (!Array.isArray(rawValue))
|
|
43
|
-
return flattenAttioLeafValue(rawValue);
|
|
44
|
-
const flattened = rawValue.map(entry => flattenAttioLeafValue(entry)).filter(entry => entry !== undefined);
|
|
45
|
-
return preferArray ? flattened : flattened[0];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
49
|
-
*/
|
|
50
|
-
export function flattenAttioRecordValues(values, isMultiValueAttribute) {
|
|
51
|
-
const flattenedValues = {};
|
|
52
|
-
for (const [attributeSlug, rawValue] of Object.entries(values)) {
|
|
53
|
-
flattenedValues[attributeSlug] = flattenAttioAttributeValue(rawValue, isMultiValueAttribute(attributeSlug));
|
|
54
|
-
}
|
|
55
|
-
return flattenedValues;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
59
|
-
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
60
|
-
*/
|
|
61
|
-
export function isProbablyAttioMultiValueAttributeSlug(attributeSlug) {
|
|
62
|
-
const slug = attributeSlug.toLowerCase();
|
|
63
|
-
return (slug === "email_addresses" ||
|
|
64
|
-
slug === "domains" ||
|
|
65
|
-
slug === "phone_numbers" ||
|
|
66
|
-
slug === "social_profiles" ||
|
|
67
|
-
slug === "links" ||
|
|
68
|
-
slug === "tags" ||
|
|
69
|
-
slug.endsWith("_addresses") ||
|
|
70
|
-
slug.endsWith("_ids"));
|
|
71
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const organizationMetadataSchema: z.ZodObject<{
|
|
3
|
-
stripeCustomerId: z.ZodString;
|
|
4
|
-
runExecutionBlocked: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>, z.ZodTransform<boolean, string | boolean | undefined>>;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export type OrganizationMetadata = z.infer<typeof organizationMetadataSchema>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Can be serialized a string, supports deserialization
|
|
3
|
-
const booleanMetadataSchema = z
|
|
4
|
-
.union([z.boolean(), z.string()])
|
|
5
|
-
.optional()
|
|
6
|
-
.transform(value => value === true || value === "true");
|
|
7
|
-
export const organizationMetadataSchema = z.object({
|
|
8
|
-
stripeCustomerId: z.string(),
|
|
9
|
-
runExecutionBlocked: booleanMetadataSchema
|
|
10
|
-
});
|