Skip to content
1 change: 1 addition & 0 deletions src/actions/iaction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ActionType } from "../classes";

/** @hidden */
export interface IAction {
actionType: ActionType;
}
1 change: 1 addition & 0 deletions src/aggregatederror.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @hidden */
const separator = "-----------------------------------";

/**
Expand Down
7 changes: 7 additions & 0 deletions src/durableorchestrationclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import { HttpRequest } from "@azure/functions";
import axios, { AxiosInstance, AxiosResponse } from "axios";
/** @hidden */
import cloneDeep = require("lodash/cloneDeep");
/** @hidden */
import process = require("process");
/** @hidden */
import url = require("url");
import { isURL } from "validator";
import { Constants, DurableOrchestrationStatus, EntityId, EntityStateResponse,
Expand All @@ -13,6 +16,7 @@ import { Constants, DurableOrchestrationStatus, EntityId, EntityStateResponse,
} from "./classes";
import { WebhookUtils } from "./webhookutils";

/** @hidden */
const URL = url.URL;

/**
Expand Down Expand Up @@ -41,6 +45,7 @@ export function getClient(context: unknown): DurableOrchestrationClient {
return new DurableOrchestrationClient(clientData);
}

/** @hidden */
function getClientData(context: IOrchestrationFunctionContext): OrchestrationClientInputData {
if (context.bindings) {
const matchingInstances = Object.keys(context.bindings)
Expand All @@ -55,6 +60,7 @@ function getClientData(context: IOrchestrationFunctionContext): OrchestrationCli
throw new Error("An orchestration client function must have an orchestrationClient input binding. Check your function.json definition.");
}

/** @hidden */
function correctClientData(clientData: OrchestrationClientInputData): OrchestrationClientInputData {
const returnValue = cloneDeep(clientData);

Expand All @@ -64,6 +70,7 @@ function correctClientData(clientData: OrchestrationClientInputData): Orchestrat
return returnValue;
}

/** @hidden */
function correctUrls(obj: { [key: string]: string }): { [key: string]: string } {
const returnValue = cloneDeep(obj);

Expand Down
4 changes: 3 additions & 1 deletion src/durableorchestrationcontext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export class DurableOrchestrationContext {
public currentUtcDateTime: Date;

/**
*
* Just an entry point to reference the methods in [[ITaskMethods]].
* Methods to handle collections of pending actions represented by [[Task]]
* instances. For use in parallelization operations.
*/
public Task: ITaskMethods;

Expand Down
1 change: 1 addition & 0 deletions src/entities/durablelock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @hidden
* For use with locking operations.
* TODO: improve this
*/
Expand Down
1 change: 1 addition & 0 deletions src/entities/lockstate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EntityId } from "../classes";

/**
* @hidden
* Returned by [DurableOrchestrationContext].[isLocked] and
* [DurableEntityContext].[isLocked].
*/
Expand Down
1 change: 1 addition & 0 deletions src/entities/signal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EntityId } from "../classes";

/** @hidden */
export class Signal {
constructor(
public readonly target: EntityId,
Expand Down
2 changes: 2 additions & 0 deletions src/guidmanager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as crypto from "crypto";
/** @hidden */
import uuidv5 = require("uuid/v5");
import { Utils } from "./classes";

Expand All @@ -25,6 +26,7 @@ export class GuidManager {
}
}

/** @hidden */
enum DeterministicGuidVersion {
V3 = 0,
V5 = 1,
Expand Down
3 changes: 2 additions & 1 deletion src/orchestrationfailureerror.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { OrchestratorState } from "./classes";

/** @hidden */
const outOfProcDataLabel = "\n\n$OutOfProcData$:";

/**
* @hidden
* A wrapper for all errors thrown within an orchestrator function. This exception will embed
* the orchestrator state in a way that the C# extension knows how to read so that it can replay the
* actions scheduled before throwing an exception. This prevents non-determinism errors in Durable Task.
Expand Down
9 changes: 9 additions & 0 deletions src/tasks/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { TaskBase } from "./taskinterfaces";
* [[DurableOrchestrationContext]] operation is not called with `yield`. They
* are useful for parallelization and timeout operations in conjunction with
* Task.all and Task.any.
*
* We discourage the usage of `instanceof`-style guards on this type,
* as it is subject to change in the future.
*
* @example Wait for all parallel operations to complete
* ```javascript
Expand All @@ -35,6 +38,7 @@ import { TaskBase } from "./taskinterfaces";
*/
export class Task implements TaskBase {
/**
* @hidden
* Used to keep track of how many times the task has been yielded to avoid
* scheduling the internal action multiple times _Internal use only._
*/
Expand All @@ -52,6 +56,7 @@ export class Task implements TaskBase {
*/
public readonly isFaulted: boolean,
/**
* @hidden
* The scheduled action represented by the task. _Internal use only._
*/
public readonly action: IAction,
Expand All @@ -60,10 +65,12 @@ export class Task implements TaskBase {
*/
public readonly result?: unknown,
/**
* @hidden
* The timestamp of the task.
*/
public readonly timestamp?: Date,
/**
* @hidden
* The ID number of the task. _Internal use only._
*/
public readonly id?: number,
Expand All @@ -75,12 +82,14 @@ export class Task implements TaskBase {
public readonly exception?: Error | undefined,

/**
* @hidden
* The index in the history state where the task was marked completed. _Internal use only._
*/
public readonly completionIndex?: number,
) { }

/**
* @hidden
* _Internal use only._
*/
public yieldNewActions(): IAction[] {
Expand Down
1 change: 1 addition & 0 deletions src/tasks/taskfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TaskBase} from "./taskinterfaces";
import { TaskSet } from "./taskset";
import { TimerTask } from "./timertask";

/** @hidden */
export class TaskFactory {
public static UncompletedTask(action: IAction): Task {
return new Task(false, false, action);
Expand Down
1 change: 1 addition & 0 deletions src/tasks/taskfilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Task } from "./task";
import { CompletedTask, FailedTask, SuccessfulTask, TaskBase, UncompletedTask } from "./taskinterfaces";
import { TaskSet } from "./taskset";

/** @hidden */
export class TaskFilter {
public static CompareFinishedTime(taskA: CompletedTask, taskB: CompletedTask) {
if (taskA.completionIndex > taskB.completionIndex) { return 1; }
Expand Down
5 changes: 5 additions & 0 deletions src/tasks/taskinterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import { IAction } from "../classes";

// Base interfaces
/** @hidden */
export interface TaskBase {
readonly isCompleted: boolean;
readonly isFaulted: boolean;
yieldNewActions(): IAction[];
}

/** @hidden */
export interface UncompletedTask extends TaskBase {
readonly isCompleted: false;
readonly isFaulted: false;
}

/** @hidden */
export interface CompletedTask extends TaskBase {
readonly completionIndex: number;
readonly isCompleted: true;
readonly result: unknown | undefined;
}

/** @hidden */
export interface SuccessfulTask extends CompletedTask {
readonly isFaulted: false;
readonly result: unknown;
readonly exception: undefined;
}

/** @hidden */
export interface FailedTask extends CompletedTask {
readonly isFaulted: true;
readonly exception: Error;
Expand Down
1 change: 1 addition & 0 deletions src/tasks/timertask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class TimerTask extends Task {
constructor(
isCompleted: boolean,
/**
* @hidden
* The scheduled action represented by the task. _Internal use only._
*/
public readonly action: CreateTimerAction,
Expand Down