@boboddy/sdk 0.1.45-alpha → 0.2.3-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/client.js CHANGED
@@ -937,6 +937,32 @@ class StepDefinitions extends HeyApiClient {
937
937
  }
938
938
 
939
939
  class StepExecutions extends HeyApiClient {
940
+ createArtifactUploadUrl(options) {
941
+ return (options.client ?? this.client).post({
942
+ url: "/api/step-executions/{stepExecutionId}/artifact-upload-url",
943
+ ...options,
944
+ headers: {
945
+ "Content-Type": "application/json",
946
+ ...options.headers
947
+ }
948
+ });
949
+ }
950
+ listStepExecutionArtifacts(options) {
951
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/artifacts", ...options });
952
+ }
953
+ recordStepExecutionArtifact(options) {
954
+ return (options.client ?? this.client).post({
955
+ url: "/api/step-executions/{stepExecutionId}/artifacts",
956
+ ...options,
957
+ headers: {
958
+ "Content-Type": "application/json",
959
+ ...options.headers
960
+ }
961
+ });
962
+ }
963
+ getArtifactDownloadUrl(options) {
964
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/artifacts/{artifactId}/download-url", ...options });
965
+ }
940
966
  claimStepExecutions(options) {
941
967
  return (options.client ?? this.client).post({
942
968
  url: "/api/step-executions/claims",
@@ -1009,6 +1035,22 @@ class StepExecutions extends HeyApiClient {
1009
1035
  getStepExecution(options) {
1010
1036
  return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}", ...options });
1011
1037
  }
1038
+ readStepExecutionLogs(options) {
1039
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs", ...options });
1040
+ }
1041
+ appendStepExecutionLogs(options) {
1042
+ return (options.client ?? this.client).post({
1043
+ url: "/api/step-executions/{stepExecutionId}/logs",
1044
+ ...options,
1045
+ headers: {
1046
+ "Content-Type": "application/json",
1047
+ ...options.headers
1048
+ }
1049
+ });
1050
+ }
1051
+ getStepExecutionLogArchive(options) {
1052
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs/archive", ...options });
1053
+ }
1012
1054
  }
1013
1055
 
1014
1056
  class PipelineDefinitions extends HeyApiClient {
@@ -1347,6 +1389,12 @@ class ProjectInvites extends HeyApiClient {
1347
1389
  }
1348
1390
  }
1349
1391
 
1392
+ class Billing extends HeyApiClient {
1393
+ getOrgUsage(options) {
1394
+ return (options.client ?? this.client).get({ url: "/api/orgs/{orgId}/usage", ...options });
1395
+ }
1396
+ }
1397
+
1350
1398
  class BoboddyClient extends HeyApiClient {
1351
1399
  static __registry = new HeyApiRegistry;
1352
1400
  constructor(args) {
@@ -1409,6 +1457,10 @@ class BoboddyClient extends HeyApiClient {
1409
1457
  get projectInvites() {
1410
1458
  return this._projectInvites ??= new ProjectInvites({ client: this.client });
1411
1459
  }
1460
+ _billing;
1461
+ get billing() {
1462
+ return this._billing ??= new Billing({ client: this.client });
1463
+ }
1412
1464
  }
1413
1465
  // src/step-execution-plane-client.ts
1414
1466
  function createStepExecutionPlaneClient(baseUrl) {
@@ -1471,6 +1523,54 @@ var buildStepExecutionPlaneClient = (stepExecutions) => {
1471
1523
  });
1472
1524
  if (result.error)
1473
1525
  throw new Error(JSON.stringify(result.error));
1526
+ },
1527
+ createArtifactUploadUrl: async (stepExecutionId, body, options) => {
1528
+ const result = await stepExecutions.createArtifactUploadUrl({
1529
+ path: { stepExecutionId },
1530
+ body,
1531
+ headers: options?.headers
1532
+ });
1533
+ if (result.error)
1534
+ throw new Error(JSON.stringify(result.error));
1535
+ return result.data;
1536
+ },
1537
+ recordStepExecutionArtifact: async (stepExecutionId, body, options) => {
1538
+ const result = await stepExecutions.recordStepExecutionArtifact({
1539
+ path: { stepExecutionId },
1540
+ body,
1541
+ headers: options?.headers
1542
+ });
1543
+ if (result.error)
1544
+ throw new Error(JSON.stringify(result.error));
1545
+ return result.data;
1546
+ },
1547
+ listStepExecutionArtifacts: async (stepExecutionId, options) => {
1548
+ const result = await stepExecutions.listStepExecutionArtifacts({
1549
+ path: { stepExecutionId },
1550
+ headers: options?.headers
1551
+ });
1552
+ if (result.error)
1553
+ throw new Error(JSON.stringify(result.error));
1554
+ return result.data;
1555
+ },
1556
+ getArtifactDownloadUrl: async (stepExecutionId, artifactId, options) => {
1557
+ const result = await stepExecutions.getArtifactDownloadUrl({
1558
+ path: { stepExecutionId, artifactId },
1559
+ headers: options?.headers
1560
+ });
1561
+ if (result.error)
1562
+ throw new Error(JSON.stringify(result.error));
1563
+ return result.data;
1564
+ },
1565
+ appendStepExecutionLogs: async (stepExecutionId, body, options) => {
1566
+ const result = await stepExecutions.appendStepExecutionLogs({
1567
+ path: { stepExecutionId },
1568
+ body,
1569
+ headers: options?.headers
1570
+ });
1571
+ if (result.error)
1572
+ throw new Error(JSON.stringify(result.error));
1573
+ return result.data;
1474
1574
  }
1475
1575
  };
1476
1576
  };
@@ -1497,5 +1597,6 @@ export {
1497
1597
  NotificationRules,
1498
1598
  GitHubIntegrations,
1499
1599
  BoboddyClient,
1600
+ Billing,
1500
1601
  Api
1501
1602
  };
@@ -281,7 +281,7 @@ async function loadProjectConfig(rootDir = process.cwd()) {
281
281
  import path2 from "path";
282
282
  async function findProjectConfigUpwards(startDir) {
283
283
  let current = path2.resolve(startDir);
284
- while (true) {
284
+ for (;; ) {
285
285
  const found = await loadProjectConfig(current);
286
286
  if (found)
287
287
  return found;
@@ -294,9 +294,9 @@ async function findProjectConfigUpwards(startDir) {
294
294
  async function loadPushDefaults(opts) {
295
295
  const baseUrl = resolveBoboddyBaseUrl();
296
296
  const envProjectId = process.env["BOBODDY_PROJECT_ID"]?.trim();
297
- const projectId = envProjectId && envProjectId.length > 0 ? envProjectId : (await findProjectConfigUpwards(opts.dir))?.projectId;
297
+ const projectId = envProjectId ? envProjectId : (await findProjectConfigUpwards(opts.dir))?.projectId;
298
298
  const envAccessToken = process.env["BOBODDY_ACCESS_TOKEN"]?.trim();
299
- const accessToken = envAccessToken && envAccessToken.length > 0 ? envAccessToken : loadAuthProfile(baseUrl)?.accessToken;
299
+ const accessToken = envAccessToken ? envAccessToken : loadAuthProfile(baseUrl)?.accessToken;
300
300
  return { baseUrl, projectId, accessToken };
301
301
  }
302
302
  export {
@@ -0,0 +1,69 @@
1
+ import { z, type ZodType } from "zod";
2
+ import { type AdditionalStepInputBinding, type TypedStepDefinitionSpec } from "../steps/define-step";
3
+ import { type AnyBinding, type LiteralBinding, type StepOutputBinding, type StepSignalBinding, type WorkItemBinding } from "./define-pipeline";
4
+ import { type InputAccessor } from "./input-accessor";
5
+ export type AnyTypedStep = TypedStepDefinitionSpec<any, any, any, any>;
6
+ export type StepConfig = {
7
+ timeout?: number | null;
8
+ };
9
+ type ElementOf<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer U> ? U : never;
10
+ export type WorkItemAccessor = {
11
+ readonly title: WorkItemBinding;
12
+ readonly description: WorkItemBinding;
13
+ readonly field: (fieldName: string) => WorkItemBinding;
14
+ };
15
+ export type WithWorkItemFields<T> = {
16
+ workItemTitle: string;
17
+ workItemDescription: string | null;
18
+ } & T;
19
+ type RequiredInputKeys<T extends object> = {
20
+ [K in keyof T & string]-?: undefined extends T[K] ? never : K;
21
+ }[keyof T & string];
22
+ type OptionalInputKeys<T extends object> = {
23
+ [K in keyof T & string]-?: undefined extends T[K] ? K : never;
24
+ }[keyof T & string];
25
+ type Prettify<T> = {
26
+ [K in keyof T]: T[K];
27
+ } & {};
28
+ export type StepInputCtx<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>> = {
29
+ input: InputAccessor<Prettify<WithWorkItemFields<TInput["_output"]>>>;
30
+ signal: <S extends ElementOf<TSteps>>(step: S, key: S["__signalKeys"]) => StepSignalBinding;
31
+ output: (step: ElementOf<TSteps>) => StepOutputBinding;
32
+ literal: (value: unknown) => LiteralBinding;
33
+ };
34
+ type ReservedPipelineInputKeys = "workItemTitle" | "workItemDescription";
35
+ export type NoReservedKeys<T extends ZodType> = T extends {
36
+ shape: infer Shape;
37
+ } ? [keyof Shape & ReservedPipelineInputKeys] extends [never] ? T : never : T;
38
+ export type PipelineMeta<TInput extends ZodType = z.ZodUnknown> = {
39
+ key: string;
40
+ name: string;
41
+ description?: string;
42
+ version?: number;
43
+ status?: "draft" | "active";
44
+ additionalPipelineInput?: {
45
+ schema: NoReservedKeys<TInput>;
46
+ bindings: (ctx: {
47
+ workItem: WorkItemAccessor;
48
+ literal: (value: unknown) => LiteralBinding;
49
+ }) => TInput["_output"] extends object ? {
50
+ [K in RequiredInputKeys<TInput["_output"]>]: AnyBinding;
51
+ } & {
52
+ [K in OptionalInputKeys<TInput["_output"]>]?: AnyBinding;
53
+ } : Partial<Record<string, AnyBinding>>;
54
+ };
55
+ additionalStepInput?: {
56
+ schema: ZodType;
57
+ bindings: (ctx: {
58
+ workItemField: (fieldName: string) => WorkItemBinding;
59
+ literal: (value: unknown) => LiteralBinding;
60
+ }) => Partial<Record<string, AdditionalStepInputBinding>>;
61
+ };
62
+ };
63
+ export declare const WORK_ITEM_ACCESSOR: WorkItemAccessor;
64
+ export declare function makeStepInputCtx<TInput extends ZodType>(inputSchema: TInput): StepInputCtx<TInput, ReadonlyArray<AnyTypedStep>>;
65
+ export declare function literal(value: unknown): LiteralBinding;
66
+ export declare function normalizeInputMapping(mapping: Record<string, AnyBinding | undefined> | undefined): Record<string, AnyBinding> | undefined;
67
+ export declare function resolveAdditionalStepInputBindings(label: "additionalStepInput", definition: PipelineMeta["additionalStepInput"] | undefined): Record<string, AnyBinding>;
68
+ export declare function mergeStepBindings(pipelineBindings: Record<string, AnyBinding>, explicitBindings: Record<string, AnyBinding> | undefined): Record<string, AnyBinding> | undefined;
69
+ export {};
@@ -1,13 +1,8 @@
1
1
  import { z, type ZodType } from "zod";
2
- import { type AdditionalStepInputBinding, type TypedStepDefinitionSpec } from "../steps/define-step";
3
2
  import { type AdvanceCtx, type AdvanceResult } from "../advancement-policies/fluent-rules";
4
- import { type AnyBinding, type LiteralBinding, type PipelineDefinitionSpec, type PipelineStepConfig, type StepOutputBinding, type StepSignalBinding, type WorkItemBinding } from "./define-pipeline";
5
- import { type InputAccessor } from "./input-accessor";
6
- type AnyTypedStep = TypedStepDefinitionSpec<any, any, any, any>;
7
- export type StepConfig = {
8
- timeout?: number | null;
9
- };
10
- type ElementOf<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer U> ? U : never;
3
+ import { type AnyBinding, type PipelineDefinitionSpec, type PipelineStepConfig } from "./define-pipeline";
4
+ import { type AnyTypedStep, type PipelineMeta, type StepConfig, type StepInputCtx } from "./builder-helpers";
5
+ export type { AnyTypedStep, PipelineMeta, StepConfig, StepInputCtx, WorkItemAccessor, } from "./builder-helpers";
11
6
  type LastStep<T extends ReadonlyArray<AnyTypedStep>> = T extends readonly [
12
7
  ...AnyTypedStep[],
13
8
  infer L
@@ -15,9 +10,6 @@ type LastStep<T extends ReadonlyArray<AnyTypedStep>> = T extends readonly [
15
10
  type LastSignalKeys<T extends ReadonlyArray<AnyTypedStep>> = LastStep<T> extends AnyTypedStep ? LastStep<T>["__signalKeys"] : never;
16
11
  type LastSignalTypeMap<T extends ReadonlyArray<AnyTypedStep>> = LastStep<T> extends AnyTypedStep ? LastStep<T>["__signalTypeMap"] : Record<string, unknown>;
17
12
  type IsAny<T> = 0 extends 1 & T ? true : false;
18
- type Prettify<T> = {
19
- [K in keyof T]: T[K];
20
- } & {};
21
13
  type RequiredInputKeys<T extends object> = {
22
14
  [K in keyof T & string]-?: undefined extends T[K] ? never : K;
23
15
  }[keyof T & string];
@@ -29,50 +21,6 @@ type StepInputMapping<S extends AnyTypedStep> = IsAny<S["__inputType"]> extends
29
21
  } & {
30
22
  [K in OptionalInputKeys<S["__inputType"]>]?: AnyBinding;
31
23
  } : Partial<Record<string, AnyBinding>>;
32
- export type WorkItemAccessor = {
33
- readonly title: WorkItemBinding;
34
- readonly description: WorkItemBinding;
35
- readonly field: (fieldName: string) => WorkItemBinding;
36
- };
37
- type WithWorkItemFields<T> = {
38
- workItemTitle: string;
39
- workItemDescription: string | null;
40
- } & T;
41
- export type StepInputCtx<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>> = {
42
- input: InputAccessor<Prettify<WithWorkItemFields<TInput["_output"]>>>;
43
- signal: <S extends ElementOf<TSteps>>(step: S, key: S["__signalKeys"]) => StepSignalBinding;
44
- output: <S extends ElementOf<TSteps>>(step: S) => StepOutputBinding;
45
- literal: (value: unknown) => LiteralBinding;
46
- };
47
- type ReservedPipelineInputKeys = "workItemTitle" | "workItemDescription";
48
- type NoReservedKeys<T extends ZodType> = T extends {
49
- shape: infer Shape;
50
- } ? [string & keyof Shape & ReservedPipelineInputKeys] extends [never] ? T : never : T;
51
- export type PipelineMeta<TInput extends ZodType = z.ZodUnknown> = {
52
- key: string;
53
- name: string;
54
- description?: string;
55
- version?: number;
56
- status?: "draft" | "active";
57
- additionalPipelineInput?: {
58
- schema: NoReservedKeys<TInput>;
59
- bindings: (ctx: {
60
- workItem: WorkItemAccessor;
61
- literal: (value: unknown) => LiteralBinding;
62
- }) => TInput["_output"] extends object ? {
63
- [K in RequiredInputKeys<TInput["_output"]>]: AnyBinding;
64
- } & {
65
- [K in OptionalInputKeys<TInput["_output"]>]?: AnyBinding;
66
- } : Partial<Record<string, AnyBinding>>;
67
- };
68
- additionalStepInput?: {
69
- schema: ZodType;
70
- bindings: (ctx: {
71
- workItemField: (fieldName: string) => WorkItemBinding;
72
- literal: (value: unknown) => LiteralBinding;
73
- }) => Partial<Record<string, AdditionalStepInputBinding>>;
74
- };
75
- };
76
24
  /**
77
25
  * Returned by `.step()`. Requires `.advance()` before the pipeline can
78
26
  * continue. Also accepts `.timeout()` before `.advance()`.
@@ -122,6 +70,5 @@ export declare class PipelineBuilder<TInput extends ZodType> {
122
70
  }>(step: S, mapper?: (ctx: StepInputCtx<TInput, []>) => Partial<Record<string, AnyBinding>>, configFn?: (config: StepConfig) => void): PipelineStepAdvancementBuilder<TInput, [S]>;
123
71
  step<S extends AnyTypedStep>(step: S, mapper: (ctx: StepInputCtx<TInput, []>) => StepInputMapping<S>, configFn?: (config: StepConfig) => void): PipelineStepAdvancementBuilder<TInput, [S]>;
124
72
  }
125
- export declare function literal(value: unknown): LiteralBinding;
73
+ export { literal } from "./builder-helpers";
126
74
  export declare function pipeline<TInput extends ZodType = z.ZodUnknown>(meta: PipelineMeta<TInput>): PipelineBuilder<TInput>;
127
- export {};
@@ -11478,7 +11478,7 @@ function finalize(ctx, schema) {
11478
11478
  result.$schema = "http://json-schema.org/draft-07/schema#";
11479
11479
  } else if (ctx.target === "draft-04") {
11480
11480
  result.$schema = "http://json-schema.org/draft-04/schema#";
11481
- } else if (ctx.target === "openapi-3.0") {} else {}
11481
+ } else if (ctx.target === "openapi-3.0") {}
11482
11482
  if (ctx.external?.uri) {
11483
11483
  const id = ctx.external.registry.get(schema)?.id;
11484
11484
  if (!id)
@@ -11722,7 +11722,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
11722
11722
  if (val === undefined) {
11723
11723
  if (ctx.unrepresentable === "throw") {
11724
11724
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11725
- } else {}
11725
+ }
11726
11726
  } else if (typeof val === "bigint") {
11727
11727
  if (ctx.unrepresentable === "throw") {
11728
11728
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -14643,6 +14643,82 @@ function materializeAccessor(accessor) {
14643
14643
  };
14644
14644
  }
14645
14645
 
14646
+ // src/definitions/pipelines/builder-helpers.ts
14647
+ var WORK_ITEM_ACCESSOR = Object.freeze({
14648
+ title: Object.freeze({ source: "work_item", field: "title" }),
14649
+ description: Object.freeze({
14650
+ source: "work_item",
14651
+ field: "description"
14652
+ }),
14653
+ field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
14654
+ });
14655
+ var WORK_ITEM_FIELD_BINDINGS = {
14656
+ workItemTitle: { source: "work_item", field: "title" },
14657
+ workItemDescription: { source: "work_item", field: "description" }
14658
+ };
14659
+ function makeStepInputCtx(inputSchema) {
14660
+ const baseAccessor = createInputAccessor(inputSchema);
14661
+ const input = new Proxy(baseAccessor, {
14662
+ get(target, prop) {
14663
+ if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
14664
+ return WORK_ITEM_FIELD_BINDINGS[prop];
14665
+ }
14666
+ return target[prop];
14667
+ }
14668
+ });
14669
+ return {
14670
+ input,
14671
+ signal(step, key) {
14672
+ return { source: "step_signal", step, signalKey: key };
14673
+ },
14674
+ output(step) {
14675
+ return { source: "step_output", step };
14676
+ },
14677
+ literal: literal2
14678
+ };
14679
+ }
14680
+ function literal2(value) {
14681
+ return { source: "literal", value };
14682
+ }
14683
+ function normalizeInputMapping(mapping) {
14684
+ if (!mapping)
14685
+ return;
14686
+ const out = {};
14687
+ for (const [key, value] of Object.entries(mapping)) {
14688
+ if (value === undefined)
14689
+ continue;
14690
+ out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
14691
+ }
14692
+ return out;
14693
+ }
14694
+ function resolveAdditionalStepInputBindings(label, definition) {
14695
+ if (!definition) {
14696
+ return {};
14697
+ }
14698
+ const raw = definition.bindings({
14699
+ workItemField: (fieldName) => ({
14700
+ source: "work_item",
14701
+ field: `fields.${fieldName}`
14702
+ }),
14703
+ literal: literal2
14704
+ });
14705
+ if (definition.schema instanceof exports_external.ZodObject) {
14706
+ const validKeys = new Set(Object.keys(definition.schema.shape));
14707
+ const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
14708
+ if (unknown2.length > 0) {
14709
+ throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
14710
+ }
14711
+ }
14712
+ return normalizeInputMapping(raw) ?? {};
14713
+ }
14714
+ function mergeStepBindings(pipelineBindings, explicitBindings) {
14715
+ const merged = {
14716
+ ...pipelineBindings,
14717
+ ...explicitBindings ?? {}
14718
+ };
14719
+ return Object.keys(merged).length > 0 ? merged : undefined;
14720
+ }
14721
+
14646
14722
  // src/definitions/pipelines/builder.ts
14647
14723
  class PipelineStepAdvancementBuilder {
14648
14724
  inputSchema;
@@ -14659,6 +14735,8 @@ class PipelineStepAdvancementBuilder {
14659
14735
  }
14660
14736
  advance(callback) {
14661
14737
  const last = this.steps.at(-1);
14738
+ if (!last)
14739
+ throw new Error("Internal error: no steps available");
14662
14740
  const ctx = makeAdvanceCtx();
14663
14741
  const result = callback(ctx);
14664
14742
  const policy = {
@@ -14755,80 +14833,6 @@ class PipelineBuilder {
14755
14833
  return new PipelineStepAdvancementBuilder(this.inputSchema, this.meta, this.steps, this.pipelineInputBindings, this.pipelineStepInputBindings);
14756
14834
  }
14757
14835
  }
14758
- var WORK_ITEM_ACCESSOR = Object.freeze({
14759
- title: Object.freeze({ source: "work_item", field: "title" }),
14760
- description: Object.freeze({
14761
- source: "work_item",
14762
- field: "description"
14763
- }),
14764
- field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
14765
- });
14766
- var WORK_ITEM_FIELD_BINDINGS = {
14767
- workItemTitle: { source: "work_item", field: "title" },
14768
- workItemDescription: { source: "work_item", field: "description" }
14769
- };
14770
- function makeStepInputCtx(inputSchema) {
14771
- const baseAccessor = createInputAccessor(inputSchema);
14772
- const input = new Proxy(baseAccessor, {
14773
- get(target, prop) {
14774
- if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
14775
- return WORK_ITEM_FIELD_BINDINGS[prop];
14776
- }
14777
- return target[prop];
14778
- }
14779
- });
14780
- return {
14781
- input,
14782
- signal(step, key) {
14783
- return { source: "step_signal", step, signalKey: key };
14784
- },
14785
- output(step) {
14786
- return { source: "step_output", step };
14787
- },
14788
- literal: literal2
14789
- };
14790
- }
14791
- function literal2(value) {
14792
- return { source: "literal", value };
14793
- }
14794
- function normalizeInputMapping(mapping) {
14795
- if (!mapping)
14796
- return;
14797
- const out = {};
14798
- for (const [key, value] of Object.entries(mapping)) {
14799
- if (value === undefined)
14800
- continue;
14801
- out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
14802
- }
14803
- return out;
14804
- }
14805
- function resolveAdditionalStepInputBindings(label, definition) {
14806
- if (!definition) {
14807
- return {};
14808
- }
14809
- const raw = definition.bindings({
14810
- workItemField: (fieldName) => ({
14811
- source: "work_item",
14812
- field: `fields.${fieldName}`
14813
- }),
14814
- literal: literal2
14815
- });
14816
- if (definition.schema instanceof exports_external.ZodObject) {
14817
- const validKeys = new Set(Object.keys(definition.schema.shape));
14818
- const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
14819
- if (unknown2.length > 0) {
14820
- throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
14821
- }
14822
- }
14823
- return normalizeInputMapping(raw) ?? {};
14824
- }
14825
- function mergeStepBindings(pipelineBindings, explicitBindings) {
14826
- const merged = {
14827
- ...pipelineBindings,
14828
- ...explicitBindings ?? {}
14829
- };
14830
- return Object.keys(merged).length > 0 ? merged : undefined;
14831
- }
14832
14836
  function pipeline(meta3) {
14833
14837
  return new PipelineBuilder(meta3);
14834
14838
  }
@@ -15755,6 +15759,32 @@ class StepDefinitions extends HeyApiClient {
15755
15759
  }
15756
15760
 
15757
15761
  class StepExecutions extends HeyApiClient {
15762
+ createArtifactUploadUrl(options) {
15763
+ return (options.client ?? this.client).post({
15764
+ url: "/api/step-executions/{stepExecutionId}/artifact-upload-url",
15765
+ ...options,
15766
+ headers: {
15767
+ "Content-Type": "application/json",
15768
+ ...options.headers
15769
+ }
15770
+ });
15771
+ }
15772
+ listStepExecutionArtifacts(options) {
15773
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/artifacts", ...options });
15774
+ }
15775
+ recordStepExecutionArtifact(options) {
15776
+ return (options.client ?? this.client).post({
15777
+ url: "/api/step-executions/{stepExecutionId}/artifacts",
15778
+ ...options,
15779
+ headers: {
15780
+ "Content-Type": "application/json",
15781
+ ...options.headers
15782
+ }
15783
+ });
15784
+ }
15785
+ getArtifactDownloadUrl(options) {
15786
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/artifacts/{artifactId}/download-url", ...options });
15787
+ }
15758
15788
  claimStepExecutions(options) {
15759
15789
  return (options.client ?? this.client).post({
15760
15790
  url: "/api/step-executions/claims",
@@ -15827,6 +15857,22 @@ class StepExecutions extends HeyApiClient {
15827
15857
  getStepExecution(options) {
15828
15858
  return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}", ...options });
15829
15859
  }
15860
+ readStepExecutionLogs(options) {
15861
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs", ...options });
15862
+ }
15863
+ appendStepExecutionLogs(options) {
15864
+ return (options.client ?? this.client).post({
15865
+ url: "/api/step-executions/{stepExecutionId}/logs",
15866
+ ...options,
15867
+ headers: {
15868
+ "Content-Type": "application/json",
15869
+ ...options.headers
15870
+ }
15871
+ });
15872
+ }
15873
+ getStepExecutionLogArchive(options) {
15874
+ return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs/archive", ...options });
15875
+ }
15830
15876
  }
15831
15877
 
15832
15878
  class PipelineDefinitions extends HeyApiClient {
@@ -16165,6 +16211,12 @@ class ProjectInvites extends HeyApiClient {
16165
16211
  }
16166
16212
  }
16167
16213
 
16214
+ class Billing extends HeyApiClient {
16215
+ getOrgUsage(options) {
16216
+ return (options.client ?? this.client).get({ url: "/api/orgs/{orgId}/usage", ...options });
16217
+ }
16218
+ }
16219
+
16168
16220
  class BoboddyClient extends HeyApiClient {
16169
16221
  static __registry = new HeyApiRegistry;
16170
16222
  constructor(args) {
@@ -16227,6 +16279,10 @@ class BoboddyClient extends HeyApiClient {
16227
16279
  get projectInvites() {
16228
16280
  return this._projectInvites ??= new ProjectInvites({ client: this.client });
16229
16281
  }
16282
+ _billing;
16283
+ get billing() {
16284
+ return this._billing ??= new Billing({ client: this.client });
16285
+ }
16230
16286
  }
16231
16287
 
16232
16288
  // src/definitions/pipelines/pipeline-definitions-client.ts
@@ -16243,7 +16299,7 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => {
16243
16299
  });
16244
16300
  if (result.error)
16245
16301
  throw new Error(JSON.stringify(result.error));
16246
- return result.data ?? [];
16302
+ return result.data;
16247
16303
  },
16248
16304
  upsertFromSpec: async (projectId, spec, stepDefs, options) => {
16249
16305
  const stepDefMap = new Map;
@@ -16323,7 +16379,7 @@ function makeFieldRef(fact, path) {
16323
16379
  };
16324
16380
  }
16325
16381
  function makeAssign(pipeline2) {
16326
- if (typeof pipeline2 !== "object" || pipeline2 === null || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["steps"])) {
16382
+ if (typeof pipeline2 !== "object" || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["steps"])) {
16327
16383
  throw new Error("assign() requires a pipeline spec produced by pipeline().build(). " + "Pass the default-exported value from a pipeline definition file.");
16328
16384
  }
16329
16385
  return { _tag: "assign", pipeline: pipeline2 };
@@ -16372,13 +16428,10 @@ function serializeConditionNode(condition) {
16372
16428
  value: condition.value
16373
16429
  };
16374
16430
  }
16375
- if (condition._tag === "group") {
16376
- if (condition.mode === "all") {
16377
- return { all: condition.conditions.map(serializeConditionNode) };
16378
- }
16379
- return { any: condition.conditions.map(serializeConditionNode) };
16431
+ if (condition.mode === "all") {
16432
+ return { all: condition.conditions.map(serializeConditionNode) };
16380
16433
  }
16381
- throw new Error(`Unknown condition tag: ${JSON.stringify(condition["_tag"])}`);
16434
+ return { any: condition.conditions.map(serializeConditionNode) };
16382
16435
  }
16383
16436
  function serializeOutcome(outcome) {
16384
16437
  if (outcome._tag === "skip")