@sylphx/sdk 0.20.1 → 0.21.0

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/tasks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { MachineSize, DurableWorkGetTaskRunResponse, DurableWorkTaskDlqEntry, DurableWorkTaskDlqListResponse, DurableWorkTaskReplayRequestBody, DurableWorkTaskReplayResponse, DurableWorkTaskRunStep } from '@sylphx/contract';
1
+ import { MachineSize, DurableWorkUpsertCallbackTargetResponse, DurableWorkUpsertCallbackTargetRequestBody, DurableWorkGetTaskRunResponse, DurableWorkTaskDlqEntry, DurableWorkTaskDlqListResponse, DurableWorkTaskReplayRequestBody, DurableWorkTaskReplayResponse, DurableWorkTaskRunStep } from '@sylphx/contract';
2
2
 
3
3
  /**
4
4
  * SDK Configuration — ADR-055 Connection URL API
@@ -1004,6 +1004,11 @@ interface ListTaskRunDlqOptions {
1004
1004
  /** Page offset. */
1005
1005
  offset?: number;
1006
1006
  }
1007
+ interface TaskCallbackTargetInput extends DurableWorkUpsertCallbackTargetRequestBody {
1008
+ /** Stable low-cardinality target key, e.g. `spiron.task-callback.default`. */
1009
+ targetKey: string;
1010
+ }
1011
+ type TaskCallbackTarget = DurableWorkUpsertCallbackTargetResponse;
1007
1012
  interface CronInput {
1008
1013
  /** Callback URL to call on each cron trigger */
1009
1014
  callbackUrl: string;
@@ -1078,6 +1083,14 @@ declare function listTasks(config: SylphxConfig, options?: {
1078
1083
  tasks: TaskStatus[];
1079
1084
  total: number;
1080
1085
  }>;
1086
+ /**
1087
+ * Upsert a reusable task callback target.
1088
+ *
1089
+ * This is the P5 callback-target SSOT path: endpoint rotation is one idempotent
1090
+ * PUT instead of re-registering every cron schedule. New schedules can bind to
1091
+ * `targetKey` once Platform's schedule-binding slice is enabled.
1092
+ */
1093
+ declare function upsertTaskCallbackTarget(config: SylphxConfig, input: TaskCallbackTargetInput): Promise<TaskCallbackTarget>;
1081
1094
  /**
1082
1095
  * Create a recurring cron task
1083
1096
  */
@@ -1447,4 +1460,4 @@ declare function validateWorkflow(workflow: WorkflowDefinition): string[];
1447
1460
  /** @deprecated Use task() instead */
1448
1461
  declare const job: typeof task;
1449
1462
 
1450
- export { type BatchHandle, type ConditionalStep, type CronInput, type CronSchedule, DEFAULT_JOBS_CONFIG, DEFAULT_RETRY_DELAYS, type DLQOptions, type Job, type JobContext, type JobDefinition, type JobEvent, type JobOptions, type JobPayload, type JobPriority, type JobResult, type JobStatus, type JobStep, JobsClient, type TasksConfig as JobsConfig, type ListTaskRunDlqOptions, type LoopStep, type NativeSideEffectOutcome, type NativeSideEffectReceipt, type NativeStepContext, type NativeTaskDefinition, type ParallelStep, type RetryDelayStrategy, type RunHandle, type SagaStep, type ScheduledJob, type ServeOptions, type ServeResult, StepCompleteSignal, type StepContext, StepSideEffectCompleteSignal, StepSideEffectStartSignal, StepSleepSignal, type SubworkflowStep, type TaskConfig, type TaskDefinition, type TaskHandle, type TaskInput, type TaskMachineSize, type TaskResult, type TaskRunContext, type TaskRunDetail, type TaskRunDlqEntry, type TaskRunDlqListResponse, type TaskRunReplayInput, type TaskRunReplayResponse, type TaskRunStatus, type TaskRunStatus as TaskRunStatusLegacy, type TaskRunStep, type TaskStatus, type TaskTriggerConfig, TasksClient, type TasksConfig, type TasksHandlerOptions, type TasksHandlerResult, type TriggerOptions, type WaitStep, type Workflow, WorkflowBuilder, type WorkflowDefinition, type WorkflowEvent, type WorkflowOptions, type WorkflowStep, cancelTask, conditional, createCron, createJobsClient, createStepContext, createTasksClient, createTasksHandler, createWorkflow, delay, deleteCron, fanOut, getTask, getTaskRun, job, jobIf, listTaskRunDlq, listTasks, loop, parallel, pauseCron, replayTaskRun, resumeCron, saga, scheduleTask, sequence, serve, sleepUntil, subworkflow, task$1 as task, taskStub, validateWorkflow, verifySignature, wait, withRetry, withTimeout };
1463
+ export { type BatchHandle, type ConditionalStep, type CronInput, type CronSchedule, DEFAULT_JOBS_CONFIG, DEFAULT_RETRY_DELAYS, type DLQOptions, type Job, type JobContext, type JobDefinition, type JobEvent, type JobOptions, type JobPayload, type JobPriority, type JobResult, type JobStatus, type JobStep, JobsClient, type TasksConfig as JobsConfig, type ListTaskRunDlqOptions, type LoopStep, type NativeSideEffectOutcome, type NativeSideEffectReceipt, type NativeStepContext, type NativeTaskDefinition, type ParallelStep, type RetryDelayStrategy, type RunHandle, type SagaStep, type ScheduledJob, type ServeOptions, type ServeResult, StepCompleteSignal, type StepContext, StepSideEffectCompleteSignal, StepSideEffectStartSignal, StepSleepSignal, type SubworkflowStep, type TaskCallbackTarget, type TaskCallbackTargetInput, type TaskConfig, type TaskDefinition, type TaskHandle, type TaskInput, type TaskMachineSize, type TaskResult, type TaskRunContext, type TaskRunDetail, type TaskRunDlqEntry, type TaskRunDlqListResponse, type TaskRunReplayInput, type TaskRunReplayResponse, type TaskRunStatus, type TaskRunStatus as TaskRunStatusLegacy, type TaskRunStep, type TaskStatus, type TaskTriggerConfig, TasksClient, type TasksConfig, type TasksHandlerOptions, type TasksHandlerResult, type TriggerOptions, type WaitStep, type Workflow, WorkflowBuilder, type WorkflowDefinition, type WorkflowEvent, type WorkflowOptions, type WorkflowStep, cancelTask, conditional, createCron, createJobsClient, createStepContext, createTasksClient, createTasksHandler, createWorkflow, delay, deleteCron, fanOut, getTask, getTaskRun, job, jobIf, listTaskRunDlq, listTasks, loop, parallel, pauseCron, replayTaskRun, resumeCron, saga, scheduleTask, sequence, serve, sleepUntil, subworkflow, task$1 as task, taskStub, upsertTaskCallbackTarget, validateWorkflow, verifySignature, wait, withRetry, withTimeout };
package/dist/tasks.mjs CHANGED
@@ -1185,6 +1185,17 @@ async function listTasks(config, options) {
1185
1185
  query: options
1186
1186
  });
1187
1187
  }
1188
+ async function upsertTaskCallbackTarget(config, input) {
1189
+ const { targetKey, ...body } = input;
1190
+ return callApi(
1191
+ config,
1192
+ `/tasks/callback-targets/${encodeURIComponent(targetKey)}`,
1193
+ {
1194
+ method: "PUT",
1195
+ body
1196
+ }
1197
+ );
1198
+ }
1188
1199
  async function createCron(config, input) {
1189
1200
  return callApi(config, "/tasks/cron", {
1190
1201
  method: "POST",
@@ -1886,6 +1897,7 @@ export {
1886
1897
  subworkflow,
1887
1898
  task,
1888
1899
  taskStub,
1900
+ upsertTaskCallbackTarget,
1889
1901
  validateWorkflow,
1890
1902
  verifySignature,
1891
1903
  wait,