@jurislm/woodpecker-ci-plugin 1.1.9 → 2.0.1
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/.codex-plugin/plugin.json +1 -2
- package/README.md +43 -19
- package/api/manifest.json +8 -0
- package/contracts/woodpecker-mcp-v2.json +2653 -0
- package/dist/api.d.ts +11 -0
- package/dist/api.js +23 -0
- package/dist/api.js.map +1 -0
- package/dist/generated/operations.d.ts +1 -0
- package/dist/generated/operations.js +105 -118
- package/dist/generated/operations.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +19 -35
- package/dist/server.js.map +1 -1
- package/dist/tools/pipelines.d.ts +3 -0
- package/dist/tools/pipelines.js +47 -0
- package/dist/tools/pipelines.js.map +1 -0
- package/openapi/woodpecker-dev.yaml +4747 -0
- package/package.json +6 -4
- package/plugin.json +1 -1
- package/skills/woodpecker-ci/SKILL.md +1 -1
- package/.app.json +0 -3
- package/dist/generated/woodpecker-zod.d.ts +0 -1229
- package/dist/generated/woodpecker-zod.js +0 -56
- package/dist/generated/woodpecker-zod.js.map +0 -1
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GeneratedOperation } from "./generated/operations.js";
|
|
2
|
+
import type { ToolEnvelope, WoodpeckerClient } from "./client.js";
|
|
3
|
+
export type ApiRequest = (operation: GeneratedOperation, input: Record<string, unknown>) => Promise<ToolEnvelope<unknown>>;
|
|
4
|
+
export declare function createApiRequest(client: WoodpeckerClient): ApiRequest;
|
|
5
|
+
export declare function withApiErrorHandling<T>(handler: () => Promise<T>, tokens?: Array<string | undefined>): Promise<T | {
|
|
6
|
+
isError: true;
|
|
7
|
+
content: [{
|
|
8
|
+
type: "text";
|
|
9
|
+
text: string;
|
|
10
|
+
}];
|
|
11
|
+
}>;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { formatToolError } from "./errors.js";
|
|
2
|
+
export function createApiRequest(client) {
|
|
3
|
+
return async (operation, input) => {
|
|
4
|
+
const envelope = await client.request(operation, input);
|
|
5
|
+
const parsed = operation.responseSchema.safeParse(envelope.data);
|
|
6
|
+
if (!parsed.success) {
|
|
7
|
+
throw new Error(`Woodpecker API response did not match ${operation.name} response schema (HTTP ${envelope.status})`);
|
|
8
|
+
}
|
|
9
|
+
return { ...envelope, data: parsed.data };
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export async function withApiErrorHandling(handler, tokens = []) {
|
|
13
|
+
try {
|
|
14
|
+
return await handler();
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return {
|
|
18
|
+
isError: true,
|
|
19
|
+
content: [{ type: "text", text: JSON.stringify({ error: formatToolError(error, tokens) }) }],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,yCAAyC,SAAS,CAAC,IAAI,0BAA0B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACvH,CAAC;QACD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAyB,EACzB,SAAoC,EAAE;IAEtC,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;SAC7F,CAAC;IACJ,CAAC;AACH,CAAC"}
|