terse-types 0.0.75 → 0.0.76

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.
@@ -119,6 +119,7 @@ export declare const ApiRoutes: {
119
119
  LIST: string;
120
120
  DISCONNECT_BY_TYPE: string;
121
121
  ACTIVE: string;
122
+ CONNECTIONS_BY_TYPE: string;
122
123
  };
123
124
  NOTIFICATION_DESTINATIONS: {
124
125
  LIST: string;
@@ -118,7 +118,8 @@
118
118
  "INSTALLATION_DETAILS_BY_TYPE": "/integrations/:integrationType/installation-details",
119
119
  "LIST": "/integrations",
120
120
  "DISCONNECT_BY_TYPE": "/integrations/:integrationType/disconnect",
121
- "ACTIVE": "/integrations/active"
121
+ "ACTIVE": "/integrations/active",
122
+ "CONNECTIONS_BY_TYPE": "/integrations/:integrationType/connections"
122
123
  },
123
124
  "NOTIFICATION_DESTINATIONS": {
124
125
  "LIST": "/notification-destinations",
@@ -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]);
@@ -250,8 +250,8 @@ export declare const CliIntegrationDisplayStateSchema: z.ZodDiscriminatedUnion<[
250
250
  status: z.ZodLiteral<"not_connected">;
251
251
  }, z.core.$strip>, z.ZodObject<{
252
252
  status: z.ZodLiteral<"connected">;
253
- summaryLabel: z.ZodString;
254
- summaryValue: z.ZodString;
253
+ connectionLabel: z.ZodString;
254
+ connectionName: z.ZodString;
255
255
  integrationId: z.ZodString;
256
256
  }, z.core.$strip>], "status">;
257
257
  export type CliIntegrationDisplayState = z.infer<typeof CliIntegrationDisplayStateSchema>;
@@ -262,9 +262,21 @@ export declare const IntegrationWithStatusSchema: z.ZodObject<{
262
262
  status: z.ZodLiteral<"not_connected">;
263
263
  }, z.core.$strip>, z.ZodObject<{
264
264
  status: z.ZodLiteral<"connected">;
265
- summaryLabel: z.ZodString;
266
- summaryValue: z.ZodString;
265
+ connectionLabel: z.ZodString;
266
+ connectionName: z.ZodString;
267
267
  integrationId: z.ZodString;
268
268
  }, z.core.$strip>], "status">;
269
269
  }, z.core.$strip>;
270
270
  export type IntegrationWithStatus = z.infer<typeof IntegrationWithStatusSchema>;
271
+ export declare const IntegrationConnectionSchema: z.ZodObject<{
272
+ id: z.ZodString;
273
+ name: z.ZodString;
274
+ }, z.core.$strip>;
275
+ export type IntegrationConnection = z.infer<typeof IntegrationConnectionSchema>;
276
+ export declare const IntegrationConnectionsResponseSchema: z.ZodObject<{
277
+ connections: z.ZodArray<z.ZodObject<{
278
+ id: z.ZodString;
279
+ name: z.ZodString;
280
+ }, z.core.$strip>>;
281
+ }, z.core.$strip>;
282
+ export type IntegrationConnectionsResponse = z.infer<typeof IntegrationConnectionsResponseSchema>;
@@ -234,8 +234,8 @@ export const CliIntegrationDisplayStateSchema = z.discriminatedUnion("status", [
234
234
  }),
235
235
  z.object({
236
236
  status: z.literal("connected"),
237
- summaryLabel: z.string(),
238
- summaryValue: z.string(),
237
+ connectionLabel: z.string(),
238
+ connectionName: z.string(),
239
239
  integrationId: z.string()
240
240
  })
241
241
  ]);
@@ -244,3 +244,10 @@ export const IntegrationWithStatusSchema = z.object({
244
244
  isActive: z.boolean(),
245
245
  cliDisplayState: CliIntegrationDisplayStateSchema
246
246
  });
247
+ export const IntegrationConnectionSchema = z.object({
248
+ id: z.string(),
249
+ name: z.string()
250
+ });
251
+ export const IntegrationConnectionsResponseSchema = z.object({
252
+ connections: z.array(IntegrationConnectionSchema)
253
+ });
@@ -0,0 +1,18 @@
1
+ import type * as z from "zod";
2
+ export declare const triggerPayloadProjections: Readonly<Record<string, TriggerPayloadProjection>>;
3
+ export declare function isProjectedTriggerName(name: string): boolean;
4
+ export type TriggerPayloadSchemaProjection = {
5
+ kind: "schema";
6
+ schema: z.ZodType;
7
+ /** Printed verbatim after the payload interface name, e.g. "<TBody = unknown>". */
8
+ typeParams?: string;
9
+ /** Dot-path within the payload -> TypeScript type expression printed instead of the schema field. */
10
+ fieldOverrides?: Record<string, string>;
11
+ /** Extra terse-sdk type imports the overrides reference. */
12
+ sdkImports?: string[];
13
+ };
14
+ export type TriggerPayloadUnionProjection = {
15
+ kind: "union";
16
+ members: string[];
17
+ };
18
+ export type TriggerPayloadProjection = TriggerPayloadSchemaProjection | TriggerPayloadUnionProjection;
@@ -0,0 +1,167 @@
1
+ import { GithubIssueCommentCreatedTriggerSchema, GithubPRClosedTriggerSchema, GithubPRMergedTriggerSchema, GithubPROpenedTriggerSchema, GithubPRSynchronizedTriggerSchema, GithubPushTriggerSchema, attioCallRecordingCreatedTriggerSchema, attioCommentCreatedTriggerSchema, attioCommentDeletedTriggerSchema, attioCommentResolvedTriggerSchema, attioCommentUnresolvedTriggerSchema, attioListAttributeCreatedTriggerSchema, attioListAttributeUpdatedTriggerSchema, attioListCreatedTriggerSchema, attioListDeletedTriggerSchema, attioListEntryCreatedTriggerSchema, attioListEntryDeletedTriggerSchema, attioListEntryUpdatedTriggerSchema, attioListUpdatedTriggerSchema, attioNoteContentUpdatedTriggerSchema, attioNoteCreatedTriggerSchema, attioNoteDeletedTriggerSchema, attioNoteUpdatedTriggerSchema, attioObjectAttributeCreatedTriggerSchema, attioObjectAttributeUpdatedTriggerSchema, attioRecordCreatedTriggerSchema, attioRecordDeletedTriggerSchema, attioRecordMergedTriggerSchema, attioRecordUpdatedTriggerSchema, attioTaskCreatedTriggerSchema, attioTaskDeletedTriggerSchema, attioTaskUpdatedTriggerSchema, attioWorkspaceMemberCreatedTriggerSchema, cronTriggerSchema, gmailTriggerSchema, heyReachCampaignCompletedTriggerSchema, heyReachConnectionRequestAcceptedTriggerSchema, heyReachConnectionRequestSentTriggerSchema, heyReachFollowSentTriggerSchema, heyReachInmailReplyReceivedTriggerSchema, heyReachInmailSentTriggerSchema, heyReachLeadTagUpdatedTriggerSchema, heyReachLikedPostTriggerSchema, heyReachMessageReplyReceivedTriggerSchema, heyReachMessageSentTriggerSchema, heyReachViewedProfileTriggerSchema, linearCommentCreatedTriggerSchema, linearIssueCreatedTriggerSchema, linearIssueUpdatedTriggerSchema, slackAppMentionTriggerSchema, slackMessageTriggerSchema, slackReactionAddedTriggerSchema, webMonitorTriggerSchema, webhookTriggerSchema, workOSInvitationAcceptedTriggerSchema, workOSInvitationCreatedTriggerSchema, workOSInvitationResentTriggerSchema, workOSInvitationRevokedTriggerSchema, workOSOrganizationMembershipCreatedTriggerSchema, workOSOrganizationMembershipDeletedTriggerSchema, workOSOrganizationMembershipUpdatedTriggerSchema, workOSOrganizationTriggerSchema, workOSUserCreatedTriggerSchema, workOSUserDeletedTriggerSchema, workOSUserUpdatedTriggerSchema } from "./Triggers.js";
2
+ // The hand-written SlackMessageTrigger et al. widen these schema fields (z.array(z.unknown()))
3
+ // to the structured Slack types, so projections must print the widened form.
4
+ const slackWidenedFields = {
5
+ blocks: "SlackBlocks | null",
6
+ attachments: "SlackAttachments | null",
7
+ files: "SlackFiles | null"
8
+ };
9
+ const slackSdkImports = ["SlackAttachments", "SlackBlocks", "SlackFiles"];
10
+ const attioRecordProjection = (schema) => ({
11
+ kind: "schema",
12
+ schema,
13
+ typeParams: "<TValues = Record<string, unknown>>",
14
+ // The registered attio event transform flattens record.values before handlers run,
15
+ // matching the SDK-level generic, not the raw wire shape.
16
+ fieldOverrides: { "record.values": "TValues" }
17
+ });
18
+ export const triggerPayloadProjections = {
19
+ SlackMessageTrigger: { kind: "schema", schema: slackMessageTriggerSchema, fieldOverrides: slackWidenedFields, sdkImports: slackSdkImports },
20
+ SlackAppMentionTrigger: { kind: "schema", schema: slackAppMentionTriggerSchema, fieldOverrides: slackWidenedFields, sdkImports: slackSdkImports },
21
+ SlackReactionAddedTrigger: { kind: "schema", schema: slackReactionAddedTriggerSchema, fieldOverrides: slackWidenedFields, sdkImports: slackSdkImports },
22
+ SlackTrigger: { kind: "union", members: ["SlackMessageTrigger", "SlackAppMentionTrigger", "SlackReactionAddedTrigger"] },
23
+ GithubPushTrigger: { kind: "schema", schema: GithubPushTriggerSchema },
24
+ GithubPROpenedTrigger: { kind: "schema", schema: GithubPROpenedTriggerSchema },
25
+ GithubPRSynchronizedTrigger: { kind: "schema", schema: GithubPRSynchronizedTriggerSchema },
26
+ GithubPRClosedTrigger: { kind: "schema", schema: GithubPRClosedTriggerSchema },
27
+ GithubPRMergedTrigger: { kind: "schema", schema: GithubPRMergedTriggerSchema },
28
+ GithubIssueCommentCreatedTrigger: { kind: "schema", schema: GithubIssueCommentCreatedTriggerSchema },
29
+ GithubPRTrigger: { kind: "union", members: ["GithubPROpenedTrigger", "GithubPRSynchronizedTrigger", "GithubPRClosedTrigger", "GithubPRMergedTrigger"] },
30
+ GithubTrigger: {
31
+ kind: "union",
32
+ members: ["GithubPushTrigger", "GithubPROpenedTrigger", "GithubPRSynchronizedTrigger", "GithubPRClosedTrigger", "GithubPRMergedTrigger", "GithubIssueCommentCreatedTrigger"]
33
+ },
34
+ GmailTrigger: { kind: "schema", schema: gmailTriggerSchema },
35
+ LinearIssueCreatedTrigger: { kind: "schema", schema: linearIssueCreatedTriggerSchema },
36
+ LinearIssueUpdatedTrigger: { kind: "schema", schema: linearIssueUpdatedTriggerSchema },
37
+ LinearCommentCreatedTrigger: { kind: "schema", schema: linearCommentCreatedTriggerSchema },
38
+ LinearTrigger: { kind: "union", members: ["LinearIssueCreatedTrigger", "LinearIssueUpdatedTrigger", "LinearCommentCreatedTrigger"] },
39
+ WorkOSUserCreatedTrigger: { kind: "schema", schema: workOSUserCreatedTriggerSchema },
40
+ WorkOSUserUpdatedTrigger: { kind: "schema", schema: workOSUserUpdatedTriggerSchema },
41
+ WorkOSUserDeletedTrigger: { kind: "schema", schema: workOSUserDeletedTriggerSchema },
42
+ WorkOSUserTrigger: { kind: "union", members: ["WorkOSUserCreatedTrigger", "WorkOSUserUpdatedTrigger", "WorkOSUserDeletedTrigger"] },
43
+ WorkOSOrganizationMembershipCreatedTrigger: { kind: "schema", schema: workOSOrganizationMembershipCreatedTriggerSchema },
44
+ WorkOSOrganizationMembershipUpdatedTrigger: { kind: "schema", schema: workOSOrganizationMembershipUpdatedTriggerSchema },
45
+ WorkOSOrganizationMembershipDeletedTrigger: { kind: "schema", schema: workOSOrganizationMembershipDeletedTriggerSchema },
46
+ WorkOSMembershipTrigger: {
47
+ kind: "union",
48
+ members: ["WorkOSOrganizationMembershipCreatedTrigger", "WorkOSOrganizationMembershipUpdatedTrigger", "WorkOSOrganizationMembershipDeletedTrigger"]
49
+ },
50
+ WorkOSInvitationCreatedTrigger: { kind: "schema", schema: workOSInvitationCreatedTriggerSchema },
51
+ WorkOSInvitationAcceptedTrigger: { kind: "schema", schema: workOSInvitationAcceptedTriggerSchema },
52
+ WorkOSInvitationResentTrigger: { kind: "schema", schema: workOSInvitationResentTriggerSchema },
53
+ WorkOSInvitationRevokedTrigger: { kind: "schema", schema: workOSInvitationRevokedTriggerSchema },
54
+ WorkOSInvitationTrigger: {
55
+ kind: "union",
56
+ members: ["WorkOSInvitationCreatedTrigger", "WorkOSInvitationAcceptedTrigger", "WorkOSInvitationResentTrigger", "WorkOSInvitationRevokedTrigger"]
57
+ },
58
+ WorkOSOrganizationTrigger: { kind: "schema", schema: workOSOrganizationTriggerSchema },
59
+ WorkOSTrigger: {
60
+ kind: "union",
61
+ members: [
62
+ "WorkOSUserCreatedTrigger",
63
+ "WorkOSUserUpdatedTrigger",
64
+ "WorkOSUserDeletedTrigger",
65
+ "WorkOSOrganizationMembershipCreatedTrigger",
66
+ "WorkOSOrganizationMembershipUpdatedTrigger",
67
+ "WorkOSOrganizationMembershipDeletedTrigger",
68
+ "WorkOSInvitationCreatedTrigger",
69
+ "WorkOSInvitationAcceptedTrigger",
70
+ "WorkOSInvitationResentTrigger",
71
+ "WorkOSInvitationRevokedTrigger",
72
+ "WorkOSOrganizationTrigger"
73
+ ]
74
+ },
75
+ HeyReachConnectionRequestSentTrigger: { kind: "schema", schema: heyReachConnectionRequestSentTriggerSchema },
76
+ HeyReachConnectionRequestAcceptedTrigger: { kind: "schema", schema: heyReachConnectionRequestAcceptedTriggerSchema },
77
+ HeyReachMessageSentTrigger: { kind: "schema", schema: heyReachMessageSentTriggerSchema },
78
+ HeyReachMessageReplyReceivedTrigger: { kind: "schema", schema: heyReachMessageReplyReceivedTriggerSchema },
79
+ HeyReachInmailSentTrigger: { kind: "schema", schema: heyReachInmailSentTriggerSchema },
80
+ HeyReachInmailReplyReceivedTrigger: { kind: "schema", schema: heyReachInmailReplyReceivedTriggerSchema },
81
+ HeyReachFollowSentTrigger: { kind: "schema", schema: heyReachFollowSentTriggerSchema },
82
+ HeyReachLikedPostTrigger: { kind: "schema", schema: heyReachLikedPostTriggerSchema },
83
+ HeyReachViewedProfileTrigger: { kind: "schema", schema: heyReachViewedProfileTriggerSchema },
84
+ HeyReachCampaignCompletedTrigger: { kind: "schema", schema: heyReachCampaignCompletedTriggerSchema },
85
+ HeyReachLeadTagUpdatedTrigger: { kind: "schema", schema: heyReachLeadTagUpdatedTriggerSchema },
86
+ HeyReachTrigger: {
87
+ kind: "union",
88
+ members: [
89
+ "HeyReachConnectionRequestSentTrigger",
90
+ "HeyReachConnectionRequestAcceptedTrigger",
91
+ "HeyReachMessageSentTrigger",
92
+ "HeyReachMessageReplyReceivedTrigger",
93
+ "HeyReachInmailSentTrigger",
94
+ "HeyReachInmailReplyReceivedTrigger",
95
+ "HeyReachFollowSentTrigger",
96
+ "HeyReachLikedPostTrigger",
97
+ "HeyReachViewedProfileTrigger",
98
+ "HeyReachCampaignCompletedTrigger",
99
+ "HeyReachLeadTagUpdatedTrigger"
100
+ ]
101
+ },
102
+ AttioCallRecordingCreatedTrigger: { kind: "schema", schema: attioCallRecordingCreatedTriggerSchema },
103
+ AttioCommentCreatedTrigger: { kind: "schema", schema: attioCommentCreatedTriggerSchema },
104
+ AttioCommentResolvedTrigger: { kind: "schema", schema: attioCommentResolvedTriggerSchema },
105
+ AttioCommentUnresolvedTrigger: { kind: "schema", schema: attioCommentUnresolvedTriggerSchema },
106
+ AttioCommentDeletedTrigger: { kind: "schema", schema: attioCommentDeletedTriggerSchema },
107
+ AttioListCreatedTrigger: { kind: "schema", schema: attioListCreatedTriggerSchema },
108
+ AttioListUpdatedTrigger: { kind: "schema", schema: attioListUpdatedTriggerSchema },
109
+ AttioListDeletedTrigger: { kind: "schema", schema: attioListDeletedTriggerSchema },
110
+ AttioListAttributeCreatedTrigger: { kind: "schema", schema: attioListAttributeCreatedTriggerSchema },
111
+ AttioListAttributeUpdatedTrigger: { kind: "schema", schema: attioListAttributeUpdatedTriggerSchema },
112
+ AttioListEntryCreatedTrigger: { kind: "schema", schema: attioListEntryCreatedTriggerSchema },
113
+ AttioListEntryUpdatedTrigger: { kind: "schema", schema: attioListEntryUpdatedTriggerSchema },
114
+ AttioListEntryDeletedTrigger: { kind: "schema", schema: attioListEntryDeletedTriggerSchema },
115
+ AttioObjectAttributeCreatedTrigger: { kind: "schema", schema: attioObjectAttributeCreatedTriggerSchema },
116
+ AttioObjectAttributeUpdatedTrigger: { kind: "schema", schema: attioObjectAttributeUpdatedTriggerSchema },
117
+ AttioNoteCreatedTrigger: { kind: "schema", schema: attioNoteCreatedTriggerSchema },
118
+ AttioNoteContentUpdatedTrigger: { kind: "schema", schema: attioNoteContentUpdatedTriggerSchema },
119
+ AttioNoteUpdatedTrigger: { kind: "schema", schema: attioNoteUpdatedTriggerSchema },
120
+ AttioNoteDeletedTrigger: { kind: "schema", schema: attioNoteDeletedTriggerSchema },
121
+ AttioRecordCreatedTrigger: attioRecordProjection(attioRecordCreatedTriggerSchema),
122
+ AttioRecordMergedTrigger: attioRecordProjection(attioRecordMergedTriggerSchema),
123
+ AttioRecordUpdatedTrigger: attioRecordProjection(attioRecordUpdatedTriggerSchema),
124
+ AttioRecordDeletedTrigger: { kind: "schema", schema: attioRecordDeletedTriggerSchema },
125
+ AttioTaskCreatedTrigger: { kind: "schema", schema: attioTaskCreatedTriggerSchema },
126
+ AttioTaskUpdatedTrigger: { kind: "schema", schema: attioTaskUpdatedTriggerSchema },
127
+ AttioTaskDeletedTrigger: { kind: "schema", schema: attioTaskDeletedTriggerSchema },
128
+ AttioWorkspaceMemberCreatedTrigger: { kind: "schema", schema: attioWorkspaceMemberCreatedTriggerSchema },
129
+ AttioTrigger: {
130
+ kind: "union",
131
+ members: [
132
+ "AttioCallRecordingCreatedTrigger",
133
+ "AttioCommentCreatedTrigger",
134
+ "AttioCommentResolvedTrigger",
135
+ "AttioCommentUnresolvedTrigger",
136
+ "AttioCommentDeletedTrigger",
137
+ "AttioListCreatedTrigger",
138
+ "AttioListUpdatedTrigger",
139
+ "AttioListDeletedTrigger",
140
+ "AttioListAttributeCreatedTrigger",
141
+ "AttioListAttributeUpdatedTrigger",
142
+ "AttioListEntryCreatedTrigger",
143
+ "AttioListEntryUpdatedTrigger",
144
+ "AttioListEntryDeletedTrigger",
145
+ "AttioObjectAttributeCreatedTrigger",
146
+ "AttioObjectAttributeUpdatedTrigger",
147
+ "AttioNoteCreatedTrigger",
148
+ "AttioNoteContentUpdatedTrigger",
149
+ "AttioNoteUpdatedTrigger",
150
+ "AttioNoteDeletedTrigger",
151
+ "AttioRecordCreatedTrigger",
152
+ "AttioRecordMergedTrigger",
153
+ "AttioRecordUpdatedTrigger",
154
+ "AttioRecordDeletedTrigger",
155
+ "AttioTaskCreatedTrigger",
156
+ "AttioTaskUpdatedTrigger",
157
+ "AttioTaskDeletedTrigger",
158
+ "AttioWorkspaceMemberCreatedTrigger"
159
+ ]
160
+ },
161
+ CronTrigger: { kind: "schema", schema: cronTriggerSchema },
162
+ WebhookTrigger: { kind: "schema", schema: webhookTriggerSchema, typeParams: "<TBody = unknown>", fieldOverrides: { body: "TBody" } },
163
+ WebMonitorTrigger: { kind: "schema", schema: webMonitorTriggerSchema, typeParams: "<TPayload = unknown>", fieldOverrides: { payload: "TPayload" } }
164
+ };
165
+ export function isProjectedTriggerName(name) {
166
+ return name in triggerPayloadProjections;
167
+ }
package/dist/types.d.ts CHANGED
@@ -8645,11 +8645,14 @@ export declare const projectSecretsImportResponseSchema: z.ZodObject<{
8645
8645
  updated: z.ZodArray<z.ZodString>;
8646
8646
  }, z.core.$strip>;
8647
8647
  export type ProjectSecretsImportResponse = z.infer<typeof projectSecretsImportResponseSchema>;
8648
+ export declare const projectConnectionsSchema: z.ZodRecord<z.ZodEnum<typeof import("./Integrations.js").IntegrationType> & z.core.$partial, z.ZodString>;
8649
+ export type ProjectConnections = z.infer<typeof projectConnectionsSchema>;
8648
8650
  export declare const terseProjectConfigSchema: z.ZodObject<{
8649
8651
  projectId: z.ZodString;
8650
8652
  name: z.ZodString;
8651
8653
  selfHosted: z.ZodOptional<z.ZodBoolean>;
8652
8654
  remoteServerUrl: z.ZodOptional<z.ZodString>;
8655
+ connections: z.ZodOptional<z.ZodRecord<z.ZodEnum<typeof import("./Integrations.js").IntegrationType> & z.core.$partial, z.ZodString>>;
8653
8656
  }, z.core.$strip>;
8654
8657
  export type TerseProjectConfig = z.infer<typeof terseProjectConfigSchema>;
8655
8658
  export declare const sdkDeployJobSchema: z.ZodObject<{
package/dist/types.js CHANGED
@@ -637,11 +637,13 @@ export const projectSecretsImportResponseSchema = z.object({
637
637
  added: z.array(z.string()),
638
638
  updated: z.array(z.string())
639
639
  });
640
+ export const projectConnectionsSchema = z.partialRecord(integrationTypeEnum, z.string().min(1).describe("Connection ID (integrationId) this project generates against"));
640
641
  export const terseProjectConfigSchema = z.object({
641
642
  projectId: z.string().min(1),
642
643
  name: z.string().min(1),
643
644
  selfHosted: z.boolean().optional(),
644
- remoteServerUrl: z.string().optional()
645
+ remoteServerUrl: z.string().optional(),
646
+ connections: projectConnectionsSchema.optional()
645
647
  });
646
648
  export const sdkDeployJobSchema = z.object({
647
649
  jobName: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terse-types",
3
- "version": "0.0.75",
3
+ "version": "0.0.76",
4
4
  "type": "module",
5
5
  "description": "Shared Terse TypeScript types, enums, constants, and helpers.",
6
6
  "main": "./dist/index.js",
@@ -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
- });