Skip to content
Open
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 @@ -10,6 +10,7 @@ export type IOdspAudience = IServiceAudience<OdspMember>;
// @beta
export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IFluidContainer<TContainerSchema> {
attach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
}

// @beta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type IOdspAudience = IServiceAudience<OdspMember>;
// @beta
export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IFluidContainer<TContainerSchema> {
attach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
}

// @beta
Expand Down
7 changes: 7 additions & 0 deletions packages/service-clients/odsp-client/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import type {
IConfigProviderBase,
IFluidHandle,
ITelemetryBaseLogger,
} from "@fluidframework/core-interfaces";
import type {
Expand Down Expand Up @@ -97,6 +98,12 @@ export interface IOdspFluidContainer<
* @returns A promise which resolves when the attach is complete, with the string identifier of the container.
*/
attach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;

/**
* Upload a blob of data.
* @param blob - The blob to upload to the ODSP service.
*/
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/service-clients/odsp-client/src/odspClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type { ContainerAttachProps, ContainerSchema } from "@fluidframework/flui
import {
createDOProviderContainerRuntimeFactory,
createFluidContainer,
isInternalFluidContainer,
} from "@fluidframework/fluid-static/internal";
import {
OdspDocumentServiceFactory,
Expand Down Expand Up @@ -155,6 +156,9 @@ export class OdspClient {
const fluidContainer = await createFluidContainer<T>({
container,
});
if (!isInternalFluidContainer(fluidContainer)) {
throw new Error("Fluid container is not internal");
}
const services = await this.getContainerServices(container);
return { container: fluidContainer, services };
}
Expand Down Expand Up @@ -227,6 +231,9 @@ export class OdspClient {
return resolvedUrl.itemId;
};
const fluidContainer = await createFluidContainer<T>({ container });
if (!isInternalFluidContainer(fluidContainer)) {
throw new Error("Fluid container is not internal");
}
fluidContainer.attach = attach;
return fluidContainer;
}
Expand Down
Loading