"use strict";
// ---------------------------------------------------------------------------
// SimpleSteps Runtime Types
//
// These types exist ONLY for the TypeScript type checker and compiler symbol
// resolution. Every method / constructor throws at runtime.
// ---------------------------------------------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
exports.STEP_ERROR_NAMES = exports.ExceedToleratedFailureError = exports.ResultWriterFailedError = exports.ItemReaderFailedError = exports.ParameterPathFailureError = exports.ResultPathMatchFailureError = exports.IntrinsicFailureError = exports.NoChoiceMatchedError = exports.BranchFailedError = exports.HeartbeatTimeoutError = exports.PermissionsError = exports.TaskFailedError = exports.TimeoutError = exports.StepException = exports.SimpleStepContext = exports.Steps = void 0;
exports.stepFunction = stepFunction;
const RUNTIME_ERROR_MESSAGE = 'SimpleSteps runtime types cannot be called directly. They exist only for the compiler.';
// ---------------------------------------------------------------------------
// 5. Steps – static-only class
// ---------------------------------------------------------------------------
class Steps {
    constructor() {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Core helpers --------------------------------------------------------
    static createFunction(_factory) {
        // Return a stub — safe for CDK inline workflows where the transformer
        // replaces this call before runtime. The stub is an opaque marker.
        return _factory;
    }
    static delay(_options) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static sequential(_array) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    /**
     * Wrap an array for use with for...of, with optional Map state configuration.
     * Supports maxConcurrency and closures (outer variable capture).
     *
     * @example
     *   for (const item of Steps.items(input.items, { maxConcurrency: 5 })) {
     *     await processItem.call({ item, prefix: config.prefix });
     *   }
     */
    static items(_array, _options) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Intrinsic functions -------------------------------------------------
    static format(_template, ..._args) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static add(_a, _b) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static random(_start, _end) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static uuid() {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static hash(_data, _algorithm) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static base64Encode(_data) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static base64Decode(_data) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static array(..._items) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static arrayPartition(_array, _size) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static partition(array, size) {
        return Steps.arrayPartition(array, size);
    }
    static arrayContains(_array, _value) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static arrayRange(_start, _end, _step) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static range(start, end, step) {
        return Steps.arrayRange(start, end, step);
    }
    static arrayGetItem(_array, _index) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static arrayLength(_array) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static arrayUnique(_array) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static unique(array) {
        return Steps.arrayUnique(array);
    }
    static arraySlice(_array, _start, _end) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static jsonParse(_str) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static jsonStringify(_obj) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    static merge(_obj1, _obj2, _deep) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Map with options ----------------------------------------------------
    /**
     * Iterate over an array and execute the callback for each item,
     * compiling to a Map state with optional concurrency control.
     *
     * @example
     *   const results = await Steps.map(input.items, async (item) => {
     *     return await processItem.call({ item });
     *   }, { maxConcurrency: 10 });
     */
    static map(_items, _callback, _options) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Distributed Map -----------------------------------------------------
    /**
     * Distributed Map: large-scale parallel iteration with S3-based I/O.
     * Compiles to a Map state with ProcessorConfig DISTRIBUTED.
     *
     * @example
     *   const results = await Steps.distributedMap(
     *     input.items,
     *     async (item) => { return await processItem.call({ item }); },
     *     {
     *       maxConcurrency: 1000,
     *       itemReader: {
     *         Resource: 'arn:aws:states:::s3:getObject',
     *         ReaderConfig: { InputType: 'CSV' },
     *         Parameters: { Bucket: 'my-bucket', Key: 'data.csv' },
     *       },
     *       resultWriter: {
     *         Resource: 'arn:aws:states:::s3:putObject',
     *         Parameters: { Bucket: 'my-bucket', Prefix: 'results/' },
     *       },
     *       toleratedFailurePercentage: 5,
     *       label: 'ProcessRecords',
     *     },
     *   );
     */
    static distributedMap(_items, _callback, _options) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Compiler hints ------------------------------------------------------
    /**
     * Escape hatch for data flow analysis.
     *
     * Wraps a value that the compiler cannot prove is constant, but the
     * developer knows will be available at runtime. The compiler emits a
     * warning (SS708) instead of an error, and passes the value through
     * unchanged to the ASL output.
     *
     * @example
     *   const arn = getArnFromConfig();
     *   const svc = Lambda<Req, Res>(Steps.safeVar(arn));
     */
    static safeVar(_value) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    // -- Escape hatch --------------------------------------------------------
    /**
     * Direct SDK integration for any AWS service not covered by the
     * built-in bindings. Compiles to a Task state with:
     *   Resource: "arn:aws:states:::aws-sdk:<service>:<action>"
     *
     * @example
     *   const result = await Steps.awsSdk<
     *     { Bucket: string; Key: string },
     *     { Body: string }
     *   >('S3', 'GetObject', { Bucket: 'my-bucket', Key: input.key });
     */
    static awsSdk(_service, _action, _parameters) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    /**
     * Emit an explicit Succeed state. Terminates the current execution path.
     *
     * @example
     *   Steps.succeed();
     */
    static succeed() {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    /**
     * Execute branches in parallel with optional retry configuration.
     * Compiles to ASL Parallel state with Retry rules.
     *
     * @example
     *   const [a, b] = await Steps.parallel(
     *     [() => svc1.call(input), () => svc2.call(input)],
     *     { retry: { errorEquals: ['States.ALL'], maxAttempts: 3 } },
     *   );
     */
    static parallel(_branches, _options) {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
}
exports.Steps = Steps;
// ---------------------------------------------------------------------------
// 6. SimpleStepContext
// ---------------------------------------------------------------------------
class SimpleStepContext {
    execution;
    state;
    stateMachine;
    task;
    map;
    constructor() {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
    getInput() {
        throw new Error(RUNTIME_ERROR_MESSAGE);
    }
}
exports.SimpleStepContext = SimpleStepContext;
// ---------------------------------------------------------------------------
// 7. StepException + predefined ASL error subclasses
// ---------------------------------------------------------------------------
class StepException extends Error {
}
exports.StepException = StepException;
// Predefined ASL errors (States Language Appendix A)
class TimeoutError extends StepException {
}
exports.TimeoutError = TimeoutError;
class TaskFailedError extends StepException {
}
exports.TaskFailedError = TaskFailedError;
class PermissionsError extends StepException {
}
exports.PermissionsError = PermissionsError;
class HeartbeatTimeoutError extends StepException {
}
exports.HeartbeatTimeoutError = HeartbeatTimeoutError;
class BranchFailedError extends StepException {
}
exports.BranchFailedError = BranchFailedError;
class NoChoiceMatchedError extends StepException {
}
exports.NoChoiceMatchedError = NoChoiceMatchedError;
class IntrinsicFailureError extends StepException {
}
exports.IntrinsicFailureError = IntrinsicFailureError;
class ResultPathMatchFailureError extends StepException {
}
exports.ResultPathMatchFailureError = ResultPathMatchFailureError;
class ParameterPathFailureError extends StepException {
}
exports.ParameterPathFailureError = ParameterPathFailureError;
class ItemReaderFailedError extends StepException {
}
exports.ItemReaderFailedError = ItemReaderFailedError;
class ResultWriterFailedError extends StepException {
}
exports.ResultWriterFailedError = ResultWriterFailedError;
class ExceedToleratedFailureError extends StepException {
}
exports.ExceedToleratedFailureError = ExceedToleratedFailureError;
/**
 * Maps built-in error class names to ASL error strings.
 * Custom StepException subclasses not in this map use their class name directly.
 */
exports.STEP_ERROR_NAMES = {
    StepException: 'States.ALL',
    TimeoutError: 'States.Timeout',
    TaskFailedError: 'States.TaskFailed',
    PermissionsError: 'States.Permissions',
    HeartbeatTimeoutError: 'States.HeartbeatTimeout',
    BranchFailedError: 'States.BranchFailed',
    NoChoiceMatchedError: 'States.NoChoiceMatched',
    IntrinsicFailureError: 'States.IntrinsicFailure',
    ResultPathMatchFailureError: 'States.ResultPathMatchFailure',
    ParameterPathFailureError: 'States.ParameterPathFailure',
    ItemReaderFailedError: 'States.ItemReaderFailed',
    ResultWriterFailedError: 'States.ResultWriterFailed',
    ExceedToleratedFailureError: 'States.ExceedToleratedFailureThreshold',
};
// ---------------------------------------------------------------------------
// 8. stepFunction decorator
// ---------------------------------------------------------------------------
function stepFunction(_target, _propertyKey, descriptor) {
    return descriptor;
}
//# sourceMappingURL=index.js.map