@fluidframework/odsp-urlresolver 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1
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/.eslintrc.js +9 -12
- package/.mocharc.js +2 -2
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/urlResolver.d.ts.map +1 -1
- package/dist/urlResolver.js +4 -1
- package/dist/urlResolver.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/urlResolver.d.ts.map +1 -1
- package/lib/urlResolver.js +4 -1
- package/lib/urlResolver.js.map +1 -1
- package/package.json +70 -69
- package/prettier.config.cjs +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/urlResolver.ts +25 -25
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
package/.eslintrc.js
CHANGED
|
@@ -4,15 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"@typescript-eslint/strict-boolean-expressions": "off"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
13
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
14
|
+
},
|
|
15
|
+
};
|
package/.mocharc.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require(
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/odsp-urlresolver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.1.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/odsp-urlresolver";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.3.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.3.1.1";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.1.1\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAShF,qBAAa,eAAgB,YAAW,YAAY;
|
|
1
|
+
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAShF,qBAAa,eAAgB,YAAW,YAAY;IACtC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAiB7D,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG5F;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,OAEvC,CAAC"}
|
package/dist/urlResolver.js
CHANGED
|
@@ -16,7 +16,10 @@ class OdspUrlResolver {
|
|
|
16
16
|
}
|
|
17
17
|
const urlToBeResolved = (0, odsp_driver_1.createOdspUrl)(Object.assign(Object.assign({}, contents), { dataStorePath: "" }));
|
|
18
18
|
const odspDriverUrlResolver = new odsp_driver_1.OdspDriverUrlResolver();
|
|
19
|
-
return odspDriverUrlResolver.resolve({
|
|
19
|
+
return odspDriverUrlResolver.resolve({
|
|
20
|
+
url: urlToBeResolved,
|
|
21
|
+
headers: request.headers,
|
|
22
|
+
});
|
|
20
23
|
}
|
|
21
24
|
return undefined;
|
|
22
25
|
}
|
package/dist/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,6DAMqC;AAErC,MAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,6DAMqC;AAErC,MAAa,eAAe;IACpB,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,IAAI,IAAA,iBAAS,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAe,EAAC,MAAM,CAAC,CAAC;YAC/C,IAAI,CAAC,QAAQ,EAAE;gBACd,OAAO,SAAS,CAAC;aACjB;YACD,MAAM,eAAe,GAAG,IAAA,2BAAa,kCAAM,QAAQ,KAAE,aAAa,EAAE,EAAE,IAAG,CAAC;YAC1E,MAAM,qBAAqB,GAAiB,IAAI,mCAAqB,EAAE,CAAC;YACxE,OAAO,qBAAqB,CAAC,OAAO,CAAC;gBACpC,GAAG,EAAE,eAAe;gBACpB,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AArBD,0CAqBC;AAEM,MAAM,SAAS,GAAG,CAAC,GAAW,EAAW,EAAE;IACjD,OAAO,IAAA,sBAAQ,EAAC,GAAG,CAAC,IAAI,IAAA,sBAAQ,EAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport {\n\tcreateOdspUrl,\n\tOdspDriverUrlResolver,\n\tisSpoUrl,\n\tisOdcUrl,\n\tgetOdspUrlParts,\n} from \"@fluidframework/odsp-driver\";\n\nexport class OdspUrlResolver implements IUrlResolver {\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\tif (isOdspUrl(request.url)) {\n\t\t\tconst reqUrl = new URL(request.url);\n\t\t\tconst contents = await getOdspUrlParts(reqUrl);\n\t\t\tif (!contents) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst urlToBeResolved = createOdspUrl({ ...contents, dataStorePath: \"\" });\n\t\t\tconst odspDriverUrlResolver: IUrlResolver = new OdspDriverUrlResolver();\n\t\t\treturn odspDriverUrlResolver.resolve({\n\t\t\t\turl: urlToBeResolved,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n\nexport const isOdspUrl = (url: string): boolean => {\n\treturn isSpoUrl(url) || isOdcUrl(url);\n};\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/odsp-urlresolver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.1.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/odsp-urlresolver";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.3.1.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.1.1\";\n"]}
|
package/lib/urlResolver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAShF,qBAAa,eAAgB,YAAW,YAAY;
|
|
1
|
+
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAShF,qBAAa,eAAgB,YAAW,YAAY;IACtC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAiB7D,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG5F;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,OAEvC,CAAC"}
|
package/lib/urlResolver.js
CHANGED
|
@@ -13,7 +13,10 @@ export class OdspUrlResolver {
|
|
|
13
13
|
}
|
|
14
14
|
const urlToBeResolved = createOdspUrl(Object.assign(Object.assign({}, contents), { dataStorePath: "" }));
|
|
15
15
|
const odspDriverUrlResolver = new OdspDriverUrlResolver();
|
|
16
|
-
return odspDriverUrlResolver.resolve({
|
|
16
|
+
return odspDriverUrlResolver.resolve({
|
|
17
|
+
url: urlToBeResolved,
|
|
18
|
+
headers: request.headers,
|
|
19
|
+
});
|
|
17
20
|
}
|
|
18
21
|
return undefined;
|
|
19
22
|
}
|
package/lib/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,eAAe,GACf,MAAM,6BAA6B,CAAC;AAErC,MAAM,OAAO,eAAe;IACpB,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;YAC/C,IAAI,CAAC,QAAQ,EAAE;gBACd,OAAO,SAAS,CAAC;aACjB;YACD,MAAM,eAAe,GAAG,aAAa,iCAAM,QAAQ,KAAE,aAAa,EAAE,EAAE,IAAG,CAAC;YAC1E,MAAM,qBAAqB,GAAiB,IAAI,qBAAqB,EAAE,CAAC;YACxE,OAAO,qBAAqB,CAAC,OAAO,CAAC;gBACpC,GAAG,EAAE,eAAe;gBACpB,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAW,EAAE;IACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport {\n\tcreateOdspUrl,\n\tOdspDriverUrlResolver,\n\tisSpoUrl,\n\tisOdcUrl,\n\tgetOdspUrlParts,\n} from \"@fluidframework/odsp-driver\";\n\nexport class OdspUrlResolver implements IUrlResolver {\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\tif (isOdspUrl(request.url)) {\n\t\t\tconst reqUrl = new URL(request.url);\n\t\t\tconst contents = await getOdspUrlParts(reqUrl);\n\t\t\tif (!contents) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst urlToBeResolved = createOdspUrl({ ...contents, dataStorePath: \"\" });\n\t\t\tconst odspDriverUrlResolver: IUrlResolver = new OdspDriverUrlResolver();\n\t\t\treturn odspDriverUrlResolver.resolve({\n\t\t\t\turl: urlToBeResolved,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n\nexport const isOdspUrl = (url: string): boolean => {\n\treturn isSpoUrl(url) || isOdcUrl(url);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,71 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
2
|
+
"name": "@fluidframework/odsp-urlresolver",
|
|
3
|
+
"version": "2.0.0-internal.3.1.1",
|
|
4
|
+
"description": "Url Resolver for odsp urls.",
|
|
5
|
+
"homepage": "https://fluidframework.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/FluidFramework.git",
|
|
9
|
+
"directory": "packages/drivers/odsp-urlResolver"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Microsoft and contributors",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"module": "lib/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
|
|
19
|
+
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
20
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
21
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
22
|
+
"build:full": "npm run build",
|
|
23
|
+
"build:full:compile": "npm run build:compile",
|
|
24
|
+
"build:genver": "gen-version",
|
|
25
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
26
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
27
|
+
"eslint": "eslint --format stylish src",
|
|
28
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
29
|
+
"format": "npm run prettier:fix",
|
|
30
|
+
"lint": "npm run prettier && npm run eslint",
|
|
31
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
32
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
33
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
34
|
+
"test": "npm run test:mocha",
|
|
35
|
+
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
36
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
37
|
+
"tsc": "tsc",
|
|
38
|
+
"typetests:gen": "flub generate typetests --generate --dir .",
|
|
39
|
+
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.3.1.1 <2.0.0-internal.4.0.0",
|
|
43
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.3.1.1 <2.0.0-internal.4.0.0",
|
|
44
|
+
"@fluidframework/odsp-driver": ">=2.0.0-internal.3.1.1 <2.0.0-internal.4.0.0",
|
|
45
|
+
"@fluidframework/odsp-driver-definitions": ">=2.0.0-internal.3.1.1 <2.0.0-internal.4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@fluid-tools/build-cli": "^0.9.0",
|
|
49
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
50
|
+
"@fluidframework/build-tools": "^0.9.0",
|
|
51
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
52
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.1.1 <2.0.0-internal.4.0.0",
|
|
53
|
+
"@fluidframework/odsp-urlresolver-previous": "npm:@fluidframework/odsp-urlresolver@2.0.0-internal.3.0.1",
|
|
54
|
+
"@rushstack/eslint-config": "^2.5.1",
|
|
55
|
+
"@types/mocha": "^9.1.1",
|
|
56
|
+
"@types/node": "^14.18.36",
|
|
57
|
+
"concurrently": "^6.2.0",
|
|
58
|
+
"cross-env": "^7.0.2",
|
|
59
|
+
"eslint": "~8.6.0",
|
|
60
|
+
"mocha": "^10.0.0",
|
|
61
|
+
"prettier": "~2.6.2",
|
|
62
|
+
"rimraf": "^2.6.2",
|
|
63
|
+
"typescript": "~4.5.5"
|
|
64
|
+
},
|
|
65
|
+
"typeValidation": {
|
|
66
|
+
"version": "2.0.0-internal.3.1.1",
|
|
67
|
+
"previousVersionStyle": "~previousMinor",
|
|
68
|
+
"baselineRange": ">=2.0.0-internal.3.0.0 <2.0.0-internal.3.1.0",
|
|
69
|
+
"baselineVersion": "2.0.0-internal.3.0.1",
|
|
70
|
+
"broken": {}
|
|
71
|
+
}
|
|
71
72
|
}
|
package/prettier.config.cjs
CHANGED
package/src/packageVersion.ts
CHANGED
package/src/urlResolver.ts
CHANGED
|
@@ -6,36 +6,36 @@
|
|
|
6
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
createOdspUrl,
|
|
10
|
+
OdspDriverUrlResolver,
|
|
11
|
+
isSpoUrl,
|
|
12
|
+
isOdcUrl,
|
|
13
|
+
getOdspUrlParts,
|
|
14
14
|
} from "@fluidframework/odsp-driver";
|
|
15
15
|
|
|
16
16
|
export class OdspUrlResolver implements IUrlResolver {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
public async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {
|
|
18
|
+
if (isOdspUrl(request.url)) {
|
|
19
|
+
const reqUrl = new URL(request.url);
|
|
20
|
+
const contents = await getOdspUrlParts(reqUrl);
|
|
21
|
+
if (!contents) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const urlToBeResolved = createOdspUrl({ ...contents, dataStorePath: "" });
|
|
25
|
+
const odspDriverUrlResolver: IUrlResolver = new OdspDriverUrlResolver();
|
|
26
|
+
return odspDriverUrlResolver.resolve({
|
|
27
|
+
url: urlToBeResolved,
|
|
28
|
+
headers: request.headers,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
): Promise<string> {
|
|
35
|
-
throw new Error("Not implemented");
|
|
36
|
-
}
|
|
34
|
+
public async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {
|
|
35
|
+
throw new Error("Not implemented");
|
|
36
|
+
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export const isOdspUrl = (url: string): boolean => {
|
|
40
|
-
|
|
40
|
+
return isSpoUrl(url) || isOdcUrl(url);
|
|
41
41
|
};
|
package/tsconfig.esnext.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./lib",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
},
|
|
7
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"include": [
|
|
12
|
-
"src/**/*"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
2
|
+
"extends": "@fluidframework/build-common/ts-common-config.json",
|
|
3
|
+
"exclude": ["src/test/**/*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"composite": true,
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*"],
|
|
10
|
+
}
|