@boboddy/sdk 0.1.12-alpha → 0.1.14-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.
package/dist/index.js CHANGED
@@ -839,29 +839,38 @@ class HeyApiRegistry {
839
839
  }
840
840
 
841
841
  class Api extends HeyApiClient {
842
- "allApiApiAuth*"(options) {
843
- return (options?.client ?? this.client).delete({ url: "/api/api/auth/*", ...options });
842
+ "allApiAuth*"(options) {
843
+ return (options?.client ?? this.client).delete({ url: "/api/auth/*", ...options });
844
844
  }
845
- "allApiApiAuth*2"(options) {
846
- return (options?.client ?? this.client).get({ url: "/api/api/auth/*", ...options });
845
+ "allApiAuth*2"(options) {
846
+ return (options?.client ?? this.client).get({ url: "/api/auth/*", ...options });
847
847
  }
848
- "allApiApiAuth*3"(options) {
849
- return (options?.client ?? this.client).head({ url: "/api/api/auth/*", ...options });
848
+ "allApiAuth*3"(options) {
849
+ return (options?.client ?? this.client).head({ url: "/api/auth/*", ...options });
850
850
  }
851
- "allApiApiAuth*4"(options) {
852
- return (options?.client ?? this.client).options({ url: "/api/api/auth/*", ...options });
851
+ "allApiAuth*4"(options) {
852
+ return (options?.client ?? this.client).options({ url: "/api/auth/*", ...options });
853
853
  }
854
- "allApiApiAuth*5"(options) {
855
- return (options?.client ?? this.client).patch({ url: "/api/api/auth/*", ...options });
854
+ "allApiAuth*5"(options) {
855
+ return (options?.client ?? this.client).patch({ url: "/api/auth/*", ...options });
856
856
  }
857
- "allApiApiAuth*6"(options) {
858
- return (options?.client ?? this.client).post({ url: "/api/api/auth/*", ...options });
857
+ "allApiAuth*6"(options) {
858
+ return (options?.client ?? this.client).post({ url: "/api/auth/*", ...options });
859
859
  }
860
- "allApiApiAuth*7"(options) {
861
- return (options?.client ?? this.client).put({ url: "/api/api/auth/*", ...options });
860
+ "allApiAuth*7"(options) {
861
+ return (options?.client ?? this.client).put({ url: "/api/auth/*", ...options });
862
862
  }
863
- "allApiApiAuth*8"(options) {
864
- return (options?.client ?? this.client).trace({ url: "/api/api/auth/*", ...options });
863
+ "allApiAuth*8"(options) {
864
+ return (options?.client ?? this.client).trace({ url: "/api/auth/*", ...options });
865
+ }
866
+ getApiIntegrationsGithubInstall(options) {
867
+ return (options?.client ?? this.client).get({ url: "/api/integrations/github/install", ...options });
868
+ }
869
+ getApiIntegrationsGithubCallback(options) {
870
+ return (options?.client ?? this.client).get({ url: "/api/integrations/github/callback", ...options });
871
+ }
872
+ postApiIntegrationsGithubWebhook(options) {
873
+ return (options?.client ?? this.client).post({ url: "/api/integrations/github/webhook", ...options });
865
874
  }
866
875
  }
867
876
 
@@ -904,12 +913,9 @@ class StepDefinitions extends HeyApiClient {
904
913
  }
905
914
  });
906
915
  }
907
- getStepDefinition(options) {
908
- return (options.client ?? this.client).get({ url: "/api/step-definitions/{stepDefinitionId}", ...options });
909
- }
910
- updateStepDefinition(options) {
916
+ upsertStepDefinition(options) {
911
917
  return (options.client ?? this.client).put({
912
- url: "/api/step-definitions/{stepDefinitionId}",
918
+ url: "/api/step-definitions",
913
919
  ...options,
914
920
  headers: {
915
921
  "Content-Type": "application/json",
@@ -917,6 +923,9 @@ class StepDefinitions extends HeyApiClient {
917
923
  }
918
924
  });
919
925
  }
926
+ getStepDefinition(options) {
927
+ return (options.client ?? this.client).get({ url: "/api/step-definitions/{stepDefinitionId}", ...options });
928
+ }
920
929
  archiveStepDefinition(options) {
921
930
  return (options.client ?? this.client).put({ url: "/api/step-definitions/{stepDefinitionId}/archive", ...options });
922
931
  }
@@ -999,7 +1008,7 @@ class StepExecutions extends HeyApiClient {
999
1008
 
1000
1009
  class PipelineDefinitions extends HeyApiClient {
1001
1010
  listPipelineDefinitions(options) {
1002
- return (options.client ?? this.client).get({ url: "/api/linear-pipeline-definitions", ...options });
1011
+ return (options?.client ?? this.client).get({ url: "/api/linear-pipeline-definitions", ...options });
1003
1012
  }
1004
1013
  createPipelineDefinition(options) {
1005
1014
  return (options.client ?? this.client).post({
@@ -1027,6 +1036,9 @@ class PipelineDefinitions extends HeyApiClient {
1027
1036
  archivePipelineDefinition(options) {
1028
1037
  return (options.client ?? this.client).put({ url: "/api/linear-pipeline-definitions/{linearPipelineDefinitionId}/archive", ...options });
1029
1038
  }
1039
+ unarchivePipelineDefinition(options) {
1040
+ return (options.client ?? this.client).put({ url: "/api/linear-pipeline-definitions/{linearPipelineDefinitionId}/unarchive", ...options });
1041
+ }
1030
1042
  addPipelineStep(options) {
1031
1043
  return (options.client ?? this.client).post({
1032
1044
  url: "/api/linear-pipeline-definitions/{linearPipelineDefinitionId}/steps",
@@ -1235,6 +1247,28 @@ class StepDefinitionTemplates extends HeyApiClient {
1235
1247
  }
1236
1248
  }
1237
1249
 
1250
+ class ProjectIntegrations extends HeyApiClient {
1251
+ listProjectIntegrations(options) {
1252
+ return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/integrations", ...options });
1253
+ }
1254
+ createProjectIntegration(options) {
1255
+ return (options.client ?? this.client).post({
1256
+ url: "/api/projects/{projectId}/integrations",
1257
+ ...options,
1258
+ headers: {
1259
+ "Content-Type": "application/json",
1260
+ ...options.headers
1261
+ }
1262
+ });
1263
+ }
1264
+ syncProjectIntegration(options) {
1265
+ return (options.client ?? this.client).post({ url: "/api/projects/{projectId}/integrations/{integrationId}/sync", ...options });
1266
+ }
1267
+ deleteProjectIntegration(options) {
1268
+ return (options.client ?? this.client).delete({ url: "/api/projects/{projectId}/integrations/{integrationId}", ...options });
1269
+ }
1270
+ }
1271
+
1238
1272
  class BoboddyClient extends HeyApiClient {
1239
1273
  static __registry = new HeyApiRegistry;
1240
1274
  constructor(args) {
@@ -1281,6 +1315,10 @@ class BoboddyClient extends HeyApiClient {
1281
1315
  get stepDefinitionTemplates() {
1282
1316
  return this._stepDefinitionTemplates ??= new StepDefinitionTemplates({ client: this.client });
1283
1317
  }
1318
+ _projectIntegrations;
1319
+ get projectIntegrations() {
1320
+ return this._projectIntegrations ??= new ProjectIntegrations({ client: this.client });
1321
+ }
1284
1322
  }
1285
1323
  // src/step-execution-plane-client.ts
1286
1324
  function createStepExecutionPlaneClient(baseUrl) {
@@ -13395,9 +13433,12 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
13395
13433
  throw new Error(JSON.stringify(result.error));
13396
13434
  return result.data;
13397
13435
  },
13398
- update: async (stepDefinitionId, body, options) => {
13399
- const result = await stepDefinitions.updateStepDefinition({
13400
- path: { stepDefinitionId },
13436
+ upsertFromSpec: async (projectId, spec, options) => {
13437
+ const body = {
13438
+ ...spec,
13439
+ projectId
13440
+ };
13441
+ const result = await stepDefinitions.upsertStepDefinition({
13401
13442
  body,
13402
13443
  headers: options?.headers
13403
13444
  });
@@ -16005,45 +16046,65 @@ function definePipeline(config2) {
16005
16046
  }
16006
16047
  // src/definitions/pipelines/pipeline-definitions-client.ts
16007
16048
  function createPipelineDefinitionsClient(baseUrl) {
16008
- const base = baseUrl.replace(/\/$/, "");
16009
- async function doFetch(path, method, headers, body) {
16010
- const requestHeaders = { ...headers };
16011
- if (body !== undefined) {
16012
- requestHeaders["Content-Type"] = "application/json";
16013
- }
16014
- const response = await fetch(`${base}${path}`, {
16015
- method,
16016
- headers: requestHeaders,
16017
- ...body !== undefined ? { body: JSON.stringify(body) } : {}
16018
- });
16019
- if (!response.ok) {
16020
- const err = await response.json().catch(() => null);
16021
- throw new Error(err?.title ?? `HTTP ${String(response.status)} ${method} ${path}`);
16022
- }
16023
- return response.json().catch(() => null);
16024
- }
16025
- return buildPipelineDefinitionsClient(base, doFetch);
16049
+ const client2 = createClient({ baseUrl });
16050
+ return buildPipelineDefinitionsClient(new PipelineDefinitions({ client: client2 }));
16026
16051
  }
16027
- var buildPipelineDefinitionsClient = (_base, doFetch) => ({
16028
- listByProjectId: async (projectId, options) => {
16029
- const path = `/api/linear-pipeline-definitions?projectId=${encodeURIComponent(projectId)}`;
16030
- const result = await doFetch(path, "GET", options?.headers ?? {});
16031
- return result ?? [];
16032
- },
16033
- create: async (body, options) => {
16034
- const result = await doFetch("/api/linear-pipeline-definitions", "POST", options?.headers ?? {}, body);
16035
- return result;
16036
- },
16037
- update: async (pipelineId, body, options) => {
16038
- await doFetch(`/api/linear-pipeline-definitions/${pipelineId}`, "PUT", options?.headers ?? {}, body);
16039
- },
16040
- addStep: async (pipelineId, body, options) => {
16041
- await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps`, "POST", options?.headers ?? {}, body);
16042
- },
16043
- removeStep: async (pipelineId, stepId, options) => {
16044
- await doFetch(`/api/linear-pipeline-definitions/${pipelineId}/steps/${stepId}`, "DELETE", options?.headers ?? {});
16045
- }
16046
- });
16052
+ var buildPipelineDefinitionsClient = (pipelineDefinitions) => {
16053
+ return {
16054
+ listByProjectId: async (projectId, options) => {
16055
+ const result = await pipelineDefinitions.listPipelineDefinitions({
16056
+ query: { projectId },
16057
+ headers: options?.headers
16058
+ });
16059
+ if (result.error)
16060
+ throw new Error(JSON.stringify(result.error));
16061
+ return result.data ?? [];
16062
+ },
16063
+ upsertFromSpec: async (projectId, spec, stepDefs, options) => {
16064
+ const stepDefMap = new Map;
16065
+ for (const s of stepDefs) {
16066
+ const existing = stepDefMap.get(s.key);
16067
+ if (!existing || s.version > existing.version) {
16068
+ stepDefMap.set(s.key, s);
16069
+ }
16070
+ }
16071
+ const stepDefinitions = spec.steps.map((step) => {
16072
+ const stepDef = stepDefMap.get(step.stepKey);
16073
+ if (!stepDef) {
16074
+ throw new Error(`Step "${step.stepKey}" referenced in pipeline "${spec.key}" was not found on the server. ` + `Run \`boboddy steps push\` first to push your step definitions.`);
16075
+ }
16076
+ return {
16077
+ stepDefinitionId: stepDef.id,
16078
+ stepDefinitionVersion: stepDef.version,
16079
+ key: step.stepKey,
16080
+ name: step.stepName,
16081
+ description: step.stepDescription,
16082
+ position: step.position,
16083
+ inputBindingsJson: step.inputBindingsJson,
16084
+ timeoutSeconds: step.timeoutSeconds,
16085
+ retryPolicyJson: null,
16086
+ advancementPolicyDefinition: step.advancementPolicyDefinition,
16087
+ computedSignalDefinitions: step.computedSignalDefinitions
16088
+ };
16089
+ });
16090
+ const body = {
16091
+ projectId,
16092
+ key: spec.key,
16093
+ name: spec.name,
16094
+ description: spec.description,
16095
+ status: spec.status,
16096
+ stepDefinitions
16097
+ };
16098
+ const result = await pipelineDefinitions.upsertPipelineDefinition({
16099
+ body,
16100
+ headers: options?.headers
16101
+ });
16102
+ if (result.error)
16103
+ throw new Error(JSON.stringify(result.error));
16104
+ return result.data;
16105
+ }
16106
+ };
16107
+ };
16047
16108
  // src/opencode-mcp.ts
16048
16109
  var nonEmptyStringSchema = exports_external.string().trim().min(1);
16049
16110
  var mcpStringMapSchema = exports_external.record(exports_external.string(), exports_external.string());
@@ -16709,6 +16770,7 @@ export {
16709
16770
  StepDefinitionTemplates,
16710
16771
  Rule,
16711
16772
  Projects,
16773
+ ProjectIntegrations,
16712
16774
  ProjectContext,
16713
16775
  PipelineExecutions,
16714
16776
  PipelineDefinitions,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@boboddy/sdk",
4
- "version": "0.1.12-alpha",
4
+ "version": "0.1.14-alpha",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "repository": {
45
45
  "type": "git",
46
- "url": "https://github.com/connorivy/boboddy"
46
+ "url": "https://github.com/boboddy-dev/boboddy"
47
47
  },
48
48
  "scripts": {
49
49
  "generate": "openapi-ts",