@boboddy/sdk 0.1.0-alpha → 0.1.1-alpha
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.
|
@@ -132,10 +132,52 @@ function definePipeline(config) {
|
|
|
132
132
|
}))
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
+
// src/definitions/pipelines/pipeline-definitions-client.ts
|
|
136
|
+
function createPipelineDefinitionsClient(baseUrl) {
|
|
137
|
+
const base = baseUrl.replace(/\/$/, "");
|
|
138
|
+
async function doFetch(path, method, headers, body) {
|
|
139
|
+
const requestHeaders = { ...headers };
|
|
140
|
+
if (body !== undefined) {
|
|
141
|
+
requestHeaders["Content-Type"] = "application/json";
|
|
142
|
+
}
|
|
143
|
+
const response = await fetch(`${base}${path}`, {
|
|
144
|
+
method,
|
|
145
|
+
headers: requestHeaders,
|
|
146
|
+
...body !== undefined ? { body: JSON.stringify(body) } : {}
|
|
147
|
+
});
|
|
148
|
+
if (!response.ok) {
|
|
149
|
+
const err = await response.json().catch(() => null);
|
|
150
|
+
throw new Error(err?.title ?? `HTTP ${String(response.status)} ${method} ${path}`);
|
|
151
|
+
}
|
|
152
|
+
return response.json().catch(() => null);
|
|
153
|
+
}
|
|
154
|
+
return buildPipelineDefinitionsClient(base, doFetch);
|
|
155
|
+
}
|
|
156
|
+
var buildPipelineDefinitionsClient = (_base, doFetch) => ({
|
|
157
|
+
listByProjectId: async (projectId, options) => {
|
|
158
|
+
const path = `/api/linear-pipeline-definitions?projectId=${encodeURIComponent(projectId)}`;
|
|
159
|
+
const result = await doFetch(path, "GET", options?.headers ?? {});
|
|
160
|
+
return result ?? [];
|
|
161
|
+
},
|
|
162
|
+
create: async (body, options) => {
|
|
163
|
+
const result = await doFetch("/api/linear-pipeline-definitions", "POST", options?.headers ?? {}, body);
|
|
164
|
+
return result;
|
|
165
|
+
},
|
|
166
|
+
update: async (pipelineId, body, options) => {
|
|
167
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}`, "PUT", options?.headers ?? {}, body);
|
|
168
|
+
},
|
|
169
|
+
addStep: async (pipelineId, body, options) => {
|
|
170
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps`, "POST", options?.headers ?? {}, body);
|
|
171
|
+
},
|
|
172
|
+
removeStep: async (pipelineId, stepId, options) => {
|
|
173
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps/${stepId}`, "DELETE", options?.headers ?? {});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
135
176
|
export {
|
|
136
177
|
stepOutput,
|
|
137
178
|
fromSignal,
|
|
138
179
|
fromPipelineInput,
|
|
139
180
|
definePipeline,
|
|
181
|
+
createPipelineDefinitionsClient,
|
|
140
182
|
Rule
|
|
141
183
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { SerializedAdvancementPolicy } from "../advancement-policies/define-advancement-policy";
|
|
2
|
+
type RequestOptions = {
|
|
3
|
+
headers?: Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
export type PipelineStepCreateInput = {
|
|
6
|
+
stepDefinitionId: string;
|
|
7
|
+
stepDefinitionVersion: number;
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | null;
|
|
11
|
+
position: number;
|
|
12
|
+
inputBindingsJson: Record<string, unknown>;
|
|
13
|
+
timeoutSeconds: number | null;
|
|
14
|
+
retryPolicyJson: null;
|
|
15
|
+
advancementPolicyDefinition: SerializedAdvancementPolicy;
|
|
16
|
+
};
|
|
17
|
+
export type CreatePipelineInput = {
|
|
18
|
+
projectId: string;
|
|
19
|
+
key: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string | null;
|
|
22
|
+
version: number;
|
|
23
|
+
status: "draft" | "active" | "archived";
|
|
24
|
+
stepDefinitions: PipelineStepCreateInput[];
|
|
25
|
+
};
|
|
26
|
+
export type UpdatePipelineInput = {
|
|
27
|
+
projectId: string;
|
|
28
|
+
key: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
version: number;
|
|
32
|
+
status: "draft" | "active" | "archived";
|
|
33
|
+
};
|
|
34
|
+
export type ExistingPipelineStep = {
|
|
35
|
+
id: string;
|
|
36
|
+
key: string;
|
|
37
|
+
};
|
|
38
|
+
export type ExistingPipeline = {
|
|
39
|
+
id: string;
|
|
40
|
+
key: string;
|
|
41
|
+
version: number;
|
|
42
|
+
status: string;
|
|
43
|
+
steps: ExistingPipelineStep[];
|
|
44
|
+
};
|
|
45
|
+
export declare function createPipelineDefinitionsClient(baseUrl: string): ReturnType<typeof buildPipelineDefinitionsClient>;
|
|
46
|
+
declare const buildPipelineDefinitionsClient: (_base: string, doFetch: (path: string, method: string, headers: Record<string, string>, body?: unknown) => Promise<unknown>) => {
|
|
47
|
+
listByProjectId: (projectId: string, options?: RequestOptions) => Promise<ExistingPipeline[]>;
|
|
48
|
+
create: (body: CreatePipelineInput, options?: RequestOptions) => Promise<{
|
|
49
|
+
id: string;
|
|
50
|
+
key: string;
|
|
51
|
+
}>;
|
|
52
|
+
update: (pipelineId: string, body: UpdatePipelineInput, options?: RequestOptions) => Promise<void>;
|
|
53
|
+
addStep: (pipelineId: string, body: PipelineStepCreateInput, options?: RequestOptions) => Promise<void>;
|
|
54
|
+
removeStep: (pipelineId: string, stepId: string, options?: RequestOptions) => Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -13485,6 +13485,47 @@ function definePipeline(config2) {
|
|
|
13485
13485
|
}))
|
|
13486
13486
|
};
|
|
13487
13487
|
}
|
|
13488
|
+
// src/definitions/pipelines/pipeline-definitions-client.ts
|
|
13489
|
+
function createPipelineDefinitionsClient(baseUrl) {
|
|
13490
|
+
const base = baseUrl.replace(/\/$/, "");
|
|
13491
|
+
async function doFetch(path, method, headers, body) {
|
|
13492
|
+
const requestHeaders = { ...headers };
|
|
13493
|
+
if (body !== undefined) {
|
|
13494
|
+
requestHeaders["Content-Type"] = "application/json";
|
|
13495
|
+
}
|
|
13496
|
+
const response = await fetch(`${base}${path}`, {
|
|
13497
|
+
method,
|
|
13498
|
+
headers: requestHeaders,
|
|
13499
|
+
...body !== undefined ? { body: JSON.stringify(body) } : {}
|
|
13500
|
+
});
|
|
13501
|
+
if (!response.ok) {
|
|
13502
|
+
const err = await response.json().catch(() => null);
|
|
13503
|
+
throw new Error(err?.title ?? `HTTP ${String(response.status)} ${method} ${path}`);
|
|
13504
|
+
}
|
|
13505
|
+
return response.json().catch(() => null);
|
|
13506
|
+
}
|
|
13507
|
+
return buildPipelineDefinitionsClient(base, doFetch);
|
|
13508
|
+
}
|
|
13509
|
+
var buildPipelineDefinitionsClient = (_base, doFetch) => ({
|
|
13510
|
+
listByProjectId: async (projectId, options) => {
|
|
13511
|
+
const path = `/api/linear-pipeline-definitions?projectId=${encodeURIComponent(projectId)}`;
|
|
13512
|
+
const result = await doFetch(path, "GET", options?.headers ?? {});
|
|
13513
|
+
return result ?? [];
|
|
13514
|
+
},
|
|
13515
|
+
create: async (body, options) => {
|
|
13516
|
+
const result = await doFetch("/api/linear-pipeline-definitions", "POST", options?.headers ?? {}, body);
|
|
13517
|
+
return result;
|
|
13518
|
+
},
|
|
13519
|
+
update: async (pipelineId, body, options) => {
|
|
13520
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}`, "PUT", options?.headers ?? {}, body);
|
|
13521
|
+
},
|
|
13522
|
+
addStep: async (pipelineId, body, options) => {
|
|
13523
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps`, "POST", options?.headers ?? {}, body);
|
|
13524
|
+
},
|
|
13525
|
+
removeStep: async (pipelineId, stepId, options) => {
|
|
13526
|
+
await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps/${stepId}`, "DELETE", options?.headers ?? {});
|
|
13527
|
+
}
|
|
13528
|
+
});
|
|
13488
13529
|
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
13489
13530
|
var exports_external = {};
|
|
13490
13531
|
__export(exports_external, {
|
|
@@ -16485,6 +16526,7 @@ export {
|
|
|
16485
16526
|
definePipeline,
|
|
16486
16527
|
createStepExecutionPlaneClient,
|
|
16487
16528
|
createStepDefinitionsClient,
|
|
16529
|
+
createPipelineDefinitionsClient,
|
|
16488
16530
|
createBoboddyClient,
|
|
16489
16531
|
WorkItems,
|
|
16490
16532
|
StepExecutions,
|
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@boboddy/sdk",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1-alpha",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"types": "./
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
9
|
"bun": "./src/index.ts",
|
|
10
10
|
"import": "./src/index.ts",
|
|
11
11
|
"default": "./src/index.ts"
|
|
12
12
|
},
|
|
13
13
|
"./client": {
|
|
14
|
-
"types": "./
|
|
14
|
+
"types": "./dist/client.d.ts",
|
|
15
15
|
"bun": "./src/client.ts",
|
|
16
16
|
"import": "./src/client.ts",
|
|
17
17
|
"default": "./src/client.ts"
|
|
18
18
|
},
|
|
19
19
|
"./definitions/steps": {
|
|
20
|
-
"types": "./
|
|
20
|
+
"types": "./dist/definitions/steps/index.d.ts",
|
|
21
21
|
"bun": "./src/definitions/steps/index.ts",
|
|
22
22
|
"import": "./src/definitions/steps/index.ts",
|
|
23
23
|
"default": "./src/definitions/steps/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"./definitions/pipelines": {
|
|
26
|
-
"types": "./
|
|
26
|
+
"types": "./dist/definitions/pipelines/index.d.ts",
|
|
27
27
|
"bun": "./src/definitions/pipelines/index.ts",
|
|
28
28
|
"import": "./src/definitions/pipelines/index.ts",
|
|
29
29
|
"default": "./src/definitions/pipelines/index.ts"
|
|
30
30
|
},
|
|
31
31
|
"./definitions/advancement-policies": {
|
|
32
|
-
"types": "./
|
|
32
|
+
"types": "./dist/definitions/advancement-policies/index.d.ts",
|
|
33
33
|
"bun": "./src/definitions/advancement-policies/index.ts",
|
|
34
34
|
"import": "./src/definitions/advancement-policies/index.ts",
|
|
35
35
|
"default": "./src/definitions/advancement-policies/index.ts"
|
|
36
36
|
},
|
|
37
37
|
"./opencode-mcp": {
|
|
38
|
-
"types": "./
|
|
38
|
+
"types": "./dist/opencode-mcp.d.ts",
|
|
39
39
|
"bun": "./src/opencode-mcp.ts",
|
|
40
40
|
"import": "./src/opencode-mcp.ts",
|
|
41
41
|
"default": "./src/opencode-mcp.ts"
|
|
42
42
|
},
|
|
43
43
|
"./jsonc": {
|
|
44
|
-
"types": "./
|
|
44
|
+
"types": "./dist/jsonc.d.ts",
|
|
45
45
|
"bun": "./src/jsonc.ts",
|
|
46
46
|
"import": "./src/jsonc.ts",
|
|
47
47
|
"default": "./src/jsonc.ts"
|
|
48
48
|
},
|
|
49
49
|
"./boboddy-config-parser": {
|
|
50
|
-
"types": "./
|
|
50
|
+
"types": "./dist/boboddy-config-parser.d.ts",
|
|
51
51
|
"bun": "./src/boboddy-config-parser.ts",
|
|
52
52
|
"import": "./src/boboddy-config-parser.ts",
|
|
53
53
|
"default": "./src/boboddy-config-parser.ts"
|
|
@@ -57,8 +57,54 @@
|
|
|
57
57
|
"dist",
|
|
58
58
|
"README.md"
|
|
59
59
|
],
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "https://github.com/connorivy/boboddy"
|
|
63
|
+
},
|
|
60
64
|
"publishConfig": {
|
|
61
|
-
"access": "public"
|
|
65
|
+
"access": "public",
|
|
66
|
+
"exports": {
|
|
67
|
+
".": {
|
|
68
|
+
"types": "./dist/index.d.ts",
|
|
69
|
+
"import": "./dist/index.js",
|
|
70
|
+
"default": "./dist/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./client": {
|
|
73
|
+
"types": "./dist/client.d.ts",
|
|
74
|
+
"import": "./dist/client.js",
|
|
75
|
+
"default": "./dist/client.js"
|
|
76
|
+
},
|
|
77
|
+
"./definitions/steps": {
|
|
78
|
+
"types": "./dist/definitions/steps/index.d.ts",
|
|
79
|
+
"import": "./dist/definitions/steps/index.js",
|
|
80
|
+
"default": "./dist/definitions/steps/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./definitions/pipelines": {
|
|
83
|
+
"types": "./dist/definitions/pipelines/index.d.ts",
|
|
84
|
+
"import": "./dist/definitions/pipelines/index.js",
|
|
85
|
+
"default": "./dist/definitions/pipelines/index.js"
|
|
86
|
+
},
|
|
87
|
+
"./definitions/advancement-policies": {
|
|
88
|
+
"types": "./dist/definitions/advancement-policies/index.d.ts",
|
|
89
|
+
"import": "./dist/definitions/advancement-policies/index.js",
|
|
90
|
+
"default": "./dist/definitions/advancement-policies/index.js"
|
|
91
|
+
},
|
|
92
|
+
"./opencode-mcp": {
|
|
93
|
+
"types": "./dist/opencode-mcp.d.ts",
|
|
94
|
+
"import": "./dist/opencode-mcp.js",
|
|
95
|
+
"default": "./dist/opencode-mcp.js"
|
|
96
|
+
},
|
|
97
|
+
"./jsonc": {
|
|
98
|
+
"types": "./dist/jsonc.d.ts",
|
|
99
|
+
"import": "./dist/jsonc.js",
|
|
100
|
+
"default": "./dist/jsonc.js"
|
|
101
|
+
},
|
|
102
|
+
"./boboddy-config-parser": {
|
|
103
|
+
"types": "./dist/boboddy-config-parser.d.ts",
|
|
104
|
+
"import": "./dist/boboddy-config-parser.js",
|
|
105
|
+
"default": "./dist/boboddy-config-parser.js"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
62
108
|
},
|
|
63
109
|
"scripts": {
|
|
64
110
|
"generate": "openapi-ts",
|