@temporalio/client
Version:
Temporal.io SDK Client sub-package
96 lines (95 loc) • 3.51 kB
TypeScript
import { temporal } from '@temporalio/proto';
/**
* Operations that can be passed to {@link TaskQueueClient.updateBuildIdCompatibility}.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export type BuildIdOperation = AddNewIdInNewDefaultSet | AddNewCompatibleVersion | PromoteSetByBuildId | PromoteBuildIdWithinSet | MergeSets;
/**
* Adds a new Build Id into a new set, which will be used as the default set for
* the queue. This means all new workflows will start on this Build Id.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface AddNewIdInNewDefaultSet {
operation: 'addNewIdInNewDefaultSet';
buildId: string;
}
/**
* Adds a new Build Id into an existing compatible set. The newly added ID becomes
* the default for that compatible set, and thus new workflow tasks for workflows which have been
* executing on workers in that set will now start on this new Build Id.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface AddNewCompatibleVersion {
operation: 'addNewCompatibleVersion';
buildId: string;
existingCompatibleBuildId: string;
promoteSet?: boolean;
}
/**
* Promotes a set of compatible Build Ids to become the current
* default set for the task queue. Any Build Id in the set may be used to
* target it.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface PromoteSetByBuildId {
operation: 'promoteSetByBuildId';
buildId: string;
}
/**
* Promotes a Build Id within an existing set to become the default ID for that
* set.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface PromoteBuildIdWithinSet {
operation: 'promoteBuildIdWithinSet';
buildId: string;
}
/**
* Merges two sets into one set, thus declaring all the Build Ids in both as
* compatible with one another. The default of the primary set is maintained as
* the merged set's overall default.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface MergeSets {
operation: 'mergeSets';
primaryBuildId: string;
secondaryBuildId: string;
}
/**
* Represents the sets of compatible Build Id versions associated with some
* Task Queue, as fetched by {@link TaskQueueClient.getBuildIdCompatability}.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface WorkerBuildIdVersionSets {
/**
* All version sets that were fetched for this task queue.
*/
readonly versionSets: BuildIdVersionSet[];
/**
* Returns the default set of compatible Build Ids for the task queue these sets are
* associated with.
*/
defaultSet: BuildIdVersionSet;
/**
* Returns the overall default Build Id for the task queue these sets are
* associated with.
*/
defaultBuildId: string;
}
/**
* Represents one set of compatible Build Ids.
*
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
*/
export interface BuildIdVersionSet {
readonly buildIds: string[];
readonly default: string;
}
export declare function versionSetsFromProto(resp: temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse): WorkerBuildIdVersionSets;