Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"azureFunctions.projectLanguage": "TypeScript",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune"
}
"azureFunctions.preDeployTask": "npm prune",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "test/**/*.ts"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"validate:samples": "npm run build && npm --prefix samples install && npm run build:samples",
"build:nolint": "npm run clean && npm run stripInternalDocs && echo Done",
"stripInternalDocs": "tsc --pretty -p tsconfig.nocomments",
"test": "npm run validate:samples && npm run build && mocha --recursive ./lib/test/**/*-spec.js",
"test": "npm run build && mocha --recursive ./lib/test/**/*-spec.js",
"test:nolint": "npm run build:nolint && mocha --recursive ./lib/test/**/*-spec.js",
"watch": "tsc --watch",
"watch:test": "npm run test -- --watch",
Expand Down Expand Up @@ -58,7 +58,7 @@
"@types/chai-string": "~1.4.1",
"@types/commander": "~2.3.31",
"@types/debug": "0.0.29",
"@types/mocha": "~7.0.2",
"@types/mocha": "^7.0.2",
"@types/nock": "^9.3.0",
"@types/rimraf": "0.0.28",
"@types/sinon": "~5.0.5",
Expand Down
4 changes: 4 additions & 0 deletions src/actions/actiontype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ export enum ActionType {
WaitForExternalEvent = 6,
CallEntity = 7,
CallHttp = 8,
// ActionType 9 and 10 correspond to SignalEntity and ScheduledSignalEntity
// Those two are not supported yet.
WhenAny = 11,
WhenAll = 12,
}
2 changes: 1 addition & 1 deletion src/actions/createtimeraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActionType, IAction } from "../classes";
export class CreateTimerAction implements IAction {
public readonly actionType: ActionType = ActionType.CreateTimer;

constructor(public readonly fireAt: Date, public isCanceled: boolean = false) {
constructor(public readonly fireAt: Date, public isCancelled: boolean = false) {
if (!isDate(fireAt)) {
throw new TypeError(`fireAt: Expected valid Date object but got ${fireAt}`);
}
Expand Down
12 changes: 12 additions & 0 deletions src/actions/whenallaction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ActionType, IAction } from "../classes";
import { DFTask } from "../task";

/** @hidden */
export class WhenAllAction implements IAction {
public readonly actionType: ActionType = ActionType.WhenAll;
public readonly compoundActions: IAction[];

constructor(tasks: DFTask[]) {
this.compoundActions = tasks.map((t) => t.actionObj);
}
}
12 changes: 12 additions & 0 deletions src/actions/whenanyaction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ActionType, IAction } from "../classes";
import { DFTask } from "../task";

/** @hidden */
export class WhenAnyAction implements IAction {
public readonly actionType: ActionType = ActionType.WhenAny;
public readonly compoundActions: IAction[];

constructor(tasks: DFTask[]) {
this.compoundActions = tasks.map((t) => t.actionObj);
}
}
2 changes: 1 addition & 1 deletion src/aggregatederror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const separator = "-----------------------------------";

/**
* A specfic error thrown when context.df.Task.all() fails. Its message
* A specific error thrown when context.df.Task.all() fails. Its message
* contains an aggregation of all the exceptions that failed. It should follow the
* below format:
*
Expand Down
7 changes: 0 additions & 7 deletions src/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ export { TaskScheduledEvent } from "./history/taskscheduledevent";
export { TimerCreatedEvent } from "./history/timercreatedevent";
export { TimerFiredEvent } from "./history/timerfiredevent";

export { ITaskMethods } from "./tasks/itaskmethods";
export { Task } from "./tasks/task";
export { TaskFactory } from "./tasks/taskfactory";
export { TaskFilter } from "./tasks/taskfilter";
export { TaskSet } from "./tasks/taskset";
export { TimerTask } from "./tasks/timertask";

export { OrchestratorState } from "./orchestratorstate";
export { IOrchestratorState } from "./iorchestratorstate";

Expand Down
20 changes: 18 additions & 2 deletions src/durableorchestrationbindinginfo.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import { HistoryEvent } from "./classes";
import { LatestReplaySchema, ReplaySchema } from "./replaySchema";

/** @hidden */
export class DurableOrchestrationBindingInfo {
public readonly upperSchemaVersion: ReplaySchema;

constructor(
public readonly history: HistoryEvent[] = [],
public readonly input?: unknown,
public readonly instanceId: string = "",
public readonly isReplaying: boolean = false,
public readonly parentInstanceId?: string // TODO: Implement entity locking // public readonly contextLocks?: EntityId[],
) {}
public readonly parentInstanceId?: string,
upperSchemaVersion = 0 // TODO: Implement entity locking // public readonly contextLocks?: EntityId[],
) {
// It is assumed that the extension supports all schemas in range [0, upperSchemaVersion].
// Similarly, it is assumed that this SDK supports all schemas in range [0, LatestReplaySchema].

// Therefore, if the extension supplies a upperSchemaVersion included in our ReplaySchema enum, we use it.
// But if the extension supplies an upperSchemaVersion not included in our ReplaySchema enum, then we
// assume that upperSchemaVersion is larger than LatestReplaySchema and therefore use LatestReplaySchema instead.
if (Object.values(ReplaySchema).includes(upperSchemaVersion)) {
this.upperSchemaVersion = upperSchemaVersion;
} else {
this.upperSchemaVersion = LatestReplaySchema;
}
}
}
Loading