@useairfoil/producer-linear 0.0.1 → 0.0.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/LICENSE.txt +201 -0
- package/README.md +71 -0
- package/dist/index.d.mts +4027 -0
- package/dist/index.mjs +3 -0
- package/dist/main.d.mts +1 -0
- package/dist/main.mjs +1305 -0
- package/dist/main.mjs.map +1 -0
- package/dist/manifest.d.mts +114 -0
- package/dist/manifest.mjs +161 -0
- package/dist/manifest.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/src-BbzySPR7.mjs +1688 -0
- package/dist/src-BbzySPR7.mjs.map +1 -0
- package/package.json +46 -8
- package/src/client/client.ts +200 -0
- package/src/connector.ts +151 -0
- package/src/create-table.ts +10 -0
- package/src/demo/index.ts +137 -0
- package/src/demo/initiatives.ts +116 -0
- package/src/demo/issues.ts +320 -0
- package/src/demo/projects.ts +215 -0
- package/src/demo/setup.ts +151 -0
- package/src/demo/shared.ts +122 -0
- package/src/demo/teams.ts +173 -0
- package/src/index.ts +83 -0
- package/src/main.ts +28 -0
- package/src/manifest.ts +58 -0
- package/src/resources/comments.ts +32 -0
- package/src/resources/customers.ts +105 -0
- package/src/resources/documents.ts +31 -0
- package/src/resources/initiatives.ts +136 -0
- package/src/resources/issue-history.ts +119 -0
- package/src/resources/issues.ts +131 -0
- package/src/resources/pages.ts +264 -0
- package/src/resources/projects.ts +161 -0
- package/src/resources/releases.ts +114 -0
- package/src/resources/teams.ts +140 -0
- package/src/sandbox.ts +35 -0
- package/src/schemas/comments.ts +52 -0
- package/src/schemas/customers.ts +96 -0
- package/src/schemas/documents.ts +40 -0
- package/src/schemas/initiatives.ts +155 -0
- package/src/schemas/issues.ts +262 -0
- package/src/schemas/projects.ts +210 -0
- package/src/schemas/releases.ts +132 -0
- package/src/schemas/shared.ts +68 -0
- package/src/schemas/teams.ts +177 -0
- package/src/start.ts +47 -0
- package/src/tables.ts +83 -0
- package/src/webhook/route.ts +50 -0
- package/src/webhook/signature.ts +28 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
|
+
import { Schema, Struct } from "effect";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Long,
|
|
6
|
+
OptionalRef,
|
|
7
|
+
OptionalString,
|
|
8
|
+
OptionalTimestamp,
|
|
9
|
+
Ref,
|
|
10
|
+
common,
|
|
11
|
+
deleted,
|
|
12
|
+
} from "./shared";
|
|
13
|
+
|
|
14
|
+
export const InitiativeSchema = Schema.Struct({
|
|
15
|
+
...common("Initiative"),
|
|
16
|
+
_deleted: deleted("initiative"),
|
|
17
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Initiative name." })),
|
|
18
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Short summary." })),
|
|
19
|
+
content: OptionalString.pipe(
|
|
20
|
+
Schema.annotateKey({ description: "Initiative overview in markdown." }),
|
|
21
|
+
),
|
|
22
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Initiative URL." })),
|
|
23
|
+
icon: OptionalString.pipe(Schema.annotateKey({ description: "Icon." })),
|
|
24
|
+
color: OptionalString.pipe(Schema.annotateKey({ description: "Color, as hex." })),
|
|
25
|
+
status: Schema.String.pipe(
|
|
26
|
+
Schema.annotateKey({ description: "Status: Planned, Active, or Completed." }),
|
|
27
|
+
),
|
|
28
|
+
health: OptionalString.pipe(
|
|
29
|
+
Schema.annotateKey({ description: "Health from the latest update." }),
|
|
30
|
+
),
|
|
31
|
+
health_updated_at: OptionalTimestamp.pipe(
|
|
32
|
+
Schema.annotateKey({ description: "Time the health last changed." }),
|
|
33
|
+
),
|
|
34
|
+
priority: Long.pipe(
|
|
35
|
+
Schema.annotateKey({ description: "0 none, 1 urgent, 2 high, 3 medium, 4 low." }),
|
|
36
|
+
),
|
|
37
|
+
owner_id: OptionalRef.pipe(Schema.annotateKey({ description: "Initiative owner." })),
|
|
38
|
+
creator_id: OptionalRef.pipe(
|
|
39
|
+
Schema.annotateKey({ description: "User who made the initiative." }),
|
|
40
|
+
),
|
|
41
|
+
parent_initiative_id: OptionalRef.pipe(Schema.annotateKey({ description: "Parent initiative." })),
|
|
42
|
+
target_date: OptionalString.pipe(
|
|
43
|
+
Schema.annotateKey({ description: "Target date, as YYYY-MM-DD." }),
|
|
44
|
+
),
|
|
45
|
+
started_at: OptionalTimestamp.pipe(
|
|
46
|
+
Schema.annotateKey({ description: "Time the initiative started." }),
|
|
47
|
+
),
|
|
48
|
+
completed_at: OptionalTimestamp.pipe(
|
|
49
|
+
Schema.annotateKey({ description: "Time the initiative was completed." }),
|
|
50
|
+
),
|
|
51
|
+
canceled_at: OptionalTimestamp.pipe(
|
|
52
|
+
Schema.annotateKey({ description: "Time the initiative was canceled." }),
|
|
53
|
+
),
|
|
54
|
+
label_ids: Schema.Array(Schema.String).pipe(
|
|
55
|
+
Schema.annotateKey({ description: "Initiative labels." }),
|
|
56
|
+
),
|
|
57
|
+
visibility: Schema.String.pipe(
|
|
58
|
+
Schema.annotateKey({ description: "Who can see the initiative." }),
|
|
59
|
+
),
|
|
60
|
+
trashed: Schema.NullOr(Schema.Boolean).pipe(
|
|
61
|
+
Schema.annotateKey({ description: "Whether the initiative is in the trash." }),
|
|
62
|
+
),
|
|
63
|
+
})
|
|
64
|
+
.annotate({ description: "Linear initiatives, including archived and trashed ones." })
|
|
65
|
+
.pipe(Iceberg.identifier("id"));
|
|
66
|
+
|
|
67
|
+
export type Initiative = Schema.Schema.Type<typeof InitiativeSchema>;
|
|
68
|
+
|
|
69
|
+
export const InitiativeObjectSchema = InitiativeSchema.mapFields((fields) =>
|
|
70
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const InitiativeUpdateSchema = Schema.Struct({
|
|
74
|
+
...common("Update"),
|
|
75
|
+
_deleted: deleted("update"),
|
|
76
|
+
initiative_id: Ref.pipe(Schema.annotateKey({ description: "Initiative." })),
|
|
77
|
+
user_id: Ref.pipe(Schema.annotateKey({ description: "User who posted the update." })),
|
|
78
|
+
body: Schema.String.pipe(Schema.annotateKey({ description: "Update text in markdown." })),
|
|
79
|
+
health: Schema.String.pipe(
|
|
80
|
+
Schema.annotateKey({ description: "Health: onTrack, atRisk, or offTrack." }),
|
|
81
|
+
),
|
|
82
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Update URL." })),
|
|
83
|
+
edited_at: OptionalTimestamp.pipe(
|
|
84
|
+
Schema.annotateKey({ description: "Time the update was last edited." }),
|
|
85
|
+
),
|
|
86
|
+
comment_count: Long.pipe(Schema.annotateKey({ description: "Comments on the update." })),
|
|
87
|
+
})
|
|
88
|
+
.annotate({ description: "Linear initiative updates: status posts with a health." })
|
|
89
|
+
.pipe(Iceberg.identifier("id"));
|
|
90
|
+
|
|
91
|
+
export type InitiativeUpdate = Schema.Schema.Type<typeof InitiativeUpdateSchema>;
|
|
92
|
+
|
|
93
|
+
export const InitiativeUpdateObjectSchema = InitiativeUpdateSchema.mapFields((fields) =>
|
|
94
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const InitiativeLabelSchema = Schema.Struct({
|
|
98
|
+
...common("Label"),
|
|
99
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Label name." })),
|
|
100
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Label description." })),
|
|
101
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Label color, as hex." })),
|
|
102
|
+
is_group: Schema.Boolean.pipe(
|
|
103
|
+
Schema.annotateKey({ description: "Whether the label groups other labels." }),
|
|
104
|
+
),
|
|
105
|
+
parent_id: OptionalRef.pipe(Schema.annotateKey({ description: "Label group." })),
|
|
106
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the label." })),
|
|
107
|
+
retired_at: OptionalTimestamp.pipe(
|
|
108
|
+
Schema.annotateKey({ description: "Time the label was retired." }),
|
|
109
|
+
),
|
|
110
|
+
})
|
|
111
|
+
.annotate({ description: "Linear initiative labels. Names the IDs in `initiatives.label_ids`." })
|
|
112
|
+
.pipe(Iceberg.identifier("id"));
|
|
113
|
+
|
|
114
|
+
export type InitiativeLabel = Schema.Schema.Type<typeof InitiativeLabelSchema>;
|
|
115
|
+
|
|
116
|
+
export const InitiativeLabelObjectSchema = InitiativeLabelSchema.mapFields((fields) =>
|
|
117
|
+
Struct.omit(fields, ["version"]),
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export const InitiativeRelationSchema = Schema.Struct({
|
|
121
|
+
...common("Relation"),
|
|
122
|
+
initiative_id: Ref.pipe(
|
|
123
|
+
Schema.annotateKey({ description: "Initiative the relation starts from." }),
|
|
124
|
+
),
|
|
125
|
+
related_initiative_id: Ref.pipe(Schema.annotateKey({ description: "Related initiative." })),
|
|
126
|
+
sort_order: Schema.Finite.pipe(Schema.annotateKey({ description: "Order." })),
|
|
127
|
+
user_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the relation." })),
|
|
128
|
+
})
|
|
129
|
+
.annotate({ description: "Linear initiative relations. Deleted relations aren't seen." })
|
|
130
|
+
.pipe(Iceberg.identifier("id"));
|
|
131
|
+
|
|
132
|
+
export type InitiativeRelation = Schema.Schema.Type<typeof InitiativeRelationSchema>;
|
|
133
|
+
|
|
134
|
+
export const InitiativeRelationObjectSchema = InitiativeRelationSchema.mapFields((fields) =>
|
|
135
|
+
Struct.omit(fields, ["version"]),
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
export const InitiativeToProjectSchema = Schema.Struct({
|
|
139
|
+
...common("Link"),
|
|
140
|
+
initiative_id: Ref.pipe(Schema.annotateKey({ description: "Initiative." })),
|
|
141
|
+
project_id: Ref.pipe(Schema.annotateKey({ description: "Project." })),
|
|
142
|
+
sort_order: Schema.String.pipe(
|
|
143
|
+
Schema.annotateKey({ description: "Order within the initiative." }),
|
|
144
|
+
),
|
|
145
|
+
})
|
|
146
|
+
.annotate({
|
|
147
|
+
description: "Links between Linear initiatives and projects. Removed links aren't seen.",
|
|
148
|
+
})
|
|
149
|
+
.pipe(Iceberg.identifier("id"));
|
|
150
|
+
|
|
151
|
+
export type InitiativeToProject = Schema.Schema.Type<typeof InitiativeToProjectSchema>;
|
|
152
|
+
|
|
153
|
+
export const InitiativeToProjectObjectSchema = InitiativeToProjectSchema.mapFields((fields) =>
|
|
154
|
+
Struct.omit(fields, ["version"]),
|
|
155
|
+
);
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
|
+
import { Schema, Struct } from "effect";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Long,
|
|
6
|
+
OptionalRef,
|
|
7
|
+
OptionalString,
|
|
8
|
+
OptionalTimestamp,
|
|
9
|
+
Ref,
|
|
10
|
+
common,
|
|
11
|
+
deleted,
|
|
12
|
+
} from "./shared";
|
|
13
|
+
|
|
14
|
+
export const IssueSchema = Schema.Struct({
|
|
15
|
+
...common("Issue"),
|
|
16
|
+
_deleted: deleted("issue"),
|
|
17
|
+
identifier: Schema.String.pipe(
|
|
18
|
+
Schema.annotateKey({ description: "Readable ID, such as ENG-123." }),
|
|
19
|
+
),
|
|
20
|
+
number: Schema.Finite.pipe(Schema.annotateKey({ description: "Issue number within its team." })),
|
|
21
|
+
title: Schema.String.pipe(Schema.annotateKey({ description: "Issue title." })),
|
|
22
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Description in markdown." })),
|
|
23
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Issue URL." })),
|
|
24
|
+
branch_name: Schema.String.pipe(
|
|
25
|
+
Schema.annotateKey({ description: "Suggested Git branch name." }),
|
|
26
|
+
),
|
|
27
|
+
priority: Schema.Finite.pipe(
|
|
28
|
+
Schema.annotateKey({ description: "0 none, 1 urgent, 2 high, 3 medium, 4 low." }),
|
|
29
|
+
),
|
|
30
|
+
priority_label: Schema.String.pipe(Schema.annotateKey({ description: "Priority name." })),
|
|
31
|
+
estimate: Schema.NullOr(Schema.Finite).pipe(
|
|
32
|
+
Schema.annotateKey({ description: "Estimate, on the team's scale." }),
|
|
33
|
+
),
|
|
34
|
+
due_date: OptionalString.pipe(Schema.annotateKey({ description: "Due date, as YYYY-MM-DD." })),
|
|
35
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who created the issue." })),
|
|
36
|
+
assignee_id: OptionalRef.pipe(Schema.annotateKey({ description: "Assigned user." })),
|
|
37
|
+
delegate_id: OptionalRef.pipe(
|
|
38
|
+
Schema.annotateKey({ description: "Agent user working on the issue." }),
|
|
39
|
+
),
|
|
40
|
+
snoozed_by_id: OptionalRef.pipe(
|
|
41
|
+
Schema.annotateKey({ description: "User who snoozed the issue." }),
|
|
42
|
+
),
|
|
43
|
+
state_id: Ref.pipe(Schema.annotateKey({ description: "Workflow state." })),
|
|
44
|
+
team_id: Ref.pipe(Schema.annotateKey({ description: "Team the issue belongs to." })),
|
|
45
|
+
project_id: OptionalRef.pipe(Schema.annotateKey({ description: "Project." })),
|
|
46
|
+
project_milestone_id: OptionalRef.pipe(Schema.annotateKey({ description: "Project milestone." })),
|
|
47
|
+
cycle_id: OptionalRef.pipe(Schema.annotateKey({ description: "Cycle." })),
|
|
48
|
+
parent_id: OptionalRef.pipe(Schema.annotateKey({ description: "Parent issue." })),
|
|
49
|
+
source_comment_id: OptionalRef.pipe(
|
|
50
|
+
Schema.annotateKey({ description: "Comment the issue was made from." }),
|
|
51
|
+
),
|
|
52
|
+
external_user_creator_id: OptionalRef.pipe(
|
|
53
|
+
Schema.annotateKey({
|
|
54
|
+
description: "External user who created the issue through an integration.",
|
|
55
|
+
}),
|
|
56
|
+
),
|
|
57
|
+
label_ids: Schema.Array(Schema.String).pipe(Schema.annotateKey({ description: "Labels." })),
|
|
58
|
+
previous_identifiers: Schema.Array(Schema.String).pipe(
|
|
59
|
+
Schema.annotateKey({ description: "Earlier readable IDs, from before the issue moved team." }),
|
|
60
|
+
),
|
|
61
|
+
started_at: OptionalTimestamp.pipe(
|
|
62
|
+
Schema.annotateKey({ description: "Time the issue moved to a started state." }),
|
|
63
|
+
),
|
|
64
|
+
completed_at: OptionalTimestamp.pipe(
|
|
65
|
+
Schema.annotateKey({ description: "Time the issue was completed." }),
|
|
66
|
+
),
|
|
67
|
+
canceled_at: OptionalTimestamp.pipe(
|
|
68
|
+
Schema.annotateKey({ description: "Time the issue was canceled." }),
|
|
69
|
+
),
|
|
70
|
+
started_triage_at: OptionalTimestamp.pipe(
|
|
71
|
+
Schema.annotateKey({ description: "Time the issue entered triage." }),
|
|
72
|
+
),
|
|
73
|
+
triaged_at: OptionalTimestamp.pipe(
|
|
74
|
+
Schema.annotateKey({ description: "Time the issue left triage." }),
|
|
75
|
+
),
|
|
76
|
+
auto_closed_at: OptionalTimestamp.pipe(
|
|
77
|
+
Schema.annotateKey({ description: "Time the issue was closed automatically." }),
|
|
78
|
+
),
|
|
79
|
+
auto_archived_at: OptionalTimestamp.pipe(
|
|
80
|
+
Schema.annotateKey({ description: "Time the issue was archived automatically." }),
|
|
81
|
+
),
|
|
82
|
+
added_to_cycle_at: OptionalTimestamp.pipe(
|
|
83
|
+
Schema.annotateKey({ description: "Time the issue was added to its cycle." }),
|
|
84
|
+
),
|
|
85
|
+
added_to_project_at: OptionalTimestamp.pipe(
|
|
86
|
+
Schema.annotateKey({ description: "Time the issue was added to its project." }),
|
|
87
|
+
),
|
|
88
|
+
added_to_team_at: OptionalTimestamp.pipe(
|
|
89
|
+
Schema.annotateKey({ description: "Time the issue was added to its team." }),
|
|
90
|
+
),
|
|
91
|
+
snoozed_until_at: OptionalTimestamp.pipe(
|
|
92
|
+
Schema.annotateKey({ description: "Time the issue is snoozed until." }),
|
|
93
|
+
),
|
|
94
|
+
sla_type: OptionalString.pipe(Schema.annotateKey({ description: "SLA type." })),
|
|
95
|
+
sla_started_at: OptionalTimestamp.pipe(
|
|
96
|
+
Schema.annotateKey({ description: "Time the SLA started." }),
|
|
97
|
+
),
|
|
98
|
+
sla_breaches_at: OptionalTimestamp.pipe(
|
|
99
|
+
Schema.annotateKey({ description: "Time the SLA breaches." }),
|
|
100
|
+
),
|
|
101
|
+
customer_ticket_count: Long.pipe(Schema.annotateKey({ description: "Linked support tickets." })),
|
|
102
|
+
integration_source_type: OptionalString.pipe(
|
|
103
|
+
Schema.annotateKey({ description: "Integration that created the issue." }),
|
|
104
|
+
),
|
|
105
|
+
trashed: Schema.NullOr(Schema.Boolean).pipe(
|
|
106
|
+
Schema.annotateKey({ description: "Whether the issue is in the trash." }),
|
|
107
|
+
),
|
|
108
|
+
})
|
|
109
|
+
.annotate({ description: "Linear issues, including archived and trashed ones." })
|
|
110
|
+
.pipe(Iceberg.identifier("id"));
|
|
111
|
+
|
|
112
|
+
export type Issue = Schema.Schema.Type<typeof IssueSchema>;
|
|
113
|
+
|
|
114
|
+
export const IssueObjectSchema = IssueSchema.mapFields((fields) =>
|
|
115
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
export const IssueHistorySchema = Schema.Struct({
|
|
119
|
+
...common("History entry"),
|
|
120
|
+
issue_id: Schema.String.pipe(Schema.annotateKey({ description: "Issue that changed." })),
|
|
121
|
+
actor_id: OptionalString.pipe(Schema.annotateKey({ description: "User who made the change." })),
|
|
122
|
+
from_state_id: OptionalString.pipe(Schema.annotateKey({ description: "Workflow state before." })),
|
|
123
|
+
to_state_id: OptionalString.pipe(Schema.annotateKey({ description: "Workflow state after." })),
|
|
124
|
+
from_assignee_id: OptionalString.pipe(Schema.annotateKey({ description: "Assignee before." })),
|
|
125
|
+
to_assignee_id: OptionalString.pipe(Schema.annotateKey({ description: "Assignee after." })),
|
|
126
|
+
from_cycle_id: OptionalString.pipe(Schema.annotateKey({ description: "Cycle before." })),
|
|
127
|
+
to_cycle_id: OptionalString.pipe(Schema.annotateKey({ description: "Cycle after." })),
|
|
128
|
+
from_project_id: OptionalString.pipe(Schema.annotateKey({ description: "Project before." })),
|
|
129
|
+
to_project_id: OptionalString.pipe(Schema.annotateKey({ description: "Project after." })),
|
|
130
|
+
from_parent_id: OptionalString.pipe(Schema.annotateKey({ description: "Parent issue before." })),
|
|
131
|
+
to_parent_id: OptionalString.pipe(Schema.annotateKey({ description: "Parent issue after." })),
|
|
132
|
+
from_team_id: OptionalString.pipe(Schema.annotateKey({ description: "Team before." })),
|
|
133
|
+
to_team_id: OptionalString.pipe(Schema.annotateKey({ description: "Team after." })),
|
|
134
|
+
from_priority: Schema.NullOr(Schema.Finite).pipe(
|
|
135
|
+
Schema.annotateKey({ description: "Priority before." }),
|
|
136
|
+
),
|
|
137
|
+
to_priority: Schema.NullOr(Schema.Finite).pipe(
|
|
138
|
+
Schema.annotateKey({ description: "Priority after." }),
|
|
139
|
+
),
|
|
140
|
+
from_estimate: Schema.NullOr(Schema.Finite).pipe(
|
|
141
|
+
Schema.annotateKey({ description: "Estimate before." }),
|
|
142
|
+
),
|
|
143
|
+
to_estimate: Schema.NullOr(Schema.Finite).pipe(
|
|
144
|
+
Schema.annotateKey({ description: "Estimate after." }),
|
|
145
|
+
),
|
|
146
|
+
from_due_date: OptionalString.pipe(
|
|
147
|
+
Schema.annotateKey({ description: "Due date before, as YYYY-MM-DD." }),
|
|
148
|
+
),
|
|
149
|
+
to_due_date: OptionalString.pipe(
|
|
150
|
+
Schema.annotateKey({ description: "Due date after, as YYYY-MM-DD." }),
|
|
151
|
+
),
|
|
152
|
+
from_title: OptionalString.pipe(Schema.annotateKey({ description: "Title before." })),
|
|
153
|
+
to_title: OptionalString.pipe(Schema.annotateKey({ description: "Title after." })),
|
|
154
|
+
added_label_ids: Schema.NullOr(Schema.Array(Schema.String)).pipe(
|
|
155
|
+
Schema.annotateKey({ description: "Labels added." }),
|
|
156
|
+
),
|
|
157
|
+
removed_label_ids: Schema.NullOr(Schema.Array(Schema.String)).pipe(
|
|
158
|
+
Schema.annotateKey({ description: "Labels removed." }),
|
|
159
|
+
),
|
|
160
|
+
attachment_id: OptionalString.pipe(
|
|
161
|
+
Schema.annotateKey({ description: "Attachment linked or unlinked." }),
|
|
162
|
+
),
|
|
163
|
+
customer_need_id: OptionalString.pipe(
|
|
164
|
+
Schema.annotateKey({ description: "Customer request linked or unlinked." }),
|
|
165
|
+
),
|
|
166
|
+
to_converted_project_id: OptionalString.pipe(
|
|
167
|
+
Schema.annotateKey({ description: "Project the issue became." }),
|
|
168
|
+
),
|
|
169
|
+
updated_description: Schema.NullOr(Schema.Boolean).pipe(
|
|
170
|
+
Schema.annotateKey({ description: "Whether the description changed." }),
|
|
171
|
+
),
|
|
172
|
+
archived: Schema.NullOr(Schema.Boolean).pipe(
|
|
173
|
+
Schema.annotateKey({ description: "Whether the issue was archived." }),
|
|
174
|
+
),
|
|
175
|
+
trashed: Schema.NullOr(Schema.Boolean).pipe(
|
|
176
|
+
Schema.annotateKey({ description: "Whether the issue was trashed." }),
|
|
177
|
+
),
|
|
178
|
+
auto_archived: Schema.NullOr(Schema.Boolean).pipe(
|
|
179
|
+
Schema.annotateKey({ description: "Whether the issue was archived automatically." }),
|
|
180
|
+
),
|
|
181
|
+
auto_closed: Schema.NullOr(Schema.Boolean).pipe(
|
|
182
|
+
Schema.annotateKey({ description: "Whether the issue was closed automatically." }),
|
|
183
|
+
),
|
|
184
|
+
})
|
|
185
|
+
.annotate({ description: "Linear issue history. One row per change to an issue." })
|
|
186
|
+
.pipe(Iceberg.identifier("id"));
|
|
187
|
+
|
|
188
|
+
export type IssueHistory = Schema.Schema.Type<typeof IssueHistorySchema>;
|
|
189
|
+
|
|
190
|
+
export const IssueHistoryObjectSchema = IssueHistorySchema.mapFields((fields) =>
|
|
191
|
+
Struct.omit(fields, ["version", "issue_id"]),
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
export const IssueRelationSchema = Schema.Struct({
|
|
195
|
+
...common("Relation"),
|
|
196
|
+
issue_id: Ref.pipe(Schema.annotateKey({ description: "Issue the relation starts from." })),
|
|
197
|
+
related_issue_id: Ref.pipe(Schema.annotateKey({ description: "Related issue." })),
|
|
198
|
+
type: Schema.String.pipe(
|
|
199
|
+
Schema.annotateKey({ description: "Relation type: blocks, duplicate, related, or similar." }),
|
|
200
|
+
),
|
|
201
|
+
})
|
|
202
|
+
.annotate({ description: "Linear issue relations. Deleted relations aren't seen." })
|
|
203
|
+
.pipe(Iceberg.identifier("id"));
|
|
204
|
+
|
|
205
|
+
export type IssueRelation = Schema.Schema.Type<typeof IssueRelationSchema>;
|
|
206
|
+
|
|
207
|
+
export const IssueRelationObjectSchema = IssueRelationSchema.mapFields((fields) =>
|
|
208
|
+
Struct.omit(fields, ["version"]),
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
export const AttachmentSchema = Schema.Struct({
|
|
212
|
+
...common("Attachment"),
|
|
213
|
+
_deleted: deleted("attachment"),
|
|
214
|
+
issue_id: Ref.pipe(Schema.annotateKey({ description: "Issue the attachment is on." })),
|
|
215
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who added it." })),
|
|
216
|
+
external_user_creator_id: OptionalRef.pipe(
|
|
217
|
+
Schema.annotateKey({ description: "External user who added it." }),
|
|
218
|
+
),
|
|
219
|
+
title: Schema.String.pipe(Schema.annotateKey({ description: "Title." })),
|
|
220
|
+
subtitle: OptionalString.pipe(Schema.annotateKey({ description: "Subtitle." })),
|
|
221
|
+
url: Schema.String.pipe(
|
|
222
|
+
Schema.annotateKey({ description: "Linked URL, such as a pull request or ticket." }),
|
|
223
|
+
),
|
|
224
|
+
source_type: OptionalString.pipe(
|
|
225
|
+
Schema.annotateKey({ description: "Source, such as github or zendesk." }),
|
|
226
|
+
),
|
|
227
|
+
})
|
|
228
|
+
.annotate({ description: "Linear issue attachments: links to pull requests, tickets, and more." })
|
|
229
|
+
.pipe(Iceberg.identifier("id"));
|
|
230
|
+
|
|
231
|
+
export type Attachment = Schema.Schema.Type<typeof AttachmentSchema>;
|
|
232
|
+
|
|
233
|
+
export const AttachmentObjectSchema = AttachmentSchema.mapFields((fields) =>
|
|
234
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
export const IssueLabelSchema = Schema.Struct({
|
|
238
|
+
...common("Label"),
|
|
239
|
+
_deleted: deleted("label"),
|
|
240
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Label name." })),
|
|
241
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Label description." })),
|
|
242
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Label color, as hex." })),
|
|
243
|
+
is_group: Schema.Boolean.pipe(
|
|
244
|
+
Schema.annotateKey({ description: "Whether the label groups other labels." }),
|
|
245
|
+
),
|
|
246
|
+
parent_id: OptionalRef.pipe(Schema.annotateKey({ description: "Label group." })),
|
|
247
|
+
team_id: OptionalRef.pipe(
|
|
248
|
+
Schema.annotateKey({ description: "Team, or null for a workspace label." }),
|
|
249
|
+
),
|
|
250
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the label." })),
|
|
251
|
+
retired_at: OptionalTimestamp.pipe(
|
|
252
|
+
Schema.annotateKey({ description: "Time the label was retired." }),
|
|
253
|
+
),
|
|
254
|
+
})
|
|
255
|
+
.annotate({ description: "Linear issue labels. Names the IDs in `issues.label_ids`." })
|
|
256
|
+
.pipe(Iceberg.identifier("id"));
|
|
257
|
+
|
|
258
|
+
export type IssueLabel = Schema.Schema.Type<typeof IssueLabelSchema>;
|
|
259
|
+
|
|
260
|
+
export const IssueLabelObjectSchema = IssueLabelSchema.mapFields((fields) =>
|
|
261
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
262
|
+
);
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
|
+
import { Schema, Struct } from "effect";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Long,
|
|
6
|
+
OptionalRef,
|
|
7
|
+
OptionalString,
|
|
8
|
+
OptionalTimestamp,
|
|
9
|
+
Ref,
|
|
10
|
+
RefList,
|
|
11
|
+
common,
|
|
12
|
+
deleted,
|
|
13
|
+
} from "./shared";
|
|
14
|
+
|
|
15
|
+
export const ProjectSchema = Schema.Struct({
|
|
16
|
+
...common("Project"),
|
|
17
|
+
_deleted: deleted("project"),
|
|
18
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Project name." })),
|
|
19
|
+
description: Schema.String.pipe(Schema.annotateKey({ description: "Short summary." })),
|
|
20
|
+
content: OptionalString.pipe(
|
|
21
|
+
Schema.annotateKey({ description: "Project overview in markdown." }),
|
|
22
|
+
),
|
|
23
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Project URL." })),
|
|
24
|
+
icon: OptionalString.pipe(Schema.annotateKey({ description: "Icon." })),
|
|
25
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Color, as hex." })),
|
|
26
|
+
status_id: Ref.pipe(Schema.annotateKey({ description: "Project status." })),
|
|
27
|
+
priority: Long.pipe(
|
|
28
|
+
Schema.annotateKey({ description: "0 none, 1 urgent, 2 high, 3 medium, 4 low." }),
|
|
29
|
+
),
|
|
30
|
+
priority_label: Schema.String.pipe(Schema.annotateKey({ description: "Priority name." })),
|
|
31
|
+
health: OptionalString.pipe(
|
|
32
|
+
Schema.annotateKey({ description: "Health from the latest update." }),
|
|
33
|
+
),
|
|
34
|
+
health_updated_at: OptionalTimestamp.pipe(
|
|
35
|
+
Schema.annotateKey({ description: "Time the health last changed." }),
|
|
36
|
+
),
|
|
37
|
+
progress: Schema.Finite.pipe(
|
|
38
|
+
Schema.annotateKey({ description: "Share of the scope completed, from 0 to 1." }),
|
|
39
|
+
),
|
|
40
|
+
scope: Schema.Finite.pipe(
|
|
41
|
+
Schema.annotateKey({ description: "Total estimate of the project's issues." }),
|
|
42
|
+
),
|
|
43
|
+
lead_id: OptionalRef.pipe(Schema.annotateKey({ description: "Project lead." })),
|
|
44
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the project." })),
|
|
45
|
+
converted_from_issue_id: OptionalRef.pipe(
|
|
46
|
+
Schema.annotateKey({ description: "Issue the project was made from." }),
|
|
47
|
+
),
|
|
48
|
+
start_date: OptionalString.pipe(
|
|
49
|
+
Schema.annotateKey({ description: "Start date, as YYYY-MM-DD." }),
|
|
50
|
+
),
|
|
51
|
+
target_date: OptionalString.pipe(
|
|
52
|
+
Schema.annotateKey({ description: "Target date, as YYYY-MM-DD." }),
|
|
53
|
+
),
|
|
54
|
+
started_at: OptionalTimestamp.pipe(
|
|
55
|
+
Schema.annotateKey({ description: "Time the project started." }),
|
|
56
|
+
),
|
|
57
|
+
completed_at: OptionalTimestamp.pipe(
|
|
58
|
+
Schema.annotateKey({ description: "Time the project was completed." }),
|
|
59
|
+
),
|
|
60
|
+
canceled_at: OptionalTimestamp.pipe(
|
|
61
|
+
Schema.annotateKey({ description: "Time the project was canceled." }),
|
|
62
|
+
),
|
|
63
|
+
auto_archived_at: OptionalTimestamp.pipe(
|
|
64
|
+
Schema.annotateKey({ description: "Time the project was archived automatically." }),
|
|
65
|
+
),
|
|
66
|
+
label_ids: Schema.Array(Schema.String).pipe(
|
|
67
|
+
Schema.annotateKey({ description: "Project labels." }),
|
|
68
|
+
),
|
|
69
|
+
team_ids: RefList.pipe(
|
|
70
|
+
Schema.annotateKey({ description: "Teams the project belongs to. Reads up to 50." }),
|
|
71
|
+
),
|
|
72
|
+
member_ids: RefList.pipe(
|
|
73
|
+
Schema.annotateKey({ description: "Project members. Reads up to 100." }),
|
|
74
|
+
),
|
|
75
|
+
trashed: Schema.NullOr(Schema.Boolean).pipe(
|
|
76
|
+
Schema.annotateKey({ description: "Whether the project is in the trash." }),
|
|
77
|
+
),
|
|
78
|
+
})
|
|
79
|
+
.annotate({ description: "Linear projects, including archived and trashed ones." })
|
|
80
|
+
.pipe(Iceberg.identifier("id"));
|
|
81
|
+
|
|
82
|
+
export type Project = Schema.Schema.Type<typeof ProjectSchema>;
|
|
83
|
+
|
|
84
|
+
export const ProjectObjectSchema = ProjectSchema.mapFields((fields) =>
|
|
85
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
export const ProjectMilestoneSchema = Schema.Struct({
|
|
89
|
+
...common("Milestone"),
|
|
90
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Milestone name." })),
|
|
91
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Description in markdown." })),
|
|
92
|
+
project_id: Ref.pipe(Schema.annotateKey({ description: "Project." })),
|
|
93
|
+
target_date: OptionalString.pipe(
|
|
94
|
+
Schema.annotateKey({ description: "Target date, as YYYY-MM-DD." }),
|
|
95
|
+
),
|
|
96
|
+
status: Schema.String.pipe(
|
|
97
|
+
Schema.annotateKey({ description: "Status: unstarted, next, overdue, or done." }),
|
|
98
|
+
),
|
|
99
|
+
progress: Schema.Finite.pipe(
|
|
100
|
+
Schema.annotateKey({ description: "Share of the scope completed, from 0 to 1." }),
|
|
101
|
+
),
|
|
102
|
+
sort_order: Schema.Finite.pipe(Schema.annotateKey({ description: "Order within the project." })),
|
|
103
|
+
})
|
|
104
|
+
.annotate({ description: "Linear project milestones. Deleted milestones aren't seen." })
|
|
105
|
+
.pipe(Iceberg.identifier("id"));
|
|
106
|
+
|
|
107
|
+
export type ProjectMilestone = Schema.Schema.Type<typeof ProjectMilestoneSchema>;
|
|
108
|
+
|
|
109
|
+
export const ProjectMilestoneObjectSchema = ProjectMilestoneSchema.mapFields((fields) =>
|
|
110
|
+
Struct.omit(fields, ["version"]),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
export const ProjectUpdateSchema = Schema.Struct({
|
|
114
|
+
...common("Update"),
|
|
115
|
+
_deleted: deleted("update"),
|
|
116
|
+
project_id: Ref.pipe(Schema.annotateKey({ description: "Project." })),
|
|
117
|
+
user_id: Ref.pipe(Schema.annotateKey({ description: "User who posted the update." })),
|
|
118
|
+
body: Schema.String.pipe(Schema.annotateKey({ description: "Update text in markdown." })),
|
|
119
|
+
health: Schema.String.pipe(
|
|
120
|
+
Schema.annotateKey({ description: "Health: onTrack, atRisk, or offTrack." }),
|
|
121
|
+
),
|
|
122
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Update URL." })),
|
|
123
|
+
edited_at: OptionalTimestamp.pipe(
|
|
124
|
+
Schema.annotateKey({ description: "Time the update was last edited." }),
|
|
125
|
+
),
|
|
126
|
+
comment_count: Long.pipe(Schema.annotateKey({ description: "Comments on the update." })),
|
|
127
|
+
})
|
|
128
|
+
.annotate({ description: "Linear project updates: status posts with a health." })
|
|
129
|
+
.pipe(Iceberg.identifier("id"));
|
|
130
|
+
|
|
131
|
+
export type ProjectUpdate = Schema.Schema.Type<typeof ProjectUpdateSchema>;
|
|
132
|
+
|
|
133
|
+
export const ProjectUpdateObjectSchema = ProjectUpdateSchema.mapFields((fields) =>
|
|
134
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
export const ProjectStatusSchema = Schema.Struct({
|
|
138
|
+
...common("Status"),
|
|
139
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Status name." })),
|
|
140
|
+
type: Schema.String.pipe(
|
|
141
|
+
Schema.annotateKey({
|
|
142
|
+
description: "Status type: backlog, planned, started, paused, completed, or canceled.",
|
|
143
|
+
}),
|
|
144
|
+
),
|
|
145
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Color, as hex." })),
|
|
146
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Description." })),
|
|
147
|
+
position: Schema.Finite.pipe(Schema.annotateKey({ description: "Order in the list." })),
|
|
148
|
+
})
|
|
149
|
+
.annotate({ description: "Linear project statuses. Names the IDs in `projects.status_id`." })
|
|
150
|
+
.pipe(Iceberg.identifier("id"));
|
|
151
|
+
|
|
152
|
+
export type ProjectStatus = Schema.Schema.Type<typeof ProjectStatusSchema>;
|
|
153
|
+
|
|
154
|
+
export const ProjectStatusObjectSchema = ProjectStatusSchema.mapFields((fields) =>
|
|
155
|
+
Struct.omit(fields, ["version"]),
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
export const ProjectLabelSchema = Schema.Struct({
|
|
159
|
+
...common("Label"),
|
|
160
|
+
_deleted: deleted("label"),
|
|
161
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Label name." })),
|
|
162
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Label description." })),
|
|
163
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Label color, as hex." })),
|
|
164
|
+
is_group: Schema.Boolean.pipe(
|
|
165
|
+
Schema.annotateKey({ description: "Whether the label groups other labels." }),
|
|
166
|
+
),
|
|
167
|
+
parent_id: OptionalRef.pipe(Schema.annotateKey({ description: "Label group." })),
|
|
168
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the label." })),
|
|
169
|
+
retired_at: OptionalTimestamp.pipe(
|
|
170
|
+
Schema.annotateKey({ description: "Time the label was retired." }),
|
|
171
|
+
),
|
|
172
|
+
})
|
|
173
|
+
.annotate({ description: "Linear project labels. Names the IDs in `projects.label_ids`." })
|
|
174
|
+
.pipe(Iceberg.identifier("id"));
|
|
175
|
+
|
|
176
|
+
export type ProjectLabel = Schema.Schema.Type<typeof ProjectLabelSchema>;
|
|
177
|
+
|
|
178
|
+
export const ProjectLabelObjectSchema = ProjectLabelSchema.mapFields((fields) =>
|
|
179
|
+
Struct.omit(fields, ["version", "_deleted"]),
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
export const ProjectRelationSchema = Schema.Struct({
|
|
183
|
+
...common("Relation"),
|
|
184
|
+
type: Schema.String.pipe(
|
|
185
|
+
Schema.annotateKey({ description: "Relation type, such as dependency." }),
|
|
186
|
+
),
|
|
187
|
+
project_id: Ref.pipe(Schema.annotateKey({ description: "Project the relation starts from." })),
|
|
188
|
+
project_milestone_id: OptionalRef.pipe(
|
|
189
|
+
Schema.annotateKey({ description: "Milestone the relation starts from." }),
|
|
190
|
+
),
|
|
191
|
+
anchor_type: Schema.String.pipe(
|
|
192
|
+
Schema.annotateKey({ description: "Which end of the project it starts from." }),
|
|
193
|
+
),
|
|
194
|
+
related_project_id: Ref.pipe(Schema.annotateKey({ description: "Related project." })),
|
|
195
|
+
related_project_milestone_id: OptionalRef.pipe(
|
|
196
|
+
Schema.annotateKey({ description: "Related milestone." }),
|
|
197
|
+
),
|
|
198
|
+
related_anchor_type: Schema.String.pipe(
|
|
199
|
+
Schema.annotateKey({ description: "Which end of the related project." }),
|
|
200
|
+
),
|
|
201
|
+
user_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the relation." })),
|
|
202
|
+
})
|
|
203
|
+
.annotate({ description: "Linear project dependencies. Deleted relations aren't seen." })
|
|
204
|
+
.pipe(Iceberg.identifier("id"));
|
|
205
|
+
|
|
206
|
+
export type ProjectRelation = Schema.Schema.Type<typeof ProjectRelationSchema>;
|
|
207
|
+
|
|
208
|
+
export const ProjectRelationObjectSchema = ProjectRelationSchema.mapFields((fields) =>
|
|
209
|
+
Struct.omit(fields, ["version"]),
|
|
210
|
+
);
|