@fluidframework/aqueduct 2.0.0-internal.7.4.0 → 2.0.0-internal.8.0.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/dist/aqueduct-alpha.d.ts +4 -35
- package/dist/aqueduct-beta.d.ts +0 -26
- package/dist/aqueduct-public.d.ts +0 -26
- package/dist/aqueduct-untrimmed.d.ts +4 -98
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.cjs.map +1 -1
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +1 -1
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.cjs +13 -4
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.cjs.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/data-object-factories/index.cjs.map +1 -1
- package/dist/data-object-factories/index.d.ts +1 -1
- package/dist/data-object-factories/index.d.ts.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.cjs.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.d.ts +1 -10
- package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/dist/data-objects/pureDataObject.cjs +0 -7
- package/dist/data-objects/pureDataObject.cjs.map +1 -1
- package/dist/data-objects/pureDataObject.d.ts +2 -6
- package/dist/data-objects/pureDataObject.d.ts.map +1 -1
- package/dist/index.cjs +1 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/lib/aqueduct-alpha.d.ts +4 -35
- package/lib/aqueduct-beta.d.ts +0 -26
- package/lib/aqueduct-public.d.ts +0 -26
- package/lib/aqueduct-untrimmed.d.ts +4 -98
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.mjs.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs +13 -3
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs.map +1 -1
- package/lib/data-object-factories/index.d.ts +1 -1
- package/lib/data-object-factories/index.d.ts.map +1 -1
- package/lib/data-object-factories/index.mjs.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.d.ts +1 -10
- package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.mjs.map +1 -1
- package/lib/data-objects/pureDataObject.d.ts +2 -6
- package/lib/data-objects/pureDataObject.d.ts.map +1 -1
- package/lib/data-objects/pureDataObject.mjs +0 -7
- package/lib/data-objects/pureDataObject.mjs.map +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +1 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +55 -17
- package/dist/request-handlers/index.cjs +0 -12
- package/dist/request-handlers/index.cjs.map +0 -1
- package/dist/request-handlers/index.d.ts +0 -6
- package/dist/request-handlers/index.d.ts.map +0 -1
- package/dist/request-handlers/requestHandlers.cjs +0 -93
- package/dist/request-handlers/requestHandlers.cjs.map +0 -1
- package/dist/request-handlers/requestHandlers.d.ts +0 -46
- package/dist/request-handlers/requestHandlers.d.ts.map +0 -1
- package/dist/utils/containerInteractions.cjs +0 -76
- package/dist/utils/containerInteractions.cjs.map +0 -1
- package/dist/utils/containerInteractions.d.ts +0 -42
- package/dist/utils/containerInteractions.d.ts.map +0 -1
- package/dist/utils/index.cjs +0 -12
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/index.d.ts.map +0 -1
- package/lib/request-handlers/index.d.ts +0 -6
- package/lib/request-handlers/index.d.ts.map +0 -1
- package/lib/request-handlers/index.mjs +0 -6
- package/lib/request-handlers/index.mjs.map +0 -1
- package/lib/request-handlers/requestHandlers.d.ts +0 -46
- package/lib/request-handlers/requestHandlers.d.ts.map +0 -1
- package/lib/request-handlers/requestHandlers.mjs +0 -86
- package/lib/request-handlers/requestHandlers.mjs.map +0 -1
- package/lib/utils/containerInteractions.d.ts +0 -38
- package/lib/utils/containerInteractions.d.ts.map +0 -1
- package/lib/utils/containerInteractions.mjs +0 -70
- package/lib/utils/containerInteractions.mjs.map +0 -1
- package/lib/utils/index.d.ts +0 -6
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.mjs +0 -6
- package/lib/utils/index.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/aqueduct",
|
|
3
|
-
"version": "2.0.0-internal.
|
|
3
|
+
"version": "2.0.0-internal.8.0.1",
|
|
4
4
|
"description": "A set of implementations for Fluid Framework interfaces.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
"temp-directory": "nyc/.nyc_output"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@fluid-internal/client-utils": ">=2.0.0-internal.
|
|
44
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.
|
|
45
|
-
"@fluidframework/container-runtime": ">=2.0.0-internal.
|
|
46
|
-
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.
|
|
47
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.
|
|
48
|
-
"@fluidframework/core-utils": ">=2.0.0-internal.
|
|
49
|
-
"@fluidframework/datastore": ">=2.0.0-internal.
|
|
50
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-internal.
|
|
51
|
-
"@fluidframework/map": ">=2.0.0-internal.
|
|
52
|
-
"@fluidframework/request-handler": ">=2.0.0-internal.
|
|
53
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.
|
|
54
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.
|
|
55
|
-
"@fluidframework/synthesize": ">=2.0.0-internal.
|
|
56
|
-
"@fluidframework/view-interfaces": ">=2.0.0-internal.
|
|
43
|
+
"@fluid-internal/client-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
44
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
45
|
+
"@fluidframework/container-runtime": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
46
|
+
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
47
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
48
|
+
"@fluidframework/core-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
49
|
+
"@fluidframework/datastore": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
50
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
51
|
+
"@fluidframework/map": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
52
|
+
"@fluidframework/request-handler": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
53
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
54
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
55
|
+
"@fluidframework/synthesize": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
56
|
+
"@fluidframework/view-interfaces": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
57
57
|
"uuid": "^9.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@fluidframework/build-common": "^2.0.3",
|
|
64
64
|
"@fluidframework/build-tools": "^0.28.0",
|
|
65
65
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
66
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.
|
|
66
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
|
|
67
67
|
"@microsoft/api-extractor": "^7.38.3",
|
|
68
68
|
"@types/events": "^3.0.0",
|
|
69
69
|
"@types/mocha": "^9.1.1",
|
|
@@ -94,7 +94,45 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"typeValidation": {
|
|
97
|
-
"broken": {
|
|
97
|
+
"broken": {
|
|
98
|
+
"RemovedFunctionDeclaration_getDefaultObjectFromContainer": {
|
|
99
|
+
"forwardCompat": false,
|
|
100
|
+
"backCompat": false
|
|
101
|
+
},
|
|
102
|
+
"RemovedFunctionDeclaration_getObjectFromContainer": {
|
|
103
|
+
"forwardCompat": false,
|
|
104
|
+
"backCompat": false
|
|
105
|
+
},
|
|
106
|
+
"RemovedFunctionDeclaration_getObjectWithIdFromContainer": {
|
|
107
|
+
"forwardCompat": false,
|
|
108
|
+
"backCompat": false
|
|
109
|
+
},
|
|
110
|
+
"RemovedFunctionDeclaration_defaultFluidObjectRequestHandler": {
|
|
111
|
+
"forwardCompat": false,
|
|
112
|
+
"backCompat": false
|
|
113
|
+
},
|
|
114
|
+
"RemovedVariableDeclaration_defaultRouteRequestHandler": {
|
|
115
|
+
"forwardCompat": false,
|
|
116
|
+
"backCompat": false
|
|
117
|
+
},
|
|
118
|
+
"RemovedVariableDeclaration_mountableViewRequestHandler": {
|
|
119
|
+
"forwardCompat": false,
|
|
120
|
+
"backCompat": false
|
|
121
|
+
},
|
|
122
|
+
"ClassDeclaration_DataObject": {
|
|
123
|
+
"backCompat": false
|
|
124
|
+
},
|
|
125
|
+
"RemovedInterfaceDeclaration_IRootDataObjectFactory": {
|
|
126
|
+
"forwardCompat": false,
|
|
127
|
+
"backCompat": false
|
|
128
|
+
},
|
|
129
|
+
"ClassDeclaration_PureDataObject": {
|
|
130
|
+
"backCompat": false
|
|
131
|
+
},
|
|
132
|
+
"InterfaceDeclaration_IDataObjectProps": {
|
|
133
|
+
"backCompat": false
|
|
134
|
+
}
|
|
135
|
+
}
|
|
98
136
|
},
|
|
99
137
|
"scripts": {
|
|
100
138
|
"api": "fluid-build . --task api",
|
|
@@ -1,12 +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.mountableViewRequestHandler = exports.defaultRouteRequestHandler = exports.defaultFluidObjectRequestHandler = void 0;
|
|
8
|
-
var requestHandlers_1 = require("./requestHandlers.cjs");
|
|
9
|
-
Object.defineProperty(exports, "defaultFluidObjectRequestHandler", { enumerable: true, get: function () { return requestHandlers_1.defaultFluidObjectRequestHandler; } });
|
|
10
|
-
Object.defineProperty(exports, "defaultRouteRequestHandler", { enumerable: true, get: function () { return requestHandlers_1.defaultRouteRequestHandler; } });
|
|
11
|
-
Object.defineProperty(exports, "mountableViewRequestHandler", { enumerable: true, get: function () { return requestHandlers_1.mountableViewRequestHandler; } });
|
|
12
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/request-handlers/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAI2B;AAH1B,mIAAA,gCAAgC,OAAA;AAChC,6HAAA,0BAA0B,OAAA;AAC1B,8HAAA,2BAA2B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tdefaultFluidObjectRequestHandler,\n\tdefaultRouteRequestHandler,\n\tmountableViewRequestHandler,\n} from \"./requestHandlers\";\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { defaultFluidObjectRequestHandler, defaultRouteRequestHandler, mountableViewRequestHandler, } from "./requestHandlers";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request-handlers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,GAC3B,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,93 +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.defaultFluidObjectRequestHandler = exports.defaultRouteRequestHandler = exports.mountableViewRequestHandler = void 0;
|
|
8
|
-
// eslint-disable-next-line import/no-deprecated
|
|
9
|
-
const request_handler_1 = require("@fluidframework/request-handler");
|
|
10
|
-
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
11
|
-
/**
|
|
12
|
-
* A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across
|
|
13
|
-
* bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within
|
|
14
|
-
* the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will
|
|
15
|
-
* be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable
|
|
16
|
-
* view isn't necessary.
|
|
17
|
-
*
|
|
18
|
-
* When a request is received with a mountableView: true header, this request handler will reissue the request
|
|
19
|
-
* without the header, and respond with a mountable view of the given class using the response.
|
|
20
|
-
* @param MountableViewClass - The type of mountable view to use when responding
|
|
21
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
const mountableViewRequestHandler = (MountableViewClass, handlers) => {
|
|
25
|
-
// eslint-disable-next-line import/no-deprecated
|
|
26
|
-
const nestedHandler = (0, request_handler_1.buildRuntimeRequestHandler)(...handlers);
|
|
27
|
-
return async (request, runtime) => {
|
|
28
|
-
const mountableView = request.headers?.mountableView === true;
|
|
29
|
-
let newRequest = request;
|
|
30
|
-
if (mountableView) {
|
|
31
|
-
// Reissue the request without the mountableView header.
|
|
32
|
-
// We'll repack whatever the response is if we can.
|
|
33
|
-
const headers = { ...request.headers };
|
|
34
|
-
delete headers.mountableView;
|
|
35
|
-
newRequest = {
|
|
36
|
-
url: request.url,
|
|
37
|
-
headers,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const response = await nestedHandler(newRequest, runtime);
|
|
41
|
-
if (mountableView &&
|
|
42
|
-
response.status === 200 &&
|
|
43
|
-
MountableViewClass.canMount(response.value)) {
|
|
44
|
-
return {
|
|
45
|
-
status: 200,
|
|
46
|
-
mimeType: "fluid/object",
|
|
47
|
-
value: new MountableViewClass(response.value),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return response;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
exports.mountableViewRequestHandler = mountableViewRequestHandler;
|
|
54
|
-
/**
|
|
55
|
-
* Pipe through container request into internal request.
|
|
56
|
-
* If request is empty and default url is provided, redirect request to such default url.
|
|
57
|
-
* @param defaultRootId - optional default root data store ID to pass request in case request is empty.
|
|
58
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
const defaultRouteRequestHandler = (defaultRootId) => {
|
|
62
|
-
return async (request, runtime) => {
|
|
63
|
-
const parser = runtime_utils_1.RequestParser.create(request);
|
|
64
|
-
if (parser.pathParts.length === 0) {
|
|
65
|
-
return runtime.IFluidHandleContext.resolveHandle({
|
|
66
|
-
url: `/${defaultRootId}${parser.query}`,
|
|
67
|
-
headers: request.headers,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return undefined; // continue search
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
exports.defaultRouteRequestHandler = defaultRouteRequestHandler;
|
|
74
|
-
/**
|
|
75
|
-
* Default request handler for a Fluid object that returns the object itself if:
|
|
76
|
-
*
|
|
77
|
-
* 1. the request url is empty
|
|
78
|
-
*
|
|
79
|
-
* 2. the request url is "/"
|
|
80
|
-
*
|
|
81
|
-
* 3. the request url starts with "/" and is followed by a query param, such as /?key=value
|
|
82
|
-
*
|
|
83
|
-
* Returns a 404 error for any other url.
|
|
84
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
function defaultFluidObjectRequestHandler(fluidObject, request) {
|
|
88
|
-
return request.url === "" || request.url === "/" || request.url.startsWith("/?")
|
|
89
|
-
? { mimeType: "fluid/object", status: 200, value: fluidObject }
|
|
90
|
-
: (0, runtime_utils_1.create404Response)(request);
|
|
91
|
-
}
|
|
92
|
-
exports.defaultFluidObjectRequestHandler = defaultFluidObjectRequestHandler;
|
|
93
|
-
//# sourceMappingURL=requestHandlers.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.cjs","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,gDAAgD;AAChD,qEAAoG;AACpG,iEAAiF;AAEjF;;;;;;;;;;;;GAYG;AACI,MAAM,2BAA2B,GAAG,CAC1C,kBAA4C,EAC5C,QAAiC,EAChC,EAAE;IACH,gDAAgD;IAChD,MAAM,aAAa,GAAG,IAAA,4CAA0B,EAAC,GAAG,QAAQ,CAAC,CAAC;IAC9D,OAAO,KAAK,EAAE,OAAsB,EAAE,OAA0B,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;QAC9D,IAAI,UAAU,GAAa,OAAO,CAAC;QACnC,IAAI,aAAa,EAAE;YAClB,wDAAwD;YACxD,mDAAmD;YACnD,MAAM,OAAO,GAAmB,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YACvD,OAAQ,OAAe,CAAC,aAAa,CAAC;YACtC,UAAU,GAAG;gBACZ,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,OAAO;aACP,CAAC;SACF;QACD,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE1D,IACC,aAAa;YACb,QAAQ,CAAC,MAAM,KAAK,GAAG;YACvB,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC1C;YACD,OAAO;gBACN,MAAM,EAAE,GAAG;gBACX,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,IAAI,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC;aAC7C,CAAC;SACF;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC;AACH,CAAC,CAAC;AAlCW,QAAA,2BAA2B,+BAkCtC;AAEF;;;;;;GAMG;AACI,MAAM,0BAA0B,GAAG,CAAC,aAAqB,EAAE,EAAE;IACnE,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,OAAO,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC;gBAChD,GAAG,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;gBACvC,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;SACH;QACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;IACrC,CAAC,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,0BAA0B,8BAWrC;AAEF;;;;;;;;;;;;GAYG;AACH,SAAgB,gCAAgC,CAC/C,WAAwB,EACxB,OAAiB;IAEjB,OAAO,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAC/E,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAC/D,CAAC,CAAC,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAPD,4EAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest, IRequestHeader, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport type { IFluidMountableViewClass } from \"@fluidframework/view-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n\n/**\n * A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across\n * bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within\n * the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will\n * be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable\n * view isn't necessary.\n *\n * When a request is received with a mountableView: true header, this request handler will reissue the request\n * without the header, and respond with a mountable view of the given class using the response.\n * @param MountableViewClass - The type of mountable view to use when responding\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const mountableViewRequestHandler = (\n\tMountableViewClass: IFluidMountableViewClass,\n\thandlers: RuntimeRequestHandler[],\n) => {\n\t// eslint-disable-next-line import/no-deprecated\n\tconst nestedHandler = buildRuntimeRequestHandler(...handlers);\n\treturn async (request: RequestParser, runtime: IContainerRuntime) => {\n\t\tconst mountableView = request.headers?.mountableView === true;\n\t\tlet newRequest: IRequest = request;\n\t\tif (mountableView) {\n\t\t\t// Reissue the request without the mountableView header.\n\t\t\t// We'll repack whatever the response is if we can.\n\t\t\tconst headers: IRequestHeader = { ...request.headers };\n\t\t\tdelete (headers as any).mountableView;\n\t\t\tnewRequest = {\n\t\t\t\turl: request.url,\n\t\t\t\theaders,\n\t\t\t};\n\t\t}\n\t\tconst response = await nestedHandler(newRequest, runtime);\n\n\t\tif (\n\t\t\tmountableView &&\n\t\t\tresponse.status === 200 &&\n\t\t\tMountableViewClass.canMount(response.value)\n\t\t) {\n\t\t\treturn {\n\t\t\t\tstatus: 200,\n\t\t\t\tmimeType: \"fluid/object\",\n\t\t\t\tvalue: new MountableViewClass(response.value),\n\t\t\t};\n\t\t}\n\t\treturn response;\n\t};\n};\n\n/**\n * Pipe through container request into internal request.\n * If request is empty and default url is provided, redirect request to such default url.\n * @param defaultRootId - optional default root data store ID to pass request in case request is empty.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const defaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn runtime.IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\n/**\n * Default request handler for a Fluid object that returns the object itself if:\n *\n * 1. the request url is empty\n *\n * 2. the request url is \"/\"\n *\n * 3. the request url starts with \"/\" and is followed by a query param, such as /?key=value\n *\n * Returns a 404 error for any other url.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport function defaultFluidObjectRequestHandler(\n\tfluidObject: FluidObject,\n\trequest: IRequest,\n): IResponse {\n\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t? { mimeType: \"fluid/object\", status: 200, value: fluidObject }\n\t\t: create404Response(request);\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { FluidObject, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
-
import type { IFluidMountableViewClass } from "@fluidframework/view-interfaces";
|
|
8
|
-
import { RuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
9
|
-
import { RequestParser } from "@fluidframework/runtime-utils";
|
|
10
|
-
/**
|
|
11
|
-
* A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across
|
|
12
|
-
* bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within
|
|
13
|
-
* the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will
|
|
14
|
-
* be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable
|
|
15
|
-
* view isn't necessary.
|
|
16
|
-
*
|
|
17
|
-
* When a request is received with a mountableView: true header, this request handler will reissue the request
|
|
18
|
-
* without the header, and respond with a mountable view of the given class using the response.
|
|
19
|
-
* @param MountableViewClass - The type of mountable view to use when responding
|
|
20
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare const mountableViewRequestHandler: (MountableViewClass: IFluidMountableViewClass, handlers: RuntimeRequestHandler[]) => (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
24
|
-
/**
|
|
25
|
-
* Pipe through container request into internal request.
|
|
26
|
-
* If request is empty and default url is provided, redirect request to such default url.
|
|
27
|
-
* @param defaultRootId - optional default root data store ID to pass request in case request is empty.
|
|
28
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export declare const defaultRouteRequestHandler: (defaultRootId: string) => (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Default request handler for a Fluid object that returns the object itself if:
|
|
34
|
-
*
|
|
35
|
-
* 1. the request url is empty
|
|
36
|
-
*
|
|
37
|
-
* 2. the request url is "/"
|
|
38
|
-
*
|
|
39
|
-
* 3. the request url starts with "/" and is followed by a query param, such as /?key=value
|
|
40
|
-
*
|
|
41
|
-
* Returns a 404 error for any other url.
|
|
42
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare function defaultFluidObjectRequestHandler(fluidObject: FluidObject, request: IRequest): IResponse;
|
|
46
|
-
//# sourceMappingURL=requestHandlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,aAAa,EAAqB,MAAM,+BAA+B,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,uBACnB,wBAAwB,YAClC,qBAAqB,EAAE,eAIV,aAAa,WAAW,iBAAiB,uBA4BhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,eACxC,QAAQ,WAAW,iBAAiB,mCAU3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,GACf,SAAS,CAIX"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getObjectFromContainer = exports.getObjectWithIdFromContainer = exports.getDefaultObjectFromContainer = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
6
|
-
* Helper function for getting the default Fluid Object from a Container. This function only works for
|
|
7
|
-
* Containers that support "/" request.
|
|
8
|
-
*
|
|
9
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
10
|
-
*
|
|
11
|
-
* @param container - Container you're attempting to get the object from
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
async function getDefaultObjectFromContainer(container) {
|
|
15
|
-
const url = "/";
|
|
16
|
-
const response = await container.request({ url });
|
|
17
|
-
// Verify the response
|
|
18
|
-
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
19
|
-
throw new Error(`Unable to retrieve Fluid object at URL: "${url}"`);
|
|
20
|
-
}
|
|
21
|
-
else if (response.value === undefined) {
|
|
22
|
-
throw new Error(`Empty response from URL: "${url}"`);
|
|
23
|
-
}
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
25
|
-
return response.value;
|
|
26
|
-
}
|
|
27
|
-
exports.getDefaultObjectFromContainer = getDefaultObjectFromContainer;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
30
|
-
* Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for
|
|
31
|
-
* Containers that support getting FluidObjects via request.
|
|
32
|
-
*
|
|
33
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
34
|
-
*
|
|
35
|
-
* @param id - Unique id of the FluidObject
|
|
36
|
-
* @param container - Container you're attempting to get the object from
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
async function getObjectWithIdFromContainer(id, container) {
|
|
40
|
-
const url = `/${id}`;
|
|
41
|
-
const response = await container.request({ url });
|
|
42
|
-
// Verify the response
|
|
43
|
-
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
44
|
-
throw new Error(`Unable to retrieve Fluid object with ID: "${id}" from URL: "${url}"`);
|
|
45
|
-
}
|
|
46
|
-
else if (response.value === undefined) {
|
|
47
|
-
throw new Error(`Empty response for ID: "${id}" from URL: "${url}"`);
|
|
48
|
-
}
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
50
|
-
return response.value;
|
|
51
|
-
}
|
|
52
|
-
exports.getObjectWithIdFromContainer = getObjectWithIdFromContainer;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
55
|
-
* Helper function for getting a Fluid Object from a Container given a path/url. This function only works for
|
|
56
|
-
* Containers that support getting FluidObjects via request.
|
|
57
|
-
*
|
|
58
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
59
|
-
*
|
|
60
|
-
* @param path - Unique path/url of the FluidObject
|
|
61
|
-
* @param container - Container you're attempting to get the object from
|
|
62
|
-
* @internal
|
|
63
|
-
*/
|
|
64
|
-
async function getObjectFromContainer(path, container) {
|
|
65
|
-
const response = await container.request({ url: path });
|
|
66
|
-
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
67
|
-
throw new Error(`Unable to retrieve Fluid object with from URL: "${path}"`);
|
|
68
|
-
}
|
|
69
|
-
else if (response.value === undefined) {
|
|
70
|
-
throw new Error(`Empty response for from URL: "${path}"`);
|
|
71
|
-
}
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
73
|
-
return response.value;
|
|
74
|
-
}
|
|
75
|
-
exports.getObjectFromContainer = getObjectFromContainer;
|
|
76
|
-
//# sourceMappingURL=containerInteractions.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerInteractions.cjs","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":";;;AAOA;;;;;;;;;GASG;AACI,KAAK,UAAU,6BAA6B,CAClD,SAAqB;IAErB,MAAM,GAAG,GAAG,GAAG,CAAC;IAChB,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAElD,sBAAsB;IACtB,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;QACpE,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,GAAG,CAAC,CAAC;KACpE;SAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;QACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,GAAG,CAAC,CAAC;KACrD;IAED,+DAA+D;IAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;AACvB,CAAC;AAfD,sEAeC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,4BAA4B,CACjD,EAAU,EACV,SAAqB;IAErB,MAAM,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC;IACrB,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAElD,sBAAsB;IACtB,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;QACpE,MAAM,IAAI,KAAK,CAAC,6CAA6C,EAAE,gBAAgB,GAAG,GAAG,CAAC,CAAC;KACvF;SAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;QACxC,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,gBAAgB,GAAG,GAAG,CAAC,CAAC;KACrE;IAED,+DAA+D;IAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;AACvB,CAAC;AAhBD,oEAgBC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAC3C,IAAY,EACZ,SAAqB;IAErB,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;QACpE,MAAM,IAAI,KAAK,CAAC,mDAAmD,IAAI,GAAG,CAAC,CAAC;KAC5E;SAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;QACxC,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;KAC1D;IAED,+DAA+D;IAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;AACvB,CAAC;AAdD,wDAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IContainer } from \"@fluidframework/container-definitions\";\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * Helper function for getting the default Fluid Object from a Container. This function only works for\n * Containers that support \"/\" request.\n *\n * @typeParam T - Defines the type you expect to be returned.\n *\n * @param container - Container you're attempting to get the object from\n * @internal\n */\nexport async function getDefaultObjectFromContainer<T = FluidObject>(\n\tcontainer: IContainer,\n): Promise<T> {\n\tconst url = \"/\";\n\tconst response = await container.request({ url });\n\n\t// Verify the response\n\tif (response.status !== 200 || response.mimeType !== \"fluid/object\") {\n\t\tthrow new Error(`Unable to retrieve Fluid object at URL: \"${url}\"`);\n\t} else if (response.value === undefined) {\n\t\tthrow new Error(`Empty response from URL: \"${url}\"`);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn response.value;\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for\n * Containers that support getting FluidObjects via request.\n *\n * @typeParam T - Defines the type you expect to be returned.\n *\n * @param id - Unique id of the FluidObject\n * @param container - Container you're attempting to get the object from\n * @internal\n */\nexport async function getObjectWithIdFromContainer<T = FluidObject>(\n\tid: string,\n\tcontainer: IContainer,\n): Promise<T> {\n\tconst url = `/${id}`;\n\tconst response = await container.request({ url });\n\n\t// Verify the response\n\tif (response.status !== 200 || response.mimeType !== \"fluid/object\") {\n\t\tthrow new Error(`Unable to retrieve Fluid object with ID: \"${id}\" from URL: \"${url}\"`);\n\t} else if (response.value === undefined) {\n\t\tthrow new Error(`Empty response for ID: \"${id}\" from URL: \"${url}\"`);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn response.value;\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * Helper function for getting a Fluid Object from a Container given a path/url. This function only works for\n * Containers that support getting FluidObjects via request.\n *\n * @typeParam T - Defines the type you expect to be returned.\n *\n * @param path - Unique path/url of the FluidObject\n * @param container - Container you're attempting to get the object from\n * @internal\n */\nexport async function getObjectFromContainer<T = FluidObject>(\n\tpath: string,\n\tcontainer: IContainer,\n): Promise<T> {\n\tconst response = await container.request({ url: path });\n\n\tif (response.status !== 200 || response.mimeType !== \"fluid/object\") {\n\t\tthrow new Error(`Unable to retrieve Fluid object with from URL: \"${path}\"`);\n\t} else if (response.value === undefined) {\n\t\tthrow new Error(`Empty response for from URL: \"${path}\"`);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn response.value;\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IContainer } from "@fluidframework/container-definitions";
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
9
|
-
* Helper function for getting the default Fluid Object from a Container. This function only works for
|
|
10
|
-
* Containers that support "/" request.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
13
|
-
*
|
|
14
|
-
* @param container - Container you're attempting to get the object from
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export declare function getDefaultObjectFromContainer<T = FluidObject>(container: IContainer): Promise<T>;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
20
|
-
* Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for
|
|
21
|
-
* Containers that support getting FluidObjects via request.
|
|
22
|
-
*
|
|
23
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
24
|
-
*
|
|
25
|
-
* @param id - Unique id of the FluidObject
|
|
26
|
-
* @param container - Container you're attempting to get the object from
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare function getObjectWithIdFromContainer<T = FluidObject>(id: string, container: IContainer): Promise<T>;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
32
|
-
* Helper function for getting a Fluid Object from a Container given a path/url. This function only works for
|
|
33
|
-
* Containers that support getting FluidObjects via request.
|
|
34
|
-
*
|
|
35
|
-
* @typeParam T - Defines the type you expect to be returned.
|
|
36
|
-
*
|
|
37
|
-
* @param path - Unique path/url of the FluidObject
|
|
38
|
-
* @param container - Container you're attempting to get the object from
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare function getObjectFromContainer<T = FluidObject>(path: string, container: IContainer): Promise<T>;
|
|
42
|
-
//# sourceMappingURL=containerInteractions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerInteractions.d.ts","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CAAC,CAAC,GAAG,WAAW,EAClE,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,CAAC,GAAG,WAAW,EACjE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,WAAW,EAC3D,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
package/dist/utils/index.cjs
DELETED
|
@@ -1,12 +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.getObjectWithIdFromContainer = exports.getObjectFromContainer = exports.getDefaultObjectFromContainer = void 0;
|
|
8
|
-
var containerInteractions_1 = require("./containerInteractions.cjs");
|
|
9
|
-
Object.defineProperty(exports, "getDefaultObjectFromContainer", { enumerable: true, get: function () { return containerInteractions_1.getDefaultObjectFromContainer; } });
|
|
10
|
-
Object.defineProperty(exports, "getObjectFromContainer", { enumerable: true, get: function () { return containerInteractions_1.getObjectFromContainer; } });
|
|
11
|
-
Object.defineProperty(exports, "getObjectWithIdFromContainer", { enumerable: true, get: function () { return containerInteractions_1.getObjectWithIdFromContainer; } });
|
|
12
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAIiC;AAHhC,sIAAA,6BAA6B,OAAA;AAC7B,+HAAA,sBAAsB,OAAA;AACtB,qIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tgetDefaultObjectFromContainer,\n\tgetObjectFromContainer,\n\tgetObjectWithIdFromContainer,\n} from \"./containerInteractions\";\n"]}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { getDefaultObjectFromContainer, getObjectFromContainer, getObjectWithIdFromContainer, } from "./containerInteractions";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { defaultFluidObjectRequestHandler, defaultRouteRequestHandler, mountableViewRequestHandler, } from "./requestHandlers.mjs";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request-handlers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,GAC3B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { defaultFluidObjectRequestHandler, defaultRouteRequestHandler, mountableViewRequestHandler, } from "./requestHandlers.mjs";
|
|
6
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/request-handlers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,GAC3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tdefaultFluidObjectRequestHandler,\n\tdefaultRouteRequestHandler,\n\tmountableViewRequestHandler,\n} from \"./requestHandlers\";\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { FluidObject, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
-
import type { IFluidMountableViewClass } from "@fluidframework/view-interfaces";
|
|
8
|
-
import { RuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
9
|
-
import { RequestParser } from "@fluidframework/runtime-utils";
|
|
10
|
-
/**
|
|
11
|
-
* A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across
|
|
12
|
-
* bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within
|
|
13
|
-
* the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will
|
|
14
|
-
* be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable
|
|
15
|
-
* view isn't necessary.
|
|
16
|
-
*
|
|
17
|
-
* When a request is received with a mountableView: true header, this request handler will reissue the request
|
|
18
|
-
* without the header, and respond with a mountable view of the given class using the response.
|
|
19
|
-
* @param MountableViewClass - The type of mountable view to use when responding
|
|
20
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare const mountableViewRequestHandler: (MountableViewClass: IFluidMountableViewClass, handlers: RuntimeRequestHandler[]) => (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
24
|
-
/**
|
|
25
|
-
* Pipe through container request into internal request.
|
|
26
|
-
* If request is empty and default url is provided, redirect request to such default url.
|
|
27
|
-
* @param defaultRootId - optional default root data store ID to pass request in case request is empty.
|
|
28
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export declare const defaultRouteRequestHandler: (defaultRootId: string) => (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Default request handler for a Fluid object that returns the object itself if:
|
|
34
|
-
*
|
|
35
|
-
* 1. the request url is empty
|
|
36
|
-
*
|
|
37
|
-
* 2. the request url is "/"
|
|
38
|
-
*
|
|
39
|
-
* 3. the request url starts with "/" and is followed by a query param, such as /?key=value
|
|
40
|
-
*
|
|
41
|
-
* Returns a 404 error for any other url.
|
|
42
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare function defaultFluidObjectRequestHandler(fluidObject: FluidObject, request: IRequest): IResponse;
|
|
46
|
-
//# sourceMappingURL=requestHandlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,WAAW,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iCAAiC;OAC3F,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAC1E,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC;OAExE,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC;OAC5F,EAAE,aAAa,EAAqB,MAAM,+BAA+B;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,uBACnB,wBAAwB,YAClC,qBAAqB,EAAE,eAIV,aAAa,WAAW,iBAAiB,uBA4BhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,eACxC,QAAQ,WAAW,iBAAiB,mCAU3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,GACf,SAAS,CAIX"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { buildRuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
6
|
-
import { RequestParser, create404Response } from "@fluidframework/runtime-utils";
|
|
7
|
-
/**
|
|
8
|
-
* A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across
|
|
9
|
-
* bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within
|
|
10
|
-
* the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will
|
|
11
|
-
* be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable
|
|
12
|
-
* view isn't necessary.
|
|
13
|
-
*
|
|
14
|
-
* When a request is received with a mountableView: true header, this request handler will reissue the request
|
|
15
|
-
* without the header, and respond with a mountable view of the given class using the response.
|
|
16
|
-
* @param MountableViewClass - The type of mountable view to use when responding
|
|
17
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export const mountableViewRequestHandler = (MountableViewClass, handlers) => {
|
|
21
|
-
// eslint-disable-next-line import/no-deprecated
|
|
22
|
-
const nestedHandler = buildRuntimeRequestHandler(...handlers);
|
|
23
|
-
return async (request, runtime) => {
|
|
24
|
-
const mountableView = request.headers?.mountableView === true;
|
|
25
|
-
let newRequest = request;
|
|
26
|
-
if (mountableView) {
|
|
27
|
-
// Reissue the request without the mountableView header.
|
|
28
|
-
// We'll repack whatever the response is if we can.
|
|
29
|
-
const headers = { ...request.headers };
|
|
30
|
-
delete headers.mountableView;
|
|
31
|
-
newRequest = {
|
|
32
|
-
url: request.url,
|
|
33
|
-
headers,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const response = await nestedHandler(newRequest, runtime);
|
|
37
|
-
if (mountableView &&
|
|
38
|
-
response.status === 200 &&
|
|
39
|
-
MountableViewClass.canMount(response.value)) {
|
|
40
|
-
return {
|
|
41
|
-
status: 200,
|
|
42
|
-
mimeType: "fluid/object",
|
|
43
|
-
value: new MountableViewClass(response.value),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return response;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Pipe through container request into internal request.
|
|
51
|
-
* If request is empty and default url is provided, redirect request to such default url.
|
|
52
|
-
* @param defaultRootId - optional default root data store ID to pass request in case request is empty.
|
|
53
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
export const defaultRouteRequestHandler = (defaultRootId) => {
|
|
57
|
-
return async (request, runtime) => {
|
|
58
|
-
const parser = RequestParser.create(request);
|
|
59
|
-
if (parser.pathParts.length === 0) {
|
|
60
|
-
return runtime.IFluidHandleContext.resolveHandle({
|
|
61
|
-
url: `/${defaultRootId}${parser.query}`,
|
|
62
|
-
headers: request.headers,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return undefined; // continue search
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Default request handler for a Fluid object that returns the object itself if:
|
|
70
|
-
*
|
|
71
|
-
* 1. the request url is empty
|
|
72
|
-
*
|
|
73
|
-
* 2. the request url is "/"
|
|
74
|
-
*
|
|
75
|
-
* 3. the request url starts with "/" and is followed by a query param, such as /?key=value
|
|
76
|
-
*
|
|
77
|
-
* Returns a 404 error for any other url.
|
|
78
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
export function defaultFluidObjectRequestHandler(fluidObject, request) {
|
|
82
|
-
return request.url === "" || request.url === "/" || request.url.startsWith("/?")
|
|
83
|
-
? { mimeType: "fluid/object", status: 200, value: fluidObject }
|
|
84
|
-
: create404Response(request);
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=requestHandlers.mjs.map
|