Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoSign in
Socket

@fluidframework/runtime-utils

Package Overview
Dependencies
Maintainers
1
Versions
661
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluidframework/runtime-utils - npm Package Compare versions

Comparing version
2.33.0-333010
to
2.33.0
+9
-9
api-report/runtime-utils.legacy.alpha.api.md

@@ -10,9 +10,9 @@ ## Alpha API Report File for "@fluidframework/runtime-utils"

// @alpha
// @alpha @legacy
export function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
// @alpha (undocumented)
// @alpha @legacy (undocumented)
export const create404Response: (request: IRequest) => IResponse;
// @alpha
// @alpha @legacy
export abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {

@@ -37,3 +37,3 @@ // (undocumented)

// @alpha
// @alpha @legacy
export class RequestParser implements IRequest {

@@ -55,3 +55,3 @@ protected constructor(request: Readonly<IRequest>);

// @alpha (undocumented)
// @alpha @legacy (undocumented)
export abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {

@@ -68,3 +68,3 @@ hasInitialized(_runtime: T): Promise<void>;

// @alpha
// @alpha @legacy
export class SummaryTreeBuilder implements ISummaryTreeWithStats {

@@ -85,9 +85,9 @@ constructor(params?: {

// @alpha
// @alpha @legacy
export function toDeltaManagerInternal(deltaManager: IDeltaManagerErased): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
// @alpha
// @alpha @legacy
export function toFluidHandleErased<T>(handle: IFluidHandleInternal<T>): IFluidHandleErased<T>;
// @alpha
// @alpha @legacy
export function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T>;

@@ -94,0 +94,0 @@

# @fluidframework/runtime-utils
## 2.33.0
Dependency updates only.
## 2.32.0

@@ -4,0 +8,0 @@

@@ -6,3 +6,2 @@ /*!

import { IRequest, IResponse } from "@fluidframework/core-interfaces";
import { IFluidDataStoreFactory, IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions/internal";
/**

@@ -27,10 +26,2 @@ * @internal

}): IResponse;
/**
* @internal
*/
export type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
/**
* @internal
*/
export declare function createDataStoreFactory(type: string, factory: Factory | Promise<Factory>): IFluidDataStoreFactory & IFluidDataStoreRegistry;
//# sourceMappingURL=dataStoreHelpers.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,MAAM,8CAA8C,CAAC;AAWtD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0BvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAejF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,cACJ,CAAC;AAEhD;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC9B,SAAS,CAiBX;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAEvF;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GACjC,sBAAsB,GAAG,uBAAuB,CAalD"}
{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAYtE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0BvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAejF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,cACJ,CAAC;AAEhD;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC9B,SAAS,CAiBX"}

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createDataStoreFactory = exports.createResponseError = exports.create404Response = exports.responseToException = exports.exceptionToResponse = void 0;
exports.createResponseError = exports.create404Response = exports.responseToException = exports.exceptionToResponse = void 0;
const internal_1 = require("@fluidframework/core-utils/internal");

@@ -85,19 +85,2 @@ const internal_2 = require("@fluidframework/telemetry-utils/internal");

exports.createResponseError = createResponseError;
/**
* @internal
*/
function createDataStoreFactory(type, factory) {
return {
type,
get IFluidDataStoreFactory() {
return this;
},
get IFluidDataStoreRegistry() {
return this;
},
instantiateDataStore: async (context, existing) => (await factory).instantiateDataStore(context, existing),
get: async (name) => (await factory).IFluidDataStoreRegistry?.get(name),
};
}
exports.createDataStoreFactory = createDataStoreFactory;
//# sourceMappingURL=dataStoreHelpers.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"dataStoreHelpers.js","source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EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC;KAC/E,CAAC;AACH,CAAC;AAhBD,wDAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: { [key: string]: any };\n}\n\n/**\n * @internal\n */\nexport function exceptionToResponse(err: any): IResponse {\n\tconst status = 500;\n\tif (err !== null && typeof err === \"object\" && err.errorFromRequestFluidObject === true) {\n\t\tconst responseErr: IResponseException = err;\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: responseErr.code,\n\t\t\tvalue: responseErr.message,\n\t\t\tget stack() {\n\t\t\t\treturn responseErr.stack;\n\t\t\t},\n\t\t\theaders: responseErr.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${err}`,\n\t\tget stack() {\n\t\t\treturn (err?.stack as string | undefined) ?? errWithStack.stack;\n\t\t},\n\t};\n}\n\n/**\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\tconst message = response.value;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport const create404Response = (request: IRequest) =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: { [key: string]: any },\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n\n/**\n * @internal\n */\nexport type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;\n\n/**\n * @internal\n */\nexport function createDataStoreFactory(\n\ttype: string,\n\tfactory: Factory | Promise<Factory>,\n): IFluidDataStoreFactory & IFluidDataStoreRegistry {\n\treturn {\n\t\ttype,\n\t\tget IFluidDataStoreFactory() {\n\t\t\treturn this;\n\t\t},\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn this;\n\t\t},\n\t\tinstantiateDataStore: async (context, existing) =>\n\t\t\t(await factory).instantiateDataStore(context, existing),\n\t\tget: async (name: string) => (await factory).IFluidDataStoreRegistry?.get(name),\n\t};\n}\n"]}
{"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,uEAAkF;AAUlF;;GAEG;AACH,SAAgB,mBAAmB,CAAC,GAAQ;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EAAE,EAAE,CACtD,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AADnC,QAAA,iBAAiB,qBACkB;AAEhD;;GAEG;AACH,SAAgB,mBAAmB,CAClC,MAAc,EACd,KAAa,EACb,OAAiB,EACjB,OAAgC;IAEhC,IAAA,iBAAM,EAAC,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACrF,wEAAwE;IACxE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,0GAA0G;IAC1G,MAAM,YAAY,GAAG,IAAA,iCAAsB,GAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,UAAU,EAAE;QACnE,IAAI,KAAK;YACR,OAAO,YAAY,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,OAAO;KACP,CAAC;AACH,CAAC;AAtBD,kDAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: { [key: string]: any };\n}\n\n/**\n * @internal\n */\nexport function exceptionToResponse(err: any): IResponse {\n\tconst status = 500;\n\tif (err !== null && typeof err === \"object\" && err.errorFromRequestFluidObject === true) {\n\t\tconst responseErr: IResponseException = err;\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: responseErr.code,\n\t\t\tvalue: responseErr.message,\n\t\t\tget stack() {\n\t\t\t\treturn responseErr.stack;\n\t\t\t},\n\t\t\theaders: responseErr.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${err}`,\n\t\tget stack() {\n\t\t\treturn (err?.stack as string | undefined) ?? errWithStack.stack;\n\t\t},\n\t};\n}\n\n/**\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\tconst message = response.value;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport const create404Response = (request: IRequest) =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: { [key: string]: any },\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n"]}

@@ -7,3 +7,3 @@ /*!

import { IFluidHandle, fluidHandleSymbol } from "@fluidframework/core-interfaces";
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
import type { IFluidHandleInternal, IFluidHandleInternalPayloadPending } from "@fluidframework/core-interfaces/internal";
/**

@@ -16,2 +16,12 @@ * JSON serialized form of an IFluidHandle

url: string;
/**
* The handle may have a pending payload, as determined by and resolvable by the subsystem that
* the handle relates to. For instance, the BlobManager uses this to distinguish blob handles
* which may not yet have an attached blob yet.
*
* @remarks
* Will only exist if the handle was created with a pending payload, will be omitted entirely from
* the serialized format if the handle was created with an already-shared payload.
*/
readonly payloadPending?: true;
}

@@ -24,2 +34,6 @@ /**

/**
* @internal
*/
export declare const isFluidHandleInternalPayloadPending: (fluidHandleInternal: IFluidHandleInternal) => fluidHandleInternal is IFluidHandleInternalPayloadPending<unknown>;
/**
* Encodes the given IFluidHandle into a JSON-serializable form,

@@ -26,0 +40,0 @@ * @param handle - The IFluidHandle to serialize.

@@ -1,1 +0,1 @@

{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEjC,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,GAAG,+BACV,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAK5F;AAcD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAkBnE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC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;GAEG;AACH,eAAO,MAAM,mCAAmC,wBAC1B,oBAAoB,uEAE6C,CAAC;AAExF;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAW5F;AAcD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAkBnE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,OAAO,CAI7E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAWzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACpC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC7B,kBAAkB,CAAC,CAAC,CAAC,CAEvB;AAED;;;;GAIG;AACH,8BAAsB,eAAe,CAAC,CAAC,CAAE,YAAW,oBAAoB,CAAC,CAAC,CAAC;IAC1E,SAAgB,YAAY,EAAE,MAAM,CAAC;aACrB,WAAW,IAAI,IAAI;aACnB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IACxD,kBAAyB,UAAU,EAAE,OAAO,CAAC;aAC7B,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAW,YAAY,IAAI,oBAAoB,CAE9C;IAED,IAAW,CAAC,iBAAiB,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAEtD;CACD"}

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.FluidHandleBase = exports.toFluidHandleErased = exports.toFluidHandleInternal = exports.compareFluidHandles = exports.isFluidHandle = exports.encodeHandleForSerialization = exports.isSerializedHandle = void 0;
exports.FluidHandleBase = exports.toFluidHandleErased = exports.toFluidHandleInternal = exports.compareFluidHandles = exports.isFluidHandle = exports.encodeHandleForSerialization = exports.isFluidHandleInternalPayloadPending = exports.isSerializedHandle = void 0;
const core_interfaces_1 = require("@fluidframework/core-interfaces");

@@ -17,2 +17,7 @@ /**

/**
* @internal
*/
const isFluidHandleInternalPayloadPending = (fluidHandleInternal) => "payloadPending" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;
exports.isFluidHandleInternalPayloadPending = isFluidHandleInternalPayloadPending;
/**
* Encodes the given IFluidHandle into a JSON-serializable form,

@@ -25,6 +30,12 @@ * @param handle - The IFluidHandle to serialize.

function encodeHandleForSerialization(handle) {
return {
type: "__fluid_handle__",
url: handle.absolutePath,
};
return (0, exports.isFluidHandleInternalPayloadPending)(handle)
? {
type: "__fluid_handle__",
url: handle.absolutePath,
payloadPending: true,
}
: {
type: "__fluid_handle__",
url: handle.absolutePath,
};
}

@@ -31,0 +42,0 @@ exports.encodeHandleForSerialization = encodeHandleForSerialization;

@@ -1,1 +0,1 @@

{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAkF;AAelF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA8B,EAAE,CAC5E,KAAK,EAAE,IAAI,KAAK,kBAAkB,CAAC;AADvB,QAAA,kBAAkB,sBACK;AAEpC;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,MAA4B;IACxE,OAAO;QACN,IAAI,EAAE,kBAAkB;QACxB,GAAG,EAAE,MAAM,CAAC,YAAY;KACxB,CAAC;AACH,CAAC;AALD,oEAKC;AAED;;;;;;;;;GASG;AACH,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC3C,sEAAsE;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,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CAAC;AAJD,kDAIC;AAED;;;;GAIG;AACH,MAAsB,eAAe;IAOpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,mCAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD;AAjBD,0CAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn {\n\t\ttype: \"__fluid_handle__\",\n\t\turl: handle.absolutePath,\n\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAkF;AA6BlF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA8B,EAAE,CAC5E,KAAK,EAAE,IAAI,KAAK,kBAAkB,CAAC;AADvB,QAAA,kBAAkB,sBACK;AAEpC;;GAEG;AACI,MAAM,mCAAmC,GAAG,CAClD,mBAAyC,EACmB,EAAE,CAC9D,gBAAgB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,KAAK,IAAI,CAAC;AAH3E,QAAA,mCAAmC,uCAGwC;AAExF;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,MAA4B;IACxE,OAAO,IAAA,2CAAmC,EAAC,MAAM,CAAC;QACjD,CAAC,CAAC;YACA,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,MAAM,CAAC,YAA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AAE,CAAC;QACzF,IAAI,4BAA4B,IAAI,8BAAY,IAAI,MAAM,EAAE,CAAC;YAC5D,OAAO,MAAM,CAAC,8BAAY,CAA4B,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAED,kGAAkG;IAClG,6FAA6F;IAC7F,OAAO,MAAM,CAAC,mCAAiB,CAAuC,CAAC;AACxE,CAAC;AAXD,sDAWC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,MAA+B;IAE/B,OAAO,MAA0C,CAAC;AACnD,CAAC;AAJD,kDAIC;AAED;;;;GAIG;AACH,MAAsB,eAAe;IAOpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,mCAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD;AAjBD,0CAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}

@@ -6,4 +6,4 @@ /*!

export { generateHandleContextPath } from "./dataStoreHandleContextUtils.js";
export { create404Response, createDataStoreFactory, createResponseError, exceptionToResponse, Factory, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, ISerializedHandle, isSerializedHandle, isFluidHandle, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { create404Response, createResponseError, exceptionToResponse, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, ISerializedHandle, isSerializedHandle, isFluidHandle, isFluidHandleInternalPayloadPending, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { ObjectStoragePartition } from "./objectstoragepartition.js";

@@ -10,0 +10,0 @@ export { getNormalizedObjectStoragePathParts, listBlobsAtTreePath, } from "./objectstorageutils.js";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,mBAAmB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,m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AE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC"}

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.toDeltaManagerInternal = exports.toDeltaManagerErased = exports.isSnapshotFetchRequiredForLoadingGroupId = exports.encodeCompactIdToString = exports.seqFromTree = exports.RuntimeHeaders = exports.unpackChildNodesUsedRoutes = exports.utf8ByteLength = exports.TelemetryContext = exports.SummaryTreeBuilder = exports.processAttachMessageGCData = exports.mergeStats = exports.getBlobSize = exports.GCDataBuilder = exports.convertToSummaryTreeWithStats = exports.convertToSummaryTree = exports.convertSummaryTreeToITree = exports.convertSnapshotTreeToSummaryTree = exports.calculateStats = exports.addSummarizeResultToSummary = exports.addBlobToSummary = exports.RuntimeFactoryHelper = exports.RequestParser = exports.RemoteFluidObjectHandle = exports.listBlobsAtTreePath = exports.getNormalizedObjectStoragePathParts = exports.ObjectStoragePartition = exports.compareFluidHandles = exports.FluidHandleBase = exports.toFluidHandleInternal = exports.toFluidHandleErased = exports.isFluidHandle = exports.isSerializedHandle = exports.encodeHandleForSerialization = exports.responseToException = exports.exceptionToResponse = exports.createResponseError = exports.createDataStoreFactory = exports.create404Response = exports.generateHandleContextPath = void 0;
exports.toDeltaManagerInternal = exports.toDeltaManagerErased = exports.isSnapshotFetchRequiredForLoadingGroupId = exports.encodeCompactIdToString = exports.seqFromTree = exports.RuntimeHeaders = exports.unpackChildNodesUsedRoutes = exports.utf8ByteLength = exports.TelemetryContext = exports.SummaryTreeBuilder = exports.processAttachMessageGCData = exports.mergeStats = exports.getBlobSize = exports.GCDataBuilder = exports.convertToSummaryTreeWithStats = exports.convertToSummaryTree = exports.convertSummaryTreeToITree = exports.convertSnapshotTreeToSummaryTree = exports.calculateStats = exports.addSummarizeResultToSummary = exports.addBlobToSummary = exports.RuntimeFactoryHelper = exports.RequestParser = exports.RemoteFluidObjectHandle = exports.listBlobsAtTreePath = exports.getNormalizedObjectStoragePathParts = exports.ObjectStoragePartition = exports.compareFluidHandles = exports.FluidHandleBase = exports.toFluidHandleInternal = exports.toFluidHandleErased = exports.isFluidHandleInternalPayloadPending = exports.isFluidHandle = exports.isSerializedHandle = exports.encodeHandleForSerialization = exports.responseToException = exports.exceptionToResponse = exports.createResponseError = exports.create404Response = exports.generateHandleContextPath = void 0;
var dataStoreHandleContextUtils_js_1 = require("./dataStoreHandleContextUtils.js");

@@ -13,3 +13,2 @@ Object.defineProperty(exports, "generateHandleContextPath", { enumerable: true, get: function () { return dataStoreHandleContextUtils_js_1.generateHandleContextPath; } });

Object.defineProperty(exports, "create404Response", { enumerable: true, get: function () { return dataStoreHelpers_js_1.create404Response; } });
Object.defineProperty(exports, "createDataStoreFactory", { enumerable: true, get: function () { return dataStoreHelpers_js_1.createDataStoreFactory; } });
Object.defineProperty(exports, "createResponseError", { enumerable: true, get: function () { return dataStoreHelpers_js_1.createResponseError; } });

@@ -22,2 +21,3 @@ Object.defineProperty(exports, "exceptionToResponse", { enumerable: true, get: function () { return dataStoreHelpers_js_1.exceptionToResponse; } });

Object.defineProperty(exports, "isFluidHandle", { enumerable: true, get: function () { return handles_js_1.isFluidHandle; } });
Object.defineProperty(exports, "isFluidHandleInternalPayloadPending", { enumerable: true, get: function () { return handles_js_1.isFluidHandleInternalPayloadPending; } });
Object.defineProperty(exports, "toFluidHandleErased", { enumerable: true, get: function () { return handles_js_1.toFluidHandleErased; } });

@@ -24,0 +24,0 @@ Object.defineProperty(exports, "toFluidHandleInternal", { enumerable: true, get: function () { return handles_js_1.toFluidHandleInternal; } });

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mFAA6E;AAApE,2IAAA,yBAAyB,OAAA;AAClC,6DAO+B;AAN9B,wHAAA,iBAAiB,OAAA;AACjB,6HAAA,sBAAsB,OAAA;AACtB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AAEnB,0HAAA,mBAAmB,OAAA;AAEpB,2CASsB;AARrB,0HAAA,4BAA4B,OAAA;AAE5B,gHAAA,kBAAkB,OAAA;AAClB,2GAAA,aAAa,OAAA;AACb,iHAAA,mBAAmB,OAAA;AACnB,mHAAA,qBAAqB,OAAA;AACrB,6GAAA,eAAe,OAAA;AACf,iHAAA,mBAAmB,OAAA;AAEpB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,iEAGiC;AAFhC,4IAAA,mCAAmC,OAAA;AACnC,4HAAA,mBAAmB,OAAA;AAEpB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,qDAe2B;AAd1B,mHAAA,gBAAgB,OAAA;AAChB,8HAAA,2BAA2B,OAAA;AAC3B,iHAAA,cAAc,OAAA;AACd,mIAAA,gCAAgC,OAAA;AAChC,4HAAA,yBAAyB,OAAA;AACzB,uHAAA,oBAAoB,OAAA;AACpB,gIAAA,6BAA6B,OAAA;AAC7B,gHAAA,aAAa,OAAA;AACb,8GAAA,WAAW,OAAA;AACX,6GAAA,UAAU,OAAA;AACV,6HAAA,0BAA0B,OAAA;AAC1B,qHAAA,kBAAkB,OAAA;AAClB,mHAAA,gBAAgB,OAAA;AAChB,iHAAA,cAAc,OAAA;AAEf,6DAAmE;AAA1D,iIAAA,0BAA0B,OAAA;AACnC,uCAKoB;AAHnB,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,mHAAA,uBAAuB,OAAA;AAExB,uDAA8E;AAArE,4IAAA,wCAAwC,OAAA;AACjD,qDAG2B;AAF1B,uHAAA,oBAAoB,OAAA;AACpB,yHAAA,sBAAsB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils.js\";\nexport {\n\tcreate404Response,\n\tcreateDataStoreFactory,\n\tcreateResponseError,\n\texceptionToResponse,\n\tFactory,\n\tresponseToException,\n} from \"./dataStoreHelpers.js\";\nexport {\n\tencodeHandleForSerialization,\n\tISerializedHandle,\n\tisSerializedHandle,\n\tisFluidHandle,\n\ttoFluidHandleErased,\n\ttoFluidHandleInternal,\n\tFluidHandleBase,\n\tcompareFluidHandles,\n} from \"./handles.js\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition.js\";\nexport {\n\tgetNormalizedObjectStoragePathParts,\n\tlistBlobsAtTreePath,\n} from \"./objectstorageutils.js\";\nexport { RemoteFluidObjectHandle } from \"./remoteFluidObjectHandle.js\";\nexport { RequestParser } from \"./requestParser.js\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper.js\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tGCDataBuilder,\n\tgetBlobSize,\n\tmergeStats,\n\tprocessAttachMessageGCData,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils.js\";\nexport { unpackChildNodesUsedRoutes } from \"./unpackUsedRoutes.js\";\nexport {\n\tReadAndParseBlob,\n\tRuntimeHeaders,\n\tseqFromTree,\n\tencodeCompactIdToString,\n} from \"./utils.js\";\nexport { isSnapshotFetchRequiredForLoadingGroupId } from \"./snapshotUtils.js\";\nexport {\n\ttoDeltaManagerErased,\n\ttoDeltaManagerInternal,\n} from \"./deltaManager.js\";\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mFAA6E;AAApE,2IAAA,yBAAyB,OAAA;AAClC,6DAK+B;AAJ9B,wHAAA,iBAAiB,OAAA;AACjB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AAEpB,2CAUsB;AATrB,0HAAA,4BAA4B,OAAA;AAE5B,gHAAA,kBAAkB,OAAA;AAClB,2GAAA,aAAa,OAAA;AACb,iIAAA,mCAAmC,OAAA;AACnC,iHAAA,mBAAmB,OAAA;AACnB,mHAAA,qBAAqB,OAAA;AACrB,6GAAA,eAAe,OAAA;AACf,iHAAA,mBAAmB,OAAA;AAEpB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,iEAGiC;AAFhC,4IAAA,mCAAmC,OAAA;AACnC,4HAAA,mBAAmB,OAAA;AAEpB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,qDAe2B;AAd1B,mHAAA,gBAAgB,OAAA;AAChB,8HAAA,2BAA2B,OAAA;AAC3B,iHAAA,cAAc,OAAA;AACd,mIAAA,gCAAgC,OAAA;AAChC,4HAAA,yBAAyB,OAAA;AACzB,uHAAA,oBAAoB,OAAA;AACpB,gIAAA,6BAA6B,OAAA;AAC7B,gHAAA,aAAa,OAAA;AACb,8GAAA,WAAW,OAAA;AACX,6GAAA,UAAU,OAAA;AACV,6HAAA,0BAA0B,OAAA;AAC1B,qHAAA,kBAAkB,OAAA;AAClB,mHAAA,gBAAgB,OAAA;AAChB,iHAAA,cAAc,OAAA;AAEf,6DAAmE;AAA1D,iIAAA,0BAA0B,OAAA;AACnC,uCAKoB;AAHnB,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,mHAAA,uBAAuB,OAAA;AAExB,uDAA8E;AAArE,4IAAA,wCAAwC,OAAA;AACjD,qDAG2B;AAF1B,uHAAA,oBAAoB,OAAA;AACpB,yHAAA,sBAAsB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils.js\";\nexport {\n\tcreate404Response,\n\tcreateResponseError,\n\texceptionToResponse,\n\tresponseToException,\n} from \"./dataStoreHelpers.js\";\nexport {\n\tencodeHandleForSerialization,\n\tISerializedHandle,\n\tisSerializedHandle,\n\tisFluidHandle,\n\tisFluidHandleInternalPayloadPending,\n\ttoFluidHandleErased,\n\ttoFluidHandleInternal,\n\tFluidHandleBase,\n\tcompareFluidHandles,\n} from \"./handles.js\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition.js\";\nexport {\n\tgetNormalizedObjectStoragePathParts,\n\tlistBlobsAtTreePath,\n} from \"./objectstorageutils.js\";\nexport { RemoteFluidObjectHandle } from \"./remoteFluidObjectHandle.js\";\nexport { RequestParser } from \"./requestParser.js\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper.js\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tGCDataBuilder,\n\tgetBlobSize,\n\tmergeStats,\n\tprocessAttachMessageGCData,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils.js\";\nexport { unpackChildNodesUsedRoutes } from \"./unpackUsedRoutes.js\";\nexport {\n\tReadAndParseBlob,\n\tRuntimeHeaders,\n\tseqFromTree,\n\tencodeCompactIdToString,\n} from \"./utils.js\";\nexport { isSnapshotFetchRequiredForLoadingGroupId } from \"./snapshotUtils.js\";\nexport {\n\ttoDeltaManagerErased,\n\ttoDeltaManagerInternal,\n} from \"./deltaManager.js\";\n"]}

@@ -20,2 +20,3 @@ /*!

readonly routeContext: IFluidHandleContext;
readonly payloadPending: boolean;
readonly isAttached = true;

@@ -27,4 +28,5 @@ private objectP;

* @param routeContext - The root IFluidHandleContext that has a route to this handle.
* @param payloadPending - Whether the handle may have a pending payload that is not yet available.
*/
constructor(absolutePath: string, routeContext: IFluidHandleContext);
constructor(absolutePath: string, routeContext: IFluidHandleContext, payloadPending: boolean);
get(): Promise<FluidObject>;

@@ -31,0 +33,0 @@ attachGraph(): void;

@@ -1,1 +0,1 @@

{"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAUvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;IAVlD,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;OAIG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB;IASrC,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAkBjC,WAAW,IAAI,IAAI;IAInB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}
{"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;IAInB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}

@@ -26,7 +26,9 @@ "use strict";

* @param routeContext - The root IFluidHandleContext that has a route to this handle.
* @param payloadPending - Whether the handle may have a pending payload that is not yet available.
*/
constructor(absolutePath, routeContext) {
constructor(absolutePath, routeContext, payloadPending) {
super();
this.absolutePath = absolutePath;
this.routeContext = routeContext;
this.payloadPending = payloadPending;
this.isAttached = true;

@@ -40,3 +42,6 @@ (0, internal_1.assert)(absolutePath.startsWith("/"), 0x19d /* "Handles should always have absolute paths" */);

url: this.absolutePath,
headers: { [utils_js_1.RuntimeHeaders.viaHandle]: true },
headers: {
[utils_js_1.RuntimeHeaders.viaHandle]: true,
[utils_js_1.RuntimeHeaders.payloadPending]: this.payloadPending,
},
};

@@ -43,0 +48,0 @@ this.objectP = this.routeContext.resolveHandle(request).then((response) => {

@@ -1,1 +0,1 @@

{"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,kEAA6D;AAE7D,+DAA4D;AAC5D,6CAA+C;AAC/C,yCAA4C;AAE5C;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,4BAA4B;IAIxE;;;;OAIG;IACH,YACiB,YAAoB,EACpB,YAAiC;QAEjD,KAAK,EAAE,CAAC;QAHQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVlC,eAAU,GAAG,IAAI,CAAC;QAajC,IAAA,iBAAM,EACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE,EAAE,CAAC,yBAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE;aAC7C,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,IAAA,yCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD;AA7CD,0DA6CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: { [RuntimeHeaders.viaHandle]: true },\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}
{"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,kEAA6D;AAE7D,+DAA4D;AAC5D,6CAA+C;AAC/C,yCAA4C;AAE5C;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,4BAA4B;IAIxE;;;;;OAKG;IACH,YACiB,YAAoB,EACpB,YAAiC,EACjC,cAAuB;QAEvC,KAAK,EAAE,CAAC;QAJQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,mBAAc,GAAd,cAAc,CAAS;QAZxB,eAAU,GAAG,IAAI,CAAC;QAejC,IAAA,iBAAM,EACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE;oBACR,CAAC,yBAAc,CAAC,SAAS,CAAC,EAAE,IAAI;oBAChC,CAAC,yBAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc;iBACpD;aACD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,IAAA,yCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD;AAlDD,0DAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}

@@ -18,3 +18,7 @@ /*!

*/
viaHandle = "viaHandle"
viaHandle = "viaHandle",
/**
* True if the request is coming from a handle with a pending payload.
*/
payloadPending = "payloadPending"
}

@@ -21,0 +25,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,SAAS,cAAc;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,aAAa,EACnB,gBAAgB,EAAE,gBAAgB,GAChC,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,qEACiC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,SAAK,UA6B1E"}
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,cAAc,mBAAmB;CACjC;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,aAAa,EACnB,gBAAgB,EAAE,gBAAgB,GAChC,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,qEACiC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,SAAK,UA6B1E"}

@@ -23,2 +23,6 @@ "use strict";

RuntimeHeaders["viaHandle"] = "viaHandle";
/**
* True if the request is coming from a handle with a pending payload.
*/
RuntimeHeaders["payloadPending"] = "payloadPending";
})(RuntimeHeaders || (exports.RuntimeHeaders = RuntimeHeaders = {}));

@@ -25,0 +29,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAM7D;;;GAGG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACzB;;OAEG;IACH,+BAAa,CAAA;IACb;;OAEG;IACH,yCAAuB,CAAA;AACxB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AASD;;;;;;GAMG;AACI,KAAK,UAAU,WAAW,CAChC,IAAmB,EACnB,gBAAkC;IAElC,2CAA2C;IAC3C,oEAAoE;IACpE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,KAAK,CAAC,UAAW,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAsB,cAAc,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,cAAc,CAAC;AAC9B,CAAC;AATD,kCASC;AAED;;;;;;;GAOG;AACU,QAAA,qBAAqB,GACjC,kEAAkE,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,SAAgB,uBAAuB,CAAC,KAAsB,EAAE,MAAM,GAAG,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,yEAAyE;IACzE,wFAAwF;IACxF,iEAAiE;IACjE,8FAA8F;IAC9F,gDAAgD;IAChD,8EAA8E;IAC9E,wDAAwD;IACxD,IAAA,iBAAM,EAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzE,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,GAAG,CAAC;QACH,gDAAgD;QAChD,WAAW;QACX,WAAW;QACX,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,MAAM,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;QACxB,EAAE,GAAG,6BAAqB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACxC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,EAAE;IACrB,OAAO,MAAM,GAAG,EAAE,CAAC;AACpB,CAAC;AA7BD,0DA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentAttributes,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/**\n\t * True to wait for a data store to be created and loaded before returning it.\n\t */\n\twait = \"wait\",\n\t/**\n\t * True if the request is coming from an IFluidHandle.\n\t */\n\tviaHandle = \"viaHandle\",\n}\n\n/**\n * Reads a blob from storage and parses it from JSON.\n *\n * @internal\n */\nexport type ReadAndParseBlob = <T>(id: string) => Promise<T>;\n\n/**\n * Fetches the sequence number of the snapshot tree by examining the protocol.\n * @param tree - snapshot tree to examine\n * @param readAndParseBlob - function to read blob contents from storage\n * and parse the result from JSON.\n * @internal\n */\nexport async function seqFromTree(\n\ttree: ISnapshotTree,\n\treadAndParseBlob: ReadAndParseBlob,\n): Promise<number> {\n\t// TODO why are we non null asserting here?\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst attributesHash = tree.trees[\".protocol\"]!.blobs.attributes!;\n\tconst attrib = await readAndParseBlob<IDocumentAttributes>(attributesHash);\n\treturn attrib.sequenceNumber;\n}\n\n/**\n * The following characters emulates the UTF-16 code sequence from 65 - 123, except for the `[` and `{`\n * positioned at 91 and 123 respectively - which are changed to '(' and ')'. Used in the `encodeCompactIdToString` utility below.\n * NOTE: The character set must never be changed - since it could result in collisions with existing ids.\n * If changing, make sure to choose new characters that have never been\n * used before, and the characters must not change their encoding with 'encodeURIComponent'.\n * @internal\n */\nexport const charSetForEncodingIds =\n\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZ(abcdefghijklmnopqrstuvwxyz)0123456789\";\n\n/**\n * Encode compact ID (returned by IContainerRuntime.generateDocumentUniqueId()) to a compact string representation.\n * While this is the main usage pattern, it works with any non-negative integer or a string.\n * Strings are returned as is, and assumed to be UUIDs, i.e. unique enough to never overlap with\n * numbers encoded as strings by this function. Any other strings are likely to run into collisions and should not be used!\n * This function is useful in places where we serialize resulting ID as string and use them as strings, thus we are not\n * gaining any efficiency from having a number type.\n * We do not provide a decode function, so this API is only useful only result is stored and there is no need to go back to original form.\n * @param idArg - input - either a non-negative integer or a string. Strings are returned as is, while numbers are encoded in compat form\n * @param prefix - optional string prefix\n * @returns A string - representation of an input\n * @internal\n */\nexport function encodeCompactIdToString(idArg: number | string, prefix = \"\") {\n\tif (typeof idArg === \"string\") {\n\t\treturn idArg;\n\t}\n\n\t// WARNING: result of this function are stored in storage!\n\t// If you ever need to change this function, you will need to ensure that\n\t// for any inputs N1 & N2, old(N1) !== new(N2), where old() - is the old implementation,\n\t// and new() - is new implementation of encodeCompactIdToString()\n\t// This likely means - this function can't be changed, unless it uses some prefix that ensures\n\t// new values have zero overlap with old values.\n\t// Also resulting string can't contain \"/\", as that's disallowed by some users\n\t// (data store and DDS IDs can't have \"/\" in their IDs).\n\tassert(Number.isInteger(idArg) && idArg >= 0, 0x900 /* invalid input */);\n\tlet id = \"\";\n\tlet num = idArg;\n\tdo {\n\t\t// Here are some examples of the input & output:\n\t\t// 0 -> 'A'\n\t\t// 1 -> 'B'\n\t\t// 64 -> \"AA\"\n\t\t// 100 -> 'Aj'\n\t\t// 10000 -> 'BaQ'\n\t\t// 100000 -> 'XZf'\n\t\tconst encode = num % 64;\n\t\tid = charSetForEncodingIds[encode] + id;\n\t\tnum = Math.floor(num / 64) - 1;\n\t} while (num !== -1);\n\treturn prefix + id;\n}\n"]}
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAM7D;;;GAGG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB;;OAEG;IACH,+BAAa,CAAA;IACb;;OAEG;IACH,yCAAuB,CAAA;IACvB;;OAEG;IACH,mDAAiC,CAAA;AAClC,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB;AASD;;;;;;GAMG;AACI,KAAK,UAAU,WAAW,CAChC,IAAmB,EACnB,gBAAkC;IAElC,2CAA2C;IAC3C,oEAAoE;IACpE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,KAAK,CAAC,UAAW,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAsB,cAAc,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,cAAc,CAAC;AAC9B,CAAC;AATD,kCASC;AAED;;;;;;;GAOG;AACU,QAAA,qBAAqB,GACjC,kEAAkE,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,SAAgB,uBAAuB,CAAC,KAAsB,EAAE,MAAM,GAAG,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,yEAAyE;IACzE,wFAAwF;IACxF,iEAAiE;IACjE,8FAA8F;IAC9F,gDAAgD;IAChD,8EAA8E;IAC9E,wDAAwD;IACxD,IAAA,iBAAM,EAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzE,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,GAAG,CAAC;QACH,gDAAgD;QAChD,WAAW;QACX,WAAW;QACX,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,MAAM,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;QACxB,EAAE,GAAG,6BAAqB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACxC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,EAAE;IACrB,OAAO,MAAM,GAAG,EAAE,CAAC;AACpB,CAAC;AA7BD,0DA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentAttributes,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/**\n\t * True to wait for a data store to be created and loaded before returning it.\n\t */\n\twait = \"wait\",\n\t/**\n\t * True if the request is coming from an IFluidHandle.\n\t */\n\tviaHandle = \"viaHandle\",\n\t/**\n\t * True if the request is coming from a handle with a pending payload.\n\t */\n\tpayloadPending = \"payloadPending\",\n}\n\n/**\n * Reads a blob from storage and parses it from JSON.\n *\n * @internal\n */\nexport type ReadAndParseBlob = <T>(id: string) => Promise<T>;\n\n/**\n * Fetches the sequence number of the snapshot tree by examining the protocol.\n * @param tree - snapshot tree to examine\n * @param readAndParseBlob - function to read blob contents from storage\n * and parse the result from JSON.\n * @internal\n */\nexport async function seqFromTree(\n\ttree: ISnapshotTree,\n\treadAndParseBlob: ReadAndParseBlob,\n): Promise<number> {\n\t// TODO why are we non null asserting here?\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst attributesHash = tree.trees[\".protocol\"]!.blobs.attributes!;\n\tconst attrib = await readAndParseBlob<IDocumentAttributes>(attributesHash);\n\treturn attrib.sequenceNumber;\n}\n\n/**\n * The following characters emulates the UTF-16 code sequence from 65 - 123, except for the `[` and `{`\n * positioned at 91 and 123 respectively - which are changed to '(' and ')'. Used in the `encodeCompactIdToString` utility below.\n * NOTE: The character set must never be changed - since it could result in collisions with existing ids.\n * If changing, make sure to choose new characters that have never been\n * used before, and the characters must not change their encoding with 'encodeURIComponent'.\n * @internal\n */\nexport const charSetForEncodingIds =\n\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZ(abcdefghijklmnopqrstuvwxyz)0123456789\";\n\n/**\n * Encode compact ID (returned by IContainerRuntime.generateDocumentUniqueId()) to a compact string representation.\n * While this is the main usage pattern, it works with any non-negative integer or a string.\n * Strings are returned as is, and assumed to be UUIDs, i.e. unique enough to never overlap with\n * numbers encoded as strings by this function. Any other strings are likely to run into collisions and should not be used!\n * This function is useful in places where we serialize resulting ID as string and use them as strings, thus we are not\n * gaining any efficiency from having a number type.\n * We do not provide a decode function, so this API is only useful only result is stored and there is no need to go back to original form.\n * @param idArg - input - either a non-negative integer or a string. Strings are returned as is, while numbers are encoded in compat form\n * @param prefix - optional string prefix\n * @returns A string - representation of an input\n * @internal\n */\nexport function encodeCompactIdToString(idArg: number | string, prefix = \"\") {\n\tif (typeof idArg === \"string\") {\n\t\treturn idArg;\n\t}\n\n\t// WARNING: result of this function are stored in storage!\n\t// If you ever need to change this function, you will need to ensure that\n\t// for any inputs N1 & N2, old(N1) !== new(N2), where old() - is the old implementation,\n\t// and new() - is new implementation of encodeCompactIdToString()\n\t// This likely means - this function can't be changed, unless it uses some prefix that ensures\n\t// new values have zero overlap with old values.\n\t// Also resulting string can't contain \"/\", as that's disallowed by some users\n\t// (data store and DDS IDs can't have \"/\" in their IDs).\n\tassert(Number.isInteger(idArg) && idArg >= 0, 0x900 /* invalid input */);\n\tlet id = \"\";\n\tlet num = idArg;\n\tdo {\n\t\t// Here are some examples of the input & output:\n\t\t// 0 -> 'A'\n\t\t// 1 -> 'B'\n\t\t// 64 -> \"AA\"\n\t\t// 100 -> 'Aj'\n\t\t// 10000 -> 'BaQ'\n\t\t// 100000 -> 'XZf'\n\t\tconst encode = num % 64;\n\t\tid = charSetForEncodingIds[encode] + id;\n\t\tnum = Math.floor(num / 64) - 1;\n\t} while (num !== -1);\n\treturn prefix + id;\n}\n"]}

@@ -6,3 +6,2 @@ /*!

import { IRequest, IResponse } from "@fluidframework/core-interfaces";
import { IFluidDataStoreFactory, IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions/internal";
/**

@@ -27,10 +26,2 @@ * @internal

}): IResponse;
/**
* @internal
*/
export type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
/**
* @internal
*/
export declare function createDataStoreFactory(type: string, factory: Factory | Promise<Factory>): IFluidDataStoreFactory & IFluidDataStoreRegistry;
//# sourceMappingURL=dataStoreHelpers.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,MAAM,8CAA8C,CAAC;AAWtD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0BvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAejF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,cACJ,CAAC;AAEhD;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC9B,SAAS,CAiBX;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAEvF;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GACjC,sBAAsB,GAAG,uBAAuB,CAalD"}
{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAYtE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0BvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAejF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,cACJ,CAAC;AAEhD;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC9B,SAAS,CAiBX"}

@@ -77,18 +77,2 @@ /*!

}
/**
* @internal
*/
export function createDataStoreFactory(type, factory) {
return {
type,
get IFluidDataStoreFactory() {
return this;
},
get IFluidDataStoreRegistry() {
return this;
},
instantiateDataStore: async (context, existing) => (await factory).instantiateDataStore(context, existing),
get: async (name) => (await factory).IFluidDataStoreRegistry?.get(name),
};
}
//# sourceMappingURL=dataStoreHelpers.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAUlF;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAQ;IAC3C,MAAM,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,2BAA2B,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,WAAW,GAAuB,GAAG,CAAC;QAC5C,OAAO;YACN,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,WAAW,CAAC,IAAI;YACxB,KAAK,EAAE,WAAW,CAAC,OAAO;YAC1B,IAAI,KAAK;gBACR,OAAO,WAAW,CAAC,KAAK,CAAC;YAC1B,CAAC;YACD,OAAO,EAAE,WAAW,CAAC,yBAAyB;SAC9C,CAAC;IACH,CAAC;IAED,0GAA0G;IAC1G,MAAM,YAAY,GAAG,sBAAsB,EAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,GAAG,GAAG,EAAE;QACf,IAAI,KAAK;YACR,OAAQ,GAAG,EAAE,KAA4B,IAAI,YAAY,CAAC,KAAK,CAAC;QACjE,CAAC;KACD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAmB,EAAE,OAAiB;IACzE,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC/B,MA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YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,oBAAoB,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CACjD,CAAC,MAAM,OAAO,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC;QACxD,GAAG,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC;KAC/E,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: { [key: string]: any };\n}\n\n/**\n * @internal\n */\nexport function exceptionToResponse(err: any): IResponse {\n\tconst status = 500;\n\tif (err !== null && typeof err === \"object\" && err.errorFromRequestFluidObject === true) {\n\t\tconst responseErr: IResponseException = err;\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: responseErr.code,\n\t\t\tvalue: responseErr.message,\n\t\t\tget stack() {\n\t\t\t\treturn responseErr.stack;\n\t\t\t},\n\t\t\theaders: responseErr.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${err}`,\n\t\tget stack() {\n\t\t\treturn (err?.stack as string | undefined) ?? errWithStack.stack;\n\t\t},\n\t};\n}\n\n/**\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\tconst message = response.value;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport const create404Response = (request: IRequest) =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: { [key: string]: any },\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n\n/**\n * @internal\n */\nexport type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;\n\n/**\n * @internal\n */\nexport function createDataStoreFactory(\n\ttype: string,\n\tfactory: Factory | Promise<Factory>,\n): IFluidDataStoreFactory & IFluidDataStoreRegistry {\n\treturn {\n\t\ttype,\n\t\tget IFluidDataStoreFactory() {\n\t\t\treturn this;\n\t\t},\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn this;\n\t\t},\n\t\tinstantiateDataStore: async (context, existing) =>\n\t\t\t(await factory).instantiateDataStore(context, existing),\n\t\tget: async (name: string) => (await factory).IFluidDataSto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AAC,MAAM;QACrB,IAAI,KAAK;YACR,OAAO,QAAQ,CAAC,KAAK,IAAI,YAAY,CAAC,KAAK,CAAC;QAC7C,CAAC;QACD,yBAAyB,EAAE,QAAQ,CAAC,OAAO;KAC3C,CAAC;IAEF,OAAO,WAAW,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAiB,EAAE,EAAE,CACtD,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAClC,MAAc,EACd,KAAa,EACb,OAAiB,EACjB,OAAgC;IAEhC,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACrF,wEAAwE;IACxE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,0GAA0G;IAC1G,MAAM,YAAY,GAAG,sBAAsB,EAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,UAAU,EAAE;QACnE,IAAI,KAAK;YACR,OAAO,YAAY,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,OAAO;KACP,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: { [key: string]: any };\n}\n\n/**\n * @internal\n */\nexport function exceptionToResponse(err: any): IResponse {\n\tconst status = 500;\n\tif (err !== null && typeof err === \"object\" && err.errorFromRequestFluidObject === true) {\n\t\tconst responseErr: IResponseException = err;\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: responseErr.code,\n\t\t\tvalue: responseErr.message,\n\t\t\tget stack() {\n\t\t\t\treturn responseErr.stack;\n\t\t\t},\n\t\t\theaders: responseErr.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${err}`,\n\t\tget stack() {\n\t\t\treturn (err?.stack as string | undefined) ?? errWithStack.stack;\n\t\t},\n\t};\n}\n\n/**\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\tconst message = response.value;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport const create404Response = (request: IRequest) =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: { [key: string]: any },\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n"]}

@@ -7,3 +7,3 @@ /*!

import { IFluidHandle, fluidHandleSymbol } from "@fluidframework/core-interfaces";
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
import type { IFluidHandleInternal, IFluidHandleInternalPayloadPending } from "@fluidframework/core-interfaces/internal";
/**

@@ -16,2 +16,12 @@ * JSON serialized form of an IFluidHandle

url: string;
/**
* The handle may have a pending payload, as determined by and resolvable by the subsystem that
* the handle relates to. For instance, the BlobManager uses this to distinguish blob handles
* which may not yet have an attached blob yet.
*
* @remarks
* Will only exist if the handle was created with a pending payload, will be omitted entirely from
* the serialized format if the handle was created with an already-shared payload.
*/
readonly payloadPending?: true;
}

@@ -24,2 +34,6 @@ /**

/**
* @internal
*/
export declare const isFluidHandleInternalPayloadPending: (fluidHandleInternal: IFluidHandleInternal) => fluidHandleInternal is IFluidHandleInternalPayloadPending<unknown>;
/**
* Encodes the given IFluidHandle into a JSON-serializable form,

@@ -26,0 +40,0 @@ * @param handle - The IFluidHandle to serialize.

@@ -1,1 +0,1 @@

{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEjC,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,GAAG,+BACV,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM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2 +12,6 @@ /*!

/**
* @internal
*/
export const isFluidHandleInternalPayloadPending = (fluidHandleInternal) => "payloadPending" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;
/**
* Encodes the given IFluidHandle into a JSON-serializable form,

@@ -20,6 +24,12 @@ * @param handle - The IFluidHandle to serialize.

export function encodeHandleForSerialization(handle) {
return {
type: "__fluid_handle__",
url: handle.absolutePath,
};
return isFluidHandleInternalPayloadPending(handle)
? {
type: "__fluid_handle__",
url: handle.absolutePath,
payloadPending: true,
}
: {
type: "__fluid_handle__",
url: handle.absolutePath,
};
}

@@ -26,0 +36,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAelF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA8B,EAAE,CAC5E,KAAK,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAA4B;IACxE,OAAO;QACN,IAAI,EAAE,kBAAkB;QACxB,GAAG,EAAE,MAAM,CAAC,YAAY;KACxB,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC3C,sEAAsE;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,iBAAiB,IAAI,KAAK,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,kGAAkG;IAClG,IAAI,4BAA4B,IAAI,YAAY,IAAI,KAAK,EAAE,CAAC;QAC3D,qHAAqH;QACrH,MAAM,KAAK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* Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn {\n\t\ttype: \"__fluid_handle__\",\n\t\turl: handle.absolutePath,\n\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AA6BlF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA8B,EAAE,CAC5E,KAAK,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAClD,mBAAyC,EACmB,EAAE,CAC9D,gBAAgB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,KAAK,IAAI,CAAC;AAExF;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAA4B;IACxE,OAAO,mCAAmC,CAAC,MAAM,CAAC;QACjD,CAAC,CAAC;YACA,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,MAAM,CAAC,YAAY;YACxB,cAAc,EAAE,IAAI;SACpB;QACF,CAAC,CAAC;YACA,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,MAAM,CAAC,YAAY;SACxB,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,aAA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;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,MAA+B;IAE/B,OAAO,MAA0C,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,eAAe;IAOpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,iBAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}

@@ -6,4 +6,4 @@ /*!

export { generateHandleContextPath } from "./dataStoreHandleContextUtils.js";
export { create404Response, createDataStoreFactory, createResponseError, exceptionToResponse, Factory, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, ISerializedHandle, isSerializedHandle, isFluidHandle, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { create404Response, createResponseError, exceptionToResponse, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, ISerializedHandle, isSerializedHandle, isFluidHandle, isFluidHandleInternalPayloadPending, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { ObjectStoragePartition } from "./objectstoragepartition.js";

@@ -10,0 +10,0 @@ export { getNormalizedObjectStoragePathParts, listBlobsAtTreePath, } from "./objectstorageutils.js";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,mBAAmB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;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BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC"}

@@ -6,4 +6,4 @@ /*!

export { generateHandleContextPath } from "./dataStoreHandleContextUtils.js";
export { create404Response, createDataStoreFactory, createResponseError, exceptionToResponse, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, isSerializedHandle, isFluidHandle, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { create404Response, createResponseError, exceptionToResponse, responseToException, } from "./dataStoreHelpers.js";
export { encodeHandleForSerialization, isSerializedHandle, isFluidHandle, isFluidHandleInternalPayloadPending, toFluidHandleErased, toFluidHandleInternal, FluidHandleBase, compareFluidHandles, } from "./handles.js";
export { ObjectStoragePartition } from "./objectstoragepartition.js";

@@ -10,0 +10,0 @@ export { getNormalizedObjectStoragePathParts, listBlobsAtTreePath, } from "./objectstorageutils.js";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,4BAA4B,EAE5B,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAEN,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils.js\";\nexport {\n\tcreate404Response,\n\tcreateDataStoreFactory,\n\tcreateResponseError,\n\texceptionToResponse,\n\tFactory,\n\tresponseToException,\n} from \"./dataStoreHelpers.js\";\nexport {\n\tencodeHandleForSerialization,\n\tISerializedHandle,\n\tisSerializedHandle,\n\tisFluidHandle,\n\ttoFluidHandleErased,\n\ttoFluidHandleInternal,\n\tFluidHandleBase,\n\tcompareFluidHandles,\n} from \"./handles.js\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition.js\";\nexport {\n\tgetNormalizedObjectStoragePathParts,\n\tlistBlobsAtTreePath,\n} from \"./objectstorageutils.js\";\nexport { RemoteFluidObjectHandle } from \"./remoteFluidObjectHandle.js\";\nexport { RequestParser } from \"./requestParser.js\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper.js\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tGCDataBuilder,\n\tgetBlobSize,\n\tmergeStats,\n\tprocessAttachMessageGCData,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils.js\";\nexport { unpackChildNodesUsedRoutes } from \"./unpackUsedRoutes.js\";\nexport {\n\tReadAndParseBlob,\n\tRuntimeHeaders,\n\tseqFromTree,\n\tencodeCompactIdToString,\n} from \"./utils.js\";\nexport { isSnapshotFetchRequiredForLoadingGroupId } from \"./snapshotUtils.js\";\nexport {\n\ttoDeltaManagerErased,\n\ttoDeltaManagerInternal,\n} from \"./deltaManager.js\";\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACN,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,4BAA4B,EAE5B,kBAAkB,EAClB,aAAa,EACb,mCAAmC,EACnC,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAEN,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils.js\";\nexport {\n\tcreate404Response,\n\tcreateResponseError,\n\texceptionToResponse,\n\tresponseToException,\n} from \"./dataStoreHelpers.js\";\nexport {\n\tencodeHandleForSerialization,\n\tISerializedHandle,\n\tisSerializedHandle,\n\tisFluidHandle,\n\tisFluidHandleInternalPayloadPending,\n\ttoFluidHandleErased,\n\ttoFluidHandleInternal,\n\tFluidHandleBase,\n\tcompareFluidHandles,\n} from \"./handles.js\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition.js\";\nexport {\n\tgetNormalizedObjectStoragePathParts,\n\tlistBlobsAtTreePath,\n} from \"./objectstorageutils.js\";\nexport { RemoteFluidObjectHandle } from \"./remoteFluidObjectHandle.js\";\nexport { RequestParser } from \"./requestParser.js\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper.js\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tGCDataBuilder,\n\tgetBlobSize,\n\tmergeStats,\n\tprocessAttachMessageGCData,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils.js\";\nexport { unpackChildNodesUsedRoutes } from \"./unpackUsedRoutes.js\";\nexport {\n\tReadAndParseBlob,\n\tRuntimeHeaders,\n\tseqFromTree,\n\tencodeCompactIdToString,\n} from \"./utils.js\";\nexport { isSnapshotFetchRequiredForLoadingGroupId } from \"./snapshotUtils.js\";\nexport {\n\ttoDeltaManagerErased,\n\ttoDeltaManagerInternal,\n} from \"./deltaManager.js\";\n"]}

@@ -20,2 +20,3 @@ /*!

readonly routeContext: IFluidHandleContext;
readonly payloadPending: boolean;
readonly isAttached = true;

@@ -27,4 +28,5 @@ private objectP;

* @param routeContext - The root IFluidHandleContext that has a route to this handle.
* @param payloadPending - Whether the handle may have a pending payload that is not yet available.
*/
constructor(absolutePath: string, routeContext: IFluidHandleContext);
constructor(absolutePath: string, routeContext: IFluidHandleContext, payloadPending: boolean);
get(): Promise<FluidObject>;

@@ -31,0 +33,0 @@ attachGraph(): void;

@@ -1,1 +0,1 @@

{"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAUvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;IAVlD,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;OAIG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB;IASrC,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAkBjC,WAAW,IAAI,IAAI;IAInB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}
{"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;IAInB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}

@@ -23,7 +23,9 @@ /*!

* @param routeContext - The root IFluidHandleContext that has a route to this handle.
* @param payloadPending - Whether the handle may have a pending payload that is not yet available.
*/
constructor(absolutePath, routeContext) {
constructor(absolutePath, routeContext, payloadPending) {
super();
this.absolutePath = absolutePath;
this.routeContext = routeContext;
this.payloadPending = payloadPending;
this.isAttached = true;

@@ -37,3 +39,6 @@ assert(absolutePath.startsWith("/"), 0x19d /* "Handles should always have absolute paths" */);

url: this.absolutePath,
headers: { [RuntimeHeaders.viaHandle]: true },
headers: {
[RuntimeHeaders.viaHandle]: true,
[RuntimeHeaders.payloadPending]: this.payloadPending,
},
};

@@ -40,0 +45,0 @@ this.objectP = this.routeContext.resolveHandle(request).then((response) => {

@@ -1,1 +0,1 @@

{"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAA4B;IAIxE;;;;OAIG;IACH,YACiB,YAAoB,EACpB,YAAiC;QAEjD,KAAK,EAAE,CAAC;QAHQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVlC,eAAU,GAAG,IAAI,CAAC;QAajC,MAAM,CACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE;aAC7C,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: { [RuntimeHeaders.viaHandle]: true },\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}
{"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAA4B;IAIxE;;;;;OAKG;IACH,YACiB,YAAoB,EACpB,YAAiC,EACjC,cAAuB;QAEvC,KAAK,EAAE,CAAC;QAJQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,mBAAc,GAAd,cAAc,CAAS;QAZxB,eAAU,GAAG,IAAI,CAAC;QAejC,MAAM,CACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE;oBACR,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI;oBAChC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc;iBACpD;aACD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.50.1"
"packageVersion": "7.52.5"
}
]
}

@@ -18,3 +18,7 @@ /*!

*/
viaHandle = "viaHandle"
viaHandle = "viaHandle",
/**
* True if the request is coming from a handle with a pending payload.
*/
payloadPending = "payloadPending"
}

@@ -21,0 +25,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,SAAS,cAAc;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,aAAa,EACnB,gBAAgB,EAAE,gBAAgB,GAChC,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,qEACiC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,SAAK,UA6B1E"}
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,cAAc,mBAAmB;CACjC;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,aAAa,EACnB,gBAAgB,EAAE,gBAAgB,GAChC,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,qEACiC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,SAAK,UA6B1E"}

@@ -20,2 +20,6 @@ /*!

RuntimeHeaders["viaHandle"] = "viaHandle";
/**
* True if the request is coming from a handle with a pending payload.
*/
RuntimeHeaders["payloadPending"] = "payloadPending";
})(RuntimeHeaders || (RuntimeHeaders = {}));

@@ -22,0 +26,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D;;;GAGG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACzB;;OAEG;IACH,+BAAa,CAAA;IACb;;OAEG;IACH,yCAAuB,CAAA;AACxB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AASD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,IAAmB,EACnB,gBAAkC;IAElC,2CAA2C;IAC3C,oEAAoE;IACpE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,KAAK,CAAC,UAAW,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAsB,cAAc,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,cAAc,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GACjC,kEAAkE,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAsB,EAAE,MAAM,GAAG,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,yEAAyE;IACzE,wFAAwF;IACxF,iEAAiE;IACjE,8FAA8F;IAC9F,gDAAgD;IAChD,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzE,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,GAAG,CAAC;QACH,gDAAgD;QAChD,WAAW;QACX,WAAW;QACX,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,MAAM,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;QACxB,EAAE,GAAG,qBAAqB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACxC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,EAAE;IACrB,OAAO,MAAM,GAAG,EAAE,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentAttributes,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/**\n\t * True to wait for a data store to be created and loaded before returning it.\n\t */\n\twait = \"wait\",\n\t/**\n\t * True if the request is coming from an IFluidHandle.\n\t */\n\tviaHandle = \"viaHandle\",\n}\n\n/**\n * Reads a blob from storage and parses it from JSON.\n *\n * @internal\n */\nexport type ReadAndParseBlob = <T>(id: string) => Promise<T>;\n\n/**\n * Fetches the sequence number of the snapshot tree by examining the protocol.\n * @param tree - snapshot tree to examine\n * @param readAndParseBlob - function to read blob contents from storage\n * and parse the result from JSON.\n * @internal\n */\nexport async function seqFromTree(\n\ttree: ISnapshotTree,\n\treadAndParseBlob: ReadAndParseBlob,\n): Promise<number> {\n\t// TODO why are we non null asserting here?\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst attributesHash = tree.trees[\".protocol\"]!.blobs.attributes!;\n\tconst attrib = await readAndParseBlob<IDocumentAttributes>(attributesHash);\n\treturn attrib.sequenceNumber;\n}\n\n/**\n * The following characters emulates the UTF-16 code sequence from 65 - 123, except for the `[` and `{`\n * positioned at 91 and 123 respectively - which are changed to '(' and ')'. Used in the `encodeCompactIdToString` utility below.\n * NOTE: The character set must never be changed - since it could result in collisions with existing ids.\n * If changing, make sure to choose new characters that have never been\n * used before, and the characters must not change their encoding with 'encodeURIComponent'.\n * @internal\n */\nexport const charSetForEncodingIds =\n\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZ(abcdefghijklmnopqrstuvwxyz)0123456789\";\n\n/**\n * Encode compact ID (returned by IContainerRuntime.generateDocumentUniqueId()) to a compact string representation.\n * While this is the main usage pattern, it works with any non-negative integer or a string.\n * Strings are returned as is, and assumed to be UUIDs, i.e. unique enough to never overlap with\n * numbers encoded as strings by this function. Any other strings are likely to run into collisions and should not be used!\n * This function is useful in places where we serialize resulting ID as string and use them as strings, thus we are not\n * gaining any efficiency from having a number type.\n * We do not provide a decode function, so this API is only useful only result is stored and there is no need to go back to original form.\n * @param idArg - input - either a non-negative integer or a string. Strings are returned as is, while numbers are encoded in compat form\n * @param prefix - optional string prefix\n * @returns A string - representation of an input\n * @internal\n */\nexport function encodeCompactIdToString(idArg: number | string, prefix = \"\") {\n\tif (typeof idArg === \"string\") {\n\t\treturn idArg;\n\t}\n\n\t// WARNING: result of this function are stored in storage!\n\t// If you ever need to change this function, you will need to ensure that\n\t// for any inputs N1 & N2, old(N1) !== new(N2), where old() - is the old implementation,\n\t// and new() - is new implementation of encodeCompactIdToString()\n\t// This likely means - this function can't be changed, unless it uses some prefix that ensures\n\t// new values have zero overlap with old values.\n\t// Also resulting string can't contain \"/\", as that's disallowed by some users\n\t// (data store and DDS IDs can't have \"/\" in their IDs).\n\tassert(Number.isInteger(idArg) && idArg >= 0, 0x900 /* invalid input */);\n\tlet id = \"\";\n\tlet num = idArg;\n\tdo {\n\t\t// Here are some examples of the input & output:\n\t\t// 0 -> 'A'\n\t\t// 1 -> 'B'\n\t\t// 64 -> \"AA\"\n\t\t// 100 -> 'Aj'\n\t\t// 10000 -> 'BaQ'\n\t\t// 100000 -> 'XZf'\n\t\tconst encode = num % 64;\n\t\tid = charSetForEncodingIds[encode] + id;\n\t\tnum = Math.floor(num / 64) - 1;\n\t} while (num !== -1);\n\treturn prefix + id;\n}\n"]}
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D;;;GAGG;AACH,MAAM,CAAN,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB;;OAEG;IACH,+BAAa,CAAA;IACb;;OAEG;IACH,yCAAuB,CAAA;IACvB;;OAEG;IACH,mDAAiC,CAAA;AAClC,CAAC,EAbW,cAAc,KAAd,cAAc,QAazB;AASD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,IAAmB,EACnB,gBAAkC;IAElC,2CAA2C;IAC3C,oEAAoE;IACpE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,KAAK,CAAC,UAAW,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAsB,cAAc,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,cAAc,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GACjC,kEAAkE,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAsB,EAAE,MAAM,GAAG,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,yEAAyE;IACzE,wFAAwF;IACxF,iEAAiE;IACjE,8FAA8F;IAC9F,gDAAgD;IAChD,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzE,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,GAAG,CAAC;QACH,gDAAgD;QAChD,WAAW;QACX,WAAW;QACX,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,MAAM,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;QACxB,EAAE,GAAG,qBAAqB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACxC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,EAAE;IACrB,OAAO,MAAM,GAAG,EAAE,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentAttributes,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Accepted header keys for requests coming to the runtime.\n * @internal\n */\nexport enum RuntimeHeaders {\n\t/**\n\t * True to wait for a data store to be created and loaded before returning it.\n\t */\n\twait = \"wait\",\n\t/**\n\t * True if the request is coming from an IFluidHandle.\n\t */\n\tviaHandle = \"viaHandle\",\n\t/**\n\t * True if the request is coming from a handle with a pending payload.\n\t */\n\tpayloadPending = \"payloadPending\",\n}\n\n/**\n * Reads a blob from storage and parses it from JSON.\n *\n * @internal\n */\nexport type ReadAndParseBlob = <T>(id: string) => Promise<T>;\n\n/**\n * Fetches the sequence number of the snapshot tree by examining the protocol.\n * @param tree - snapshot tree to examine\n * @param readAndParseBlob - function to read blob contents from storage\n * and parse the result from JSON.\n * @internal\n */\nexport async function seqFromTree(\n\ttree: ISnapshotTree,\n\treadAndParseBlob: ReadAndParseBlob,\n): Promise<number> {\n\t// TODO why are we non null asserting here?\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst attributesHash = tree.trees[\".protocol\"]!.blobs.attributes!;\n\tconst attrib = await readAndParseBlob<IDocumentAttributes>(attributesHash);\n\treturn attrib.sequenceNumber;\n}\n\n/**\n * The following characters emulates the UTF-16 code sequence from 65 - 123, except for the `[` and `{`\n * positioned at 91 and 123 respectively - which are changed to '(' and ')'. Used in the `encodeCompactIdToString` utility below.\n * NOTE: The character set must never be changed - since it could result in collisions with existing ids.\n * If changing, make sure to choose new characters that have never been\n * used before, and the characters must not change their encoding with 'encodeURIComponent'.\n * @internal\n */\nexport const charSetForEncodingIds =\n\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZ(abcdefghijklmnopqrstuvwxyz)0123456789\";\n\n/**\n * Encode compact ID (returned by IContainerRuntime.generateDocumentUniqueId()) to a compact string representation.\n * While this is the main usage pattern, it works with any non-negative integer or a string.\n * Strings are returned as is, and assumed to be UUIDs, i.e. unique enough to never overlap with\n * numbers encoded as strings by this function. Any other strings are likely to run into collisions and should not be used!\n * This function is useful in places where we serialize resulting ID as string and use them as strings, thus we are not\n * gaining any efficiency from having a number type.\n * We do not provide a decode function, so this API is only useful only result is stored and there is no need to go back to original form.\n * @param idArg - input - either a non-negative integer or a string. Strings are returned as is, while numbers are encoded in compat form\n * @param prefix - optional string prefix\n * @returns A string - representation of an input\n * @internal\n */\nexport function encodeCompactIdToString(idArg: number | string, prefix = \"\") {\n\tif (typeof idArg === \"string\") {\n\t\treturn idArg;\n\t}\n\n\t// WARNING: result of this function are stored in storage!\n\t// If you ever need to change this function, you will need to ensure that\n\t// for any inputs N1 & N2, old(N1) !== new(N2), where old() - is the old implementation,\n\t// and new() - is new implementation of encodeCompactIdToString()\n\t// This likely means - this function can't be changed, unless it uses some prefix that ensures\n\t// new values have zero overlap with old values.\n\t// Also resulting string can't contain \"/\", as that's disallowed by some users\n\t// (data store and DDS IDs can't have \"/\" in their IDs).\n\tassert(Number.isInteger(idArg) && idArg >= 0, 0x900 /* invalid input */);\n\tlet id = \"\";\n\tlet num = idArg;\n\tdo {\n\t\t// Here are some examples of the input & output:\n\t\t// 0 -> 'A'\n\t\t// 1 -> 'B'\n\t\t// 64 -> \"AA\"\n\t\t// 100 -> 'Aj'\n\t\t// 10000 -> 'BaQ'\n\t\t// 100000 -> 'XZf'\n\t\tconst encode = num % 64;\n\t\tid = charSetForEncodingIds[encode] + id;\n\t\tnum = Math.floor(num / 64) - 1;\n\t} while (num !== -1);\n\treturn prefix + id;\n}\n"]}
{
"name": "@fluidframework/runtime-utils",
"version": "2.33.0-333010",
"version": "2.33.0",
"description": "Collection of utility functions for Fluid Runtime",

@@ -72,12 +72,12 @@ "homepage": "https://fluidframework.com",

"dependencies": {
"@fluid-internal/client-utils": "2.33.0-333010",
"@fluidframework/container-definitions": "2.33.0-333010",
"@fluidframework/container-runtime-definitions": "2.33.0-333010",
"@fluidframework/core-interfaces": "2.33.0-333010",
"@fluidframework/core-utils": "2.33.0-333010",
"@fluidframework/datastore-definitions": "2.33.0-333010",
"@fluidframework/driver-definitions": "2.33.0-333010",
"@fluidframework/driver-utils": "2.33.0-333010",
"@fluidframework/runtime-definitions": "2.33.0-333010",
"@fluidframework/telemetry-utils": "2.33.0-333010"
"@fluid-internal/client-utils": "~2.33.0",
"@fluidframework/container-definitions": "~2.33.0",
"@fluidframework/container-runtime-definitions": "~2.33.0",
"@fluidframework/core-interfaces": "~2.33.0",
"@fluidframework/core-utils": "~2.33.0",
"@fluidframework/datastore-definitions": "~2.33.0",
"@fluidframework/driver-definitions": "~2.33.0",
"@fluidframework/driver-utils": "~2.33.0",
"@fluidframework/runtime-definitions": "~2.33.0",
"@fluidframework/telemetry-utils": "~2.33.0"
},

@@ -87,3 +87,3 @@ "devDependencies": {

"@biomejs/biome": "~1.9.3",
"@fluid-internal/mocha-test-setup": "2.33.0-333010",
"@fluid-internal/mocha-test-setup": "~2.33.0",
"@fluid-tools/build-cli": "^0.55.0",

@@ -93,4 +93,4 @@ "@fluidframework/build-common": "^2.0.3",

"@fluidframework/eslint-config-fluid": "^5.7.3",
"@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.31.0",
"@microsoft/api-extractor": "7.50.1",
"@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.32.0",
"@microsoft/api-extractor": "7.52.5",
"@types/mocha": "^10.0.10",

@@ -106,3 +106,2 @@ "@types/node": "^18.19.0",

"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"rimraf": "^4.4.0",

@@ -109,0 +108,0 @@ "sinon": "^18.0.1",

@@ -8,7 +8,2 @@ /*!

import { assert } from "@fluidframework/core-utils/internal";
import {
IFluidDataStoreFactory,
IFluidDataStoreRegistry,
IProvideFluidDataStoreRegistry,
} from "@fluidframework/runtime-definitions/internal";
import { generateErrorWithStack } from "@fluidframework/telemetry-utils/internal";

@@ -108,27 +103,1 @@

}
/**
* @internal
*/
export type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
/**
* @internal
*/
export function createDataStoreFactory(
type: string,
factory: Factory | Promise<Factory>,
): IFluidDataStoreFactory & IFluidDataStoreRegistry {
return {
type,
get IFluidDataStoreFactory() {
return this;
},
get IFluidDataStoreRegistry() {
return this;
},
instantiateDataStore: async (context, existing) =>
(await factory).instantiateDataStore(context, existing),
get: async (name: string) => (await factory).IFluidDataStoreRegistry?.get(name),
};
}

@@ -8,3 +8,6 @@ /*!

import { IFluidHandle, fluidHandleSymbol } from "@fluidframework/core-interfaces";
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
import type {
IFluidHandleInternal,
IFluidHandleInternalPayloadPending,
} from "@fluidframework/core-interfaces/internal";

@@ -21,2 +24,13 @@ /**

url: string;
/**
* The handle may have a pending payload, as determined by and resolvable by the subsystem that
* the handle relates to. For instance, the BlobManager uses this to distinguish blob handles
* which may not yet have an attached blob yet.
*
* @remarks
* Will only exist if the handle was created with a pending payload, will be omitted entirely from
* the serialized format if the handle was created with an already-shared payload.
*/
readonly payloadPending?: true;
}

@@ -32,2 +46,10 @@

/**
* @internal
*/
export const isFluidHandleInternalPayloadPending = (
fluidHandleInternal: IFluidHandleInternal,
): fluidHandleInternal is IFluidHandleInternalPayloadPending =>
"payloadPending" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;
/**
* Encodes the given IFluidHandle into a JSON-serializable form,

@@ -40,6 +62,12 @@ * @param handle - The IFluidHandle to serialize.

export function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {
return {
type: "__fluid_handle__",
url: handle.absolutePath,
};
return isFluidHandleInternalPayloadPending(handle)
? {
type: "__fluid_handle__",
url: handle.absolutePath,
payloadPending: true,
}
: {
type: "__fluid_handle__",
url: handle.absolutePath,
};
}

@@ -46,0 +74,0 @@

@@ -9,6 +9,4 @@ /*!

create404Response,
createDataStoreFactory,
createResponseError,
exceptionToResponse,
Factory,
responseToException,

@@ -21,2 +19,3 @@ } from "./dataStoreHelpers.js";

isFluidHandle,
isFluidHandleInternalPayloadPending,
toFluidHandleErased,

@@ -23,0 +22,0 @@ toFluidHandleInternal,

@@ -34,2 +34,3 @@ /*!

* @param routeContext - The root IFluidHandleContext that has a route to this handle.
* @param payloadPending - Whether the handle may have a pending payload that is not yet available.
*/

@@ -39,2 +40,3 @@ constructor(

public readonly routeContext: IFluidHandleContext,
public readonly payloadPending: boolean,
) {

@@ -53,3 +55,6 @@ super();

url: this.absolutePath,
headers: { [RuntimeHeaders.viaHandle]: true },
headers: {
[RuntimeHeaders.viaHandle]: true,
[RuntimeHeaders.payloadPending]: this.payloadPending,
},
};

@@ -56,0 +61,0 @@ this.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {

@@ -25,2 +25,6 @@ /*!

viaHandle = "viaHandle",
/**
* True if the request is coming from a handle with a pending payload.
*/
payloadPending = "payloadPending",
}

@@ -27,0 +31,0 @@