@useairfoil/producer-linear 0.0.2 → 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/dist/index.mjs +1 -1
- package/dist/main.mjs +6 -4
- package/dist/main.mjs.map +1 -1
- package/dist/{src-Ci3_ltan.mjs → src-BbzySPR7.mjs} +343 -346
- package/dist/src-BbzySPR7.mjs.map +1 -0
- package/package.json +17 -17
- package/src/create-table.ts +6 -1
- package/src/main.ts +8 -2
- package/src/schemas/comments.ts +36 -16
- package/src/schemas/customers.ts +43 -27
- package/src/schemas/documents.ts +24 -16
- package/src/schemas/initiatives.ts +79 -43
- package/src/schemas/issues.ts +179 -97
- package/src/schemas/projects.ts +118 -62
- package/src/schemas/releases.ts +58 -45
- package/src/schemas/shared.ts +25 -23
- package/src/schemas/teams.ts +87 -54
- package/src/start.ts +2 -2
- package/dist/src-Ci3_ltan.mjs.map +0 -1
package/src/schemas/customers.ts
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
2
|
import { Schema, Struct } from "effect";
|
|
3
3
|
|
|
4
|
-
import { Long, OptionalRef, OptionalString, Ref, common, deleted
|
|
4
|
+
import { Long, OptionalRef, OptionalString, Ref, common, deleted } from "./shared";
|
|
5
5
|
|
|
6
6
|
export const CustomerSchema = Schema.Struct({
|
|
7
7
|
...common("Customer"),
|
|
8
8
|
_deleted: deleted("customer"),
|
|
9
|
-
name: Schema.String.pipe(
|
|
10
|
-
domains:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Customer name." })),
|
|
10
|
+
domains: Schema.Array(Schema.String).pipe(
|
|
11
|
+
Schema.annotateKey({ description: "Email domains of the customer." }),
|
|
12
|
+
),
|
|
13
|
+
external_ids: Schema.Array(Schema.String).pipe(
|
|
14
|
+
Schema.annotateKey({ description: "IDs in other systems." }),
|
|
15
|
+
),
|
|
16
|
+
logo_url: OptionalString.pipe(Schema.annotateKey({ description: "Logo URL." })),
|
|
17
|
+
owner_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who owns the customer." })),
|
|
18
|
+
status_id: Ref.pipe(Schema.annotateKey({ description: "Customer status." })),
|
|
19
|
+
tier_id: OptionalRef.pipe(Schema.annotateKey({ description: "Customer tier." })),
|
|
20
|
+
revenue: Schema.NullOr(Long).pipe(Schema.annotateKey({ description: "Annual revenue." })),
|
|
21
|
+
size: Schema.NullOr(Schema.Finite).pipe(Schema.annotateKey({ description: "Company size." })),
|
|
22
|
+
approximate_need_count: Schema.Finite.pipe(
|
|
23
|
+
Schema.annotateKey({ description: "About how many requests it has." }),
|
|
24
|
+
),
|
|
25
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Customer URL." })),
|
|
20
26
|
})
|
|
21
27
|
.annotate({ description: "Linear customers." })
|
|
22
28
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -30,16 +36,26 @@ export const CustomerObjectSchema = CustomerSchema.mapFields((fields) =>
|
|
|
30
36
|
export const CustomerNeedSchema = Schema.Struct({
|
|
31
37
|
...common("Request"),
|
|
32
38
|
_deleted: deleted("request"),
|
|
33
|
-
customer_id: OptionalRef.pipe(
|
|
34
|
-
issue_id: OptionalRef.pipe(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
customer_id: OptionalRef.pipe(Schema.annotateKey({ description: "Customer." })),
|
|
40
|
+
issue_id: OptionalRef.pipe(
|
|
41
|
+
Schema.annotateKey({ description: "Issue the request is linked to." }),
|
|
42
|
+
),
|
|
43
|
+
project_id: OptionalRef.pipe(
|
|
44
|
+
Schema.annotateKey({ description: "Project the request is linked to." }),
|
|
45
|
+
),
|
|
46
|
+
original_issue_id: OptionalRef.pipe(
|
|
47
|
+
Schema.annotateKey({ description: "Issue the request was first linked to." }),
|
|
48
|
+
),
|
|
49
|
+
comment_id: OptionalRef.pipe(
|
|
50
|
+
Schema.annotateKey({ description: "Comment the request came from." }),
|
|
51
|
+
),
|
|
52
|
+
attachment_id: OptionalRef.pipe(
|
|
53
|
+
Schema.annotateKey({ description: "Attachment the request came from." }),
|
|
54
|
+
),
|
|
55
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who added the request." })),
|
|
56
|
+
body: OptionalString.pipe(Schema.annotateKey({ description: "Request text in markdown." })),
|
|
57
|
+
priority: Schema.Finite.pipe(Schema.annotateKey({ description: "0 normal, 1 important." })),
|
|
58
|
+
url: OptionalString.pipe(Schema.annotateKey({ description: "Source URL." })),
|
|
43
59
|
})
|
|
44
60
|
.annotate({ description: "Linear customer requests, linked to issues or projects." })
|
|
45
61
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -52,11 +68,11 @@ export const CustomerNeedObjectSchema = CustomerNeedSchema.mapFields((fields) =>
|
|
|
52
68
|
|
|
53
69
|
const levelFields = (object: string) => ({
|
|
54
70
|
...common(object),
|
|
55
|
-
name: Schema.String.pipe(
|
|
56
|
-
display_name: Schema.String.pipe(
|
|
57
|
-
description: OptionalString.pipe(
|
|
58
|
-
color: Schema.String.pipe(
|
|
59
|
-
position: Schema.Finite.pipe(
|
|
71
|
+
name: Schema.String.pipe(Schema.annotateKey({ description: "Name." })),
|
|
72
|
+
display_name: Schema.String.pipe(Schema.annotateKey({ description: "Name shown in Linear." })),
|
|
73
|
+
description: OptionalString.pipe(Schema.annotateKey({ description: "Description." })),
|
|
74
|
+
color: Schema.String.pipe(Schema.annotateKey({ description: "Color, as hex." })),
|
|
75
|
+
position: Schema.Finite.pipe(Schema.annotateKey({ description: "Order in the list." })),
|
|
60
76
|
});
|
|
61
77
|
|
|
62
78
|
export const CustomerStatusSchema = Schema.Struct(levelFields("Status"))
|
package/src/schemas/documents.ts
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
2
|
import { Schema, Struct } from "effect";
|
|
3
3
|
|
|
4
|
-
import { OptionalRef, OptionalString, OptionalTimestamp, common, deleted
|
|
4
|
+
import { OptionalRef, OptionalString, OptionalTimestamp, common, deleted } from "./shared";
|
|
5
5
|
|
|
6
6
|
export const DocumentSchema = Schema.Struct({
|
|
7
7
|
...common("Document"),
|
|
8
8
|
_deleted: deleted("document"),
|
|
9
|
-
title: Schema.String.pipe(
|
|
10
|
-
content: OptionalString.pipe(
|
|
11
|
-
url: Schema.String.pipe(
|
|
12
|
-
icon: OptionalString.pipe(
|
|
13
|
-
color: OptionalString.pipe(
|
|
14
|
-
creator_id: OptionalRef.pipe(
|
|
15
|
-
updated_by_id: OptionalRef.pipe(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
title: Schema.String.pipe(Schema.annotateKey({ description: "Title." })),
|
|
10
|
+
content: OptionalString.pipe(Schema.annotateKey({ description: "Content in markdown." })),
|
|
11
|
+
url: Schema.String.pipe(Schema.annotateKey({ description: "Document URL." })),
|
|
12
|
+
icon: OptionalString.pipe(Schema.annotateKey({ description: "Icon." })),
|
|
13
|
+
color: OptionalString.pipe(Schema.annotateKey({ description: "Icon color." })),
|
|
14
|
+
creator_id: OptionalRef.pipe(Schema.annotateKey({ description: "User who made the document." })),
|
|
15
|
+
updated_by_id: OptionalRef.pipe(
|
|
16
|
+
Schema.annotateKey({ description: "User who last changed the document." }),
|
|
17
|
+
),
|
|
18
|
+
project_id: OptionalRef.pipe(Schema.annotateKey({ description: "Project the document is in." })),
|
|
19
|
+
initiative_id: OptionalRef.pipe(
|
|
20
|
+
Schema.annotateKey({ description: "Initiative the document is in." }),
|
|
21
|
+
),
|
|
22
|
+
issue_id: OptionalRef.pipe(Schema.annotateKey({ description: "Issue the document is in." })),
|
|
23
|
+
cycle_id: OptionalRef.pipe(Schema.annotateKey({ description: "Cycle the document is in." })),
|
|
24
|
+
team_id: OptionalRef.pipe(Schema.annotateKey({ description: "Team the document is in." })),
|
|
25
|
+
parent_document_id: OptionalRef.pipe(Schema.annotateKey({ description: "Parent document." })),
|
|
26
|
+
hidden_at: OptionalTimestamp.pipe(
|
|
27
|
+
Schema.annotateKey({ description: "Time the document was hidden." }),
|
|
28
|
+
),
|
|
29
|
+
trashed: Schema.NullOr(Schema.Boolean).pipe(
|
|
30
|
+
Schema.annotateKey({ description: "Whether the document is in the trash." }),
|
|
31
|
+
),
|
|
24
32
|
})
|
|
25
33
|
.annotate({ description: "Linear documents, including archived and trashed ones." })
|
|
26
34
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -9,33 +9,57 @@ import {
|
|
|
9
9
|
Ref,
|
|
10
10
|
common,
|
|
11
11
|
deleted,
|
|
12
|
-
field,
|
|
13
|
-
list,
|
|
14
12
|
} from "./shared";
|
|
15
13
|
|
|
16
14
|
export const InitiativeSchema = Schema.Struct({
|
|
17
15
|
...common("Initiative"),
|
|
18
16
|
_deleted: deleted("initiative"),
|
|
19
|
-
name: Schema.String.pipe(
|
|
20
|
-
description: OptionalString.pipe(
|
|
21
|
-
content: OptionalString.pipe(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
),
|
|
39
63
|
})
|
|
40
64
|
.annotate({ description: "Linear initiatives, including archived and trashed ones." })
|
|
41
65
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -49,13 +73,17 @@ export const InitiativeObjectSchema = InitiativeSchema.mapFields((fields) =>
|
|
|
49
73
|
export const InitiativeUpdateSchema = Schema.Struct({
|
|
50
74
|
...common("Update"),
|
|
51
75
|
_deleted: deleted("update"),
|
|
52
|
-
initiative_id: Ref.pipe(
|
|
53
|
-
user_id: Ref.pipe(
|
|
54
|
-
body: Schema.String.pipe(
|
|
55
|
-
health: Schema.String.pipe(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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." })),
|
|
59
87
|
})
|
|
60
88
|
.annotate({ description: "Linear initiative updates: status posts with a health." })
|
|
61
89
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -68,13 +96,17 @@ export const InitiativeUpdateObjectSchema = InitiativeUpdateSchema.mapFields((fi
|
|
|
68
96
|
|
|
69
97
|
export const InitiativeLabelSchema = Schema.Struct({
|
|
70
98
|
...common("Label"),
|
|
71
|
-
name: Schema.String.pipe(
|
|
72
|
-
description: OptionalString.pipe(
|
|
73
|
-
color: Schema.String.pipe(
|
|
74
|
-
is_group: Schema.Boolean.pipe(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
+
),
|
|
78
110
|
})
|
|
79
111
|
.annotate({ description: "Linear initiative labels. Names the IDs in `initiatives.label_ids`." })
|
|
80
112
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -87,10 +119,12 @@ export const InitiativeLabelObjectSchema = InitiativeLabelSchema.mapFields((fiel
|
|
|
87
119
|
|
|
88
120
|
export const InitiativeRelationSchema = Schema.Struct({
|
|
89
121
|
...common("Relation"),
|
|
90
|
-
initiative_id: Ref.pipe(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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." })),
|
|
94
128
|
})
|
|
95
129
|
.annotate({ description: "Linear initiative relations. Deleted relations aren't seen." })
|
|
96
130
|
.pipe(Iceberg.identifier("id"));
|
|
@@ -103,9 +137,11 @@ export const InitiativeRelationObjectSchema = InitiativeRelationSchema.mapFields
|
|
|
103
137
|
|
|
104
138
|
export const InitiativeToProjectSchema = Schema.Struct({
|
|
105
139
|
...common("Link"),
|
|
106
|
-
initiative_id: Ref.pipe(
|
|
107
|
-
project_id: Ref.pipe(
|
|
108
|
-
sort_order: Schema.String.pipe(
|
|
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
|
+
),
|
|
109
145
|
})
|
|
110
146
|
.annotate({
|
|
111
147
|
description: "Links between Linear initiatives and projects. Removed links aren't seen.",
|