Skip to content

Remove containerPackageInfo parameter in createOdspCreateContainerRequest #24456

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions packages/dds/tree/api-report/tree.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,17 @@ export namespace JsonAsTree {
}
const // @system
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, TreeMapNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Map, unknown>, {
[Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null], any, undefined>;
[Symbol.iterator](): Iterator<[string, string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>;
} | {
readonly [x: string]: string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
readonly [x: string]: string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null;
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
// (undocumented)
export type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
// @system
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
const // @system
_APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, TreeArrayNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, {
[Symbol.iterator](): Iterator<string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null, any, undefined>;
[Symbol.iterator](): Iterator<string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null, any, undefined>;
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
// (undocumented)
export type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array
// @alpha @legacy
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind): IRequest;

// @alpha @deprecated @legacy
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType: ISharingLinkKind | undefined, containerPackageInfo: IContainerPackageInfo | undefined): IRequest;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
*/

import { IRequest } from "@fluidframework/core-interfaces";
import {
DriverHeader,
type IContainerPackageInfo,
} from "@fluidframework/driver-definitions/internal";
import { DriverHeader } from "@fluidframework/driver-definitions/internal";
import { ISharingLinkKind } from "@fluidframework/odsp-driver-definitions/internal";

import { buildOdspShareLinkReqParams, getContainerPackageName } from "./odspUtils.js";
import { buildOdspShareLinkReqParams } from "./odspUtils.js";

/**
* Create the request object with url and headers for creating a new file on OneDrive Sharepoint
Expand All @@ -29,59 +26,12 @@ export function createOdspCreateContainerRequest(
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
*/
export function createOdspCreateContainerRequest(
siteUrl: string,
driveId: string,
filePath: string,
fileName: string,
createShareLinkType?: ISharingLinkKind,
containerPackageInfo?: IContainerPackageInfo | undefined,
): IRequest {
const shareLinkRequestParams = buildOdspShareLinkReqParams(createShareLinkType);
const createNewRequest: IRequest = {
url: `${siteUrl}?driveId=${encodeURIComponent(driveId)}&path=${encodeURIComponent(
filePath,
)}${containerPackageInfo ? `&containerPackageName=${getContainerPackageName(containerPackageInfo)}` : ""}${shareLinkRequestParams ? `&${shareLinkRequestParams}` : ""}`,
)}${shareLinkRequestParams ? `&${shareLinkRequestParams}` : ""}`,
headers: {
[DriverHeader.createNew]: {
fileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,4 @@ describe("Odsp Driver Resolver", () => {
`https://placeholder/placeholder/${resolvedUrl.hashedDocumentId}/` + `${testFilePath}`;
assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
});
it("Should create request with containerPackageName and resolve it", async () => {
request = createOdspCreateContainerRequest(
siteUrl,
driveId,
filePath,
fileName,
undefined,
{ name: "testContainerPackageName" }, // Container package info variable,
);
const resolvedUrl = await resolver.resolve(request);
assert.strictEqual(
resolvedUrl.codeHint?.containerPackageName,
"testContainerPackageName",
"containerPackageName should match",
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -790,17 +790,17 @@ export namespace JsonAsTree {
}
const // @system
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, TreeMapNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Map, unknown>, {
[Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null], any, undefined>;
[Symbol.iterator](): Iterator<[string, string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>;
} | {
readonly [x: string]: string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
readonly [x: string]: string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null;
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
// (undocumented)
export type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
// @system
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
const // @system
_APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, TreeArrayNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, {
[Symbol.iterator](): Iterator<string | number | JsonObject | Array | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null, any, undefined>;
[Symbol.iterator](): Iterator<string | number | InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null, any, undefined>;
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
// (undocumented)
export type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
Expand Down
2 changes: 0 additions & 2 deletions packages/service-clients/odsp-client/src/odspClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ export class OdspClient {
const attach = async (
odspProps?: ContainerAttachProps<OdspContainerAttachProps>,
): Promise<string> => {
// 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,
Expand Down
4 changes: 0 additions & 4 deletions packages/test/test-drivers/src/odspDriverApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ 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";
Expand All @@ -33,8 +31,6 @@ 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?
};
Expand Down
Loading