skedyul 1.7.9 → 1.7.11

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1785987631012
1
+ 1786058725534
package/dist/cli/index.js CHANGED
@@ -4781,7 +4781,11 @@ async function handleBatchOperationRoute(req, ctx) {
4781
4781
  status: 200,
4782
4782
  body: {
4783
4783
  success: true,
4784
- result: { state: {}, total: void 0 },
4784
+ result: {
4785
+ state: {},
4786
+ total: void 0,
4787
+ cascade: operation.cascade
4788
+ },
4785
4789
  billing: normalizeBilling(void 0)
4786
4790
  }
4787
4791
  };
@@ -4804,20 +4808,26 @@ async function handleBatchOperationRoute(req, ctx) {
4804
4808
  status: 200,
4805
4809
  body: {
4806
4810
  success: true,
4807
- result: domain2,
4811
+ result: {
4812
+ ...domain2,
4813
+ // Expose definition cascade to the platform workflow
4814
+ cascade: operation.cascade ?? domain2.cascade
4815
+ },
4808
4816
  billing: normalizeBilling(setupResult.billing)
4809
4817
  }
4810
4818
  };
4811
4819
  }
4820
+ const iterateBody = body;
4812
4821
  const raw = await runWithConfig(requestConfig, async () => {
4813
4822
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
4814
4823
  return runWithLogContext({ invocation }, async () => {
4815
4824
  return operation.iterate({
4816
4825
  ...opContextBase,
4817
- state: body.state,
4818
- page: body.page,
4819
- cursor: body.cursor,
4820
- limit: body.limit
4826
+ state: iterateBody.state,
4827
+ page: iterateBody.page,
4828
+ cursor: iterateBody.cursor,
4829
+ limit: iterateBody.limit,
4830
+ cascadeEntities: iterateBody.cascadeEntities
4821
4831
  });
4822
4832
  });
4823
4833
  });
@@ -42,17 +42,48 @@ export interface BatchOperationSetupResult {
42
42
  state?: Record<string, unknown>;
43
43
  /** Optional total count for progress display */
44
44
  total?: number;
45
+ /**
46
+ * Cascade phases (usually injected from the operation definition by the
47
+ * route handler so the platform workflow can resolve map-gated targets).
48
+ */
49
+ cascade?: BatchCascadePhase[];
45
50
  /** Optional billing (normalized by the route if omitted) */
46
51
  billing?: ToolBilling;
47
52
  /** Optional success discriminator (default true when domain fields present) */
48
53
  success?: true;
49
54
  }
55
+ /**
56
+ * Cascade phase for multi-entity batch imports.
57
+ * Platform upserts configured entities in `order` within each wave.
58
+ */
59
+ export interface BatchCascadePhase {
60
+ /** App entity handle to upsert */
61
+ entity: string;
62
+ /** Lower runs first within the same wave */
63
+ order: number;
64
+ /** setup = once (typically first iterate); page = every iterate page */
65
+ wave: 'setup' | 'page';
66
+ /**
67
+ * Other cascade entities that must also be CRM-configured for this phase
68
+ * to run (e.g. plan requires package).
69
+ */
70
+ requires?: string[];
71
+ }
50
72
  /**
51
73
  * Result from a batch operation iterate function.
52
74
  */
53
75
  export interface BatchOperationIterateResult {
54
- /** Array of raw items from the external source */
76
+ /**
77
+ * Array of raw items for the primary `entity`.
78
+ * Prefer `itemsByEntity` for cascade imports; when both are set, platform
79
+ * uses `itemsByEntity` and falls back to `items` for the primary entity.
80
+ */
55
81
  items: Record<string, unknown>[];
82
+ /**
83
+ * Multi-entity items keyed by entity handle (cascade imports).
84
+ * Platform upserts each configured entity in cascade order.
85
+ */
86
+ itemsByEntity?: Record<string, Record<string, unknown>[]>;
56
87
  /** Pagination info for fetching more pages */
57
88
  pagination: BatchPagination;
58
89
  /** Optional state to persist for the next iterate call */
@@ -89,6 +120,12 @@ export interface BatchOperationContext {
89
120
  env: Record<string, string>;
90
121
  /** Invocation context for log traceability */
91
122
  invocation?: InvocationContext;
123
+ /**
124
+ * Entity handles whose CRM maps are configured for this job's cascade.
125
+ * Platform injects this on iterate so apps can skip expensive fetches
126
+ * (e.g. per-member credits) when that entity is not mapped.
127
+ */
128
+ cascadeEntities?: string[];
92
129
  /** Logger instance */
93
130
  log: {
94
131
  info: (message: string, meta?: Record<string, unknown>) => void;
@@ -150,10 +187,15 @@ export interface BatchOperationDefinition {
150
187
  /** Description of what this operation does */
151
188
  description?: string;
152
189
  /**
153
- * Entity handle that items will be upserted to.
190
+ * Primary entity handle (progress + start gate).
154
191
  * The platform applies CRM mappings and calls upsertMany.
155
192
  */
156
193
  entity: string;
194
+ /**
195
+ * Optional multi-entity cascade. When set, iterate may return
196
+ * `itemsByEntity` and the platform upserts map-configured phases in order.
197
+ */
198
+ cascade?: BatchCascadePhase[];
157
199
  /**
158
200
  * Setup function called once at the start of the operation.
159
201
  * Use to initialize state, fetch total count, etc.
@@ -2111,7 +2111,11 @@ async function handleBatchOperationRoute(req, ctx) {
2111
2111
  status: 200,
2112
2112
  body: {
2113
2113
  success: true,
2114
- result: { state: {}, total: void 0 },
2114
+ result: {
2115
+ state: {},
2116
+ total: void 0,
2117
+ cascade: operation.cascade
2118
+ },
2115
2119
  billing: normalizeBilling(void 0)
2116
2120
  }
2117
2121
  };
@@ -2134,20 +2138,26 @@ async function handleBatchOperationRoute(req, ctx) {
2134
2138
  status: 200,
2135
2139
  body: {
2136
2140
  success: true,
2137
- result: domain2,
2141
+ result: {
2142
+ ...domain2,
2143
+ // Expose definition cascade to the platform workflow
2144
+ cascade: operation.cascade ?? domain2.cascade
2145
+ },
2138
2146
  billing: normalizeBilling(setupResult.billing)
2139
2147
  }
2140
2148
  };
2141
2149
  }
2150
+ const iterateBody = body;
2142
2151
  const raw = await runWithConfig(requestConfig, async () => {
2143
2152
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
2144
2153
  return runWithLogContext({ invocation }, async () => {
2145
2154
  return operation.iterate({
2146
2155
  ...opContextBase,
2147
- state: body.state,
2148
- page: body.page,
2149
- cursor: body.cursor,
2150
- limit: body.limit
2156
+ state: iterateBody.state,
2157
+ page: iterateBody.page,
2158
+ cursor: iterateBody.cursor,
2159
+ limit: iterateBody.limit,
2160
+ cascadeEntities: iterateBody.cascadeEntities
2151
2161
  });
2152
2162
  });
2153
2163
  });
@@ -1923,8 +1923,15 @@ var BatchOperationSetupResultSchema = z8.object({
1923
1923
  state: z8.record(z8.string(), z8.unknown()).optional(),
1924
1924
  total: z8.number().int().nonnegative().optional()
1925
1925
  });
1926
+ var BatchCascadePhaseSchema = z8.object({
1927
+ entity: z8.string(),
1928
+ order: z8.number().int(),
1929
+ wave: z8.enum(["setup", "page"]),
1930
+ requires: z8.array(z8.string()).optional()
1931
+ });
1926
1932
  var BatchOperationIterateResultSchema = z8.object({
1927
1933
  items: z8.array(z8.record(z8.string(), z8.unknown())),
1934
+ itemsByEntity: z8.record(z8.string(), z8.array(z8.record(z8.string(), z8.unknown()))).optional(),
1928
1935
  pagination: BatchPaginationSchema,
1929
1936
  state: z8.record(z8.string(), z8.unknown()).optional()
1930
1937
  });
@@ -1933,6 +1940,7 @@ var BatchOperationDefinitionSchema = z8.object({
1933
1940
  label: z8.string(),
1934
1941
  description: z8.string().optional(),
1935
1942
  entity: z8.string(),
1943
+ cascade: z8.array(BatchCascadePhaseSchema).optional(),
1936
1944
  maxConcurrent: z8.number().int().positive().optional(),
1937
1945
  pageSize: z8.number().int().positive().optional(),
1938
1946
  icon: z8.string().optional()
@@ -5598,7 +5606,11 @@ async function handleBatchOperationRoute(req, ctx) {
5598
5606
  status: 200,
5599
5607
  body: {
5600
5608
  success: true,
5601
- result: { state: {}, total: void 0 },
5609
+ result: {
5610
+ state: {},
5611
+ total: void 0,
5612
+ cascade: operation.cascade
5613
+ },
5602
5614
  billing: normalizeBilling(void 0)
5603
5615
  }
5604
5616
  };
@@ -5621,20 +5633,26 @@ async function handleBatchOperationRoute(req, ctx) {
5621
5633
  status: 200,
5622
5634
  body: {
5623
5635
  success: true,
5624
- result: domain2,
5636
+ result: {
5637
+ ...domain2,
5638
+ // Expose definition cascade to the platform workflow
5639
+ cascade: operation.cascade ?? domain2.cascade
5640
+ },
5625
5641
  billing: normalizeBilling(setupResult.billing)
5626
5642
  }
5627
5643
  };
5628
5644
  }
5645
+ const iterateBody = body;
5629
5646
  const raw = await runWithConfig(requestConfig, async () => {
5630
5647
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
5631
5648
  return runWithLogContext({ invocation }, async () => {
5632
5649
  return operation.iterate({
5633
5650
  ...opContextBase,
5634
- state: body.state,
5635
- page: body.page,
5636
- cursor: body.cursor,
5637
- limit: body.limit
5651
+ state: iterateBody.state,
5652
+ page: iterateBody.page,
5653
+ cursor: iterateBody.cursor,
5654
+ limit: iterateBody.limit,
5655
+ cascadeEntities: iterateBody.cascadeEntities
5638
5656
  });
5639
5657
  });
5640
5658
  });
@@ -8678,6 +8696,7 @@ export {
8678
8696
  AssociationSchema,
8679
8697
  AuthenticationError,
8680
8698
  BaseEventPayloadSchema,
8699
+ BatchCascadePhaseSchema,
8681
8700
  BatchOperationDefinitionSchema,
8682
8701
  BatchOperationIterateResultSchema,
8683
8702
  BatchOperationSetupResultSchema,
package/dist/index.d.ts CHANGED
@@ -35,7 +35,7 @@ export type { CRMContext, SenderContext, ThreadContextItem, ThreadInfo, SandboxC
35
35
  export { MemoryEntryTypeSchema, MemoryEntrySchema, WorkingMemoryConfigSchema, SemanticMemoryConfigSchema, ExternalMemoryConfigSchema, MemoryConfigSchema, MemoryScopeSchema, MemoryQueryOptionsSchema, ConversationSummarySchema, AgentObservationSchema, ExternalDataCacheSchema, MemoryService, InMemoryStore, createInMemoryService, } from './memory';
36
36
  export type { MemoryEntryType, MemoryEntry, WorkingMemoryConfig as MemoryWorkingConfig, SemanticMemoryConfig as MemorySemanticConfig, ExternalMemoryConfig as MemoryExternalConfig, MemoryConfig, MemoryScope, MemoryQueryOptions, ConversationSummary, AgentObservation, ExternalDataCache, MemoryStore, } from './memory';
37
37
  export type { CRMFieldType, CRMFieldRequirement, CRMFieldOption, CRMFieldDefinition, CRMFieldSchema, CRMModelSchema, CRMCardinality, CRMOnDelete, CRMRelationshipLink, CRMRelationshipSchema, CRMSchema, CRMSchemaValidationResult, } from './schemas';
38
- export type { SkedyulConfig, SerializableSkedyulConfig, InstallConfig, ProvisionConfig, BaseDefinition, Scope, FieldOwner, Visibility, ComputeLayer, StructuredFilter, FilterOperator, FilterCondition, FieldOption, EnvVariable, EnvSchema, FieldType, Cardinality, OnDelete, InlineFieldDefinition, FieldVisibility, FieldDefinition, ModelDefinition, RelationshipLink, RelationshipDefinition, CapabilityType, ChannelCapability, ChannelBatchCapability, ChannelFieldPermissions, ChannelField, ChannelDefinition, WorkflowActionInput, WorkflowAction, WorkflowDefinition, AgentDefinition, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, ContextMode, ContextItemModel, ContextItemTool, ContextItem, ContextDefinition, FormStyleProps, ButtonVariant, ButtonSize, ButtonProps, RelationshipExtension, FormHeader, FormActionDefinition, ActionDefinition, ModalFormDefinition, InputComponent, TextareaComponent, SelectComponent, ComboboxComponent, CheckboxComponent, DatePickerComponent, TimePickerComponent, StatusIndicator, FieldSettingComponent, ImageSettingComponent, FileSettingComponent, ListItemTemplate, ListComponent, EmptyFormComponent, AlertComponent, FormComponent, FormLayoutColumn, FormLayoutRow, FormLayoutConfig, FormProps, CardHeader, CardBlock, ListBlock, BlockDefinition, SetupStepDefinition, SetupStepKind, PageType, PageDefinition, HttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, } from './config';
38
+ export type { SkedyulConfig, SerializableSkedyulConfig, InstallConfig, ProvisionConfig, BaseDefinition, Scope, FieldOwner, Visibility, ComputeLayer, StructuredFilter, FilterOperator, FilterCondition, FieldOption, EnvVariable, EnvSchema, FieldType, Cardinality, OnDelete, InlineFieldDefinition, FieldVisibility, FieldDefinition, ModelDefinition, RelationshipLink, RelationshipDefinition, CapabilityType, ChannelCapability, ChannelBatchCapability, ChannelFieldPermissions, ChannelField, ChannelDefinition, WorkflowActionInput, WorkflowAction, WorkflowDefinition, AgentDefinition, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, ContextMode, ContextItemModel, ContextItemTool, ContextItem, ContextDefinition, FormStyleProps, ButtonVariant, ButtonSize, ButtonProps, RelationshipExtension, FormHeader, FormActionDefinition, ActionDefinition, ModalFormDefinition, InputComponent, TextareaComponent, SelectComponent, ComboboxComponent, CheckboxComponent, DatePickerComponent, TimePickerComponent, StatusIndicator, FieldSettingComponent, ImageSettingComponent, FileSettingComponent, ListItemTemplate, ListComponent, EmptyFormComponent, AlertComponent, FormComponent, FormLayoutColumn, FormLayoutRow, FormLayoutConfig, FormProps, CardHeader, CardBlock, ListBlock, BlockDefinition, SetupStepDefinition, SetupStepKind, BatchCascadePhase, BatchOperationDefinition, BatchOperationContext, BatchOperationIterateResult, BatchOperationSetupResult, PageType, PageDefinition, HttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, } from './config';
39
39
  export { compileAgent, compileWorkflow } from './compiler';
40
40
  export type { ValidationError, ValidationWarning, ResolvedPersona, ResolvedTool, EventConfig as CompilerEventConfig, IRMemoryConfig, PolicyConfig, IRRuntimeConfig, AgentIR, WorkflowStepIR, WorkflowIR, CompilationResult, } from './compiler';
41
41
  export { TimeStampSchema, DayOfWeekSchema, TimeWindowSlotSchema, WaitUnitSchema, WaitInputRelativeSchema, WaitInputAbsoluteSchema, WaitInputSchema, } from './scheduling/types';
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  AssociationSchema: () => AssociationSchema,
43
43
  AuthenticationError: () => AuthenticationError,
44
44
  BaseEventPayloadSchema: () => BaseEventPayloadSchema,
45
+ BatchCascadePhaseSchema: () => BatchCascadePhaseSchema,
45
46
  BatchOperationDefinitionSchema: () => BatchOperationDefinitionSchema,
46
47
  BatchOperationIterateResultSchema: () => BatchOperationIterateResultSchema,
47
48
  BatchOperationSetupResultSchema: () => BatchOperationSetupResultSchema,
@@ -2303,8 +2304,15 @@ var BatchOperationSetupResultSchema = import_v48.z.object({
2303
2304
  state: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional(),
2304
2305
  total: import_v48.z.number().int().nonnegative().optional()
2305
2306
  });
2307
+ var BatchCascadePhaseSchema = import_v48.z.object({
2308
+ entity: import_v48.z.string(),
2309
+ order: import_v48.z.number().int(),
2310
+ wave: import_v48.z.enum(["setup", "page"]),
2311
+ requires: import_v48.z.array(import_v48.z.string()).optional()
2312
+ });
2306
2313
  var BatchOperationIterateResultSchema = import_v48.z.object({
2307
2314
  items: import_v48.z.array(import_v48.z.record(import_v48.z.string(), import_v48.z.unknown())),
2315
+ itemsByEntity: import_v48.z.record(import_v48.z.string(), import_v48.z.array(import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()))).optional(),
2308
2316
  pagination: BatchPaginationSchema,
2309
2317
  state: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional()
2310
2318
  });
@@ -2313,6 +2321,7 @@ var BatchOperationDefinitionSchema = import_v48.z.object({
2313
2321
  label: import_v48.z.string(),
2314
2322
  description: import_v48.z.string().optional(),
2315
2323
  entity: import_v48.z.string(),
2324
+ cascade: import_v48.z.array(BatchCascadePhaseSchema).optional(),
2316
2325
  maxConcurrent: import_v48.z.number().int().positive().optional(),
2317
2326
  pageSize: import_v48.z.number().int().positive().optional(),
2318
2327
  icon: import_v48.z.string().optional()
@@ -5978,7 +5987,11 @@ async function handleBatchOperationRoute(req, ctx) {
5978
5987
  status: 200,
5979
5988
  body: {
5980
5989
  success: true,
5981
- result: { state: {}, total: void 0 },
5990
+ result: {
5991
+ state: {},
5992
+ total: void 0,
5993
+ cascade: operation.cascade
5994
+ },
5982
5995
  billing: normalizeBilling(void 0)
5983
5996
  }
5984
5997
  };
@@ -6001,20 +6014,26 @@ async function handleBatchOperationRoute(req, ctx) {
6001
6014
  status: 200,
6002
6015
  body: {
6003
6016
  success: true,
6004
- result: domain2,
6017
+ result: {
6018
+ ...domain2,
6019
+ // Expose definition cascade to the platform workflow
6020
+ cascade: operation.cascade ?? domain2.cascade
6021
+ },
6005
6022
  billing: normalizeBilling(setupResult.billing)
6006
6023
  }
6007
6024
  };
6008
6025
  }
6026
+ const iterateBody = body;
6009
6027
  const raw = await runWithConfig(requestConfig, async () => {
6010
6028
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
6011
6029
  return runWithLogContext({ invocation }, async () => {
6012
6030
  return operation.iterate({
6013
6031
  ...opContextBase,
6014
- state: body.state,
6015
- page: body.page,
6016
- cursor: body.cursor,
6017
- limit: body.limit
6032
+ state: iterateBody.state,
6033
+ page: iterateBody.page,
6034
+ cursor: iterateBody.cursor,
6035
+ limit: iterateBody.limit,
6036
+ cascadeEntities: iterateBody.cascadeEntities
6018
6037
  });
6019
6038
  });
6020
6039
  });
@@ -9059,6 +9078,7 @@ var index_default = { z: import_v414.z };
9059
9078
  AssociationSchema,
9060
9079
  AuthenticationError,
9061
9080
  BaseEventPayloadSchema,
9081
+ BatchCascadePhaseSchema,
9062
9082
  BatchOperationDefinitionSchema,
9063
9083
  BatchOperationIterateResultSchema,
9064
9084
  BatchOperationSetupResultSchema,
package/dist/schemas.d.ts CHANGED
@@ -3368,8 +3368,18 @@ export declare const BatchOperationSetupResultSchema: z.ZodObject<{
3368
3368
  state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3369
3369
  total: z.ZodOptional<z.ZodNumber>;
3370
3370
  }, z.core.$strip>;
3371
+ export declare const BatchCascadePhaseSchema: z.ZodObject<{
3372
+ entity: z.ZodString;
3373
+ order: z.ZodNumber;
3374
+ wave: z.ZodEnum<{
3375
+ page: "page";
3376
+ setup: "setup";
3377
+ }>;
3378
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
3379
+ }, z.core.$strip>;
3371
3380
  export declare const BatchOperationIterateResultSchema: z.ZodObject<{
3372
3381
  items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3382
+ itemsByEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
3373
3383
  pagination: z.ZodObject<{
3374
3384
  hasMore: z.ZodBoolean;
3375
3385
  page: z.ZodOptional<z.ZodNumber>;
@@ -3384,6 +3394,15 @@ export declare const BatchOperationDefinitionSchema: z.ZodObject<{
3384
3394
  label: z.ZodString;
3385
3395
  description: z.ZodOptional<z.ZodString>;
3386
3396
  entity: z.ZodString;
3397
+ cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
3398
+ entity: z.ZodString;
3399
+ order: z.ZodNumber;
3400
+ wave: z.ZodEnum<{
3401
+ page: "page";
3402
+ setup: "setup";
3403
+ }>;
3404
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
3405
+ }, z.core.$strip>>>;
3387
3406
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
3388
3407
  pageSize: z.ZodOptional<z.ZodNumber>;
3389
3408
  icon: z.ZodOptional<z.ZodString>;
@@ -4197,6 +4216,15 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
4197
4216
  label: z.ZodString;
4198
4217
  description: z.ZodOptional<z.ZodString>;
4199
4218
  entity: z.ZodString;
4219
+ cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
4220
+ entity: z.ZodString;
4221
+ order: z.ZodNumber;
4222
+ wave: z.ZodEnum<{
4223
+ page: "page";
4224
+ setup: "setup";
4225
+ }>;
4226
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
4227
+ }, z.core.$strip>>>;
4200
4228
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
4201
4229
  pageSize: z.ZodOptional<z.ZodNumber>;
4202
4230
  icon: z.ZodOptional<z.ZodString>;
@@ -5021,6 +5049,15 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
5021
5049
  label: z.ZodString;
5022
5050
  description: z.ZodOptional<z.ZodString>;
5023
5051
  entity: z.ZodString;
5052
+ cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
5053
+ entity: z.ZodString;
5054
+ order: z.ZodNumber;
5055
+ wave: z.ZodEnum<{
5056
+ page: "page";
5057
+ setup: "setup";
5058
+ }>;
5059
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
5060
+ }, z.core.$strip>>>;
5024
5061
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
5025
5062
  pageSize: z.ZodOptional<z.ZodNumber>;
5026
5063
  icon: z.ZodOptional<z.ZodString>;
package/dist/server.js CHANGED
@@ -2111,7 +2111,11 @@ async function handleBatchOperationRoute(req, ctx) {
2111
2111
  status: 200,
2112
2112
  body: {
2113
2113
  success: true,
2114
- result: { state: {}, total: void 0 },
2114
+ result: {
2115
+ state: {},
2116
+ total: void 0,
2117
+ cascade: operation.cascade
2118
+ },
2115
2119
  billing: normalizeBilling(void 0)
2116
2120
  }
2117
2121
  };
@@ -2134,20 +2138,26 @@ async function handleBatchOperationRoute(req, ctx) {
2134
2138
  status: 200,
2135
2139
  body: {
2136
2140
  success: true,
2137
- result: domain2,
2141
+ result: {
2142
+ ...domain2,
2143
+ // Expose definition cascade to the platform workflow
2144
+ cascade: operation.cascade ?? domain2.cascade
2145
+ },
2138
2146
  billing: normalizeBilling(setupResult.billing)
2139
2147
  }
2140
2148
  };
2141
2149
  }
2150
+ const iterateBody = body;
2142
2151
  const raw = await runWithConfig(requestConfig, async () => {
2143
2152
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
2144
2153
  return runWithLogContext({ invocation }, async () => {
2145
2154
  return operation.iterate({
2146
2155
  ...opContextBase,
2147
- state: body.state,
2148
- page: body.page,
2149
- cursor: body.cursor,
2150
- limit: body.limit
2156
+ state: iterateBody.state,
2157
+ page: iterateBody.page,
2158
+ cursor: iterateBody.cursor,
2159
+ limit: iterateBody.limit,
2160
+ cascadeEntities: iterateBody.cascadeEntities
2151
2161
  });
2152
2162
  });
2153
2163
  });
@@ -2072,7 +2072,11 @@ async function handleBatchOperationRoute(req, ctx) {
2072
2072
  status: 200,
2073
2073
  body: {
2074
2074
  success: true,
2075
- result: { state: {}, total: void 0 },
2075
+ result: {
2076
+ state: {},
2077
+ total: void 0,
2078
+ cascade: operation.cascade
2079
+ },
2076
2080
  billing: normalizeBilling(void 0)
2077
2081
  }
2078
2082
  };
@@ -2095,20 +2099,26 @@ async function handleBatchOperationRoute(req, ctx) {
2095
2099
  status: 200,
2096
2100
  body: {
2097
2101
  success: true,
2098
- result: domain2,
2102
+ result: {
2103
+ ...domain2,
2104
+ // Expose definition cascade to the platform workflow
2105
+ cascade: operation.cascade ?? domain2.cascade
2106
+ },
2099
2107
  billing: normalizeBilling(setupResult.billing)
2100
2108
  }
2101
2109
  };
2102
2110
  }
2111
+ const iterateBody = body;
2103
2112
  const raw = await runWithConfig(requestConfig, async () => {
2104
2113
  return runWithRateLimitExecutionContext(rateLimitContext, async () => {
2105
2114
  return runWithLogContext({ invocation }, async () => {
2106
2115
  return operation.iterate({
2107
2116
  ...opContextBase,
2108
- state: body.state,
2109
- page: body.page,
2110
- cursor: body.cursor,
2111
- limit: body.limit
2117
+ state: iterateBody.state,
2118
+ page: iterateBody.page,
2119
+ cursor: iterateBody.cursor,
2120
+ limit: iterateBody.limit,
2121
+ cascadeEntities: iterateBody.cascadeEntities
2112
2122
  });
2113
2123
  });
2114
2124
  });
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * These types define the registry and context for batch operations at runtime.
5
5
  */
6
- import type { BatchOperationSetupFn, BatchOperationIterateFn } from '../config/types/batch-operation';
7
- export type { BatchOperationContext } from '../config/types/batch-operation';
6
+ import type { BatchCascadePhase, BatchOperationSetupFn, BatchOperationIterateFn } from '../config/types/batch-operation';
7
+ export type { BatchCascadePhase, BatchOperationContext, } from '../config/types/batch-operation';
8
8
  /**
9
9
  * Entry in the batch operation registry.
10
10
  * Contains both metadata and function implementations.
@@ -16,8 +16,10 @@ export interface BatchOperationRegistryEntry {
16
16
  label: string;
17
17
  /** Description of what this operation does */
18
18
  description?: string;
19
- /** Entity handle that items will be upserted to */
19
+ /** Primary entity handle that items will be upserted to */
20
20
  entity: string;
21
+ /** Optional multi-entity cascade phases */
22
+ cascade?: BatchCascadePhase[];
21
23
  /** Setup function called once at the start */
22
24
  setup?: BatchOperationSetupFn;
23
25
  /** Iterate function called for each page */
@@ -41,6 +43,7 @@ export interface BatchOperationMetadata {
41
43
  label: string;
42
44
  description?: string;
43
45
  entity: string;
46
+ cascade?: BatchCascadePhase[];
44
47
  maxConcurrent?: number;
45
48
  pageSize?: number;
46
49
  icon?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",