@fluidframework/routerlicious-urlresolver 2.0.0-internal.3.0.0 → 2.0.0-internal.3.1.0
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 +29 -32
- 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 +9 -3
- 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 +9 -3
- package/lib/urlResolver.js.map +1 -1
- package/package.json +74 -73
- package/prettier.config.cjs +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/urlResolver.ts +150 -139
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +10 -16
package/.eslintrc.js
CHANGED
|
@@ -4,37 +4,34 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
13
|
+
"unicorn/filename-case": [
|
|
14
|
+
"error",
|
|
15
|
+
{
|
|
16
|
+
cases: {
|
|
17
|
+
camelCase: true,
|
|
18
|
+
pascalCase: true,
|
|
19
|
+
},
|
|
20
|
+
ignore: [/.*routerlicious-urlResolver\.spec\.ts/],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
24
|
+
// This library is used in the browser, so we don't want dependencies on most node libraries.
|
|
25
|
+
"import/no-nodejs-modules": ["error", { allow: ["url"] }],
|
|
26
|
+
},
|
|
27
|
+
overrides: [
|
|
28
|
+
{
|
|
29
|
+
// Rules only for test files
|
|
30
|
+
files: ["*.spec.ts", "src/test/**"],
|
|
31
|
+
rules: {
|
|
32
|
+
// Test files are run in node only so additional node libraries can be used.
|
|
33
|
+
"import/no-nodejs-modules": ["error", { allow: ["assert"] }],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
40
37
|
};
|
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/routerlicious-urlresolver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.1.0";
|
|
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/routerlicious-urlresolver";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.3.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.3.1.0";
|
|
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,2CAA2C,CAAC;AACtD,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/routerlicious-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,2CAA2C,CAAC;AACtD,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/routerlicious-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.1.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQjC,qBAAa,wBAAyB,YAAW,YAAY;IAE3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IAGvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAJP,MAAM,EACpB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAC5D,SAAS,EACK,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAC/B,OAAO,EAAE,MAAM;IAGjC;;OAEG;IACU,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IA8G7D,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB5F;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/urlResolver.js
CHANGED
|
@@ -30,7 +30,9 @@ class RouterliciousUrlResolver {
|
|
|
30
30
|
const reqUrl = new URL(requestedUrl);
|
|
31
31
|
const server = reqUrl.hostname.toLowerCase();
|
|
32
32
|
// If we don't have a valid server or a prescriptive config, we cannot resolve the URL
|
|
33
|
-
if (!(r11sServers.includes(server) ||
|
|
33
|
+
if (!(r11sServers.includes(server) ||
|
|
34
|
+
(server === "localhost" && reqUrl.port === "3000") ||
|
|
35
|
+
this.config)) {
|
|
34
36
|
return undefined;
|
|
35
37
|
}
|
|
36
38
|
const path = reqUrl.pathname.split("/");
|
|
@@ -55,7 +57,9 @@ class RouterliciousUrlResolver {
|
|
|
55
57
|
const isInternalRequest = server.includes("gateway"); // e.g. gateway:3000 || fierce-dog-gateway:3000
|
|
56
58
|
const serverSuffix = isLocalHost ? `${server}:3003` : server.substring(4);
|
|
57
59
|
let fluidUrl = "fluid://" +
|
|
58
|
-
`${this.config
|
|
60
|
+
`${this.config
|
|
61
|
+
? (0, url_1.parse)(this.config.provider.get("worker:serverUrl")).host
|
|
62
|
+
: serverSuffix}/` +
|
|
59
63
|
`${encodeURIComponent(tenantId)}/` +
|
|
60
64
|
`${encodeURIComponent(documentId)}`;
|
|
61
65
|
// In case of any additional parameters add them back to the url
|
|
@@ -75,7 +79,9 @@ class RouterliciousUrlResolver {
|
|
|
75
79
|
deltaStorageUrl = `${provider.get("worker:alfredUrl")}/deltas/${encodeURIComponent(tenantId)}/${encodeURIComponent(documentId)}`;
|
|
76
80
|
}
|
|
77
81
|
else if (provider) {
|
|
78
|
-
storageUrl = provider
|
|
82
|
+
storageUrl = provider
|
|
83
|
+
.get("worker:blobStorageUrl")
|
|
84
|
+
.replace("historian:3000", "localhost:3001");
|
|
79
85
|
ordererUrl = provider.get("worker:serverUrl");
|
|
80
86
|
deltaStorageUrl = `${ordererUrl}/deltas/${encodeURIComponent(tenantId)}/${encodeURIComponent(documentId)}`;
|
|
81
87
|
}
|
package/dist/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../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,UAAU;gBACV,eAAe;gBACf,UAAU;aACV;YACD,EAAE,EAAE,UAAU;YACd,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;YACtB,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,QAAQ;SACb,CAAC;QACF,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,gBAAgB,GAAG,WAAgC,CAAC;QAE1D,MAAM,SAAS,GAAG,IAAA,WAAK,EAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAA,qBAAM,EAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAClE,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAA,qBAAM,EAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACzD,IAAA,qBAAM,EAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAE7D,IAAI,GAAG,GAAG,WAAW,CAAC;QACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAC3E,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;CACD;AA5ID,4DA4IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IFluidResolvedUrl, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport { IUser } from \"@fluidframework/protocol-definitions\";\nimport { Provider } from \"nconf\";\n\nconst r11sServers = [\n\t\"www.wu2-ppe.prague.office-int.com\",\n\t\"www.wu2.prague.office-int.com\",\n\t\"www.eu.prague.office-int.com\",\n];\n\nexport class RouterliciousUrlResolver implements IUrlResolver {\n\tconstructor(\n\t\tprivate readonly config:\n\t\t\t| { provider: Provider; tenantId: string; documentId: string }\n\t\t\t| undefined,\n\t\tprivate readonly getToken: () => Promise<string>,\n\t\tprivate readonly hostUrl: string,\n\t) {}\n\n\t/**\n\t * Handles a request and returns the relevant endpoints for the environment\n\t */\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\tlet requestedUrl = request.url;\n\n\t\t// If we know the original hostname, reinsert it\n\t\tif (this.config && request.url.startsWith(\"/\")) {\n\t\t\trequestedUrl = `http://dummy:3000${request.url}`;\n\t\t}\n\n\t\tconst reqUrl = new URL(requestedUrl);\n\t\tconst server = reqUrl.hostname.toLowerCase();\n\n\t\t// If we don't have a valid server or a prescriptive config, we cannot resolve the URL\n\t\tif (\n\t\t\t!(\n\t\t\t\tr11sServers.includes(server) ||\n\t\t\t\t(server === \"localhost\" && reqUrl.port === \"3000\") ||\n\t\t\t\tthis.config\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst path = reqUrl.pathname.split(\"/\");\n\t\tlet tenantId: string;\n\t\tlet documentId: string;\n\t\tlet provider: Provider | undefined;\n\t\tif (this.config) {\n\t\t\ttenantId = this.config.tenantId;\n\t\t\tdocumentId = this.config.documentId;\n\t\t\tprovider = this.config.provider;\n\t\t} else if (path.length >= 4) {\n\t\t\ttenantId = path[2];\n\t\t\tdocumentId = path[3];\n\t\t} else {\n\t\t\ttenantId = \"fluid\";\n\t\t\tdocumentId = path[2];\n\t\t}\n\n\t\tconst token = await this.getToken();\n\n\t\tconst isLocalHost = server === \"localhost\";\n\t\tconst isInternalRequest = server.includes(\"gateway\"); // e.g. gateway:3000 || fierce-dog-gateway:3000\n\n\t\tconst serverSuffix = isLocalHost ? `${server}:3003` : server.substring(4);\n\n\t\tlet fluidUrl =\n\t\t\t\"fluid://\" +\n\t\t\t`${\n\t\t\t\tthis.config\n\t\t\t\t\t? parse(this.config.provider.get(\"worker:serverUrl\")).host\n\t\t\t\t\t: serverSuffix\n\t\t\t}/` +\n\t\t\t`${encodeURIComponent(tenantId)}/` +\n\t\t\t`${encodeURIComponent(documentId)}`;\n\n\t\t// In case of any additional parameters add them back to the url\n\t\tif (reqUrl.search) {\n\t\t\tconst searchParams = reqUrl.search;\n\t\t\tif (searchParams) {\n\t\t\t\tfluidUrl += searchParams;\n\t\t\t}\n\t\t}\n\n\t\tlet storageUrl = \"\";\n\t\tlet ordererUrl = \"\";\n\t\tlet deltaStorageUrl = \"\";\n\n\t\t// There is no provider when using debugging tooling\n\t\tif (provider && isInternalRequest) {\n\t\t\tstorageUrl = provider.get(\"worker:internalBlobStorageUrl\");\n\t\t\tordererUrl = provider.get(\"worker:alfredUrl\");\n\t\t\tdeltaStorageUrl = `${provider.get(\"worker:alfredUrl\")}/deltas/${encodeURIComponent(\n\t\t\t\ttenantId,\n\t\t\t)}/${encodeURIComponent(documentId)}`;\n\t\t} else if (provider) {\n\t\t\tstorageUrl = provider\n\t\t\t\t.get(\"worker:blobStorageUrl\")\n\t\t\t\t.replace(\"historian:3000\", \"localhost:3001\");\n\t\t\tordererUrl = provider.get(\"worker:serverUrl\");\n\t\t\tdeltaStorageUrl = `${ordererUrl}/deltas/${encodeURIComponent(\n\t\t\t\ttenantId,\n\t\t\t)}/${encodeURIComponent(documentId)}`;\n\t\t} else if (isLocalHost) {\n\t\t\tstorageUrl = `http://localhost:3001`;\n\t\t\tordererUrl = `http://localhost:3003`;\n\t\t\tdeltaStorageUrl = `http://localhost:3003/deltas/${tenantId}/${documentId}`;\n\t\t} else {\n\t\t\tstorageUrl = `https://historian.${serverSuffix}`;\n\t\t\tordererUrl = `https://alfred.${serverSuffix}`;\n\t\t\tdeltaStorageUrl = `https://alfred.${serverSuffix}/deltas/${tenantId}/${documentId}`;\n\t\t}\n\n\t\tstorageUrl += `/repos/${tenantId}`;\n\t\tordererUrl += ``;\n\t\tdeltaStorageUrl += ``;\n\n\t\tconst resolved: IFluidResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tstorageUrl,\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: { jwt: token },\n\t\t\ttype: \"fluid\",\n\t\t\turl: fluidUrl,\n\t\t};\n\t\treturn resolved;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst fluidResolvedUrl = resolvedUrl as IFluidResolvedUrl;\n\n\t\tconst parsedUrl = parse(fluidResolvedUrl.url);\n\t\tassert(!!parsedUrl.pathname, 0x0b9 /* \"PathName should exist\" */);\n\t\tconst [, tenantId, documentId] = parsedUrl.pathname.split(\"/\");\n\t\tassert(!!tenantId, 0x0ba /* \"Tenant id should exist\" */);\n\t\tassert(!!documentId, 0x0bb /* \"Document id should exist\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n}\n\nexport interface IAlfredUser extends IUser {\n\tdisplayName: string;\n\tname: string;\n}\n\nexport interface IConfig {\n\tserverUrl: string;\n\tblobStorageUrl: string;\n\ttenantId: string;\n\tdocumentId: string;\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/routerlicious-urlresolver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.1.0";
|
|
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/routerlicious-urlresolver";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.3.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.3.1.0";
|
|
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,2CAA2C,CAAC;AACnE,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/routerlicious-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,2CAA2C,CAAC;AACnE,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/routerlicious-urlresolver\";\nexport const pkgVersion = \"2.0.0-internal.3.1.0\";\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;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQjC,qBAAa,wBAAyB,YAAW,YAAY;IAE3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IAGvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAJP,MAAM,EACpB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAC5D,SAAS,EACK,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAC/B,OAAO,EAAE,MAAM;IAGjC;;OAEG;IACU,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IA8G7D,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB5F;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB"}
|
package/lib/urlResolver.js
CHANGED
|
@@ -27,7 +27,9 @@ export class RouterliciousUrlResolver {
|
|
|
27
27
|
const reqUrl = new URL(requestedUrl);
|
|
28
28
|
const server = reqUrl.hostname.toLowerCase();
|
|
29
29
|
// If we don't have a valid server or a prescriptive config, we cannot resolve the URL
|
|
30
|
-
if (!(r11sServers.includes(server) ||
|
|
30
|
+
if (!(r11sServers.includes(server) ||
|
|
31
|
+
(server === "localhost" && reqUrl.port === "3000") ||
|
|
32
|
+
this.config)) {
|
|
31
33
|
return undefined;
|
|
32
34
|
}
|
|
33
35
|
const path = reqUrl.pathname.split("/");
|
|
@@ -52,7 +54,9 @@ export class RouterliciousUrlResolver {
|
|
|
52
54
|
const isInternalRequest = server.includes("gateway"); // e.g. gateway:3000 || fierce-dog-gateway:3000
|
|
53
55
|
const serverSuffix = isLocalHost ? `${server}:3003` : server.substring(4);
|
|
54
56
|
let fluidUrl = "fluid://" +
|
|
55
|
-
`${this.config
|
|
57
|
+
`${this.config
|
|
58
|
+
? parse(this.config.provider.get("worker:serverUrl")).host
|
|
59
|
+
: serverSuffix}/` +
|
|
56
60
|
`${encodeURIComponent(tenantId)}/` +
|
|
57
61
|
`${encodeURIComponent(documentId)}`;
|
|
58
62
|
// In case of any additional parameters add them back to the url
|
|
@@ -72,7 +76,9 @@ export class RouterliciousUrlResolver {
|
|
|
72
76
|
deltaStorageUrl = `${provider.get("worker:alfredUrl")}/deltas/${encodeURIComponent(tenantId)}/${encodeURIComponent(documentId)}`;
|
|
73
77
|
}
|
|
74
78
|
else if (provider) {
|
|
75
|
-
storageUrl = provider
|
|
79
|
+
storageUrl = provider
|
|
80
|
+
.get("worker:blobStorageUrl")
|
|
81
|
+
.replace("historian:3000", "localhost:3001");
|
|
76
82
|
ordererUrl = provider.get("worker:serverUrl");
|
|
77
83
|
deltaStorageUrl = `${ordererUrl}/deltas/${encodeURIComponent(tenantId)}/${encodeURIComponent(documentId)}`;
|
|
78
84
|
}
|
package/lib/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMtD,MAAM,WAAW,GAAG;IACnB,mCAAmC;IACnC,+BAA+B;IAC/B,8BAA8B;CAC9B,CAAC;AAEF,MAAM,OAAO,wBAAwB;IACpC,YACkB,MAEL,EACK,QAA+B,EAC/B,OAAe;QAJf,WAAM,GAAN,MAAM,CAEX;QACK,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,IAAI,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;QAE/B,gDAAgD;QAChD,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC/C,YAAY,GAAG,oBAAoB,OAAO,CAAC,GAAG,EAAE,CAAC;SACjD;QAED,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QAE7C,sFAAsF;QACtF,IACC,CAAC,CACA,WAAW,CAAC,QAAQ,CAAC,MA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AC,QAAQ,CAAC,IAAI,kBAAkB,CAC3E,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IFluidResolvedUrl, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport { IUser } from \"@fluidframework/protocol-definitions\";\nimport { Provider } from \"nconf\";\n\nconst r11sServers = [\n\t\"www.wu2-ppe.prague.office-int.com\",\n\t\"www.wu2.prague.office-int.com\",\n\t\"www.eu.prague.office-int.com\",\n];\n\nexport class RouterliciousUrlResolver implements IUrlResolver {\n\tconstructor(\n\t\tprivate readonly config:\n\t\t\t| { provider: Provider; tenantId: string; documentId: string }\n\t\t\t| undefined,\n\t\tprivate readonly getToken: () => Promise<string>,\n\t\tprivate readonly hostUrl: string,\n\t) {}\n\n\t/**\n\t * Handles a request and returns the relevant endpoints for the environment\n\t */\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\tlet requestedUrl = request.url;\n\n\t\t// If we know the original hostname, reinsert it\n\t\tif (this.config && request.url.startsWith(\"/\")) {\n\t\t\trequestedUrl = `http://dummy:3000${request.url}`;\n\t\t}\n\n\t\tconst reqUrl = new URL(requestedUrl);\n\t\tconst server = reqUrl.hostname.toLowerCase();\n\n\t\t// If we don't have a valid server or a prescriptive config, we cannot resolve the URL\n\t\tif (\n\t\t\t!(\n\t\t\t\tr11sServers.includes(server) ||\n\t\t\t\t(server === \"localhost\" && reqUrl.port === \"3000\") ||\n\t\t\t\tthis.config\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst path = reqUrl.pathname.split(\"/\");\n\t\tlet tenantId: string;\n\t\tlet documentId: string;\n\t\tlet provider: Provider | undefined;\n\t\tif (this.config) {\n\t\t\ttenantId = this.config.tenantId;\n\t\t\tdocumentId = this.config.documentId;\n\t\t\tprovider = this.config.provider;\n\t\t} else if (path.length >= 4) {\n\t\t\ttenantId = path[2];\n\t\t\tdocumentId = path[3];\n\t\t} else {\n\t\t\ttenantId = \"fluid\";\n\t\t\tdocumentId = path[2];\n\t\t}\n\n\t\tconst token = await this.getToken();\n\n\t\tconst isLocalHost = server === \"localhost\";\n\t\tconst isInternalRequest = server.includes(\"gateway\"); // e.g. gateway:3000 || fierce-dog-gateway:3000\n\n\t\tconst serverSuffix = isLocalHost ? `${server}:3003` : server.substring(4);\n\n\t\tlet fluidUrl =\n\t\t\t\"fluid://\" +\n\t\t\t`${\n\t\t\t\tthis.config\n\t\t\t\t\t? parse(this.config.provider.get(\"worker:serverUrl\")).host\n\t\t\t\t\t: serverSuffix\n\t\t\t}/` +\n\t\t\t`${encodeURIComponent(tenantId)}/` +\n\t\t\t`${encodeURIComponent(documentId)}`;\n\n\t\t// In case of any additional parameters add them back to the url\n\t\tif (reqUrl.search) {\n\t\t\tconst searchParams = reqUrl.search;\n\t\t\tif (searchParams) {\n\t\t\t\tfluidUrl += searchParams;\n\t\t\t}\n\t\t}\n\n\t\tlet storageUrl = \"\";\n\t\tlet ordererUrl = \"\";\n\t\tlet deltaStorageUrl = \"\";\n\n\t\t// There is no provider when using debugging tooling\n\t\tif (provider && isInternalRequest) {\n\t\t\tstorageUrl = provider.get(\"worker:internalBlobStorageUrl\");\n\t\t\tordererUrl = provider.get(\"worker:alfredUrl\");\n\t\t\tdeltaStorageUrl = `${provider.get(\"worker:alfredUrl\")}/deltas/${encodeURIComponent(\n\t\t\t\ttenantId,\n\t\t\t)}/${encodeURIComponent(documentId)}`;\n\t\t} else if (provider) {\n\t\t\tstorageUrl = provider\n\t\t\t\t.get(\"worker:blobStorageUrl\")\n\t\t\t\t.replace(\"historian:3000\", \"localhost:3001\");\n\t\t\tordererUrl = provider.get(\"worker:serverUrl\");\n\t\t\tdeltaStorageUrl = `${ordererUrl}/deltas/${encodeURIComponent(\n\t\t\t\ttenantId,\n\t\t\t)}/${encodeURIComponent(documentId)}`;\n\t\t} else if (isLocalHost) {\n\t\t\tstorageUrl = `http://localhost:3001`;\n\t\t\tordererUrl = `http://localhost:3003`;\n\t\t\tdeltaStorageUrl = `http://localhost:3003/deltas/${tenantId}/${documentId}`;\n\t\t} else {\n\t\t\tstorageUrl = `https://historian.${serverSuffix}`;\n\t\t\tordererUrl = `https://alfred.${serverSuffix}`;\n\t\t\tdeltaStorageUrl = `https://alfred.${serverSuffix}/deltas/${tenantId}/${documentId}`;\n\t\t}\n\n\t\tstorageUrl += `/repos/${tenantId}`;\n\t\tordererUrl += ``;\n\t\tdeltaStorageUrl += ``;\n\n\t\tconst resolved: IFluidResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tstorageUrl,\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: { jwt: token },\n\t\t\ttype: \"fluid\",\n\t\t\turl: fluidUrl,\n\t\t};\n\t\treturn resolved;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst fluidResolvedUrl = resolvedUrl as IFluidResolvedUrl;\n\n\t\tconst parsedUrl = parse(fluidResolvedUrl.url);\n\t\tassert(!!parsedUrl.pathname, 0x0b9 /* \"PathName should exist\" */);\n\t\tconst [, tenantId, documentId] = parsedUrl.pathname.split(\"/\");\n\t\tassert(!!tenantId, 0x0ba /* \"Tenant id should exist\" */);\n\t\tassert(!!documentId, 0x0bb /* \"Document id should exist\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n}\n\nexport interface IAlfredUser extends IUser {\n\tdisplayName: string;\n\tname: string;\n}\n\nexport interface IConfig {\n\tserverUrl: string;\n\tblobStorageUrl: string;\n\ttenantId: string;\n\tdocumentId: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,75 +1,76 @@
|
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
"name": "@fluidframework/routerlicious-urlresolver",
|
|
3
|
+
"version": "2.0.0-internal.3.1.0",
|
|
4
|
+
"description": "Url Resolver for routerlicious urls.",
|
|
5
|
+
"homepage": "https://fluidframework.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/FluidFramework.git",
|
|
9
|
+
"directory": "packages/drivers/routerlicious-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/common-utils": "^1.0.0",
|
|
43
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.3.1.0 <2.0.0-internal.4.0.0",
|
|
44
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.3.1.0 <2.0.0-internal.4.0.0",
|
|
45
|
+
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
46
|
+
"nconf": "^0.12.0",
|
|
47
|
+
"url": "^0.11.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@fluid-tools/build-cli": "^0.9.0",
|
|
51
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
52
|
+
"@fluidframework/build-tools": "^0.9.0",
|
|
53
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
54
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.1.0 <2.0.0-internal.4.0.0",
|
|
55
|
+
"@fluidframework/routerlicious-urlresolver-previous": "npm:@fluidframework/routerlicious-urlresolver@2.0.0-internal.3.0.0",
|
|
56
|
+
"@rushstack/eslint-config": "^2.5.1",
|
|
57
|
+
"@types/mocha": "^9.1.1",
|
|
58
|
+
"@types/nconf": "^0.10.0",
|
|
59
|
+
"@types/node": "^14.18.36",
|
|
60
|
+
"assert": "^2.0.0",
|
|
61
|
+
"concurrently": "^6.2.0",
|
|
62
|
+
"cross-env": "^7.0.2",
|
|
63
|
+
"eslint": "~8.6.0",
|
|
64
|
+
"mocha": "^10.0.0",
|
|
65
|
+
"prettier": "~2.6.2",
|
|
66
|
+
"rimraf": "^2.6.2",
|
|
67
|
+
"typescript": "~4.5.5"
|
|
68
|
+
},
|
|
69
|
+
"typeValidation": {
|
|
70
|
+
"version": "2.0.0-internal.3.1.0",
|
|
71
|
+
"previousVersionStyle": "~previousMinor",
|
|
72
|
+
"baselineRange": ">=2.0.0-internal.3.0.0 <2.0.0-internal.3.1.0",
|
|
73
|
+
"baselineVersion": "2.0.0-internal.3.0.0",
|
|
74
|
+
"broken": {}
|
|
75
|
+
}
|
|
75
76
|
}
|
package/prettier.config.cjs
CHANGED
package/src/packageVersion.ts
CHANGED
package/src/urlResolver.ts
CHANGED
|
@@ -5,156 +5,167 @@
|
|
|
5
5
|
|
|
6
6
|
import { parse } from "url";
|
|
7
7
|
import { assert } from "@fluidframework/common-utils";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
} from "@fluidframework/core-interfaces";
|
|
11
|
-
import {
|
|
12
|
-
IFluidResolvedUrl,
|
|
13
|
-
IResolvedUrl,
|
|
14
|
-
IUrlResolver,
|
|
15
|
-
} from "@fluidframework/driver-definitions";
|
|
8
|
+
import { IRequest } from "@fluidframework/core-interfaces";
|
|
9
|
+
import { IFluidResolvedUrl, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
16
10
|
import { IUser } from "@fluidframework/protocol-definitions";
|
|
17
11
|
import { Provider } from "nconf";
|
|
18
12
|
|
|
19
13
|
const r11sServers = [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
"www.wu2-ppe.prague.office-int.com",
|
|
15
|
+
"www.wu2.prague.office-int.com",
|
|
16
|
+
"www.eu.prague.office-int.com",
|
|
23
17
|
];
|
|
24
18
|
|
|
25
19
|
export class RouterliciousUrlResolver implements IUrlResolver {
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
20
|
+
constructor(
|
|
21
|
+
private readonly config:
|
|
22
|
+
| { provider: Provider; tenantId: string; documentId: string }
|
|
23
|
+
| undefined,
|
|
24
|
+
private readonly getToken: () => Promise<string>,
|
|
25
|
+
private readonly hostUrl: string,
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Handles a request and returns the relevant endpoints for the environment
|
|
30
|
+
*/
|
|
31
|
+
public async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {
|
|
32
|
+
let requestedUrl = request.url;
|
|
33
|
+
|
|
34
|
+
// If we know the original hostname, reinsert it
|
|
35
|
+
if (this.config && request.url.startsWith("/")) {
|
|
36
|
+
requestedUrl = `http://dummy:3000${request.url}`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const reqUrl = new URL(requestedUrl);
|
|
40
|
+
const server = reqUrl.hostname.toLowerCase();
|
|
41
|
+
|
|
42
|
+
// If we don't have a valid server or a prescriptive config, we cannot resolve the URL
|
|
43
|
+
if (
|
|
44
|
+
!(
|
|
45
|
+
r11sServers.includes(server) ||
|
|
46
|
+
(server === "localhost" && reqUrl.port === "3000") ||
|
|
47
|
+
this.config
|
|
48
|
+
)
|
|
49
|
+
) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const path = reqUrl.pathname.split("/");
|
|
54
|
+
let tenantId: string;
|
|
55
|
+
let documentId: string;
|
|
56
|
+
let provider: Provider | undefined;
|
|
57
|
+
if (this.config) {
|
|
58
|
+
tenantId = this.config.tenantId;
|
|
59
|
+
documentId = this.config.documentId;
|
|
60
|
+
provider = this.config.provider;
|
|
61
|
+
} else if (path.length >= 4) {
|
|
62
|
+
tenantId = path[2];
|
|
63
|
+
documentId = path[3];
|
|
64
|
+
} else {
|
|
65
|
+
tenantId = "fluid";
|
|
66
|
+
documentId = path[2];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const token = await this.getToken();
|
|
70
|
+
|
|
71
|
+
const isLocalHost = server === "localhost";
|
|
72
|
+
const isInternalRequest = server.includes("gateway"); // e.g. gateway:3000 || fierce-dog-gateway:3000
|
|
73
|
+
|
|
74
|
+
const serverSuffix = isLocalHost ? `${server}:3003` : server.substring(4);
|
|
75
|
+
|
|
76
|
+
let fluidUrl =
|
|
77
|
+
"fluid://" +
|
|
78
|
+
`${
|
|
79
|
+
this.config
|
|
80
|
+
? parse(this.config.provider.get("worker:serverUrl")).host
|
|
81
|
+
: serverSuffix
|
|
82
|
+
}/` +
|
|
83
|
+
`${encodeURIComponent(tenantId)}/` +
|
|
84
|
+
`${encodeURIComponent(documentId)}`;
|
|
85
|
+
|
|
86
|
+
// In case of any additional parameters add them back to the url
|
|
87
|
+
if (reqUrl.search) {
|
|
88
|
+
const searchParams = reqUrl.search;
|
|
89
|
+
if (searchParams) {
|
|
90
|
+
fluidUrl += searchParams;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let storageUrl = "";
|
|
95
|
+
let ordererUrl = "";
|
|
96
|
+
let deltaStorageUrl = "";
|
|
97
|
+
|
|
98
|
+
// There is no provider when using debugging tooling
|
|
99
|
+
if (provider && isInternalRequest) {
|
|
100
|
+
storageUrl = provider.get("worker:internalBlobStorageUrl");
|
|
101
|
+
ordererUrl = provider.get("worker:alfredUrl");
|
|
102
|
+
deltaStorageUrl = `${provider.get("worker:alfredUrl")}/deltas/${encodeURIComponent(
|
|
103
|
+
tenantId,
|
|
104
|
+
)}/${encodeURIComponent(documentId)}`;
|
|
105
|
+
} else if (provider) {
|
|
106
|
+
storageUrl = provider
|
|
107
|
+
.get("worker:blobStorageUrl")
|
|
108
|
+
.replace("historian:3000", "localhost:3001");
|
|
109
|
+
ordererUrl = provider.get("worker:serverUrl");
|
|
110
|
+
deltaStorageUrl = `${ordererUrl}/deltas/${encodeURIComponent(
|
|
111
|
+
tenantId,
|
|
112
|
+
)}/${encodeURIComponent(documentId)}`;
|
|
113
|
+
} else if (isLocalHost) {
|
|
114
|
+
storageUrl = `http://localhost:3001`;
|
|
115
|
+
ordererUrl = `http://localhost:3003`;
|
|
116
|
+
deltaStorageUrl = `http://localhost:3003/deltas/${tenantId}/${documentId}`;
|
|
117
|
+
} else {
|
|
118
|
+
storageUrl = `https://historian.${serverSuffix}`;
|
|
119
|
+
ordererUrl = `https://alfred.${serverSuffix}`;
|
|
120
|
+
deltaStorageUrl = `https://alfred.${serverSuffix}/deltas/${tenantId}/${documentId}`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
storageUrl += `/repos/${tenantId}`;
|
|
124
|
+
ordererUrl += ``;
|
|
125
|
+
deltaStorageUrl += ``;
|
|
126
|
+
|
|
127
|
+
const resolved: IFluidResolvedUrl = {
|
|
128
|
+
endpoints: {
|
|
129
|
+
storageUrl,
|
|
130
|
+
deltaStorageUrl,
|
|
131
|
+
ordererUrl,
|
|
132
|
+
},
|
|
133
|
+
id: documentId,
|
|
134
|
+
tokens: { jwt: token },
|
|
135
|
+
type: "fluid",
|
|
136
|
+
url: fluidUrl,
|
|
137
|
+
};
|
|
138
|
+
return resolved;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {
|
|
142
|
+
const fluidResolvedUrl = resolvedUrl as IFluidResolvedUrl;
|
|
143
|
+
|
|
144
|
+
const parsedUrl = parse(fluidResolvedUrl.url);
|
|
145
|
+
assert(!!parsedUrl.pathname, 0x0b9 /* "PathName should exist" */);
|
|
146
|
+
const [, tenantId, documentId] = parsedUrl.pathname.split("/");
|
|
147
|
+
assert(!!tenantId, 0x0ba /* "Tenant id should exist" */);
|
|
148
|
+
assert(!!documentId, 0x0bb /* "Document id should exist" */);
|
|
149
|
+
|
|
150
|
+
let url = relativeUrl;
|
|
151
|
+
if (url.startsWith("/")) {
|
|
152
|
+
url = url.substr(1);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return `${this.hostUrl}/${encodeURIComponent(tenantId)}/${encodeURIComponent(
|
|
156
|
+
documentId,
|
|
157
|
+
)}/${url}`;
|
|
158
|
+
}
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
export interface IAlfredUser extends IUser {
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
displayName: string;
|
|
163
|
+
name: string;
|
|
153
164
|
}
|
|
154
165
|
|
|
155
166
|
export interface IConfig {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
serverUrl: string;
|
|
168
|
+
blobStorageUrl: string;
|
|
169
|
+
tenantId: string;
|
|
170
|
+
documentId: string;
|
|
160
171
|
}
|
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,17 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
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
|
+
"types": ["node"],
|
|
9
|
+
},
|
|
10
|
+
"include": ["src/**/*"],
|
|
11
|
+
}
|