Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legacy tags to the added apis for creating and loading container #23301

Merged
merged 1 commit into from
Dec 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ export interface IContainerLoadMode {
opsBeforeReturn?: undefined | "cached" | "all";
}

// @alpha
export type IContainerPolicies = {
maxClientLeaveWaitTime?: number;
};

// @public
export type ICriticalContainerError = IErrorBase_2;

Expand Down
1 change: 1 addition & 0 deletions packages/common/container-definitions/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ export type ILoaderOptions = {

/**
* Policies to have various behaviors during container create and load.
* @legacy
* @alpha
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export enum ConnectionState {
EstablishingConnection = 3
}

// @alpha
export function createDetachedContainer(createDetachedContainerProps: ICreateDetachedContainerProps): Promise<IContainer>;

// @alpha (undocumented)
export interface IBaseProtocolHandler {
// (undocumented)
Expand All @@ -35,6 +38,25 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
}

// @alpha
export interface ICreateAndLoadContainerProps {
readonly allowReconnect?: boolean | undefined;
readonly clientDetailsOverride?: IClientDetails | undefined;
readonly codeLoader: ICodeDetailsLoader_2;
readonly configProvider?: IConfigProviderBase | undefined;
readonly documentServiceFactory: IDocumentServiceFactory;
readonly logger?: ITelemetryBaseLogger | undefined;
readonly options?: IContainerPolicies | undefined;
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;
readonly scope?: FluidObject | undefined;
readonly urlResolver: IUrlResolver;
}

// @alpha
export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {
readonly codeDetails: IFluidCodeDetails;
}

// @alpha @deprecated
export type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
size: number;
Expand Down Expand Up @@ -80,6 +102,12 @@ export interface ILoaderServices {
readonly urlResolver: IUrlResolver;
}

// @alpha
export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {
readonly pendingLocalState?: string | undefined;
readonly request: IRequest;
}

// @alpha
export interface IParsedUrl {
id: string;
Expand All @@ -106,6 +134,11 @@ export interface IQuorumSnapshot {
values: QuorumProposalsSnapshot["values"];
}

// @alpha
export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {
readonly serializedState: string;
}

// @alpha (undocumented)
export interface IScribeProtocolState {
// (undocumented)
Expand Down Expand Up @@ -139,6 +172,9 @@ export class Loader implements IHostLoader {
readonly services: ILoaderServices;
}

// @alpha
export function loadExistingContainer(loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>;

// @alpha
export type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;

Expand All @@ -151,6 +187,9 @@ export type QuorumProposalsSnapshot = {
values: [string, ICommittedProposal][];
};

// @alpha
export function rehydrateDetachedContainer(rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>;

// @alpha
export function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ProtocolHandlerBuilder } from "./protocol.js";

/**
* Properties necessary for creating and loading a container.
* @legacy
* @alpha
*/
export interface ICreateAndLoadContainerProps {
Expand Down Expand Up @@ -88,6 +89,7 @@ export interface ICreateAndLoadContainerProps {

/**
* Props used to load a container.
* @legacy
* @alpha
*/
export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {
Expand All @@ -104,6 +106,7 @@ export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProp

/**
* Props used to create a detached container.
* @legacy
* @alpha
*/
export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {
Expand All @@ -115,6 +118,7 @@ export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerPr

/**
* Props used to rehydrate a detached container.
* @legacy
* @alpha
*/
export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {
Expand All @@ -128,6 +132,7 @@ export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContaine
* Creates a new container using the specified code details but in an unattached state. While unattached, all
* updates will only be local until the user explicitly attaches the container to a service provider.
* @param createDetachedContainerProps - Services and properties necessary for creating detached container.
* @legacy
* @alpha
*/
export async function createDetachedContainer(
Expand All @@ -144,6 +149,7 @@ export async function createDetachedContainer(
* Creates a new container using the specified snapshot but in an unattached state. While unattached, all
* updates will only be local until the user explicitly attaches the container to a service provider.
* @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.
* @legacy
* @alpha
*/
export async function rehydrateDetachedContainer(
Expand All @@ -162,6 +168,7 @@ export async function rehydrateDetachedContainer(
/**
* Loads a container with an existing snapshot from the service.
* @param loadExistingContainerProps - Services and properties necessary for loading an existing container.
* @legacy
* @alpha
*/
export async function loadExistingContainer(
Expand Down
Loading