@onetaskgraph/sdk 0.12.9 → 0.12.10
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/client.d.ts +249 -0
- package/dist/generated/commands.d.ts +1 -0
- package/dist/generated/models.d.ts +14647 -0
- package/dist/generated/schemas.d.ts +20301 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +36176 -0
- package/package.json +2 -2
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { CacheCleared, Classification, CommentList, CommentWritten, CopyReport, DeletedComment, DocumentDetail, EffectiveConfig, FailureDocument, FieldsReport, IssuesCompleted, LocateReport, MetadataSet, NativeId, Priority, ProjectGraph, ProjectStatusSet, QueryResponseOfQualifiedDocument, QueryResponseOfQualifiedEdge, QueryResponseOfQualifiedLabel, QueryResponseOfQualifiedProject, QueryResponseOfQualifiedTask, QueryResponseOfSearchHit, Regenerated, RenderedTemplate, SourceListings, SourceRoute, StatusCategory, StatusesReconciled, StatusNamesReport, StatusOptionsReport, TaskAssetNames, TaskContentSet, TaskDetail, TaskDetails, TaskPrioritySet, TaskStatusSet, TaskUpdated, TemplateAnswers, TemplateVariables } from "./generated/models.ts";
|
|
2
|
+
import { runtimeSchemas } from "./generated/schemas.ts";
|
|
3
|
+
export type QueryOptions = {
|
|
4
|
+
sources?: string[];
|
|
5
|
+
limit?: number;
|
|
6
|
+
page?: string;
|
|
7
|
+
allowPartial?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type DependencyOptions = Omit<QueryOptions, "sources"> & {
|
|
10
|
+
direction?: "depends-on" | "depended-on-by";
|
|
11
|
+
};
|
|
12
|
+
export declare const projectGraphDirections: readonly ["auto", "td", "lr"];
|
|
13
|
+
export type ProjectGraphOptions = {
|
|
14
|
+
direction?: (typeof projectGraphDirections)[number];
|
|
15
|
+
groupBy?: string;
|
|
16
|
+
complete?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type FilterOptions = QueryOptions & {
|
|
19
|
+
labels?: string[];
|
|
20
|
+
excludeLabels?: string[];
|
|
21
|
+
statuses?: string[];
|
|
22
|
+
search?: string;
|
|
23
|
+
fields?: "title" | "content" | "both";
|
|
24
|
+
};
|
|
25
|
+
export type DocumentFilterOptions = Omit<FilterOptions, "statuses">;
|
|
26
|
+
export type WriteOptions = {
|
|
27
|
+
termScope?: string[];
|
|
28
|
+
};
|
|
29
|
+
export type ExpectOptions = {
|
|
30
|
+
expect?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Status ownership on copy updates. Creates always carry the source status. */
|
|
33
|
+
export declare const statusPolicies: readonly ["source", "preserve-destination"];
|
|
34
|
+
export type StatusPolicy = (typeof statusPolicies)[number];
|
|
35
|
+
export type StatusCopyOptions = {
|
|
36
|
+
statusPolicy?: StatusPolicy;
|
|
37
|
+
};
|
|
38
|
+
export type CopyOptions = WriteOptions & {
|
|
39
|
+
matchBy?: string;
|
|
40
|
+
recreate?: boolean;
|
|
41
|
+
dryRun?: boolean;
|
|
42
|
+
noLink?: boolean;
|
|
43
|
+
comments?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type CopyQueryOptions = {
|
|
46
|
+
sources?: string[];
|
|
47
|
+
commentedSince?: string;
|
|
48
|
+
metadata?: string[];
|
|
49
|
+
statuses?: StatusCategory[];
|
|
50
|
+
};
|
|
51
|
+
export type TaskCopyOptions = StatusCopyOptions & CopyOptions & CopyQueryOptions & ExpectOptions & {
|
|
52
|
+
create?: boolean;
|
|
53
|
+
targetTask?: string;
|
|
54
|
+
};
|
|
55
|
+
export type CommentBodyOptions = ({
|
|
56
|
+
body: string;
|
|
57
|
+
} | {
|
|
58
|
+
bodyFile: string;
|
|
59
|
+
}) & WriteOptions & ExpectOptions;
|
|
60
|
+
export type CommentAddOptions = CommentBodyOptions & {
|
|
61
|
+
author?: string;
|
|
62
|
+
};
|
|
63
|
+
export type TemplateOptions = {
|
|
64
|
+
searchPath?: string[];
|
|
65
|
+
};
|
|
66
|
+
export type TemplateRenderOptions = TemplateOptions & {
|
|
67
|
+
answers?: Record<string, JsonValue>;
|
|
68
|
+
vars?: Record<string, string>;
|
|
69
|
+
templateLoader?: string;
|
|
70
|
+
};
|
|
71
|
+
export type TemplateSourceOptions = TemplateOptions & {
|
|
72
|
+
template?: string;
|
|
73
|
+
templateLoader?: string;
|
|
74
|
+
answers?: Record<string, JsonValue>;
|
|
75
|
+
vars?: Record<string, string>;
|
|
76
|
+
};
|
|
77
|
+
export type CreateOptions = TemplateSourceOptions & WriteOptions & {
|
|
78
|
+
body?: string;
|
|
79
|
+
bodyFile?: string;
|
|
80
|
+
labels?: string[];
|
|
81
|
+
repositories?: string[];
|
|
82
|
+
metadata?: Record<string, JsonValue>;
|
|
83
|
+
classification?: Classification;
|
|
84
|
+
};
|
|
85
|
+
export type AssetOptions = {
|
|
86
|
+
assets?: string[];
|
|
87
|
+
};
|
|
88
|
+
export type TaskCreateOptions = CreateOptions & AssetOptions & {
|
|
89
|
+
status?: StatusCategory;
|
|
90
|
+
dependsOn?: string[];
|
|
91
|
+
delivers?: string[];
|
|
92
|
+
};
|
|
93
|
+
export type DocumentCreateOptions = CreateOptions & AssetOptions & {
|
|
94
|
+
id?: string;
|
|
95
|
+
};
|
|
96
|
+
export type ProjectCreateOptions = CreateOptions & {
|
|
97
|
+
status?: StatusCategory;
|
|
98
|
+
};
|
|
99
|
+
export type TaskUpdateOptions = WriteOptions & ExpectOptions & {
|
|
100
|
+
title?: string;
|
|
101
|
+
bodyFile?: string;
|
|
102
|
+
status?: StatusCategory;
|
|
103
|
+
statusName?: string;
|
|
104
|
+
priority?: Priority;
|
|
105
|
+
metadata?: Record<string, JsonValue>;
|
|
106
|
+
removeMetadata?: string[];
|
|
107
|
+
delivers?: string[];
|
|
108
|
+
dependsOn?: string[];
|
|
109
|
+
};
|
|
110
|
+
export type RenderOptions = TemplateSourceOptions & WriteOptions & {
|
|
111
|
+
unset?: string[];
|
|
112
|
+
dryRun?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export type ItemRenderOptions = RenderOptions & AssetOptions;
|
|
115
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
116
|
+
[key: string]: JsonValue;
|
|
117
|
+
};
|
|
118
|
+
export type ClientOptions = {
|
|
119
|
+
binaryPath?: string;
|
|
120
|
+
cwd?: string;
|
|
121
|
+
env?: NodeJS.ProcessEnv;
|
|
122
|
+
};
|
|
123
|
+
export declare class OnetaskgraphExecutionError extends Error {
|
|
124
|
+
readonly exitCode: number | null;
|
|
125
|
+
readonly stderr: string;
|
|
126
|
+
readonly failure?: FailureDocument["failure"] | undefined;
|
|
127
|
+
constructor(exitCode: number | null, stderr?: string, failure?: FailureDocument["failure"] | undefined);
|
|
128
|
+
}
|
|
129
|
+
export declare class OnetaskgraphValidationError extends Error {
|
|
130
|
+
readonly command: string;
|
|
131
|
+
readonly validationErrors: unknown;
|
|
132
|
+
constructor(command: string, validationErrors: unknown);
|
|
133
|
+
}
|
|
134
|
+
export declare const commandResponseRoots: Readonly<Record<string, keyof typeof runtimeSchemas>>;
|
|
135
|
+
export declare const commandAlternateRoots: Readonly<Record<string, readonly (keyof typeof runtimeSchemas)[]>>;
|
|
136
|
+
export declare const clientCommands: readonly string[];
|
|
137
|
+
export declare const taskUpdateOptionFlags: Readonly<Record<keyof TaskUpdateOptions, string>>;
|
|
138
|
+
export declare function taskUpdateFlags(options: unknown): string[];
|
|
139
|
+
export declare function taskCopyFlags(options: TaskCopyOptions): string[];
|
|
140
|
+
export declare function projectCopyFlags(options: CopyOptions & StatusCopyOptions & {
|
|
141
|
+
noTasks?: boolean;
|
|
142
|
+
members?: string[];
|
|
143
|
+
membersOnly?: boolean;
|
|
144
|
+
}): string[];
|
|
145
|
+
export declare class OnetaskgraphClient {
|
|
146
|
+
readonly binaryPath: string;
|
|
147
|
+
readonly cwd: string | undefined;
|
|
148
|
+
readonly env: NodeJS.ProcessEnv;
|
|
149
|
+
constructor(options?: ClientOptions);
|
|
150
|
+
schema(): Promise<unknown>;
|
|
151
|
+
configShow(): Promise<EffectiveConfig>;
|
|
152
|
+
cacheClear(source?: string): Promise<CacheCleared>;
|
|
153
|
+
sourcesList(): Promise<SourceListings>;
|
|
154
|
+
sourcesStatusOptions(source: string, options?: {
|
|
155
|
+
apply?: boolean;
|
|
156
|
+
}): Promise<StatusOptionsReport>;
|
|
157
|
+
sourcesFields(source: string, options?: {
|
|
158
|
+
apply?: boolean;
|
|
159
|
+
}): Promise<FieldsReport | StatusNamesReport>;
|
|
160
|
+
sourcesRoute(source: string, options?: {
|
|
161
|
+
repositories?: string[];
|
|
162
|
+
classification?: Classification;
|
|
163
|
+
}): Promise<SourceRoute>;
|
|
164
|
+
taskList(options?: FilterOptions & {
|
|
165
|
+
project?: string;
|
|
166
|
+
noProject?: boolean;
|
|
167
|
+
priorities?: Priority[];
|
|
168
|
+
commentedSince?: string;
|
|
169
|
+
metadata?: string[];
|
|
170
|
+
origin?: string;
|
|
171
|
+
members?: boolean;
|
|
172
|
+
}): Promise<QueryResponseOfQualifiedTask>;
|
|
173
|
+
taskShow(id: string, options?: Pick<QueryOptions, "allowPartial"> & {
|
|
174
|
+
noComments?: boolean;
|
|
175
|
+
pin?: string;
|
|
176
|
+
}): Promise<TaskDetail>;
|
|
177
|
+
taskShowMany(ids: string[], options?: {
|
|
178
|
+
noComments?: boolean;
|
|
179
|
+
pins?: Record<string, string>;
|
|
180
|
+
}): Promise<TaskDetails>;
|
|
181
|
+
taskCommentAdd(id: string, options: CommentAddOptions): Promise<CommentWritten>;
|
|
182
|
+
taskCommentList(id: string, options?: {
|
|
183
|
+
pin?: string;
|
|
184
|
+
}): Promise<CommentList>;
|
|
185
|
+
taskCommentEdit(id: string, commentId: string, options: CommentBodyOptions): Promise<CommentWritten>;
|
|
186
|
+
taskCommentDelete(id: string, commentId: string, options?: ExpectOptions): Promise<DeletedComment>;
|
|
187
|
+
taskStatusSet(id: string, category: StatusCategory, options?: WriteOptions & ExpectOptions): Promise<TaskStatusSet>;
|
|
188
|
+
taskStatusReconcile(source: string, options?: WriteOptions & {
|
|
189
|
+
dryRun?: boolean;
|
|
190
|
+
}): Promise<StatusesReconciled>;
|
|
191
|
+
taskStatusComplete(issues: string[], options?: WriteOptions & {
|
|
192
|
+
sources?: string[];
|
|
193
|
+
dryRun?: boolean;
|
|
194
|
+
}): Promise<IssuesCompleted>;
|
|
195
|
+
taskPrioritySet(id: string, priority: Priority, options?: WriteOptions & ExpectOptions): Promise<TaskPrioritySet>;
|
|
196
|
+
taskContentSet(id: string, file: string, options?: WriteOptions & ExpectOptions): Promise<TaskContentSet>;
|
|
197
|
+
taskMetadataSet(id: string, key: string, value: string, options?: WriteOptions & ExpectOptions): Promise<MetadataSet>;
|
|
198
|
+
taskUpdate(id: string, options: TaskUpdateOptions): Promise<TaskUpdated>;
|
|
199
|
+
taskDeps(id: string, options?: DependencyOptions): Promise<QueryResponseOfQualifiedEdge>;
|
|
200
|
+
taskCopy(ids: string[], to: string, options?: TaskCopyOptions): Promise<CopyReport>;
|
|
201
|
+
taskLocate(ids: string[], options: {
|
|
202
|
+
to: string;
|
|
203
|
+
noCounterpart?: boolean;
|
|
204
|
+
targetNative?: string;
|
|
205
|
+
}): Promise<LocateReport>;
|
|
206
|
+
projectList(options?: FilterOptions): Promise<QueryResponseOfQualifiedProject>;
|
|
207
|
+
projectShow(id: string, options?: Pick<QueryOptions, "allowPartial"> & {
|
|
208
|
+
pin?: string;
|
|
209
|
+
}): Promise<QueryResponseOfQualifiedProject>;
|
|
210
|
+
projectDeps(id: string, options?: DependencyOptions): Promise<QueryResponseOfQualifiedEdge>;
|
|
211
|
+
projectGraph(id: string, options?: ProjectGraphOptions): Promise<ProjectGraph>;
|
|
212
|
+
projectCopy(id: string, to: string, options?: CopyOptions & StatusCopyOptions & {
|
|
213
|
+
noTasks?: boolean;
|
|
214
|
+
members?: string[];
|
|
215
|
+
membersOnly?: boolean;
|
|
216
|
+
}): Promise<CopyReport>;
|
|
217
|
+
projectMetadataSet(id: string, key: string, value: string, options?: WriteOptions): Promise<MetadataSet>;
|
|
218
|
+
projectStatusSet(id: string, category: StatusCategory, options?: WriteOptions): Promise<ProjectStatusSet>;
|
|
219
|
+
documentList(options?: DocumentFilterOptions & {
|
|
220
|
+
project?: string;
|
|
221
|
+
noProject?: boolean;
|
|
222
|
+
}): Promise<QueryResponseOfQualifiedDocument>;
|
|
223
|
+
documentShow(id: string, options?: Pick<QueryOptions, "allowPartial"> & {
|
|
224
|
+
pin?: string;
|
|
225
|
+
}): Promise<DocumentDetail>;
|
|
226
|
+
documentCopy(ids: string[], to: string, options?: Omit<CopyOptions, "comments">): Promise<CopyReport>;
|
|
227
|
+
documentMetadataSet(id: string, key: string, value: string, options?: WriteOptions): Promise<MetadataSet>;
|
|
228
|
+
labelList(options?: QueryOptions): Promise<QueryResponseOfQualifiedLabel>;
|
|
229
|
+
search(text: string, options?: QueryOptions & {
|
|
230
|
+
fields?: "title" | "content" | "both";
|
|
231
|
+
kind?: "task" | "project" | "both";
|
|
232
|
+
}): Promise<QueryResponseOfSearchHit>;
|
|
233
|
+
templateVariables(file?: string, options?: TemplateOptions & {
|
|
234
|
+
templateLoader?: string;
|
|
235
|
+
}): Promise<TemplateVariables>;
|
|
236
|
+
templateRender(file?: string, options?: TemplateRenderOptions): Promise<RenderedTemplate>;
|
|
237
|
+
taskCreate(source: string, project: string, title: string, options?: TaskCreateOptions): Promise<TaskDetail>;
|
|
238
|
+
taskRender(id: string, options?: ItemRenderOptions): Promise<Regenerated>;
|
|
239
|
+
taskAnswers(id: string): Promise<TemplateAnswers>;
|
|
240
|
+
taskAssets(id: string, outputDir: string): Promise<TaskAssetNames>;
|
|
241
|
+
projectCreate(source: string, id: NativeId, title: string, options?: ProjectCreateOptions): Promise<QueryResponseOfQualifiedProject>;
|
|
242
|
+
projectRender(id: string, options?: RenderOptions): Promise<Regenerated>;
|
|
243
|
+
projectAnswers(id: string): Promise<TemplateAnswers>;
|
|
244
|
+
documentCreate(source: string, project: string, title: string, options?: DocumentCreateOptions): Promise<DocumentDetail>;
|
|
245
|
+
documentRender(id: string, options?: ItemRenderOptions): Promise<Regenerated>;
|
|
246
|
+
documentAnswers(id: string): Promise<TemplateAnswers>;
|
|
247
|
+
private run;
|
|
248
|
+
}
|
|
249
|
+
export declare function assertCompleteCommandSurface(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const binaryCommands: readonly ["schema", "config show", "sources list", "sources status-options", "sources fields", "sources route", "task list", "task show", "task show-many", "task deps", "task copy", "task locate", "task comment add", "task comment list", "task comment edit", "task comment delete", "task status set", "task status reconcile", "task status complete", "task priority set", "task content set", "task metadata set", "task update", "task create", "task render", "task answers", "task assets", "project list", "project show", "project deps", "project graph", "project copy", "project metadata set", "project status set", "project create", "project render", "project answers", "document list", "document show", "document copy", "document metadata set", "document create", "document render", "document answers", "label list", "search", "cache clear", "template variables", "template render"];
|