@fluidframework/driver-utils 2.0.0-dev.4.4.0.162574 → 2.0.0-dev.5.2.0.169897
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/blob.d.ts +53 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/blob.js +62 -0
- package/dist/blob.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/insecureUrlResolver.d.ts.map +1 -1
- package/dist/insecureUrlResolver.js +1 -2
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/network.d.ts +2 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +2 -1
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.d.ts +3 -2
- package/dist/networkUtils.d.ts.map +1 -1
- package/dist/networkUtils.js +1 -1
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts +4 -3
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js.map +1 -1
- package/dist/runWithRetry.d.ts +2 -2
- package/dist/runWithRetry.d.ts.map +1 -1
- package/dist/runWithRetry.js.map +1 -1
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +4 -4
- package/dist/treeConversions.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/blob.d.ts +53 -0
- package/lib/blob.d.ts.map +1 -0
- package/lib/blob.js +56 -0
- package/lib/blob.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/insecureUrlResolver.d.ts.map +1 -1
- package/lib/insecureUrlResolver.js +2 -3
- package/lib/insecureUrlResolver.js.map +1 -1
- package/lib/network.d.ts +2 -1
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +2 -1
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.d.ts +3 -2
- package/lib/networkUtils.d.ts.map +1 -1
- package/lib/networkUtils.js +1 -1
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts +4 -3
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js.map +1 -1
- package/lib/runWithRetry.d.ts +2 -2
- package/lib/runWithRetry.d.ts.map +1 -1
- package/lib/runWithRetry.js.map +1 -1
- package/lib/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +1 -1
- package/lib/treeConversions.js.map +1 -1
- package/package.json +17 -16
- package/src/blob.ts +68 -0
- package/src/index.ts +1 -1
- package/src/insecureUrlResolver.ts +4 -11
- package/src/network.ts +3 -1
- package/src/networkUtils.ts +4 -3
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +5 -5
- package/src/runWithRetry.ts +2 -2
- package/src/treeConversions.ts +1 -1
- package/dist/fluidResolvedUrl.d.ts +0 -16
- package/dist/fluidResolvedUrl.d.ts.map +0 -1
- package/dist/fluidResolvedUrl.js +0 -24
- package/dist/fluidResolvedUrl.js.map +0 -1
- package/lib/fluidResolvedUrl.d.ts +0 -16
- package/lib/fluidResolvedUrl.d.ts.map +0 -1
- package/lib/fluidResolvedUrl.js +0 -19
- package/lib/fluidResolvedUrl.js.map +0 -1
- package/src/fluidResolvedUrl.ts +0 -26
|
@@ -6,12 +6,7 @@
|
|
|
6
6
|
import { parse } from "url";
|
|
7
7
|
import { assert } from "@fluidframework/common-utils";
|
|
8
8
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
9
|
-
import {
|
|
10
|
-
IFluidResolvedUrl,
|
|
11
|
-
IResolvedUrl,
|
|
12
|
-
IUrlResolver,
|
|
13
|
-
DriverHeader,
|
|
14
|
-
} from "@fluidframework/driver-definitions";
|
|
9
|
+
import { IResolvedUrl, IUrlResolver, DriverHeader } from "@fluidframework/driver-definitions";
|
|
15
10
|
import Axios from "axios";
|
|
16
11
|
|
|
17
12
|
/**
|
|
@@ -98,7 +93,7 @@ export class InsecureUrlResolver implements IUrlResolver {
|
|
|
98
93
|
// the actual container ID will be generated by the driver.
|
|
99
94
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
100
95
|
if (!documentId) {
|
|
101
|
-
const createNewResponse:
|
|
96
|
+
const createNewResponse: IResolvedUrl = {
|
|
102
97
|
endpoints: {
|
|
103
98
|
deltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,
|
|
104
99
|
ordererUrl: this.ordererUrl,
|
|
@@ -122,7 +117,7 @@ export class InsecureUrlResolver implements IUrlResolver {
|
|
|
122
117
|
const deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;
|
|
123
118
|
const storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;
|
|
124
119
|
|
|
125
|
-
const response:
|
|
120
|
+
const response: IResolvedUrl = {
|
|
126
121
|
endpoints: {
|
|
127
122
|
deltaStorageUrl,
|
|
128
123
|
ordererUrl: this.ordererUrl,
|
|
@@ -137,9 +132,7 @@ export class InsecureUrlResolver implements IUrlResolver {
|
|
|
137
132
|
}
|
|
138
133
|
|
|
139
134
|
public async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const parsedUrl = parse(fluidResolvedUrl.url);
|
|
135
|
+
const parsedUrl = parse(resolvedUrl.url);
|
|
143
136
|
const [, , documentId] = parsedUrl.pathname?.split("/") ?? [];
|
|
144
137
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
145
138
|
assert(!!documentId, 0x273 /* "Invalid document id from parsed URL" */);
|
package/src/network.ts
CHANGED
|
@@ -72,9 +72,11 @@ export class DeltaStreamConnectionForbiddenError
|
|
|
72
72
|
static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
73
73
|
readonly errorType = DeltaStreamConnectionForbiddenError.errorType;
|
|
74
74
|
readonly canRetry = false;
|
|
75
|
+
readonly storageOnlyReason: string | undefined;
|
|
75
76
|
|
|
76
|
-
constructor(message: string, props: DriverErrorTelemetryProps) {
|
|
77
|
+
constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {
|
|
77
78
|
super(message, { ...props, statusCode: 400 });
|
|
79
|
+
this.storageOnlyReason = storageOnlyReason;
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
|
package/src/networkUtils.ts
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryErrorEvent
|
|
6
|
+
import { ITelemetryErrorEvent } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
8
|
import { isOnline, OnlineStatus, canRetryOnError } from "./network";
|
|
8
9
|
|
|
9
10
|
export function logNetworkFailure(
|
|
10
|
-
logger:
|
|
11
|
+
logger: ITelemetryLoggerExt,
|
|
11
12
|
event: ITelemetryErrorEvent,
|
|
12
13
|
error?: any,
|
|
13
14
|
) {
|
|
14
15
|
const newEvent = { ...event };
|
|
15
16
|
|
|
16
|
-
const errorOnlineProp = error
|
|
17
|
+
const errorOnlineProp = error?.online;
|
|
17
18
|
newEvent.online =
|
|
18
19
|
typeof errorOnlineProp === "string" ? errorOnlineProp : OnlineStatus[isOnline()];
|
|
19
20
|
|
package/src/packageVersion.ts
CHANGED
package/src/parallelRequests.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { assert, Deferred, performance } from "@fluidframework/common-utils";
|
|
6
|
-
import {
|
|
7
|
-
import { PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { ITelemetryProperties } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
8
8
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
9
9
|
import { IDeltasFetchResult, IStream, IStreamResult } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { getRetryDelayFromError, canRetryOnError, createGenericNetworkError } from "./network";
|
|
@@ -50,7 +50,7 @@ export class ParallelRequests<T> {
|
|
|
50
50
|
from: number,
|
|
51
51
|
private to: number | undefined,
|
|
52
52
|
private readonly payloadSize: number,
|
|
53
|
-
private readonly logger:
|
|
53
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
54
54
|
private readonly requestCallback: (
|
|
55
55
|
request: number,
|
|
56
56
|
from: number,
|
|
@@ -409,7 +409,7 @@ async function getSingleOpBatch(
|
|
|
409
409
|
get: (telemetryProps: ITelemetryProperties) => Promise<IDeltasFetchResult>,
|
|
410
410
|
props: ITelemetryProperties,
|
|
411
411
|
strongTo: boolean,
|
|
412
|
-
logger:
|
|
412
|
+
logger: ITelemetryLoggerExt,
|
|
413
413
|
signal?: AbortSignal,
|
|
414
414
|
scenarioName?: string,
|
|
415
415
|
): Promise<{ partial: boolean; cancel: boolean; payload: ISequencedDocumentMessage[] }> {
|
|
@@ -540,7 +540,7 @@ export function requestOps(
|
|
|
540
540
|
fromTotal: number,
|
|
541
541
|
toTotal: number | undefined,
|
|
542
542
|
payloadSize: number,
|
|
543
|
-
logger:
|
|
543
|
+
logger: ITelemetryLoggerExt,
|
|
544
544
|
signal?: AbortSignal,
|
|
545
545
|
scenarioName?: string,
|
|
546
546
|
): IStream<ISequencedDocumentMessage[]> {
|
package/src/runWithRetry.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { delay, performance } from "@fluidframework/common-utils";
|
|
8
8
|
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
9
9
|
import { canRetryOnError, getRetryDelayFromError } from "./network";
|
|
@@ -45,7 +45,7 @@ export interface IProgress {
|
|
|
45
45
|
export async function runWithRetry<T>(
|
|
46
46
|
api: (cancel?: AbortSignal) => Promise<T>,
|
|
47
47
|
fetchCallName: string,
|
|
48
|
-
logger:
|
|
48
|
+
logger: ITelemetryLoggerExt,
|
|
49
49
|
progress: IProgress,
|
|
50
50
|
): Promise<T> {
|
|
51
51
|
let result: T | undefined;
|
package/src/treeConversions.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Uint8ArrayToString, unreachableCase } from "@fluidframework/common-utils";
|
|
7
|
-
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "@fluidframework/protocol-base";
|
|
8
7
|
import { ISummaryTree, ITree, ITreeEntry, SummaryType } from "@fluidframework/protocol-definitions";
|
|
8
|
+
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "./blob";
|
|
9
9
|
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IResolvedUrl, IFluidResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
8
|
-
* so this method is no longer necessary.
|
|
9
|
-
*/
|
|
10
|
-
export declare const isFluidResolvedUrl: (resolved: IResolvedUrl | undefined) => resolved is IFluidResolvedUrl;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
13
|
-
* so this method is no longer necessary.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ensureFluidResolvedUrl(resolved: IResolvedUrl | undefined): asserts resolved is IFluidResolvedUrl;
|
|
16
|
-
//# sourceMappingURL=fluidResolvedUrl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluidResolvedUrl.d.ts","sourceRoot":"","sources":["../src/fluidResolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aACpB,YAAY,GAAG,SAAS,kCAC2B,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,YAAY,GAAG,SAAS,GAChC,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAIvC"}
|
package/dist/fluidResolvedUrl.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ensureFluidResolvedUrl = exports.isFluidResolvedUrl = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
10
|
-
* so this method is no longer necessary.
|
|
11
|
-
*/
|
|
12
|
-
const isFluidResolvedUrl = (resolved) => (resolved === null || resolved === void 0 ? void 0 : resolved.type) === "fluid";
|
|
13
|
-
exports.isFluidResolvedUrl = isFluidResolvedUrl;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
16
|
-
* so this method is no longer necessary.
|
|
17
|
-
*/
|
|
18
|
-
function ensureFluidResolvedUrl(resolved) {
|
|
19
|
-
if (!(0, exports.isFluidResolvedUrl)(resolved)) {
|
|
20
|
-
throw new Error(`resolved is not a Fluid url. Type: ${resolved === null || resolved === void 0 ? void 0 : resolved.type}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.ensureFluidResolvedUrl = ensureFluidResolvedUrl;
|
|
24
|
-
//# sourceMappingURL=fluidResolvedUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluidResolvedUrl.js","sourceRoot":"","sources":["../src/fluidResolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CACjC,QAAkC,EACF,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,OAAO,CAAC;AAFlD,QAAA,kBAAkB,sBAEgC;AAE/D;;;GAGG;AACH,SAAgB,sBAAsB,CACrC,QAAkC;IAElC,IAAI,CAAC,IAAA,0BAAkB,EAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAC,CAAC;KACxE;AACF,CAAC;AAND,wDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl, IFluidResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,\n * so this method is no longer necessary.\n */\nexport const isFluidResolvedUrl = (\n\tresolved: IResolvedUrl | undefined,\n): resolved is IFluidResolvedUrl => resolved?.type === \"fluid\";\n\n/**\n * @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,\n * so this method is no longer necessary.\n */\nexport function ensureFluidResolvedUrl(\n\tresolved: IResolvedUrl | undefined,\n): asserts resolved is IFluidResolvedUrl {\n\tif (!isFluidResolvedUrl(resolved)) {\n\t\tthrow new Error(`resolved is not a Fluid url. Type: ${resolved?.type}`);\n\t}\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IResolvedUrl, IFluidResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
8
|
-
* so this method is no longer necessary.
|
|
9
|
-
*/
|
|
10
|
-
export declare const isFluidResolvedUrl: (resolved: IResolvedUrl | undefined) => resolved is IFluidResolvedUrl;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
13
|
-
* so this method is no longer necessary.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ensureFluidResolvedUrl(resolved: IResolvedUrl | undefined): asserts resolved is IFluidResolvedUrl;
|
|
16
|
-
//# sourceMappingURL=fluidResolvedUrl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluidResolvedUrl.d.ts","sourceRoot":"","sources":["../src/fluidResolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aACpB,YAAY,GAAG,SAAS,kCAC2B,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,YAAY,GAAG,SAAS,GAChC,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAIvC"}
|
package/lib/fluidResolvedUrl.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
7
|
-
* so this method is no longer necessary.
|
|
8
|
-
*/
|
|
9
|
-
export const isFluidResolvedUrl = (resolved) => (resolved === null || resolved === void 0 ? void 0 : resolved.type) === "fluid";
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
12
|
-
* so this method is no longer necessary.
|
|
13
|
-
*/
|
|
14
|
-
export function ensureFluidResolvedUrl(resolved) {
|
|
15
|
-
if (!isFluidResolvedUrl(resolved)) {
|
|
16
|
-
throw new Error(`resolved is not a Fluid url. Type: ${resolved === null || resolved === void 0 ? void 0 : resolved.type}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=fluidResolvedUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluidResolvedUrl.js","sourceRoot":"","sources":["../src/fluidResolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,QAAkC,EACF,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,OAAO,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACrC,QAAkC;IAElC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAC,CAAC;KACxE;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl, IFluidResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,\n * so this method is no longer necessary.\n */\nexport const isFluidResolvedUrl = (\n\tresolved: IResolvedUrl | undefined,\n): resolved is IFluidResolvedUrl => resolved?.type === \"fluid\";\n\n/**\n * @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,\n * so this method is no longer necessary.\n */\nexport function ensureFluidResolvedUrl(\n\tresolved: IResolvedUrl | undefined,\n): asserts resolved is IFluidResolvedUrl {\n\tif (!isFluidResolvedUrl(resolved)) {\n\t\tthrow new Error(`resolved is not a Fluid url. Type: ${resolved?.type}`);\n\t}\n}\n"]}
|
package/src/fluidResolvedUrl.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { IResolvedUrl, IFluidResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
10
|
-
* so this method is no longer necessary.
|
|
11
|
-
*/
|
|
12
|
-
export const isFluidResolvedUrl = (
|
|
13
|
-
resolved: IResolvedUrl | undefined,
|
|
14
|
-
): resolved is IFluidResolvedUrl => resolved?.type === "fluid";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
18
|
-
* so this method is no longer necessary.
|
|
19
|
-
*/
|
|
20
|
-
export function ensureFluidResolvedUrl(
|
|
21
|
-
resolved: IResolvedUrl | undefined,
|
|
22
|
-
): asserts resolved is IFluidResolvedUrl {
|
|
23
|
-
if (!isFluidResolvedUrl(resolved)) {
|
|
24
|
-
throw new Error(`resolved is not a Fluid url. Type: ${resolved?.type}`);
|
|
25
|
-
}
|
|
26
|
-
}
|