@epilot/sdk 2.0.0-beta.6 → 2.0.4

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.
Files changed (142) hide show
  1. package/definitions/entity-runtime.json +1 -1
  2. package/dist/apis/access-token.cjs +7 -7
  3. package/dist/apis/access-token.js +1 -1
  4. package/dist/apis/address-suggestions.cjs +7 -7
  5. package/dist/apis/address-suggestions.js +1 -1
  6. package/dist/apis/address.cjs +7 -7
  7. package/dist/apis/address.js +1 -1
  8. package/dist/apis/ai-agents.cjs +7 -7
  9. package/dist/apis/ai-agents.js +1 -1
  10. package/dist/apis/app.cjs +7 -7
  11. package/dist/apis/app.js +1 -1
  12. package/dist/apis/audit-logs.cjs +7 -7
  13. package/dist/apis/audit-logs.js +1 -1
  14. package/dist/apis/automation.cjs +7 -7
  15. package/dist/apis/automation.d.cts +2 -2
  16. package/dist/apis/automation.d.ts +2 -2
  17. package/dist/apis/automation.js +1 -1
  18. package/dist/apis/billing.cjs +7 -7
  19. package/dist/apis/billing.js +1 -1
  20. package/dist/apis/blueprint-manifest.cjs +7 -7
  21. package/dist/apis/blueprint-manifest.js +1 -1
  22. package/dist/apis/consent.cjs +7 -7
  23. package/dist/apis/consent.js +1 -1
  24. package/dist/apis/customer-portal.cjs +8 -8
  25. package/dist/apis/customer-portal.d.cts +2 -2
  26. package/dist/apis/customer-portal.d.ts +2 -2
  27. package/dist/apis/customer-portal.js +2 -2
  28. package/dist/apis/dashboard.cjs +7 -7
  29. package/dist/apis/dashboard.js +1 -1
  30. package/dist/apis/data-management.cjs +7 -7
  31. package/dist/apis/data-management.d.cts +2 -2
  32. package/dist/apis/data-management.d.ts +2 -2
  33. package/dist/apis/data-management.js +1 -1
  34. package/dist/apis/deduplication.cjs +7 -7
  35. package/dist/apis/deduplication.js +1 -1
  36. package/dist/apis/design.cjs +7 -7
  37. package/dist/apis/design.js +1 -1
  38. package/dist/apis/document.cjs +7 -7
  39. package/dist/apis/document.js +1 -1
  40. package/dist/apis/email-settings.cjs +7 -7
  41. package/dist/apis/email-settings.js +1 -1
  42. package/dist/apis/email-template.cjs +7 -7
  43. package/dist/apis/email-template.js +1 -1
  44. package/dist/apis/entity-mapping.cjs +7 -7
  45. package/dist/apis/entity-mapping.js +1 -1
  46. package/dist/apis/entity.cjs +8 -8
  47. package/dist/apis/entity.d.cts +2 -2
  48. package/dist/apis/entity.d.ts +2 -2
  49. package/dist/apis/entity.js +2 -2
  50. package/dist/apis/environments.cjs +7 -7
  51. package/dist/apis/environments.js +1 -1
  52. package/dist/apis/erp-integration.cjs +8 -8
  53. package/dist/apis/erp-integration.d.cts +2 -2
  54. package/dist/apis/erp-integration.d.ts +2 -2
  55. package/dist/apis/erp-integration.js +2 -2
  56. package/dist/apis/event-catalog.cjs +7 -7
  57. package/dist/apis/event-catalog.js +1 -1
  58. package/dist/apis/file.cjs +7 -7
  59. package/dist/apis/file.js +1 -1
  60. package/dist/apis/iban.cjs +7 -7
  61. package/dist/apis/iban.js +1 -1
  62. package/dist/apis/journey.cjs +7 -7
  63. package/dist/apis/journey.d.cts +2 -2
  64. package/dist/apis/journey.d.ts +2 -2
  65. package/dist/apis/journey.js +1 -1
  66. package/dist/apis/kanban.cjs +7 -7
  67. package/dist/apis/kanban.d.cts +2 -2
  68. package/dist/apis/kanban.d.ts +2 -2
  69. package/dist/apis/kanban.js +1 -1
  70. package/dist/apis/message.cjs +7 -7
  71. package/dist/apis/message.js +1 -1
  72. package/dist/apis/metering.cjs +7 -7
  73. package/dist/apis/metering.js +1 -1
  74. package/dist/apis/notes.cjs +7 -7
  75. package/dist/apis/notes.js +1 -1
  76. package/dist/apis/notification.cjs +7 -7
  77. package/dist/apis/notification.js +1 -1
  78. package/dist/apis/organization.cjs +8 -8
  79. package/dist/apis/organization.d.cts +2 -2
  80. package/dist/apis/organization.d.ts +2 -2
  81. package/dist/apis/organization.js +2 -2
  82. package/dist/apis/partner-directory.cjs +7 -7
  83. package/dist/apis/partner-directory.js +1 -1
  84. package/dist/apis/permissions.cjs +7 -7
  85. package/dist/apis/permissions.js +1 -1
  86. package/dist/apis/pricing-tier.cjs +7 -7
  87. package/dist/apis/pricing-tier.js +1 -1
  88. package/dist/apis/pricing.cjs +7 -7
  89. package/dist/apis/pricing.js +1 -1
  90. package/dist/apis/purpose.cjs +7 -7
  91. package/dist/apis/purpose.js +1 -1
  92. package/dist/apis/sandbox.cjs +7 -7
  93. package/dist/apis/sandbox.js +1 -1
  94. package/dist/apis/submission.cjs +7 -7
  95. package/dist/apis/submission.js +1 -1
  96. package/dist/apis/targeting.cjs +7 -7
  97. package/dist/apis/targeting.js +1 -1
  98. package/dist/apis/template-variables.cjs +7 -7
  99. package/dist/apis/template-variables.js +1 -1
  100. package/dist/apis/user.cjs +7 -7
  101. package/dist/apis/user.js +1 -1
  102. package/dist/apis/validation-rules.cjs +7 -7
  103. package/dist/apis/validation-rules.js +1 -1
  104. package/dist/apis/webhooks.cjs +7 -7
  105. package/dist/apis/webhooks.js +1 -1
  106. package/dist/apis/workflow-definition.cjs +7 -7
  107. package/dist/apis/workflow-definition.js +1 -1
  108. package/dist/apis/workflow.cjs +7 -7
  109. package/dist/apis/workflow.d.cts +2 -2
  110. package/dist/apis/workflow.d.ts +2 -2
  111. package/dist/apis/workflow.js +1 -1
  112. package/dist/{automation.d-sRCRiHKf.d.cts → automation.d-KOiZ6ru5.d.cts} +2 -24
  113. package/dist/{automation.d-sRCRiHKf.d.ts → automation.d-KOiZ6ru5.d.ts} +2 -24
  114. package/dist/bin/cli.js +123 -25
  115. package/dist/{chunk-QMQNMCOC.js → chunk-XE25WERA.js} +1 -1
  116. package/dist/{chunk-5LXNSDG2.cjs → chunk-XEQMAKGA.cjs} +1 -1
  117. package/dist/{customer-portal.d-D7cJvhBK.d.cts → customer-portal.d-Bh9NF8cY.d.cts} +598 -99
  118. package/dist/{customer-portal.d-D7cJvhBK.d.ts → customer-portal.d-Bh9NF8cY.d.ts} +598 -99
  119. package/dist/{data-management.d-pnuiRU2h.d.cts → data-management.d-CkDmJwpx.d.cts} +1 -2
  120. package/dist/{data-management.d-pnuiRU2h.d.ts → data-management.d-CkDmJwpx.d.ts} +1 -2
  121. package/dist/{entity.d-CrtZaZr8.d.cts → entity.d-DtiajmaY.d.cts} +292 -10
  122. package/dist/{entity.d-CrtZaZr8.d.ts → entity.d-DtiajmaY.d.ts} +292 -10
  123. package/dist/{erp-integration.d-3LmxMirP.d.cts → erp-integration.d-DOhxy4P5.d.cts} +409 -15
  124. package/dist/{erp-integration.d-3LmxMirP.d.ts → erp-integration.d-DOhxy4P5.d.ts} +409 -15
  125. package/dist/index.cjs +7 -7
  126. package/dist/index.d.cts +9 -9
  127. package/dist/index.d.ts +9 -9
  128. package/dist/index.js +1 -1
  129. package/dist/{journey.d-DkBvO_Wa.d.cts → journey.d-C4N4t1Rh.d.cts} +122 -4
  130. package/dist/{journey.d-DkBvO_Wa.d.ts → journey.d-C4N4t1Rh.d.ts} +122 -4
  131. package/dist/js-yaml-UPZKYVRY.js +2645 -0
  132. package/dist/kanban.d-CtSt3uX2.d.cts +745 -0
  133. package/dist/kanban.d-CtSt3uX2.d.ts +745 -0
  134. package/dist/organization.d-Bd2Hmk8v.d.cts +1244 -0
  135. package/dist/organization.d-Bd2Hmk8v.d.ts +1244 -0
  136. package/dist/{workflow.d-EPa2OdVW.d.cts → workflow.d-DvhTpEtU.d.cts} +45 -3
  137. package/dist/{workflow.d-EPa2OdVW.d.ts → workflow.d-DvhTpEtU.d.ts} +45 -3
  138. package/package.json +1 -1
  139. package/dist/kanban.d-DUClxyBG.d.cts +0 -630
  140. package/dist/kanban.d-DUClxyBG.d.ts +0 -630
  141. package/dist/organization.d-BOLK3v9o.d.cts +0 -628
  142. package/dist/organization.d-BOLK3v9o.d.ts +0 -628
@@ -1,7 +1,7 @@
1
1
  import { A as ApiHandle } from '../types-BwBvJkY_.cjs';
2
2
  export { T as TokenArg, a as authorize } from '../types-BwBvJkY_.cjs';
3
- import { C as Client } from '../workflow.d-EPa2OdVW.cjs';
4
- export { A as ActionSchedule, c as AddTaskReq, d as AgentConfig, e as AgentExecutionInfo, f as AiAgentTask, g as AnalyticsInfo, h as Assignees, i as AutomationConfig, j as AutomationInfo, k as AutomationTask, l as ClosingReason, m as ClosingReasonResp, a as Components, n as Condition, o as ConditionId, p as CreateStepReq, D as DecisionTask, q as DelayedSchedule, r as DueDateConfig, s as DynamicDueDate, E as ECPDetails, t as Edge, u as EnableRequirement, v as EntityRef, w as EntitySync, x as ErrorResp, y as EvaluationSource, z as ExecutionPaginationDynamo, F as Flow, B as FlowClosingReason, G as FlowContext, H as FlowExecution, I as FlowExecutionId, J as FlowSlim, K as FlowTemplateId, L as FlowTrigger, M as ImmediateSchedule, N as ItemType, Q as LastEvaluatedKey, R as LoopConfig, S as LoopInfo, T as ManualTask, O as OperationMethods, U as Operator, V as PatchFlowReq, W as PatchPhaseReq, X as PatchTaskReq, P as Paths, b as PathsDictionary, Y as Phase, Z as PhaseId, _ as PhaseInEntity, $ as RelativeSchedule, a0 as SearchExecutionsReq, a1 as SearchExecutionsResp, a2 as SearchFlowsReq, a3 as SearchPagination, a4 as SearchSorting, a5 as SearchStepsReq, a6 as SearchStepsResp, a7 as Section, a8 as SectionSimplified, a9 as SectionStatus, aa as StartFlowReq, ab as Statement, ac as Step, ad as StepDescription, ae as StepExtended, af as StepId, ag as StepJourney, ah as StepPositionAt, ai as StepRequirement, aj as StepSimplified, ak as StepStatus, al as StepType, am as Task, an as TaskBase, ao as TaskId, ap as TaskType, aq as TimeUnit, ar as TriggerMode, as as TriggerType, at as UpdateEntityAttributes, au as UpdateStepReq, av as UpdateStepResp, aw as UserId, ax as VariableAssignment, ay as WorkflowContext, az as WorkflowExecution, aA as WorkflowExecutionBase, aB as WorkflowExecutionCreateReq, aC as WorkflowExecutionSlim, aD as WorkflowExecutionUpdateReq, aE as WorkflowInEntity, aF as WorkflowStatus } from '../workflow.d-EPa2OdVW.cjs';
3
+ import { C as Client } from '../workflow.d-DvhTpEtU.cjs';
4
+ export { A as ActionSchedule, c as AddTaskReq, d as AgentConfig, e as AgentExecutionInfo, f as AiAgentTask, g as AnalyticsInfo, h as Assignees, i as AutomationConfig, j as AutomationInfo, k as AutomationTask, l as ClosingReason, m as ClosingReasonResp, a as Components, n as Condition, o as ConditionId, p as CreateStepReq, D as DecisionTask, q as DelayedSchedule, r as DueDateConfig, s as DynamicDueDate, E as ECPDetails, t as Edge, u as EnableRequirement, v as EntityRef, w as EntitySync, x as ErrorResp, y as EvaluationSource, z as ExecutionPaginationDynamo, F as Flow, B as FlowClosingReason, G as FlowContext, H as FlowExecution, I as FlowExecutionId, J as FlowSlim, K as FlowTemplateId, L as FlowTrigger, M as ImmediateSchedule, N as ItemType, Q as LastEvaluatedKey, R as LoopConfig, S as LoopInfo, T as ManualTask, O as OperationMethods, U as Operator, V as PatchFlowReq, W as PatchPhaseReq, X as PatchTaskReq, P as Paths, b as PathsDictionary, Y as Phase, Z as PhaseId, _ as PhaseInEntity, $ as RelativeSchedule, a0 as SearchExecutionsReq, a1 as SearchExecutionsResp, a2 as SearchFlowsReq, a3 as SearchPagination, a4 as SearchSorting, a5 as SearchStepsReq, a6 as SearchStepsResp, a7 as Section, a8 as SectionSimplified, a9 as SectionStatus, aa as StartFlowReq, ab as Statement, ac as Step, ad as StepDescription, ae as StepExtended, af as StepId, ag as StepJourney, ah as StepPositionAt, ai as StepRequirement, aj as StepSimplified, ak as StepStatus, al as StepType, am as Task, an as TaskBase, ao as TaskId, ap as TaskType, aq as TimeUnit, ar as TriggerMode, as as TriggerType, at as UpdateEntityAttributes, au as UpdateStepReq, av as UpdateStepResp, aw as UserId, ax as VariableAssignment, ay as WorkflowContext, az as WorkflowExecution, aA as WorkflowExecutionBase, aB as WorkflowExecutionCreateReq, aC as WorkflowExecutionSlim, aD as WorkflowExecutionUpdateReq, aE as WorkflowInEntity, aF as WorkflowStatus } from '../workflow.d-DvhTpEtU.cjs';
5
5
  export { OpenAPIClient } from 'openapi-client-axios';
6
6
  import 'axios';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { A as ApiHandle } from '../types-BwBvJkY_.js';
2
2
  export { T as TokenArg, a as authorize } from '../types-BwBvJkY_.js';
3
- import { C as Client } from '../workflow.d-EPa2OdVW.js';
4
- export { A as ActionSchedule, c as AddTaskReq, d as AgentConfig, e as AgentExecutionInfo, f as AiAgentTask, g as AnalyticsInfo, h as Assignees, i as AutomationConfig, j as AutomationInfo, k as AutomationTask, l as ClosingReason, m as ClosingReasonResp, a as Components, n as Condition, o as ConditionId, p as CreateStepReq, D as DecisionTask, q as DelayedSchedule, r as DueDateConfig, s as DynamicDueDate, E as ECPDetails, t as Edge, u as EnableRequirement, v as EntityRef, w as EntitySync, x as ErrorResp, y as EvaluationSource, z as ExecutionPaginationDynamo, F as Flow, B as FlowClosingReason, G as FlowContext, H as FlowExecution, I as FlowExecutionId, J as FlowSlim, K as FlowTemplateId, L as FlowTrigger, M as ImmediateSchedule, N as ItemType, Q as LastEvaluatedKey, R as LoopConfig, S as LoopInfo, T as ManualTask, O as OperationMethods, U as Operator, V as PatchFlowReq, W as PatchPhaseReq, X as PatchTaskReq, P as Paths, b as PathsDictionary, Y as Phase, Z as PhaseId, _ as PhaseInEntity, $ as RelativeSchedule, a0 as SearchExecutionsReq, a1 as SearchExecutionsResp, a2 as SearchFlowsReq, a3 as SearchPagination, a4 as SearchSorting, a5 as SearchStepsReq, a6 as SearchStepsResp, a7 as Section, a8 as SectionSimplified, a9 as SectionStatus, aa as StartFlowReq, ab as Statement, ac as Step, ad as StepDescription, ae as StepExtended, af as StepId, ag as StepJourney, ah as StepPositionAt, ai as StepRequirement, aj as StepSimplified, ak as StepStatus, al as StepType, am as Task, an as TaskBase, ao as TaskId, ap as TaskType, aq as TimeUnit, ar as TriggerMode, as as TriggerType, at as UpdateEntityAttributes, au as UpdateStepReq, av as UpdateStepResp, aw as UserId, ax as VariableAssignment, ay as WorkflowContext, az as WorkflowExecution, aA as WorkflowExecutionBase, aB as WorkflowExecutionCreateReq, aC as WorkflowExecutionSlim, aD as WorkflowExecutionUpdateReq, aE as WorkflowInEntity, aF as WorkflowStatus } from '../workflow.d-EPa2OdVW.js';
3
+ import { C as Client } from '../workflow.d-DvhTpEtU.js';
4
+ export { A as ActionSchedule, c as AddTaskReq, d as AgentConfig, e as AgentExecutionInfo, f as AiAgentTask, g as AnalyticsInfo, h as Assignees, i as AutomationConfig, j as AutomationInfo, k as AutomationTask, l as ClosingReason, m as ClosingReasonResp, a as Components, n as Condition, o as ConditionId, p as CreateStepReq, D as DecisionTask, q as DelayedSchedule, r as DueDateConfig, s as DynamicDueDate, E as ECPDetails, t as Edge, u as EnableRequirement, v as EntityRef, w as EntitySync, x as ErrorResp, y as EvaluationSource, z as ExecutionPaginationDynamo, F as Flow, B as FlowClosingReason, G as FlowContext, H as FlowExecution, I as FlowExecutionId, J as FlowSlim, K as FlowTemplateId, L as FlowTrigger, M as ImmediateSchedule, N as ItemType, Q as LastEvaluatedKey, R as LoopConfig, S as LoopInfo, T as ManualTask, O as OperationMethods, U as Operator, V as PatchFlowReq, W as PatchPhaseReq, X as PatchTaskReq, P as Paths, b as PathsDictionary, Y as Phase, Z as PhaseId, _ as PhaseInEntity, $ as RelativeSchedule, a0 as SearchExecutionsReq, a1 as SearchExecutionsResp, a2 as SearchFlowsReq, a3 as SearchPagination, a4 as SearchSorting, a5 as SearchStepsReq, a6 as SearchStepsResp, a7 as Section, a8 as SectionSimplified, a9 as SectionStatus, aa as StartFlowReq, ab as Statement, ac as Step, ad as StepDescription, ae as StepExtended, af as StepId, ag as StepJourney, ah as StepPositionAt, ai as StepRequirement, aj as StepSimplified, ak as StepStatus, al as StepType, am as Task, an as TaskBase, ao as TaskId, ap as TaskType, aq as TimeUnit, ar as TriggerMode, as as TriggerType, at as UpdateEntityAttributes, au as UpdateStepReq, av as UpdateStepResp, aw as UserId, ax as VariableAssignment, ay as WorkflowContext, az as WorkflowExecution, aA as WorkflowExecutionBase, aB as WorkflowExecutionCreateReq, aC as WorkflowExecutionSlim, aD as WorkflowExecutionUpdateReq, aE as WorkflowInEntity, aF as WorkflowStatus } from '../workflow.d-DvhTpEtU.js';
5
5
  export { OpenAPIClient } from 'openapi-client-axios';
6
6
  import 'axios';
7
7
 
@@ -4,7 +4,7 @@ import {
4
4
  createApiClient,
5
5
  createApiHandle,
6
6
  expand
7
- } from "../chunk-QMQNMCOC.js";
7
+ } from "../chunk-XE25WERA.js";
8
8
 
9
9
  // src/definitions/workflow-runtime.json
10
10
  var require_workflow_runtime = __commonJS({
@@ -1,8 +1,6 @@
1
1
  import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse, UnknownParamsObject } from 'openapi-client-axios';
2
2
 
3
3
  /* Auto-copied from automation-client */
4
- /* eslint-disable */
5
-
6
4
 
7
5
 
8
6
  declare namespace Components {
@@ -1005,7 +1003,6 @@ declare namespace Components {
1005
1003
  * Source blueprint/manifest ID used when automation is created via blueprints.
1006
1004
  */
1007
1005
  _manifest?: string /* uuid */[] | null;
1008
- workflow_context?: /* For automation that are connected to workflows V2, this field tracks various information about the workflow. */ WorkflowContext;
1009
1006
  }
1010
1007
  /**
1011
1008
  * ID of the Automation Flow
@@ -2309,11 +2306,7 @@ declare namespace Components {
2309
2306
  */
2310
2307
  id?: string; // uuid
2311
2308
  type: "flows_trigger";
2312
- configuration: {
2313
- /**
2314
- * The ID of the workflow v2 that triggers this automation
2315
- */
2316
- source_id: string; // uuid
2309
+ configuration?: {
2317
2310
  /**
2318
2311
  * When Journeys are linked to Workflows V2 as Journey Automations, this field will contain the ID of the Journey
2319
2312
  */
@@ -3960,20 +3953,6 @@ declare namespace Components {
3960
3953
  export interface WildcardCondition {
3961
3954
  wildcard?: string;
3962
3955
  }
3963
- /**
3964
- * For automation that are connected to workflows V2, this field tracks various information about the workflow.
3965
- */
3966
- export interface WorkflowContext {
3967
- /**
3968
- * The ID of the workflow this automation is connected to
3969
- */
3970
- workflow_id: string; // uuid
3971
- /**
3972
- * The ID of the task in the workflow that this automation is connected to
3973
- */
3974
- task_id?: string; // uuid
3975
- workflow_role: /* The role this automation plays in the workflow. */ WorkflowContextRole;
3976
- }
3977
3956
  /**
3978
3957
  * The role this automation plays in the workflow.
3979
3958
  */
@@ -4913,8 +4892,7 @@ type TriggerWorkflowActionConfig = Components.Schemas.TriggerWorkflowActionConfi
4913
4892
  type TriggerWorkflowCondition = Components.Schemas.TriggerWorkflowCondition;
4914
4893
  type TriggerWorkflowConfig = Components.Schemas.TriggerWorkflowConfig;
4915
4894
  type WildcardCondition = Components.Schemas.WildcardCondition;
4916
- type WorkflowContext = Components.Schemas.WorkflowContext;
4917
4895
  type WorkflowContextRole = Components.Schemas.WorkflowContextRole;
4918
4896
  type WorkflowExecutionContext = Components.Schemas.WorkflowExecutionContext;
4919
4897
 
4920
- export { type EqualsIgnoreCaseCondition as $, type ActionCondition as A, type BulkTriggerJob as B, type Client as C, type CancellationReason as D, type CartCheckoutAction as E, type CartCheckoutActionConfig as F, type CartCheckoutConfig as G, type Comparison as H, type ConditionStatement as I, type CopyValueMapper as J, type CreateDocumentAction as K, type CreateDocumentActionConfig as L, type CreateDocumentConfig as M, type CustomAction as N, type OperationMethods as O, Paths as P, type DiffAdded as Q, type DiffDeleted as R, type DiffUpdated as S, type EntityId as T, type EntityItemSnapshot as U, type EntityManualTrigger as V, type EntityOperation as W, type EntityOperationTrigger as X, type EntityRef as Y, type EntitySearchFilter as Z, type EntitySearchFilterValue as _, Components as a, type TriggerEventMessaging as a$, type ErrorCode as a0, type ErrorDetail as a1, type ErrorObject as a2, type ErrorOutput as a3, type ExecItem as a4, type ExecutionChain as a5, type ExecutionStatus as a6, type ExistsCondition as a7, type FilterConditionOnEvent as a8, type FlowExecutionCancelAction as a9, type PatchBulkJobRequest as aA, type PrefixCondition as aB, type PrimitiveJSONValue as aC, type ReceivedEmailTrigger as aD, type RelationAttribute as aE, type ResumeReq as aF, type ResumeResp as aG, type ResumeToken as aH, type RetryReq as aI, type RetryStrategy as aJ, type SearchAutomationsResp as aK, type SendEmailAction as aL, type SendEmailActionConfig as aM, type SendEmailCondition as aN, type SendEmailConfig as aO, type SetValueMapper as aP, type StartExecutionRequest as aQ, type SuffixCondition as aR, type TriggerCondition as aS, type TriggerContext as aT, type TriggerEventAction as aU, type TriggerEventActionConfig as aV, type TriggerEventConfig as aW, type TriggerEventEntityActivity as aX, type TriggerEventEntityOperation as aY, type TriggerEventFlowAutomationTask as aZ, type TriggerEventManual as a_, type FlowExecutionCancelActionConfig as aa, type FlowExecutionCancelConfig as ab, type FlowsTrigger as ac, type FrontendSubmitTrigger as ad, type GetExecutionsResp as ae, type InformERPAction as af, type InformERPActionConfig as ag, type InformERPConfig as ah, type JobId as ai, type JourneySubmitTrigger as aj, type MapEntityAction as ak, type MapEntityActionConfig as al, type MapEntityConfig as am, type MappingAttribute as an, type MappingAttributeMode as ao, type MappingAttributeV2 as ap, type MappingConfigRef as aq, type MoveThreadAction as ar, type MoveThreadConfig as as, type NewEmailThreadTrigger as at, type NumericCondition as au, type OperationNode as av, type OperationObjectNode as aw, type OrCondition as ax, type OrConditionForDiff as ay, type OrganizationId as az, type PathsDictionary as b, type TriggerShareEntityAction as b0, type TriggerShareEntityActionConfig as b1, type TriggerShareEntityConfig as b2, type TriggerWebhookAction as b3, type TriggerWebhookActionConfig as b4, type TriggerWebhookConfig as b5, type TriggerWorkflowAction as b6, type TriggerWorkflowActionConfig as b7, type TriggerWorkflowCondition as b8, type TriggerWorkflowConfig as b9, type WildcardCondition as ba, type WorkflowContext as bb, type WorkflowContextRole as bc, type WorkflowExecutionContext as bd, type ActionSchedule as c, type ActionScheduleSource as d, type ActivityId as e, type ActivityTrigger as f, type AnyAction as g, type AnyActionConfig as h, type AnyTrigger as i, type AnythingButCondition as j, type ApiCallerContext as k, type ApiSubmissionTrigger as l, type AppendValueMapper as m, type AssignThreadAction as n, type AssignThreadConfig as o, type AssignUsersToStep as p, type AutomationAction as q, type AutomationActionConfig as r, type AutomationActionExecutionState as s, type AutomationActionId as t, type AutomationExecution as u, type AutomationExecutionId as v, type AutomationFlow as w, type AutomationFlowId as x, type AutomationTrigger as y, type BulkTriggerRequest as z };
4898
+ export { type EqualsIgnoreCaseCondition as $, type ActionCondition as A, type BulkTriggerJob as B, type Client as C, type CancellationReason as D, type CartCheckoutAction as E, type CartCheckoutActionConfig as F, type CartCheckoutConfig as G, type Comparison as H, type ConditionStatement as I, type CopyValueMapper as J, type CreateDocumentAction as K, type CreateDocumentActionConfig as L, type CreateDocumentConfig as M, type CustomAction as N, type OperationMethods as O, Paths as P, type DiffAdded as Q, type DiffDeleted as R, type DiffUpdated as S, type EntityId as T, type EntityItemSnapshot as U, type EntityManualTrigger as V, type EntityOperation as W, type EntityOperationTrigger as X, type EntityRef as Y, type EntitySearchFilter as Z, type EntitySearchFilterValue as _, Components as a, type TriggerEventMessaging as a$, type ErrorCode as a0, type ErrorDetail as a1, type ErrorObject as a2, type ErrorOutput as a3, type ExecItem as a4, type ExecutionChain as a5, type ExecutionStatus as a6, type ExistsCondition as a7, type FilterConditionOnEvent as a8, type FlowExecutionCancelAction as a9, type PatchBulkJobRequest as aA, type PrefixCondition as aB, type PrimitiveJSONValue as aC, type ReceivedEmailTrigger as aD, type RelationAttribute as aE, type ResumeReq as aF, type ResumeResp as aG, type ResumeToken as aH, type RetryReq as aI, type RetryStrategy as aJ, type SearchAutomationsResp as aK, type SendEmailAction as aL, type SendEmailActionConfig as aM, type SendEmailCondition as aN, type SendEmailConfig as aO, type SetValueMapper as aP, type StartExecutionRequest as aQ, type SuffixCondition as aR, type TriggerCondition as aS, type TriggerContext as aT, type TriggerEventAction as aU, type TriggerEventActionConfig as aV, type TriggerEventConfig as aW, type TriggerEventEntityActivity as aX, type TriggerEventEntityOperation as aY, type TriggerEventFlowAutomationTask as aZ, type TriggerEventManual as a_, type FlowExecutionCancelActionConfig as aa, type FlowExecutionCancelConfig as ab, type FlowsTrigger as ac, type FrontendSubmitTrigger as ad, type GetExecutionsResp as ae, type InformERPAction as af, type InformERPActionConfig as ag, type InformERPConfig as ah, type JobId as ai, type JourneySubmitTrigger as aj, type MapEntityAction as ak, type MapEntityActionConfig as al, type MapEntityConfig as am, type MappingAttribute as an, type MappingAttributeMode as ao, type MappingAttributeV2 as ap, type MappingConfigRef as aq, type MoveThreadAction as ar, type MoveThreadConfig as as, type NewEmailThreadTrigger as at, type NumericCondition as au, type OperationNode as av, type OperationObjectNode as aw, type OrCondition as ax, type OrConditionForDiff as ay, type OrganizationId as az, type PathsDictionary as b, type TriggerShareEntityAction as b0, type TriggerShareEntityActionConfig as b1, type TriggerShareEntityConfig as b2, type TriggerWebhookAction as b3, type TriggerWebhookActionConfig as b4, type TriggerWebhookConfig as b5, type TriggerWorkflowAction as b6, type TriggerWorkflowActionConfig as b7, type TriggerWorkflowCondition as b8, type TriggerWorkflowConfig as b9, type WildcardCondition as ba, type WorkflowContextRole as bb, type WorkflowExecutionContext as bc, type ActionSchedule as c, type ActionScheduleSource as d, type ActivityId as e, type ActivityTrigger as f, type AnyAction as g, type AnyActionConfig as h, type AnyTrigger as i, type AnythingButCondition as j, type ApiCallerContext as k, type ApiSubmissionTrigger as l, type AppendValueMapper as m, type AssignThreadAction as n, type AssignThreadConfig as o, type AssignUsersToStep as p, type AutomationAction as q, type AutomationActionConfig as r, type AutomationActionExecutionState as s, type AutomationActionId as t, type AutomationExecution as u, type AutomationExecutionId as v, type AutomationFlow as w, type AutomationFlowId as x, type AutomationTrigger as y, type BulkTriggerRequest as z };
@@ -1,8 +1,6 @@
1
1
  import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse, UnknownParamsObject } from 'openapi-client-axios';
2
2
 
3
3
  /* Auto-copied from automation-client */
4
- /* eslint-disable */
5
-
6
4
 
7
5
 
8
6
  declare namespace Components {
@@ -1005,7 +1003,6 @@ declare namespace Components {
1005
1003
  * Source blueprint/manifest ID used when automation is created via blueprints.
1006
1004
  */
1007
1005
  _manifest?: string /* uuid */[] | null;
1008
- workflow_context?: /* For automation that are connected to workflows V2, this field tracks various information about the workflow. */ WorkflowContext;
1009
1006
  }
1010
1007
  /**
1011
1008
  * ID of the Automation Flow
@@ -2309,11 +2306,7 @@ declare namespace Components {
2309
2306
  */
2310
2307
  id?: string; // uuid
2311
2308
  type: "flows_trigger";
2312
- configuration: {
2313
- /**
2314
- * The ID of the workflow v2 that triggers this automation
2315
- */
2316
- source_id: string; // uuid
2309
+ configuration?: {
2317
2310
  /**
2318
2311
  * When Journeys are linked to Workflows V2 as Journey Automations, this field will contain the ID of the Journey
2319
2312
  */
@@ -3960,20 +3953,6 @@ declare namespace Components {
3960
3953
  export interface WildcardCondition {
3961
3954
  wildcard?: string;
3962
3955
  }
3963
- /**
3964
- * For automation that are connected to workflows V2, this field tracks various information about the workflow.
3965
- */
3966
- export interface WorkflowContext {
3967
- /**
3968
- * The ID of the workflow this automation is connected to
3969
- */
3970
- workflow_id: string; // uuid
3971
- /**
3972
- * The ID of the task in the workflow that this automation is connected to
3973
- */
3974
- task_id?: string; // uuid
3975
- workflow_role: /* The role this automation plays in the workflow. */ WorkflowContextRole;
3976
- }
3977
3956
  /**
3978
3957
  * The role this automation plays in the workflow.
3979
3958
  */
@@ -4913,8 +4892,7 @@ type TriggerWorkflowActionConfig = Components.Schemas.TriggerWorkflowActionConfi
4913
4892
  type TriggerWorkflowCondition = Components.Schemas.TriggerWorkflowCondition;
4914
4893
  type TriggerWorkflowConfig = Components.Schemas.TriggerWorkflowConfig;
4915
4894
  type WildcardCondition = Components.Schemas.WildcardCondition;
4916
- type WorkflowContext = Components.Schemas.WorkflowContext;
4917
4895
  type WorkflowContextRole = Components.Schemas.WorkflowContextRole;
4918
4896
  type WorkflowExecutionContext = Components.Schemas.WorkflowExecutionContext;
4919
4897
 
4920
- export { type EqualsIgnoreCaseCondition as $, type ActionCondition as A, type BulkTriggerJob as B, type Client as C, type CancellationReason as D, type CartCheckoutAction as E, type CartCheckoutActionConfig as F, type CartCheckoutConfig as G, type Comparison as H, type ConditionStatement as I, type CopyValueMapper as J, type CreateDocumentAction as K, type CreateDocumentActionConfig as L, type CreateDocumentConfig as M, type CustomAction as N, type OperationMethods as O, Paths as P, type DiffAdded as Q, type DiffDeleted as R, type DiffUpdated as S, type EntityId as T, type EntityItemSnapshot as U, type EntityManualTrigger as V, type EntityOperation as W, type EntityOperationTrigger as X, type EntityRef as Y, type EntitySearchFilter as Z, type EntitySearchFilterValue as _, Components as a, type TriggerEventMessaging as a$, type ErrorCode as a0, type ErrorDetail as a1, type ErrorObject as a2, type ErrorOutput as a3, type ExecItem as a4, type ExecutionChain as a5, type ExecutionStatus as a6, type ExistsCondition as a7, type FilterConditionOnEvent as a8, type FlowExecutionCancelAction as a9, type PatchBulkJobRequest as aA, type PrefixCondition as aB, type PrimitiveJSONValue as aC, type ReceivedEmailTrigger as aD, type RelationAttribute as aE, type ResumeReq as aF, type ResumeResp as aG, type ResumeToken as aH, type RetryReq as aI, type RetryStrategy as aJ, type SearchAutomationsResp as aK, type SendEmailAction as aL, type SendEmailActionConfig as aM, type SendEmailCondition as aN, type SendEmailConfig as aO, type SetValueMapper as aP, type StartExecutionRequest as aQ, type SuffixCondition as aR, type TriggerCondition as aS, type TriggerContext as aT, type TriggerEventAction as aU, type TriggerEventActionConfig as aV, type TriggerEventConfig as aW, type TriggerEventEntityActivity as aX, type TriggerEventEntityOperation as aY, type TriggerEventFlowAutomationTask as aZ, type TriggerEventManual as a_, type FlowExecutionCancelActionConfig as aa, type FlowExecutionCancelConfig as ab, type FlowsTrigger as ac, type FrontendSubmitTrigger as ad, type GetExecutionsResp as ae, type InformERPAction as af, type InformERPActionConfig as ag, type InformERPConfig as ah, type JobId as ai, type JourneySubmitTrigger as aj, type MapEntityAction as ak, type MapEntityActionConfig as al, type MapEntityConfig as am, type MappingAttribute as an, type MappingAttributeMode as ao, type MappingAttributeV2 as ap, type MappingConfigRef as aq, type MoveThreadAction as ar, type MoveThreadConfig as as, type NewEmailThreadTrigger as at, type NumericCondition as au, type OperationNode as av, type OperationObjectNode as aw, type OrCondition as ax, type OrConditionForDiff as ay, type OrganizationId as az, type PathsDictionary as b, type TriggerShareEntityAction as b0, type TriggerShareEntityActionConfig as b1, type TriggerShareEntityConfig as b2, type TriggerWebhookAction as b3, type TriggerWebhookActionConfig as b4, type TriggerWebhookConfig as b5, type TriggerWorkflowAction as b6, type TriggerWorkflowActionConfig as b7, type TriggerWorkflowCondition as b8, type TriggerWorkflowConfig as b9, type WildcardCondition as ba, type WorkflowContext as bb, type WorkflowContextRole as bc, type WorkflowExecutionContext as bd, type ActionSchedule as c, type ActionScheduleSource as d, type ActivityId as e, type ActivityTrigger as f, type AnyAction as g, type AnyActionConfig as h, type AnyTrigger as i, type AnythingButCondition as j, type ApiCallerContext as k, type ApiSubmissionTrigger as l, type AppendValueMapper as m, type AssignThreadAction as n, type AssignThreadConfig as o, type AssignUsersToStep as p, type AutomationAction as q, type AutomationActionConfig as r, type AutomationActionExecutionState as s, type AutomationActionId as t, type AutomationExecution as u, type AutomationExecutionId as v, type AutomationFlow as w, type AutomationFlowId as x, type AutomationTrigger as y, type BulkTriggerRequest as z };
4898
+ export { type EqualsIgnoreCaseCondition as $, type ActionCondition as A, type BulkTriggerJob as B, type Client as C, type CancellationReason as D, type CartCheckoutAction as E, type CartCheckoutActionConfig as F, type CartCheckoutConfig as G, type Comparison as H, type ConditionStatement as I, type CopyValueMapper as J, type CreateDocumentAction as K, type CreateDocumentActionConfig as L, type CreateDocumentConfig as M, type CustomAction as N, type OperationMethods as O, Paths as P, type DiffAdded as Q, type DiffDeleted as R, type DiffUpdated as S, type EntityId as T, type EntityItemSnapshot as U, type EntityManualTrigger as V, type EntityOperation as W, type EntityOperationTrigger as X, type EntityRef as Y, type EntitySearchFilter as Z, type EntitySearchFilterValue as _, Components as a, type TriggerEventMessaging as a$, type ErrorCode as a0, type ErrorDetail as a1, type ErrorObject as a2, type ErrorOutput as a3, type ExecItem as a4, type ExecutionChain as a5, type ExecutionStatus as a6, type ExistsCondition as a7, type FilterConditionOnEvent as a8, type FlowExecutionCancelAction as a9, type PatchBulkJobRequest as aA, type PrefixCondition as aB, type PrimitiveJSONValue as aC, type ReceivedEmailTrigger as aD, type RelationAttribute as aE, type ResumeReq as aF, type ResumeResp as aG, type ResumeToken as aH, type RetryReq as aI, type RetryStrategy as aJ, type SearchAutomationsResp as aK, type SendEmailAction as aL, type SendEmailActionConfig as aM, type SendEmailCondition as aN, type SendEmailConfig as aO, type SetValueMapper as aP, type StartExecutionRequest as aQ, type SuffixCondition as aR, type TriggerCondition as aS, type TriggerContext as aT, type TriggerEventAction as aU, type TriggerEventActionConfig as aV, type TriggerEventConfig as aW, type TriggerEventEntityActivity as aX, type TriggerEventEntityOperation as aY, type TriggerEventFlowAutomationTask as aZ, type TriggerEventManual as a_, type FlowExecutionCancelActionConfig as aa, type FlowExecutionCancelConfig as ab, type FlowsTrigger as ac, type FrontendSubmitTrigger as ad, type GetExecutionsResp as ae, type InformERPAction as af, type InformERPActionConfig as ag, type InformERPConfig as ah, type JobId as ai, type JourneySubmitTrigger as aj, type MapEntityAction as ak, type MapEntityActionConfig as al, type MapEntityConfig as am, type MappingAttribute as an, type MappingAttributeMode as ao, type MappingAttributeV2 as ap, type MappingConfigRef as aq, type MoveThreadAction as ar, type MoveThreadConfig as as, type NewEmailThreadTrigger as at, type NumericCondition as au, type OperationNode as av, type OperationObjectNode as aw, type OrCondition as ax, type OrConditionForDiff as ay, type OrganizationId as az, type PathsDictionary as b, type TriggerShareEntityAction as b0, type TriggerShareEntityActionConfig as b1, type TriggerShareEntityConfig as b2, type TriggerWebhookAction as b3, type TriggerWebhookActionConfig as b4, type TriggerWebhookConfig as b5, type TriggerWorkflowAction as b6, type TriggerWorkflowActionConfig as b7, type TriggerWorkflowCondition as b8, type TriggerWorkflowConfig as b9, type WildcardCondition as ba, type WorkflowContextRole as bb, type WorkflowExecutionContext as bc, type ActionSchedule as c, type ActionScheduleSource as d, type ActivityId as e, type ActivityTrigger as f, type AnyAction as g, type AnyActionConfig as h, type AnyTrigger as i, type AnythingButCondition as j, type ApiCallerContext as k, type ApiSubmissionTrigger as l, type AppendValueMapper as m, type AssignThreadAction as n, type AssignThreadConfig as o, type AssignUsersToStep as p, type AutomationAction as q, type AutomationActionConfig as r, type AutomationActionExecutionState as s, type AutomationActionId as t, type AutomationExecution as u, type AutomationExecutionId as v, type AutomationFlow as w, type AutomationFlowId as x, type AutomationTrigger as y, type BulkTriggerRequest as z };
package/dist/bin/cli.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- #!/usr/bin/env node
3
2
 
4
3
  // src/bin/cli.ts
5
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -21,6 +20,11 @@ Examples:
21
20
  npx epilot-sdk typegen
22
21
  `);
23
22
  };
23
+ var isYamlFile = (filePath) => filePath.endsWith(".yaml") || filePath.endsWith(".yml");
24
+ var parseYaml = async (content) => {
25
+ const { load } = await import("../js-yaml-UPZKYVRY.js");
26
+ return load(content);
27
+ };
24
28
  var readOverrides = () => {
25
29
  const filePath = resolve(process.cwd(), OVERRIDES_PATH);
26
30
  if (!existsSync(filePath)) return {};
@@ -42,6 +46,81 @@ var fetchSpec = async (specPath) => {
42
46
  if (!existsSync(absolutePath)) throw new Error(`Spec file not found: ${absolutePath}`);
43
47
  return readFileSync(absolutePath, "utf-8");
44
48
  };
49
+ var parseSpec = async (content, specPath) => {
50
+ if (isYamlFile(specPath)) {
51
+ return await parseYaml(content);
52
+ }
53
+ return JSON.parse(content);
54
+ };
55
+ var toKebabCase = (name) => name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
56
+ var compactifyParam = (p) => {
57
+ if (p.$ref) {
58
+ return [p.$ref.split("/").pop()];
59
+ }
60
+ const loc = { path: "p", query: "q", header: "h", cookie: "c" }[p.in] || "q";
61
+ const cp = [p.name, loc];
62
+ if (p.required) cp.push(true);
63
+ if (p.style) {
64
+ if (!p.required) cp.push(false);
65
+ cp.push(p.style);
66
+ }
67
+ if (p.explode !== void 0) {
68
+ cp.push(p.explode);
69
+ }
70
+ return cp;
71
+ };
72
+ var compactifySpec = (spec) => {
73
+ const server = spec.servers?.[0]?.url || "";
74
+ const openapiVersion = spec.openapi || "3.0.2";
75
+ const paths = spec.paths || {};
76
+ const ops = [];
77
+ const pathParams = {};
78
+ for (const [path, methods] of Object.entries(paths)) {
79
+ if (methods.parameters) {
80
+ pathParams[path] = methods.parameters.map(compactifyParam);
81
+ }
82
+ for (const [method, rawOp] of Object.entries(methods)) {
83
+ if (method === "parameters") continue;
84
+ const op = rawOp;
85
+ if (typeof op !== "object" || !op.operationId) continue;
86
+ const params = op.parameters || [];
87
+ const compactParams = params.map(compactifyParam);
88
+ const hasBody = op.requestBody ? 1 : 0;
89
+ const entry = [op.operationId, method, path];
90
+ if (compactParams.length > 0 || hasBody) entry.push(compactParams.length > 0 ? compactParams : void 0);
91
+ if (hasBody) entry.push(1);
92
+ ops.push(entry);
93
+ }
94
+ }
95
+ const componentParams = spec.components?.parameters;
96
+ const result = { s: server, o: ops };
97
+ if (openapiVersion !== "3.0.2") result.v = openapiVersion;
98
+ if (componentParams && Object.keys(componentParams).length > 0) {
99
+ const cpObj = {};
100
+ for (const [refName, p] of Object.entries(componentParams)) {
101
+ cpObj[refName] = compactifyParam(p);
102
+ }
103
+ result.cp = cpObj;
104
+ }
105
+ if (Object.keys(pathParams).length > 0) {
106
+ result.pp = pathParams;
107
+ }
108
+ return result;
109
+ };
110
+ var findSdkRoot = () => {
111
+ try {
112
+ let dir = process.cwd();
113
+ while (true) {
114
+ const candidate = resolve(dir, "node_modules/@epilot/sdk");
115
+ if (existsSync(candidate)) return candidate;
116
+ const parent = dirname(dir);
117
+ if (parent === dir) break;
118
+ dir = parent;
119
+ }
120
+ } catch {
121
+ }
122
+ return null;
123
+ };
45
124
  var overrideCmd = async (args) => {
46
125
  if (args.length === 2) {
47
126
  const [apiName, specPath] = args;
@@ -49,7 +128,7 @@ var overrideCmd = async (args) => {
49
128
  overrides2[apiName] = specPath;
50
129
  writeOverrides(overrides2);
51
130
  console.log(`Added override: ${apiName} -> ${specPath}`);
52
- console.log(`Run 'npx epilot-sdk typegen' to regenerate types.`);
131
+ console.log(`Run 'npx epilot-sdk override' to apply, then 'npx epilot-sdk typegen' to regenerate types.`);
53
132
  return;
54
133
  }
55
134
  const overrides = readOverrides();
@@ -59,19 +138,27 @@ var overrideCmd = async (args) => {
59
138
  console.log(`Create one with: npx epilot-sdk override <api-name> <spec-path>`);
60
139
  return;
61
140
  }
141
+ const sdkRoot = findSdkRoot();
142
+ if (!sdkRoot) {
143
+ console.error("Could not find @epilot/sdk in node_modules. Is it installed?");
144
+ process.exit(1);
145
+ }
146
+ const defsDir = resolve(sdkRoot, "definitions");
62
147
  console.log(`Applying ${entries.length} override(s)...`);
63
148
  for (const [apiName, specPath] of entries) {
64
149
  try {
65
- console.log(` ${apiName}: ${specPath}`);
66
- const spec = await fetchSpec(specPath);
67
- const overridesDir = resolve(process.cwd(), ".epilot/specs");
68
- mkdirSync(overridesDir, { recursive: true });
69
- const destPath = resolve(overridesDir, `${apiName}.json`);
70
- if (specPath.endsWith(".yaml") || specPath.endsWith(".yml")) {
71
- console.log(` Note: YAML specs should be converted to JSON. Saving as-is.`);
72
- }
73
- writeFileSync(destPath, spec);
74
- console.log(` -> .epilot/specs/${apiName}.json`);
150
+ const kebabName = toKebabCase(apiName);
151
+ console.log(` ${apiName} (${kebabName}): ${specPath}`);
152
+ const rawContent = await fetchSpec(specPath);
153
+ const spec = await parseSpec(rawContent, specPath);
154
+ const fullSpecDest = resolve(defsDir, `${kebabName}.json`);
155
+ writeFileSync(fullSpecDest, `${JSON.stringify(spec, null, 2)}
156
+ `);
157
+ console.log(` -> definitions/${kebabName}.json`);
158
+ const compactSpec = compactifySpec(spec);
159
+ const runtimeDest = resolve(defsDir, `${kebabName}-runtime.json`);
160
+ writeFileSync(runtimeDest, JSON.stringify(compactSpec));
161
+ console.log(` -> definitions/${kebabName}-runtime.json`);
75
162
  } catch (err) {
76
163
  console.error(` Error: ${err.message}`);
77
164
  }
@@ -82,28 +169,39 @@ Done. Run 'npx epilot-sdk typegen' to regenerate types.`);
82
169
  var typegenCmd = async () => {
83
170
  try {
84
171
  const { execSync } = await import("child_process");
85
- const specsDir = resolve(process.cwd(), ".epilot/specs");
86
- if (!existsSync(specsDir)) {
87
- console.log('No override specs found. Run "npx epilot-sdk override" first.');
172
+ const sdkRoot = findSdkRoot();
173
+ if (!sdkRoot) {
174
+ console.error("Could not find @epilot/sdk in node_modules. Is it installed?");
175
+ process.exit(1);
176
+ }
177
+ const overrides = readOverrides();
178
+ const entries = Object.entries(overrides);
179
+ if (entries.length === 0) {
180
+ console.log('No overrides found. Run "npx epilot-sdk override" first.');
88
181
  return;
89
182
  }
90
- const { readdirSync } = await import("fs");
91
- const specs = readdirSync(specsDir).filter((f) => f.endsWith(".json"));
92
- const typesDir = resolve(process.cwd(), ".epilot/types");
93
- mkdirSync(typesDir, { recursive: true });
94
- for (const spec of specs) {
95
- const apiName = spec.replace(".json", "");
96
- const specPath = resolve(specsDir, spec);
97
- const typesPath = resolve(typesDir, `${apiName}.d.ts`);
183
+ const defsDir = resolve(sdkRoot, "definitions");
184
+ const distDir = resolve(sdkRoot, "dist");
185
+ for (const [apiName] of entries) {
186
+ const kebabName = toKebabCase(apiName);
187
+ const specPath = resolve(defsDir, `${kebabName}.json`);
188
+ if (!existsSync(specPath)) {
189
+ console.error(` No spec found for ${apiName}. Run "npx epilot-sdk override" first.`);
190
+ continue;
191
+ }
98
192
  console.log(`Generating types for ${apiName}...`);
99
193
  try {
194
+ const typesPath = resolve(distDir, `apis/${kebabName}.d.ts`);
100
195
  execSync(`npx openapi-client-axios-typegen ${specPath} --client > ${typesPath}`, { stdio: "pipe" });
101
- console.log(` -> .epilot/types/${apiName}.d.ts`);
196
+ console.log(` -> dist/apis/${kebabName}.d.ts`);
197
+ const ctypesPath = resolve(distDir, `apis/${kebabName}.d.cts`);
198
+ execSync(`npx openapi-client-axios-typegen ${specPath} --client > ${ctypesPath}`, { stdio: "pipe" });
199
+ console.log(` -> dist/apis/${kebabName}.d.cts`);
102
200
  } catch (err) {
103
201
  console.error(` Error generating types for ${apiName}: ${err.message}`);
104
202
  }
105
203
  }
106
- console.log("\nDone. Types generated in .epilot/types/");
204
+ console.log("\nDone.");
107
205
  } catch (err) {
108
206
  console.error(`Error: ${err.message}`);
109
207
  }
@@ -61,7 +61,7 @@ var expand = (c) => {
61
61
  openapi: c.v || "3.0.2",
62
62
  info: { title: "", version: "" },
63
63
  paths,
64
- servers: [{ url: c.s }]
64
+ servers: c.s ? [{ url: c.s }] : []
65
65
  };
66
66
  if (c.cp) {
67
67
  const params = {};
@@ -61,7 +61,7 @@ var expand = (c) => {
61
61
  openapi: c.v || "3.0.2",
62
62
  info: { title: "", version: "" },
63
63
  paths,
64
- servers: [{ url: c.s }]
64
+ servers: c.s ? [{ url: c.s }] : []
65
65
  };
66
66
  if (c.cp) {
67
67
  const params = {};