diff --git a/.changeset/wicked-eagles-search.md b/.changeset/wicked-eagles-search.md new file mode 100644 index 000000000000..199a7a34ec31 --- /dev/null +++ b/.changeset/wicked-eagles-search.md @@ -0,0 +1,12 @@ +--- +"@fluidframework/odsp-driver": minor +"__section": deprecation +--- + +The containerPackageInfo parameter in createOdspCreateContainerRequest() is now deprecated + +The `containerPackageInfo` parameter in `createOdspCreateContainerRequest()` is now deprecated and will be removed in version 2.40.0. + +The name of the containerPackage can no longer be sent through the request. Instead, it can be added in the constructor of `OdspDriverUrlResolverForShareLink`. + +See [issue #23882](https://github.com/microsoft/FluidFramework/issues/23882) for more details. diff --git a/examples/utils/webpack-fluid-loader/src/odspUrlResolver.ts b/examples/utils/webpack-fluid-loader/src/odspUrlResolver.ts index c0c11f372d81..ba58cbb7120d 100644 --- a/examples/utils/webpack-fluid-loader/src/odspUrlResolver.ts +++ b/examples/utils/webpack-fluid-loader/src/odspUrlResolver.ts @@ -11,6 +11,8 @@ import { } from "@fluidframework/odsp-doclib-utils/internal"; import { OdspDriverUrlResolver, + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated createOdspCreateContainerRequest, createOdspUrl, } from "@fluidframework/odsp-driver/internal"; @@ -75,6 +77,8 @@ export class OdspUrlResolver implements IUrlResolver { this.authRequestInfo, false, ); + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated return createOdspCreateContainerRequest( `https://${this.server}`, driveId, diff --git a/packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md b/packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md index 272dd95f8649..327047e0953f 100644 --- a/packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md +++ b/packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md @@ -11,7 +11,10 @@ export function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined; export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array | string): IDocumentServiceFactory; // @alpha -export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind, containerPackageInfo?: IContainerPackageInfo | undefined): IRequest; +export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind): IRequest; + +// @alpha @deprecated +export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType: ISharingLinkKind | undefined, containerPackageInfo: IContainerPackageInfo | undefined): IRequest; // @alpha export function createOdspUrl(l: OdspFluidDataStoreLocator): string; diff --git a/packages/drivers/odsp-driver/src/createOdspCreateContainerRequest.ts b/packages/drivers/odsp-driver/src/createOdspCreateContainerRequest.ts index f1bf103e2856..14da3852a215 100644 --- a/packages/drivers/odsp-driver/src/createOdspCreateContainerRequest.ts +++ b/packages/drivers/odsp-driver/src/createOdspCreateContainerRequest.ts @@ -20,7 +20,51 @@ import { buildOdspShareLinkReqParams, getContainerPackageName } from "./odspUtil * @param fileName - name of the new file to be created * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink - * @param containerPackageInfo - container package information which will be used to extract the container package name. + * @legacy + * @alpha + */ +export function createOdspCreateContainerRequest( + siteUrl: string, + driveId: string, + filePath: string, + fileName: string, + createShareLinkType?: ISharingLinkKind, +): IRequest; + +/** + * Create the request object with url and headers for creating a new file on OneDrive Sharepoint + * @param siteUrl - Base url for OneDrive + * @param driveId - drive identifier + * @param filePath - path where file needs to be created + * @param fileName - name of the new file to be created + * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes + * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink + * @param containerPackageInfo - **Deprecated Parameter** - container package information which will be used to extract the container package name. + * If not given that means that the container package does not have a name. + * @legacy + * @alpha + * @deprecated To be removed in 2.40 + * Add containerPackageInfo to the OdspDriverUrlResolverForShareLink constructor instead; see https://github.com/microsoft/FluidFramework/issues/23882 for more details. + * Deprecating overloaded function to remove containerPackageInfo + */ +export function createOdspCreateContainerRequest( + siteUrl: string, + driveId: string, + filePath: string, + fileName: string, + createShareLinkType: ISharingLinkKind | undefined, + containerPackageInfo: IContainerPackageInfo | undefined, +): IRequest; + +/** + * Create the request object with url and headers for creating a new file on OneDrive Sharepoint + * @param siteUrl - Base url for OneDrive + * @param driveId - drive identifier + * @param filePath - path where file needs to be created + * @param fileName - name of the new file to be created + * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes + * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink + * @param containerPackageInfo - **Deprecated Parameter** - container package information which will be used to extract the container package name. * If not given that means that the container package does not have a name. * @legacy * @alpha diff --git a/packages/service-clients/odsp-client/src/odspClient.ts b/packages/service-clients/odsp-client/src/odspClient.ts index 7f8435a15109..8ee74ff4f3fd 100644 --- a/packages/service-clients/odsp-client/src/odspClient.ts +++ b/packages/service-clients/odsp-client/src/odspClient.ts @@ -36,6 +36,8 @@ import { import { OdspDocumentServiceFactory, OdspDriverUrlResolver, + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated createOdspCreateContainerRequest, createOdspUrl, isOdspResolvedUrl, @@ -209,6 +211,8 @@ export class OdspClient { const attach = async ( odspProps?: ContainerAttachProps, ): Promise => { + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated const createNewRequest: IRequest = createOdspCreateContainerRequest( connection.siteUrl, connection.driveId, diff --git a/packages/test/test-drivers/src/odspDriverApi.ts b/packages/test/test-drivers/src/odspDriverApi.ts index f92997e5fd67..b1960b40bb87 100644 --- a/packages/test/test-drivers/src/odspDriverApi.ts +++ b/packages/test/test-drivers/src/odspDriverApi.ts @@ -12,6 +12,8 @@ import { import { OdspDocumentServiceFactory, OdspDriverUrlResolver, + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated createOdspCreateContainerRequest, createOdspUrl, } from "@fluidframework/odsp-driver/internal"; @@ -31,6 +33,8 @@ export const OdspDriverApi = { version: pkgVersion, OdspDocumentServiceFactory, OdspDriverUrlResolver, + // The comment will be removed up when the deprecated code is removed in AB#31049 + // eslint-disable-next-line import/no-deprecated createOdspCreateContainerRequest, createOdspUrl, // REVIEW: does this need to be back compat? };