Skip to content

Commit 42b26b7

Browse files
Deprecate containerPackageInfo parameter in createOdspCreateContainerRequest (#23919)
## Description As of PR #22849 (released in 2.23), preferred pattern to add "containerPackageName" parameter to request is via URL resolver instead of `createOdspCreateContainerRequest`'s last parameter. Tag calling `createOdspCreateContainerRequest` with that parameter as deprecated now, and then in the 2.40 release remove that form altogether. ## Future Breaking Changes See [issue 23882](#23882) for more details. ## Reviewer Guidance Please let me know if there's anything else I should be aware of or can do better, thanks! Fixes: [AB#31450](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/31450) --------- Co-authored-by: Jatin Garg <48029724+jatgarg@users.noreply.github.com>
1 parent fc69038 commit 42b26b7

File tree

6 files changed

+73
-2
lines changed

6 files changed

+73
-2
lines changed

.changeset/wicked-eagles-search.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@fluidframework/odsp-driver": minor
3+
"__section": deprecation
4+
---
5+
6+
The containerPackageInfo parameter in createOdspCreateContainerRequest() is now deprecated
7+
8+
The `containerPackageInfo` parameter in `createOdspCreateContainerRequest()` is now deprecated and will be removed in version 2.40.0.
9+
10+
The name of the containerPackage can no longer be sent through the request. Instead, it can be added in the constructor of `OdspDriverUrlResolverForShareLink`.
11+
12+
See [issue #23882](https://github.com/microsoft/FluidFramework/issues/23882) for more details.

examples/utils/webpack-fluid-loader/src/odspUrlResolver.ts

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
} from "@fluidframework/odsp-doclib-utils/internal";
1212
import {
1313
OdspDriverUrlResolver,
14+
// The comment will be removed up when the deprecated code is removed in AB#31049
15+
// eslint-disable-next-line import/no-deprecated
1416
createOdspCreateContainerRequest,
1517
createOdspUrl,
1618
} from "@fluidframework/odsp-driver/internal";
@@ -75,6 +77,8 @@ export class OdspUrlResolver implements IUrlResolver {
7577
this.authRequestInfo,
7678
false,
7779
);
80+
// The comment will be removed up when the deprecated code is removed in AB#31049
81+
// eslint-disable-next-line import/no-deprecated
7882
return createOdspCreateContainerRequest(
7983
`https://${this.server}`,
8084
driveId,

packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined;
1111
export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array | string): IDocumentServiceFactory;
1212

1313
// @alpha
14-
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind, containerPackageInfo?: IContainerPackageInfo | undefined): IRequest;
14+
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind): IRequest;
15+
16+
// @alpha @deprecated
17+
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType: ISharingLinkKind | undefined, containerPackageInfo: IContainerPackageInfo | undefined): IRequest;
1518

1619
// @alpha
1720
export function createOdspUrl(l: OdspFluidDataStoreLocator): string;

packages/drivers/odsp-driver/src/createOdspCreateContainerRequest.ts

+45-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,51 @@ import { buildOdspShareLinkReqParams, getContainerPackageName } from "./odspUtil
2020
* @param fileName - name of the new file to be created
2121
* @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes
2222
* will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink
23-
* @param containerPackageInfo - container package information which will be used to extract the container package name.
23+
* @legacy
24+
* @alpha
25+
*/
26+
export function createOdspCreateContainerRequest(
27+
siteUrl: string,
28+
driveId: string,
29+
filePath: string,
30+
fileName: string,
31+
createShareLinkType?: ISharingLinkKind,
32+
): IRequest;
33+
34+
/**
35+
* Create the request object with url and headers for creating a new file on OneDrive Sharepoint
36+
* @param siteUrl - Base url for OneDrive
37+
* @param driveId - drive identifier
38+
* @param filePath - path where file needs to be created
39+
* @param fileName - name of the new file to be created
40+
* @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes
41+
* will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink
42+
* @param containerPackageInfo - **Deprecated Parameter** - container package information which will be used to extract the container package name.
43+
* If not given that means that the container package does not have a name.
44+
* @legacy
45+
* @alpha
46+
* @deprecated To be removed in 2.40
47+
* Add containerPackageInfo to the OdspDriverUrlResolverForShareLink constructor instead; see https://github.com/microsoft/FluidFramework/issues/23882 for more details.
48+
* Deprecating overloaded function to remove containerPackageInfo
49+
*/
50+
export function createOdspCreateContainerRequest(
51+
siteUrl: string,
52+
driveId: string,
53+
filePath: string,
54+
fileName: string,
55+
createShareLinkType: ISharingLinkKind | undefined,
56+
containerPackageInfo: IContainerPackageInfo | undefined,
57+
): IRequest;
58+
59+
/**
60+
* Create the request object with url and headers for creating a new file on OneDrive Sharepoint
61+
* @param siteUrl - Base url for OneDrive
62+
* @param driveId - drive identifier
63+
* @param filePath - path where file needs to be created
64+
* @param fileName - name of the new file to be created
65+
* @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes
66+
* will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink
67+
* @param containerPackageInfo - **Deprecated Parameter** - container package information which will be used to extract the container package name.
2468
* If not given that means that the container package does not have a name.
2569
* @legacy
2670
* @alpha

packages/service-clients/odsp-client/src/odspClient.ts

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import {
3636
import {
3737
OdspDocumentServiceFactory,
3838
OdspDriverUrlResolver,
39+
// The comment will be removed up when the deprecated code is removed in AB#31049
40+
// eslint-disable-next-line import/no-deprecated
3941
createOdspCreateContainerRequest,
4042
createOdspUrl,
4143
isOdspResolvedUrl,
@@ -209,6 +211,8 @@ export class OdspClient {
209211
const attach = async (
210212
odspProps?: ContainerAttachProps<OdspContainerAttachProps>,
211213
): Promise<string> => {
214+
// The comment will be removed up when the deprecated code is removed in AB#31049
215+
// eslint-disable-next-line import/no-deprecated
212216
const createNewRequest: IRequest = createOdspCreateContainerRequest(
213217
connection.siteUrl,
214218
connection.driveId,

packages/test/test-drivers/src/odspDriverApi.ts

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
import {
1313
OdspDocumentServiceFactory,
1414
OdspDriverUrlResolver,
15+
// The comment will be removed up when the deprecated code is removed in AB#31049
16+
// eslint-disable-next-line import/no-deprecated
1517
createOdspCreateContainerRequest,
1618
createOdspUrl,
1719
} from "@fluidframework/odsp-driver/internal";
@@ -31,6 +33,8 @@ export const OdspDriverApi = {
3133
version: pkgVersion,
3234
OdspDocumentServiceFactory,
3335
OdspDriverUrlResolver,
36+
// The comment will be removed up when the deprecated code is removed in AB#31049
37+
// eslint-disable-next-line import/no-deprecated
3438
createOdspCreateContainerRequest,
3539
createOdspUrl, // REVIEW: does this need to be back compat?
3640
};

0 commit comments

Comments
 (0)