@boboddy/sdk 0.1.7-alpha → 0.1.9-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.
@@ -1,5 +1,5 @@
1
1
  import type { ZodType } from "zod";
2
- import type { DotPaths, TypedStepDefinitionSpec } from "../steps/define-step";
2
+ import type { DotPaths, StepDefinitionSpec, TypedStepDefinitionSpec } from "../steps/define-step";
3
3
  import { type AdvancementPolicy, type SerializedAdvancementPolicy, type SerializedComputedSignalDefinition } from "../advancement-policies/define-advancement-policy";
4
4
  export type { AdvancementPolicy, PipelineStepComputedSignalType, } from "../advancement-policies/define-advancement-policy";
5
5
  export { Computed, Rule, } from "../advancement-policies/define-advancement-policy";
@@ -78,6 +78,8 @@ export type PipelineDefinitionSpec = {
78
78
  advancementPolicyDefinition: SerializedAdvancementPolicy;
79
79
  computedSignalDefinitions: SerializedComputedSignalDefinition[];
80
80
  }>;
81
+ /** Step specs referenced by this pipeline. Populated by definePipeline so the push command can auto-push steps that aren't explicitly exported. */
82
+ _stepDefinitions?: StepDefinitionSpec[];
81
83
  };
82
84
  /**
83
85
  * Untyped input shape used for documentation and as the internal implementation
@@ -176,12 +176,20 @@ function serializeBinding(binding) {
176
176
  }
177
177
  function definePipeline(config) {
178
178
  const steps = config.steps;
179
+ const stepDefMap = new Map;
180
+ for (const stepConfig of steps) {
181
+ const mapKey = `${stepConfig.step.key}@v${String(stepConfig.step.version)}`;
182
+ if (!stepDefMap.has(mapKey)) {
183
+ stepDefMap.set(mapKey, stepConfig.step);
184
+ }
185
+ }
179
186
  return {
180
187
  key: config.key,
181
188
  name: config.name,
182
189
  description: config.description ?? null,
183
190
  version: config.version ?? 1,
184
191
  status: config.status ?? "active",
192
+ _stepDefinitions: [...stepDefMap.values()],
185
193
  steps: steps.map((stepConfig, index) => ({
186
194
  stepKey: stepConfig.step.key,
187
195
  stepName: stepConfig.step.name,
package/dist/index.js CHANGED
@@ -15959,12 +15959,20 @@ function serializeBinding(binding) {
15959
15959
  }
15960
15960
  function definePipeline(config2) {
15961
15961
  const steps = config2.steps;
15962
+ const stepDefMap = new Map;
15963
+ for (const stepConfig of steps) {
15964
+ const mapKey = `${stepConfig.step.key}@v${String(stepConfig.step.version)}`;
15965
+ if (!stepDefMap.has(mapKey)) {
15966
+ stepDefMap.set(mapKey, stepConfig.step);
15967
+ }
15968
+ }
15962
15969
  return {
15963
15970
  key: config2.key,
15964
15971
  name: config2.name,
15965
15972
  description: config2.description ?? null,
15966
15973
  version: config2.version ?? 1,
15967
15974
  status: config2.status ?? "active",
15975
+ _stepDefinitions: [...stepDefMap.values()],
15968
15976
  steps: steps.map((stepConfig, index) => ({
15969
15977
  stepKey: stepConfig.step.key,
15970
15978
  stepName: stepConfig.step.name,
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.7-alpha",
4
+ "version": "0.1.9-alpha",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {