@spencerboucher/switchyard-client 0.14.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1524 -1333
- package/dist/types/protocol/api.d.ts +38 -0
- package/dist/types/protocol/client-wire.d.ts +76 -0
- package/dist/types/protocol/entities.d.ts +39 -0
- package/dist/types/protocol/events.d.ts +38 -0
- package/dist/types/protocol/host-wire.d.ts +103 -0
- package/dist/types/protocol/ids.d.ts +1 -1
- package/dist/types/protocol/index.d.ts +1 -0
- package/dist/types/protocol/trackers.d.ts +244 -0
- package/dist/types/protocol/views.d.ts +3 -1
- package/package.json +5 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Host feature: the host answers `tracker.*` commands. */
|
|
3
|
+
export declare const TRACKERS_FEATURE = "trackers.v1";
|
|
4
|
+
export declare const GitHubLogin: z.ZodString;
|
|
5
|
+
export declare const TrackerStatusOption: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type TrackerStatusOption = z.infer<typeof TrackerStatusOption>;
|
|
10
|
+
export declare const TrackerBoard: z.ZodObject<{
|
|
11
|
+
projectNumber: z.ZodNumber;
|
|
12
|
+
statusField: z.ZodDefault<z.ZodString>;
|
|
13
|
+
onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type TrackerBoard = z.infer<typeof TrackerBoard>;
|
|
17
|
+
export declare const Tracker: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
provider: z.ZodLiteral<"github">;
|
|
21
|
+
hostId: z.ZodString;
|
|
22
|
+
owner: z.ZodString;
|
|
23
|
+
repositories: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
24
|
+
extraRepositories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
26
|
+
projectNumber: z.ZodNumber;
|
|
27
|
+
statusField: z.ZodDefault<z.ZodString>;
|
|
28
|
+
onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
writeBack: z.ZodBoolean;
|
|
32
|
+
moveShared: z.ZodBoolean;
|
|
33
|
+
enabled: z.ZodBoolean;
|
|
34
|
+
login: z.ZodNullable<z.ZodString>;
|
|
35
|
+
lastSyncedAt: z.ZodNullable<z.ZodString>;
|
|
36
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
updatedAt: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type Tracker = z.infer<typeof Tracker>;
|
|
41
|
+
export declare const TrackerInput: z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
hostId: z.ZodString;
|
|
44
|
+
owner: z.ZodString;
|
|
45
|
+
repositories: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
46
|
+
extraRepositories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
47
|
+
board: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
48
|
+
projectNumber: z.ZodNumber;
|
|
49
|
+
statusField: z.ZodDefault<z.ZodString>;
|
|
50
|
+
onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
writeBack: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
moveShared: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type TrackerInput = z.input<typeof TrackerInput>;
|
|
58
|
+
export declare const TrackerPatch: z.ZodObject<{
|
|
59
|
+
name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
hostId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
62
|
+
repositories: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
63
|
+
extraRepositories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
board: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
65
|
+
projectNumber: z.ZodNumber;
|
|
66
|
+
statusField: z.ZodDefault<z.ZodString>;
|
|
67
|
+
onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
writeBack: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
moveShared: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type TrackerPatch = z.input<typeof TrackerPatch>;
|
|
75
|
+
export declare const TrackerItemBoard: z.ZodObject<{
|
|
76
|
+
projectId: z.ZodString;
|
|
77
|
+
projectItemId: z.ZodString;
|
|
78
|
+
fieldId: z.ZodString;
|
|
79
|
+
status: z.ZodNullable<z.ZodString>;
|
|
80
|
+
statusOptionId: z.ZodNullable<z.ZodString>;
|
|
81
|
+
options: z.ZodArray<z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type TrackerItemBoard = z.infer<typeof TrackerItemBoard>;
|
|
87
|
+
export declare const TrackerPullRequest: z.ZodObject<{
|
|
88
|
+
number: z.ZodNumber;
|
|
89
|
+
state: z.ZodEnum<{
|
|
90
|
+
CLOSED: "CLOSED";
|
|
91
|
+
MERGED: "MERGED";
|
|
92
|
+
OPEN: "OPEN";
|
|
93
|
+
}>;
|
|
94
|
+
url: z.ZodString;
|
|
95
|
+
headRefName: z.ZodString;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type TrackerPullRequest = z.infer<typeof TrackerPullRequest>;
|
|
98
|
+
export declare const TrackerItem: z.ZodObject<{
|
|
99
|
+
itemId: z.ZodString;
|
|
100
|
+
repository: z.ZodString;
|
|
101
|
+
number: z.ZodNumber;
|
|
102
|
+
title: z.ZodString;
|
|
103
|
+
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
104
|
+
assignees: z.ZodArray<z.ZodString>;
|
|
105
|
+
branches: z.ZodArray<z.ZodString>;
|
|
106
|
+
pullRequest: z.ZodNullable<z.ZodObject<{
|
|
107
|
+
number: z.ZodNumber;
|
|
108
|
+
state: z.ZodEnum<{
|
|
109
|
+
CLOSED: "CLOSED";
|
|
110
|
+
MERGED: "MERGED";
|
|
111
|
+
OPEN: "OPEN";
|
|
112
|
+
}>;
|
|
113
|
+
url: z.ZodString;
|
|
114
|
+
headRefName: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
117
|
+
projectId: z.ZodString;
|
|
118
|
+
projectItemId: z.ZodString;
|
|
119
|
+
fieldId: z.ZodString;
|
|
120
|
+
status: z.ZodNullable<z.ZodString>;
|
|
121
|
+
statusOptionId: z.ZodNullable<z.ZodString>;
|
|
122
|
+
options: z.ZodArray<z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type TrackerItem = z.infer<typeof TrackerItem>;
|
|
129
|
+
export declare const TrackerSyncResult: z.ZodObject<{
|
|
130
|
+
login: z.ZodString;
|
|
131
|
+
items: z.ZodArray<z.ZodObject<{
|
|
132
|
+
itemId: z.ZodString;
|
|
133
|
+
repository: z.ZodString;
|
|
134
|
+
number: z.ZodNumber;
|
|
135
|
+
title: z.ZodString;
|
|
136
|
+
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
137
|
+
assignees: z.ZodArray<z.ZodString>;
|
|
138
|
+
branches: z.ZodArray<z.ZodString>;
|
|
139
|
+
pullRequest: z.ZodNullable<z.ZodObject<{
|
|
140
|
+
number: z.ZodNumber;
|
|
141
|
+
state: z.ZodEnum<{
|
|
142
|
+
CLOSED: "CLOSED";
|
|
143
|
+
MERGED: "MERGED";
|
|
144
|
+
OPEN: "OPEN";
|
|
145
|
+
}>;
|
|
146
|
+
url: z.ZodString;
|
|
147
|
+
headRefName: z.ZodString;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
150
|
+
projectId: z.ZodString;
|
|
151
|
+
projectItemId: z.ZodString;
|
|
152
|
+
fieldId: z.ZodString;
|
|
153
|
+
status: z.ZodNullable<z.ZodString>;
|
|
154
|
+
statusOptionId: z.ZodNullable<z.ZodString>;
|
|
155
|
+
options: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
truncated: z.ZodBoolean;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export type TrackerSyncResult = z.infer<typeof TrackerSyncResult>;
|
|
164
|
+
/** A task's link to its tracker item (server-owned). */
|
|
165
|
+
export declare const TaskTracker: z.ZodObject<{
|
|
166
|
+
trackerId: z.ZodString;
|
|
167
|
+
itemId: z.ZodString;
|
|
168
|
+
repository: z.ZodString;
|
|
169
|
+
number: z.ZodNumber;
|
|
170
|
+
assignees: z.ZodArray<z.ZodString>;
|
|
171
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
172
|
+
workspaceId: z.ZodNullable<z.ZodString>;
|
|
173
|
+
pullRequest: z.ZodNullable<z.ZodObject<{
|
|
174
|
+
number: z.ZodNumber;
|
|
175
|
+
state: z.ZodEnum<{
|
|
176
|
+
CLOSED: "CLOSED";
|
|
177
|
+
MERGED: "MERGED";
|
|
178
|
+
OPEN: "OPEN";
|
|
179
|
+
}>;
|
|
180
|
+
url: z.ZodString;
|
|
181
|
+
headRefName: z.ZodString;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
184
|
+
projectId: z.ZodString;
|
|
185
|
+
projectItemId: z.ZodString;
|
|
186
|
+
fieldId: z.ZodString;
|
|
187
|
+
status: z.ZodNullable<z.ZodString>;
|
|
188
|
+
statusOptionId: z.ZodNullable<z.ZodString>;
|
|
189
|
+
options: z.ZodArray<z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export type TaskTracker = z.infer<typeof TaskTracker>;
|
|
196
|
+
export declare const TrackerSetStatusResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
197
|
+
status: z.ZodLiteral<"moved">;
|
|
198
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
+
status: z.ZodLiteral<"skipped">;
|
|
200
|
+
reason: z.ZodEnum<{
|
|
201
|
+
not_assigned: "not_assigned";
|
|
202
|
+
shared: "shared";
|
|
203
|
+
stale: "stale";
|
|
204
|
+
}>;
|
|
205
|
+
}, z.core.$strip>], "status">;
|
|
206
|
+
export type TrackerSetStatusResult = z.infer<typeof TrackerSetStatusResult>;
|
|
207
|
+
/** POST /api/tasks/:id/tracker/status */
|
|
208
|
+
export declare const TrackerStatusRequest: z.ZodObject<{
|
|
209
|
+
status: z.ZodString;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
/** Host command bodies (without `type`). */
|
|
212
|
+
export declare const TrackerHostSyncRequest: z.ZodObject<{
|
|
213
|
+
owner: z.ZodString;
|
|
214
|
+
repositories: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
215
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
216
|
+
projectNumber: z.ZodNumber;
|
|
217
|
+
statusField: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
export type TrackerHostSyncRequest = z.infer<typeof TrackerHostSyncRequest>;
|
|
221
|
+
export declare const TrackerHostPrepareBranchRequest: z.ZodObject<{
|
|
222
|
+
checkoutPath: z.ZodString;
|
|
223
|
+
branch: z.ZodString;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
export declare const TrackerHostStartIssueRequest: z.ZodObject<{
|
|
226
|
+
checkoutPath: z.ZodString;
|
|
227
|
+
repository: z.ZodString;
|
|
228
|
+
number: z.ZodNumber;
|
|
229
|
+
branch: z.ZodString;
|
|
230
|
+
base: z.ZodString;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
export type TrackerHostStartIssueRequest = z.infer<typeof TrackerHostStartIssueRequest>;
|
|
233
|
+
export declare const TrackerHostSetStatusRequest: z.ZodObject<{
|
|
234
|
+
projectId: z.ZodString;
|
|
235
|
+
projectItemId: z.ZodString;
|
|
236
|
+
fieldId: z.ZodString;
|
|
237
|
+
statusField: z.ZodString;
|
|
238
|
+
optionId: z.ZodString;
|
|
239
|
+
expectedOptionId: z.ZodNullable<z.ZodString>;
|
|
240
|
+
login: z.ZodString;
|
|
241
|
+
allowShared: z.ZodBoolean;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
export type TrackerHostSetStatusRequest = z.infer<typeof TrackerHostSetStatusRequest>;
|
|
244
|
+
//# sourceMappingURL=trackers.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Session, View, ViewClient, Workspace } from "./entities.js";
|
|
1
|
+
import type { Session, Task, View, ViewClient, Workspace } from "./entities.js";
|
|
2
2
|
/** A client counts as open in a view while its last report is younger than this. */
|
|
3
3
|
export declare const CLIENT_OPEN_MS: number;
|
|
4
4
|
type WorkspaceLookup = Record<string, Pick<Workspace, "projectId">> | Map<string, Pick<Workspace, "projectId">>;
|
|
@@ -8,5 +8,7 @@ export declare function sessionInView(view: View, s: Pick<Session, "id" | "proje
|
|
|
8
8
|
export declare function openClients(view: View, now?: number): ViewClient[];
|
|
9
9
|
/** Resolve a view by id, else by case-insensitive name; null if absent or ambiguous. */
|
|
10
10
|
export declare function findView(views: View[], ref: string): View | null;
|
|
11
|
+
/** Is a task in a view? By its project, or because its session is pinned. Host filters do not apply to tasks. */
|
|
12
|
+
export declare function taskInView(view: View, t: Pick<Task, "projectId" | "sessionId">): boolean;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=views.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spencerboucher/switchyard-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Node.js REST and WebSocket SDK for Switchyard",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/justmytwospence/switchyard.git"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"engines": {
|
|
8
12
|
"node": ">=24"
|