@fluidframework/aqueduct 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229
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/README.md +29 -29
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +9 -5
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +20 -7
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +2 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -5
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.js +4 -2
- package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/dist/data-objects/dataObject.d.ts.map +1 -1
- package/dist/data-objects/dataObject.js +1 -1
- package/dist/data-objects/dataObject.js.map +1 -1
- package/dist/data-objects/pureDataObject.d.ts +1 -6
- package/dist/data-objects/pureDataObject.d.ts.map +1 -1
- package/dist/data-objects/pureDataObject.js +15 -14
- package/dist/data-objects/pureDataObject.js.map +1 -1
- package/dist/data-objects/types.d.ts.map +1 -1
- package/dist/data-objects/types.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/request-handlers/requestHandlers.d.ts +1 -1
- package/dist/request-handlers/requestHandlers.d.ts.map +1 -1
- package/dist/request-handlers/requestHandlers.js +4 -2
- package/dist/request-handlers/requestHandlers.js.map +1 -1
- package/dist/test/defaultRoute.spec.js +3 -1
- package/dist/test/defaultRoute.spec.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/test/types/validateAqueductPrevious.generated.js +8 -18
- package/dist/test/types/validateAqueductPrevious.generated.js.map +1 -1
- package/dist/utils/containerInteractions.d.ts.map +1 -1
- package/dist/utils/containerInteractions.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +22 -9
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -5
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/lib/data-object-factories/dataObjectFactory.js +1 -1
- package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.js +4 -2
- package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/lib/data-objects/dataObject.js +1 -1
- package/lib/data-objects/dataObject.js.map +1 -1
- package/lib/data-objects/pureDataObject.js +15 -14
- package/lib/data-objects/pureDataObject.js.map +1 -1
- package/lib/data-objects/types.js.map +1 -1
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/lib/request-handlers/requestHandlers.js +4 -2
- package/lib/request-handlers/requestHandlers.js.map +1 -1
- package/lib/utils/containerInteractions.js.map +1 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +58 -58
- package/dist/container-services/containerServices.d.ts +0 -27
- package/dist/container-services/containerServices.d.ts.map +0 -1
- package/dist/container-services/containerServices.js +0 -84
- package/dist/container-services/containerServices.js.map +0 -1
- package/dist/container-services/index.d.ts +0 -6
- package/dist/container-services/index.d.ts.map +0 -1
- package/dist/container-services/index.js +0 -12
- package/dist/container-services/index.js.map +0 -1
- package/dist/test/containerServices.spec.js +0 -121
- package/dist/test/containerServices.spec.js.map +0 -1
- package/dist/utils/attachUtils.d.ts +0 -7
- package/dist/utils/attachUtils.d.ts.map +0 -1
- package/dist/utils/attachUtils.js +0 -20
- package/dist/utils/attachUtils.js.map +0 -1
- package/lib/container-services/containerServices.js +0 -79
- package/lib/container-services/containerServices.js.map +0 -1
- package/lib/container-services/index.js +0 -6
- package/lib/container-services/index.js.map +0 -1
- package/lib/utils/attachUtils.js +0 -16
- package/lib/utils/attachUtils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateAqueductPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateAqueductPrevious.generated.ts"],"names":[],"mappings":";;AAwBA,wDAAwD,CACpD,oDAAoD,EAAE,CAAC,CAAC;AAW5D,oDAAoD,CAChD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,iDAAiD,CAC7C,6CAA6C,EAAE,CAAC,CAAC;AAWrD,6CAA6C,CACzC,iDAAiD,EAAE,CAAC,CAAC;AAWzD,wEAAwE,CACpE,oEAAoE,EAAE,CAAC,CAAC;AAW5E,oEAAoE,CAChE,wEAAwE,EAAE,CAAC,CAAC;AAWhF,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,CAAC;AAWpE,4DAA4D,CACxD,gEAAgE,EAAE,CAAC,CAAC;AAWxE,uCAAuC,CACnC,mCAAmC,EAAE,CAAC,CAAC;AAW3C,mCAAmC,CAC/B,uCAAuC,EAAE,CAAC,CAAC;AAW/C,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,C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* Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-validator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/aqueduct-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerRuntimeFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_BaseContainerRuntimeFactory():\n TypeOnly<old.BaseContainerRuntimeFactory>;\ndeclare function use_current_ClassDeclaration_BaseContainerRuntimeFactory(\n use: TypeOnly<current.BaseContainerRuntimeFactory>);\nuse_current_ClassDeclaration_BaseContainerRuntimeFactory(\n get_old_ClassDeclaration_BaseContainerRuntimeFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerRuntimeFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_BaseContainerRuntimeFactory():\n TypeOnly<current.BaseContainerRuntimeFactory>;\ndeclare function use_old_ClassDeclaration_BaseContainerRuntimeFactory(\n use: TypeOnly<old.BaseContainerRuntimeFactory>);\nuse_old_ClassDeclaration_BaseContainerRuntimeFactory(\n get_current_ClassDeclaration_BaseContainerRuntimeFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_BaseContainerService():\n TypeOnly<old.BaseContainerService>;\ndeclare function use_current_ClassDeclaration_BaseContainerService(\n use: TypeOnly<current.BaseContainerService>);\nuse_current_ClassDeclaration_BaseContainerService(\n get_old_ClassDeclaration_BaseContainerService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_BaseContainerService():\n TypeOnly<current.BaseContainerService>;\ndeclare function use_old_ClassDeclaration_BaseContainerService(\n use: TypeOnly<old.BaseContainerService>);\nuse_old_ClassDeclaration_BaseContainerService(\n get_current_ClassDeclaration_BaseContainerService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore():\n TypeOnly<old.ContainerRuntimeFactoryWithDefaultDataStore>;\ndeclare function use_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n use: TypeOnly<current.ContainerRuntimeFactoryWithDefaultDataStore>);\nuse_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n get_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore():\n TypeOnly<current.ContainerRuntimeFactoryWithDefaultDataStore>;\ndeclare function use_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n use: TypeOnly<old.ContainerRuntimeFactoryWithDefaultDataStore>);\nuse_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n get_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ContainerServiceRegistryEntries\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_ContainerServiceRegistryEntries():\n TypeOnly<old.ContainerServiceRegistryEntries>;\ndeclare function use_current_TypeAliasDeclaration_ContainerServiceRegistryEntries(\n use: TypeOnly<current.ContainerServiceRegistryEntries>);\nuse_current_TypeAliasDeclaration_ContainerServiceRegistryEntries(\n get_old_TypeAliasDeclaration_ContainerServiceRegistryEntries());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ContainerServiceRegistryEntries\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_ContainerServiceRegistryEntries():\n TypeOnly<current.ContainerServiceRegistryEntries>;\ndeclare function use_old_TypeAliasDeclaration_ContainerServiceRegistryEntries(\n use: TypeOnly<old.ContainerServiceRegistryEntries>);\nuse_old_TypeAliasDeclaration_ContainerServiceRegistryEntries(\n get_current_TypeAliasDeclaration_ContainerServiceRegistryEntries());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DataObject():\n TypeOnly<old.DataObject>;\ndeclare function use_current_ClassDeclaration_DataObject(\n use: TypeOnly<current.DataObject>);\nuse_current_ClassDeclaration_DataObject(\n get_old_ClassDeclaration_DataObject());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DataObject():\n TypeOnly<current.DataObject>;\ndeclare function use_old_ClassDeclaration_DataObject(\n use: TypeOnly<old.DataObject>);\nuse_old_ClassDeclaration_DataObject(\n get_current_ClassDeclaration_DataObject());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DataObjectFactory():\n TypeOnly<old.DataObjectFactory<any,any>>;\ndeclare function use_current_ClassDeclaration_DataObjectFactory(\n use: TypeOnly<current.DataObjectFactory<any,any>>);\nuse_current_ClassDeclaration_DataObjectFactory(\n get_old_ClassDeclaration_DataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DataObjectFactory():\n TypeOnly<current.DataObjectFactory<any,any>>;\ndeclare function use_old_ClassDeclaration_DataObjectFactory(\n use: TypeOnly<old.DataObjectFactory<any,any>>);\nuse_old_ClassDeclaration_DataObjectFactory(\n get_current_ClassDeclaration_DataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_DataObjectTypes\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_DataObjectTypes():\n TypeOnly<old.DataObjectTypes>;\ndeclare function use_current_InterfaceDeclaration_DataObjectTypes(\n use: TypeOnly<current.DataObjectTypes>);\nuse_current_InterfaceDeclaration_DataObjectTypes(\n get_old_InterfaceDeclaration_DataObjectTypes());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_DataObjectTypes\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_DataObjectTypes():\n TypeOnly<current.DataObjectTypes>;\ndeclare function use_old_InterfaceDeclaration_DataObjectTypes(\n use: TypeOnly<old.DataObjectTypes>);\nuse_old_InterfaceDeclaration_DataObjectTypes(\n get_current_InterfaceDeclaration_DataObjectTypes());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_defaultFluidObjectRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_defaultFluidObjectRequestHandler():\n TypeOnly<typeof old.defaultFluidObjectRequestHandler>;\ndeclare function use_current_FunctionDeclaration_defaultFluidObjectRequestHandler(\n use: TypeOnly<typeof current.defaultFluidObjectRequestHandler>);\nuse_current_FunctionDeclaration_defaultFluidObjectRequestHandler(\n get_old_FunctionDeclaration_defaultFluidObjectRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_defaultFluidObjectRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_defaultFluidObjectRequestHandler():\n TypeOnly<typeof current.defaultFluidObjectRequestHandler>;\ndeclare function use_old_FunctionDeclaration_defaultFluidObjectRequestHandler(\n use: TypeOnly<typeof old.defaultFluidObjectRequestHandler>);\nuse_old_FunctionDeclaration_defaultFluidObjectRequestHandler(\n get_current_FunctionDeclaration_defaultFluidObjectRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_defaultRouteRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_defaultRouteRequestHandler():\n TypeOnly<typeof old.defaultRouteRequestHandler>;\ndeclare function use_current_VariableDeclaration_defaultRouteRequestHandler(\n use: TypeOnly<typeof current.defaultRouteRequestHandler>);\nuse_current_VariableDeclaration_defaultRouteRequestHandler(\n get_old_VariableDeclaration_defaultRouteRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_defaultRouteRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_defaultRouteRequestHandler():\n TypeOnly<typeof current.defaultRouteRequestHandler>;\ndeclare function use_old_VariableDeclaration_defaultRouteRequestHandler(\n use: TypeOnly<typeof old.defaultRouteRequestHandler>);\nuse_old_VariableDeclaration_defaultRouteRequestHandler(\n get_current_VariableDeclaration_defaultRouteRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_generateContainerServicesRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_generateContainerServicesRequestHandler():\n TypeOnly<typeof old.generateContainerServicesRequestHandler>;\ndeclare function use_current_VariableDeclaration_generateContainerServicesRequestHandler(\n use: TypeOnly<typeof current.generateContainerServicesRequestHandler>);\nuse_current_VariableDeclaration_generateContainerServicesRequestHandler(\n get_old_VariableDeclaration_generateContainerServicesRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_generateContainerServicesRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_generateContainerServicesRequestHandler():\n TypeOnly<typeof current.generateContainerServicesRequestHandler>;\ndeclare function use_old_VariableDeclaration_generateContainerServicesRequestHandler(\n use: TypeOnly<typeof old.generateContainerServicesRequestHandler>);\nuse_old_VariableDeclaration_generateContainerServicesRequestHandler(\n get_current_VariableDeclaration_generateContainerServicesRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getDefaultObjectFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getDefaultObjectFromContainer():\n TypeOnly<typeof old.getDefaultObjectFromContainer>;\ndeclare function use_current_FunctionDeclaration_getDefaultObjectFromContainer(\n use: TypeOnly<typeof current.getDefaultObjectFromContainer>);\nuse_current_FunctionDeclaration_getDefaultObjectFromContainer(\n get_old_FunctionDeclaration_getDefaultObjectFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getDefaultObjectFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getDefaultObjectFromContainer():\n TypeOnly<typeof current.getDefaultObjectFromContainer>;\ndeclare function use_old_FunctionDeclaration_getDefaultObjectFromContainer(\n use: TypeOnly<typeof old.getDefaultObjectFromContainer>);\nuse_old_FunctionDeclaration_getDefaultObjectFromContainer(\n get_current_FunctionDeclaration_getDefaultObjectFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getObjectFromContainer():\n TypeOnly<typeof old.getObjectFromContainer>;\ndeclare function use_current_FunctionDeclaration_getObjectFromContainer(\n use: TypeOnly<typeof current.getObjectFromContainer>);\nuse_current_FunctionDeclaration_getObjectFromContainer(\n get_old_FunctionDeclaration_getObjectFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getObjectFromContainer():\n TypeOnly<typeof current.getObjectFromContainer>;\ndeclare function use_old_FunctionDeclaration_getObjectFromContainer(\n use: TypeOnly<typeof old.getObjectFromContainer>);\nuse_old_FunctionDeclaration_getObjectFromContainer(\n get_current_FunctionDeclaration_getObjectFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectWithIdFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getObjectWithIdFromContainer():\n TypeOnly<typeof old.getObjectWithIdFromContainer>;\ndeclare function use_current_FunctionDeclaration_getObjectWithIdFromContainer(\n use: TypeOnly<typeof current.getObjectWithIdFromContainer>);\nuse_current_FunctionDeclaration_getObjectWithIdFromContainer(\n get_old_FunctionDeclaration_getObjectWithIdFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectWithIdFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getObjectWithIdFromContainer():\n TypeOnly<typeof current.getObjectWithIdFromContainer>;\ndeclare function use_old_FunctionDeclaration_getObjectWithIdFromContainer(\n use: TypeOnly<typeof old.getObjectWithIdFromContainer>);\nuse_old_FunctionDeclaration_getObjectWithIdFromContainer(\n get_current_FunctionDeclaration_getObjectWithIdFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IDataObjectProps\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IDataObjectProps():\n TypeOnly<old.IDataObjectProps>;\ndeclare function use_current_InterfaceDeclaration_IDataObjectProps(\n use: TypeOnly<current.IDataObjectProps>);\nuse_current_InterfaceDeclaration_IDataObjectProps(\n get_old_InterfaceDeclaration_IDataObjectProps());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IDataObjectProps\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IDataObjectProps():\n TypeOnly<current.IDataObjectProps>;\ndeclare function use_old_InterfaceDeclaration_IDataObjectProps(\n use: TypeOnly<old.IDataObjectProps>);\nuse_old_InterfaceDeclaration_IDataObjectProps(\n get_current_InterfaceDeclaration_IDataObjectProps());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IRootDataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IRootDataObjectFactory():\n TypeOnly<old.IRootDataObjectFactory>;\ndeclare function use_current_InterfaceDeclaration_IRootDataObjectFactory(\n use: TypeOnly<current.IRootDataObjectFactory>);\nuse_current_InterfaceDeclaration_IRootDataObjectFactory(\n get_old_InterfaceDeclaration_IRootDataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IRootDataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IRootDataObjectFactory():\n TypeOnly<current.IRootDataObjectFactory>;\ndeclare function use_old_InterfaceDeclaration_IRootDataObjectFactory(\n use: TypeOnly<old.IRootDataObjectFactory>);\nuse_old_InterfaceDeclaration_IRootDataObjectFactory(\n get_current_InterfaceDeclaration_IRootDataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mountableViewRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_mountableViewRequestHandler():\n TypeOnly<typeof old.mountableViewRequestHandler>;\ndeclare function use_current_VariableDeclaration_mountableViewRequestHandler(\n use: TypeOnly<typeof current.mountableViewRequestHandler>);\nuse_current_VariableDeclaration_mountableViewRequestHandler(\n get_old_VariableDeclaration_mountableViewRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mountableViewRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_mountableViewRequestHandler():\n TypeOnly<typeof current.mountableViewRequestHandler>;\ndeclare function use_old_VariableDeclaration_mountableViewRequestHandler(\n use: TypeOnly<typeof old.mountableViewRequestHandler>);\nuse_old_VariableDeclaration_mountableViewRequestHandler(\n get_current_VariableDeclaration_mountableViewRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_PureDataObject():\n TypeOnly<old.PureDataObject>;\ndeclare function use_current_ClassDeclaration_PureDataObject(\n use: TypeOnly<current.PureDataObject>);\nuse_current_ClassDeclaration_PureDataObject(\n get_old_ClassDeclaration_PureDataObject());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_PureDataObject():\n TypeOnly<current.PureDataObject>;\ndeclare function use_old_ClassDeclaration_PureDataObject(\n use: TypeOnly<old.PureDataObject>);\nuse_old_ClassDeclaration_PureDataObject(\n get_current_ClassDeclaration_PureDataObject());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_PureDataObjectFactory():\n TypeOnly<old.PureDataObjectFactory<any,any>>;\ndeclare function use_current_ClassDeclaration_PureDataObjectFactory(\n use: TypeOnly<current.PureDataObjectFactory<any,any>>);\nuse_current_ClassDeclaration_PureDataObjectFactory(\n get_old_ClassDeclaration_PureDataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_PureDataObjectFactory():\n TypeOnly<current.PureDataObjectFactory<any,any>>;\ndeclare function use_old_ClassDeclaration_PureDataObjectFactory(\n use: TypeOnly<old.PureDataObjectFactory<any,any>>);\nuse_old_ClassDeclaration_PureDataObjectFactory(\n get_current_ClassDeclaration_PureDataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_serviceRoutePathRoot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_serviceRoutePathRoot():\n TypeOnly<typeof old.serviceRoutePathRoot>;\ndeclare function use_current_VariableDeclaration_serviceRoutePathRoot(\n use: TypeOnly<typeof current.serviceRoutePathRoot>);\nuse_current_VariableDeclaration_serviceRoutePathRoot(\n get_old_VariableDeclaration_serviceRoutePathRoot());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_serviceRoutePathRoot\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_serviceRoutePathRoot():\n TypeOnly<typeof current.serviceRoutePathRoot>;\ndeclare function use_old_VariableDeclaration_serviceRoutePathRoot(\n use: TypeOnly<typeof old.serviceRoutePathRoot>);\nuse_old_VariableDeclaration_serviceRoutePathRoot(\n get_current_VariableDeclaration_serviceRoutePathRoot());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_waitForAttach\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_waitForAttach():\n TypeOnly<typeof old.waitForAttach>;\ndeclare function use_current_FunctionDeclaration_waitForAttach(\n use: TypeOnly<typeof current.waitForAttach>);\nuse_current_FunctionDeclaration_waitForAttach(\n get_old_FunctionDeclaration_waitForAttach());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_waitForAttach\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_waitForAttach():\n TypeOnly<typeof current.waitForAttach>;\ndeclare function use_old_FunctionDeclaration_waitForAttach(\n use: TypeOnly<typeof old.waitForAttach>);\nuse_old_FunctionDeclaration_waitForAttach(\n get_current_FunctionDeclaration_waitForAttach());\n"]}
|
|
1
|
+
{"version":3,"file":"validateAqueductPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateAqueductPrevious.generated.ts"],"names":[],"mappings":";;AAwBA,wDAAwD,CACpD,oDAAoD,EAAE,CAAC,CAAC;AAW5D,oDAAoD,CAChD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,wEAAwE,CACpE,oEAAoE,EAAE,CAAC,CAAC;AAW5E,oEAAoE,CAChE,wEAAwE,EAAE,CAAC,CAAC;AAWhF,uCAAuC,CACnC,mCAAmC,EAAE,CAAC,CAAC;AAW3C,mCAAmC,CAC/B,uCAAuC,EAAE,CAAC,CAAC;AAW/C,8CAA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THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/aqueduct-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerRuntimeFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_BaseContainerRuntimeFactory():\n TypeOnly<old.BaseContainerRuntimeFactory>;\ndeclare function use_current_ClassDeclaration_BaseContainerRuntimeFactory(\n use: TypeOnly<current.BaseContainerRuntimeFactory>);\nuse_current_ClassDeclaration_BaseContainerRuntimeFactory(\n get_old_ClassDeclaration_BaseContainerRuntimeFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_BaseContainerRuntimeFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_BaseContainerRuntimeFactory():\n TypeOnly<current.BaseContainerRuntimeFactory>;\ndeclare function use_old_ClassDeclaration_BaseContainerRuntimeFactory(\n use: TypeOnly<old.BaseContainerRuntimeFactory>);\nuse_old_ClassDeclaration_BaseContainerRuntimeFactory(\n get_current_ClassDeclaration_BaseContainerRuntimeFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore():\n TypeOnly<old.ContainerRuntimeFactoryWithDefaultDataStore>;\ndeclare function use_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n use: TypeOnly<current.ContainerRuntimeFactoryWithDefaultDataStore>);\nuse_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n get_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore():\n TypeOnly<current.ContainerRuntimeFactoryWithDefaultDataStore>;\ndeclare function use_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n use: TypeOnly<old.ContainerRuntimeFactoryWithDefaultDataStore>);\nuse_old_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore(\n get_current_ClassDeclaration_ContainerRuntimeFactoryWithDefaultDataStore());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DataObject():\n TypeOnly<old.DataObject>;\ndeclare function use_current_ClassDeclaration_DataObject(\n use: TypeOnly<current.DataObject>);\nuse_current_ClassDeclaration_DataObject(\n get_old_ClassDeclaration_DataObject());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DataObject():\n TypeOnly<current.DataObject>;\ndeclare function use_old_ClassDeclaration_DataObject(\n use: TypeOnly<old.DataObject>);\nuse_old_ClassDeclaration_DataObject(\n get_current_ClassDeclaration_DataObject());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DataObjectFactory():\n TypeOnly<old.DataObjectFactory<any,any>>;\ndeclare function use_current_ClassDeclaration_DataObjectFactory(\n use: TypeOnly<current.DataObjectFactory<any,any>>);\nuse_current_ClassDeclaration_DataObjectFactory(\n get_old_ClassDeclaration_DataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DataObjectFactory():\n TypeOnly<current.DataObjectFactory<any,any>>;\ndeclare function use_old_ClassDeclaration_DataObjectFactory(\n use: TypeOnly<old.DataObjectFactory<any,any>>);\nuse_old_ClassDeclaration_DataObjectFactory(\n get_current_ClassDeclaration_DataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_DataObjectTypes\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_DataObjectTypes():\n TypeOnly<old.DataObjectTypes>;\ndeclare function use_current_InterfaceDeclaration_DataObjectTypes(\n use: TypeOnly<current.DataObjectTypes>);\nuse_current_InterfaceDeclaration_DataObjectTypes(\n get_old_InterfaceDeclaration_DataObjectTypes());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_DataObjectTypes\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_DataObjectTypes():\n TypeOnly<current.DataObjectTypes>;\ndeclare function use_old_InterfaceDeclaration_DataObjectTypes(\n use: TypeOnly<old.DataObjectTypes>);\nuse_old_InterfaceDeclaration_DataObjectTypes(\n get_current_InterfaceDeclaration_DataObjectTypes());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IDataObjectProps\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IDataObjectProps():\n TypeOnly<old.IDataObjectProps>;\ndeclare function use_current_InterfaceDeclaration_IDataObjectProps(\n use: TypeOnly<current.IDataObjectProps>);\nuse_current_InterfaceDeclaration_IDataObjectProps(\n get_old_InterfaceDeclaration_IDataObjectProps());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IDataObjectProps\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IDataObjectProps():\n TypeOnly<current.IDataObjectProps>;\ndeclare function use_old_InterfaceDeclaration_IDataObjectProps(\n use: TypeOnly<old.IDataObjectProps>);\nuse_old_InterfaceDeclaration_IDataObjectProps(\n get_current_InterfaceDeclaration_IDataObjectProps());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IRootDataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IRootDataObjectFactory():\n TypeOnly<old.IRootDataObjectFactory>;\ndeclare function use_current_InterfaceDeclaration_IRootDataObjectFactory(\n use: TypeOnly<current.IRootDataObjectFactory>);\nuse_current_InterfaceDeclaration_IRootDataObjectFactory(\n get_old_InterfaceDeclaration_IRootDataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IRootDataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IRootDataObjectFactory():\n TypeOnly<current.IRootDataObjectFactory>;\ndeclare function use_old_InterfaceDeclaration_IRootDataObjectFactory(\n use: TypeOnly<old.IRootDataObjectFactory>);\nuse_old_InterfaceDeclaration_IRootDataObjectFactory(\n get_current_InterfaceDeclaration_IRootDataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_PureDataObject():\n TypeOnly<old.PureDataObject>;\ndeclare function use_current_ClassDeclaration_PureDataObject(\n use: TypeOnly<current.PureDataObject>);\nuse_current_ClassDeclaration_PureDataObject(\n get_old_ClassDeclaration_PureDataObject());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_PureDataObject():\n TypeOnly<current.PureDataObject>;\ndeclare function use_old_ClassDeclaration_PureDataObject(\n use: TypeOnly<old.PureDataObject>);\nuse_old_ClassDeclaration_PureDataObject(\n get_current_ClassDeclaration_PureDataObject());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObjectFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_PureDataObjectFactory():\n TypeOnly<old.PureDataObjectFactory<any,any>>;\ndeclare function use_current_ClassDeclaration_PureDataObjectFactory(\n use: TypeOnly<current.PureDataObjectFactory<any,any>>);\nuse_current_ClassDeclaration_PureDataObjectFactory(\n get_old_ClassDeclaration_PureDataObjectFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_PureDataObjectFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_PureDataObjectFactory():\n TypeOnly<current.PureDataObjectFactory<any,any>>;\ndeclare function use_old_ClassDeclaration_PureDataObjectFactory(\n use: TypeOnly<old.PureDataObjectFactory<any,any>>);\nuse_old_ClassDeclaration_PureDataObjectFactory(\n get_current_ClassDeclaration_PureDataObjectFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_defaultFluidObjectRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_defaultFluidObjectRequestHandler():\n TypeOnly<typeof old.defaultFluidObjectRequestHandler>;\ndeclare function use_current_FunctionDeclaration_defaultFluidObjectRequestHandler(\n use: TypeOnly<typeof current.defaultFluidObjectRequestHandler>);\nuse_current_FunctionDeclaration_defaultFluidObjectRequestHandler(\n get_old_FunctionDeclaration_defaultFluidObjectRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_defaultFluidObjectRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_defaultFluidObjectRequestHandler():\n TypeOnly<typeof current.defaultFluidObjectRequestHandler>;\ndeclare function use_old_FunctionDeclaration_defaultFluidObjectRequestHandler(\n use: TypeOnly<typeof old.defaultFluidObjectRequestHandler>);\nuse_old_FunctionDeclaration_defaultFluidObjectRequestHandler(\n get_current_FunctionDeclaration_defaultFluidObjectRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_defaultRouteRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_defaultRouteRequestHandler():\n TypeOnly<typeof old.defaultRouteRequestHandler>;\ndeclare function use_current_VariableDeclaration_defaultRouteRequestHandler(\n use: TypeOnly<typeof current.defaultRouteRequestHandler>);\nuse_current_VariableDeclaration_defaultRouteRequestHandler(\n get_old_VariableDeclaration_defaultRouteRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_defaultRouteRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_defaultRouteRequestHandler():\n TypeOnly<typeof current.defaultRouteRequestHandler>;\ndeclare function use_old_VariableDeclaration_defaultRouteRequestHandler(\n use: TypeOnly<typeof old.defaultRouteRequestHandler>);\nuse_old_VariableDeclaration_defaultRouteRequestHandler(\n get_current_VariableDeclaration_defaultRouteRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getDefaultObjectFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getDefaultObjectFromContainer():\n TypeOnly<typeof old.getDefaultObjectFromContainer>;\ndeclare function use_current_FunctionDeclaration_getDefaultObjectFromContainer(\n use: TypeOnly<typeof current.getDefaultObjectFromContainer>);\nuse_current_FunctionDeclaration_getDefaultObjectFromContainer(\n get_old_FunctionDeclaration_getDefaultObjectFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getDefaultObjectFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getDefaultObjectFromContainer():\n TypeOnly<typeof current.getDefaultObjectFromContainer>;\ndeclare function use_old_FunctionDeclaration_getDefaultObjectFromContainer(\n use: TypeOnly<typeof old.getDefaultObjectFromContainer>);\nuse_old_FunctionDeclaration_getDefaultObjectFromContainer(\n get_current_FunctionDeclaration_getDefaultObjectFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getObjectFromContainer():\n TypeOnly<typeof old.getObjectFromContainer>;\ndeclare function use_current_FunctionDeclaration_getObjectFromContainer(\n use: TypeOnly<typeof current.getObjectFromContainer>);\nuse_current_FunctionDeclaration_getObjectFromContainer(\n get_old_FunctionDeclaration_getObjectFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getObjectFromContainer():\n TypeOnly<typeof current.getObjectFromContainer>;\ndeclare function use_old_FunctionDeclaration_getObjectFromContainer(\n use: TypeOnly<typeof old.getObjectFromContainer>);\nuse_old_FunctionDeclaration_getObjectFromContainer(\n get_current_FunctionDeclaration_getObjectFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectWithIdFromContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getObjectWithIdFromContainer():\n TypeOnly<typeof old.getObjectWithIdFromContainer>;\ndeclare function use_current_FunctionDeclaration_getObjectWithIdFromContainer(\n use: TypeOnly<typeof current.getObjectWithIdFromContainer>);\nuse_current_FunctionDeclaration_getObjectWithIdFromContainer(\n get_old_FunctionDeclaration_getObjectWithIdFromContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getObjectWithIdFromContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getObjectWithIdFromContainer():\n TypeOnly<typeof current.getObjectWithIdFromContainer>;\ndeclare function use_old_FunctionDeclaration_getObjectWithIdFromContainer(\n use: TypeOnly<typeof old.getObjectWithIdFromContainer>);\nuse_old_FunctionDeclaration_getObjectWithIdFromContainer(\n get_current_FunctionDeclaration_getObjectWithIdFromContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mountableViewRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_mountableViewRequestHandler():\n TypeOnly<typeof old.mountableViewRequestHandler>;\ndeclare function use_current_VariableDeclaration_mountableViewRequestHandler(\n use: TypeOnly<typeof current.mountableViewRequestHandler>);\nuse_current_VariableDeclaration_mountableViewRequestHandler(\n get_old_VariableDeclaration_mountableViewRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mountableViewRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_mountableViewRequestHandler():\n TypeOnly<typeof current.mountableViewRequestHandler>;\ndeclare function use_old_VariableDeclaration_mountableViewRequestHandler(\n use: TypeOnly<typeof old.mountableViewRequestHandler>);\nuse_old_VariableDeclaration_mountableViewRequestHandler(\n get_current_VariableDeclaration_mountableViewRequestHandler());\n"]}
|
|
@@ -1 +1 @@
|
|
|
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;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CAAC,CAAC,GAAG,WAAW,
|
|
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;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CAAC,CAAC,GAAG,WAAW,EAClE,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAAC,CAAC,GAAG,WAAW,EACjE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,WAAW,EAC3D,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerInteractions.js","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":";;;AAOA;;;;;;;GAOG;AACI,KAAK,UAAU,6BAA6B,
|
|
1
|
+
{"version":3,"file":"containerInteractions.js","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":";;;AAOA;;;;;;;GAOG;A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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 * 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 */\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 * 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 */\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 * 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 */\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"]}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { waitForAttach } from "./attachUtils";
|
|
6
5
|
export { getDefaultObjectFromContainer, getObjectFromContainer, getObjectWithIdFromContainer, } from "./containerInteractions";
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
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"}
|
package/dist/utils/index.js
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getObjectWithIdFromContainer = exports.getObjectFromContainer = exports.getDefaultObjectFromContainer =
|
|
8
|
-
var attachUtils_1 = require("./attachUtils");
|
|
9
|
-
Object.defineProperty(exports, "waitForAttach", { enumerable: true, get: function () { return attachUtils_1.waitForAttach; } });
|
|
7
|
+
exports.getObjectWithIdFromContainer = exports.getObjectFromContainer = exports.getDefaultObjectFromContainer = void 0;
|
|
10
8
|
var containerInteractions_1 = require("./containerInteractions");
|
|
11
9
|
Object.defineProperty(exports, "getDefaultObjectFromContainer", { enumerable: true, get: function () { return containerInteractions_1.getDefaultObjectFromContainer; } });
|
|
12
10
|
Object.defineProperty(exports, "getObjectFromContainer", { enumerable: true, get: function () { return containerInteractions_1.getObjectFromContainer; } });
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAIiC;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"]}
|
|
@@ -3,31 +3,36 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { FluidDataStoreRegistry, ContainerRuntime, } from "@fluidframework/container-runtime";
|
|
6
|
-
import { IContainerRuntime
|
|
7
|
-
import { buildRuntimeRequestHandler
|
|
6
|
+
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
+
import { buildRuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
8
8
|
import { DependencyContainer, } from "@fluidframework/synthesize";
|
|
9
9
|
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
|
|
10
10
|
/**
|
|
11
|
-
* BaseContainerRuntimeFactory produces container runtimes with
|
|
12
|
-
*
|
|
13
|
-
* it creates.
|
|
11
|
+
* BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,
|
|
12
|
+
* request handlers, runtimeOptions, and entryPoint initialization function.
|
|
13
|
+
* It can be subclassed to implement a first-time initialization procedure for the containers it creates.
|
|
14
14
|
*/
|
|
15
15
|
export class BaseContainerRuntimeFactory extends RuntimeFactoryHelper {
|
|
16
16
|
/**
|
|
17
17
|
* @param registryEntries - The data store registry for containers produced
|
|
18
|
-
* @param
|
|
18
|
+
* @param dependencyContainer -
|
|
19
19
|
* @param requestHandlers - Request handlers for containers produced
|
|
20
20
|
* @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
|
|
21
|
+
* @param initializeEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
|
|
22
|
+
* created with this factory
|
|
21
23
|
*/
|
|
22
|
-
constructor(registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
|
|
24
|
+
constructor(registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
|
|
23
25
|
super();
|
|
24
26
|
this.registryEntries = registryEntries;
|
|
25
27
|
this.dependencyContainer = dependencyContainer;
|
|
26
28
|
this.requestHandlers = requestHandlers;
|
|
27
29
|
this.runtimeOptions = runtimeOptions;
|
|
30
|
+
this.initializeEntryPoint = initializeEntryPoint;
|
|
28
31
|
this.registry = new FluidDataStoreRegistry(registryEntries);
|
|
29
32
|
}
|
|
30
|
-
get IFluidDataStoreRegistry() {
|
|
33
|
+
get IFluidDataStoreRegistry() {
|
|
34
|
+
return this.registry;
|
|
35
|
+
}
|
|
31
36
|
async instantiateFirstTime(runtime) {
|
|
32
37
|
await this.containerInitializingFirstTime(runtime);
|
|
33
38
|
await this.containerHasInitialized(runtime);
|
|
@@ -39,7 +44,15 @@ export class BaseContainerRuntimeFactory extends RuntimeFactoryHelper {
|
|
|
39
44
|
const scope = context.scope;
|
|
40
45
|
const dc = new DependencyContainer(this.dependencyContainer, scope.IFluidDependencySynthesizer);
|
|
41
46
|
scope.IFluidDependencySynthesizer = dc;
|
|
42
|
-
const runtime = await ContainerRuntime.
|
|
47
|
+
const runtime = await ContainerRuntime.loadRuntime({
|
|
48
|
+
context,
|
|
49
|
+
requestHandler: buildRuntimeRequestHandler(...this.requestHandlers),
|
|
50
|
+
existing,
|
|
51
|
+
runtimeOptions: this.runtimeOptions,
|
|
52
|
+
registryEntries: this.registryEntries,
|
|
53
|
+
containerScope: scope,
|
|
54
|
+
initializeEntryPoint: this.initializeEntryPoint,
|
|
55
|
+
});
|
|
43
56
|
// we register the runtime so developers of providers can use it in the factory pattern.
|
|
44
57
|
dc.register(IContainerRuntime, runtime);
|
|
45
58
|
return runtime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,E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,MAAM,OAAO,GAAqB,MAAM,gBAAgB,CAAC,WAAW,CAAC;YACpE,OAAO;YACP,cAAc,EAAE,0BAA0B,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,QAAQ;YACR,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,KAAK;YACrB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;SAC/C,CAAC,CAAC;QAEH,wFAAwF;QACxF,EAAE,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAExC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAG,CAAC;IAE7E;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAG,CAAC;CACtE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext } from \"@fluidframework/container-definitions\";\nimport {\n\tIContainerRuntimeOptions,\n\tFluidDataStoreRegistry,\n\tContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tDependencyContainer,\n\tIFluidDependencySynthesizer,\n\tIProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\t/**\n\t * @param registryEntries - The data store registry for containers produced\n\t * @param dependencyContainer -\n\t * @param requestHandlers - Request handlers for containers produced\n\t * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it\n\t * @param initializeEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tconstructor(\n\t\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer,\n\t\tprivate readonly requestHandlers: RuntimeRequestHandler[] = [],\n\t\tprivate readonly runtimeOptions?: IContainerRuntimeOptions,\n\t\tprivate readonly initializeEntryPoint?: (\n\t\t\truntime: IContainerRuntime,\n\t\t) => Promise<FluidObject>,\n\t) {\n\t\tsuper();\n\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\tconst dc = new DependencyContainer<FluidObject<IContainerRuntime>>(\n\t\t\tthis.dependencyContainer,\n\t\t\tscope.IFluidDependencySynthesizer,\n\t\t);\n\t\tscope.IFluidDependencySynthesizer = dc;\n\n\t\tconst runtime: ContainerRuntime = await ContainerRuntime.loadRuntime({\n\t\t\tcontext,\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\texisting,\n\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\tregistryEntries: this.registryEntries,\n\t\t\tcontainerScope: scope,\n\t\t\tinitializeEntryPoint: this.initializeEntryPoint,\n\t\t});\n\n\t\t// we register the runtime so developers of providers can use it in the factory pattern.\n\t\tdc.register(IContainerRuntime, runtime);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime) {}\n}\n"]}
|
|
@@ -12,11 +12,8 @@ const defaultDataStoreId = "default";
|
|
|
12
12
|
* This factory should be exposed as fluidExport off the entry point to your module.
|
|
13
13
|
*/
|
|
14
14
|
export class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
|
|
15
|
-
constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
|
|
16
|
-
super(registryEntries, dependencyContainer, [
|
|
17
|
-
defaultRouteRequestHandler(defaultDataStoreId),
|
|
18
|
-
...requestHandlers,
|
|
19
|
-
], runtimeOptions);
|
|
15
|
+
constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
|
|
16
|
+
super(registryEntries, dependencyContainer, [defaultRouteRequestHandler(defaultDataStoreId), ...requestHandlers], runtimeOptions, initializeEntryPoint);
|
|
20
17
|
this.defaultFactory = defaultFactory;
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,2CAA4C,SAAQ,2BAA2B;IAG3F,YACoB,cAAsC,EACzD,eAAmD,EACnD,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC,EACzC,oBAA2E;QAE3E,KAAK,CACJ,eAAe,EACf,mBAAmB,EACnB,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,EAAE,GAAG,eAAe,CAAC,EACpE,cAAc,EACd,oBAAoB,CACpB,CAAC;QAbiB,mBAAc,GAAd,cAAc,CAAwB;IAc1D,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1E,MAAM,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;;AAzBsB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidDependencySynthesizer } from \"@fluidframework/synthesize\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\nimport { defaultRouteRequestHandler } from \"../request-handlers\";\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory\";\n\nconst defaultDataStoreId = \"default\";\n\n/**\n * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from\n * the container with an empty URL.\n *\n * This factory should be exposed as fluidExport off the entry point to your module.\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tconstructor(\n\t\tprotected readonly defaultFactory: IFluidDataStoreFactory,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\tdependencyContainer?: IFluidDependencySynthesizer,\n\t\trequestHandlers: RuntimeRequestHandler[] = [],\n\t\truntimeOptions?: IContainerRuntimeOptions,\n\t\tinitializeEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>,\n\t) {\n\t\tsuper(\n\t\t\tregistryEntries,\n\t\t\tdependencyContainer,\n\t\t\t[defaultRouteRequestHandler(defaultDataStoreId), ...requestHandlers],\n\t\t\truntimeOptions,\n\t\t\tinitializeEntryPoint,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultFactory.type);\n\t\tawait dataStore.trySetAlias(defaultDataStoreId);\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { DirectoryFactory, MapFactory, SharedDirectory, SharedMap
|
|
5
|
+
import { DirectoryFactory, MapFactory, SharedDirectory, SharedMap } from "@fluidframework/map";
|
|
6
6
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore";
|
|
7
7
|
import { PureDataObjectFactory } from "./pureDataObjectFactory";
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAI/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,OAAO,iBAGX,SAAQ,qBAA8B;IACvC,YACC,IAAY,EACZ,IAA8C,EAC9C,gBAA4C,EAAE,EAC9C,iBAAoE,EACpE,eAAoD,EACpD,iBAA+C,qBAAqB;QAEpE,MAAM,aAAa,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;QAEzC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC7E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,CAAC;SACjD;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE;YACvE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;SAC3C;QAED,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACtF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DirectoryFactory, MapFactory, SharedDirectory, SharedMap } from \"@fluidframework/map\";\nimport { NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport { FluidObjectSymbolProvider } from \"@fluidframework/synthesize\";\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore\";\n\nimport { DataObject, DataObjectTypes, IDataObjectProps } from \"../data-objects\";\nimport { PureDataObjectFactory } from \"./pureDataObjectFactory\";\n\n/**\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n */\nexport class DataObjectFactory<\n\tTObj extends DataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TObj, I> {\n\tconstructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeFactory: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tconst mergedObjects = [...sharedObjects];\n\n\t\tif (!sharedObjects.find((factory) => factory.type === DirectoryFactory.Type)) {\n\t\t\t// User did not register for directory\n\t\t\tmergedObjects.push(SharedDirectory.getFactory());\n\t\t}\n\n\t\t// TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n\t\tif (!sharedObjects.find((factory) => factory.type === MapFactory.Type)) {\n\t\t\t// User did not register for map\n\t\t\tmergedObjects.push(SharedMap.getFactory());\n\t\t}\n\n\t\tsuper(type, ctor, mergedObjects, optionalProviders, registryEntries, runtimeFactory);\n\t}\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import { assert } from "@fluidframework/common-utils";
|
|
|
9
9
|
/**
|
|
10
10
|
* Proxy over PureDataObject
|
|
11
11
|
* Does delayed creation & initialization of PureDataObject
|
|
12
|
-
*/
|
|
12
|
+
*/
|
|
13
13
|
async function createDataObject(ctor, context, sharedObjectRegistry, optionalProviders, runtimeClassArg, existing, initProps) {
|
|
14
14
|
// base
|
|
15
15
|
let runtimeClass = runtimeClassArg;
|
|
@@ -76,7 +76,9 @@ export class PureDataObjectFactory {
|
|
|
76
76
|
}
|
|
77
77
|
this.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));
|
|
78
78
|
}
|
|
79
|
-
get IFluidDataStoreFactory() {
|
|
79
|
+
get IFluidDataStoreFactory() {
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
80
82
|
get IFluidDataStoreRegistry() {
|
|
81
83
|
return this.registry;
|
|
82
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,qBAAqB,EAErB,mBAAmB,GACrB,MAAM,2BAA2B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAa3E,OAAO,EAEH,mBAAmB,GAEtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAetD;;;EAGE;AACF,KAAK,UAAU,gBAAgB,CAC3B,IAA8C,EAC9C,OAA+B,EAC/B,oBAA2C,EAC3C,iBAAoE,EACpE,eAA6C,EAC7C,QAAiB,EACjB,S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AO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAES,KAAK,CAAC,yBAAyB,CACrC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgC;QAEhC,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAES,KAAK,CAAC,kBAAkB,CAC9B,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CAChD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CAAC,CAAC;QAElB,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n FluidDataStoreRuntime,\n ISharedObjectRegistry,\n mixinRequestHandler,\n } from \"@fluidframework/datastore\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n IFluidDataStoreContext,\n IContainerRuntimeBase,\n IFluidDataStoreFactory,\n IFluidDataStoreRegistry,\n IProvideFluidDataStoreRegistry,\n NamedFluidDataStoreRegistryEntries,\n NamedFluidDataStoreRegistryEntry,\n IFluidDataStoreContextDetached,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport {\n FluidObjectSymbolProvider,\n DependencyContainer,\n IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n IDataObjectProps,\n PureDataObject,\n DataObjectTypes,\n} from \"../data-objects\";\n/*\n * Useful interface in places where it's useful to do type erasure for PureDataObject generic\n */\nexport interface IRootDataObjectFactory extends IFluidDataStoreFactory {\n createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime): Promise<IFluidRouter>;\n}\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n*/\nasync function createDataObject<TObj extends PureDataObject, I extends DataObjectTypes = DataObjectTypes>(\n ctor: new (props: IDataObjectProps<I>) => TObj,\n context: IFluidDataStoreContext,\n sharedObjectRegistry: ISharedObjectRegistry,\n optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n runtimeClassArg: typeof FluidDataStoreRuntime,\n existing: boolean,\n initProps?: I[\"InitialState\"]) {\n // base\n let runtimeClass = runtimeClassArg;\n\n // request mixin in\n runtimeClass = mixinRequestHandler(\n async (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n const maybeRouter: FluidObject<IFluidRouter> | undefined = await runtimeArg.entryPoint?.get();\n assert(maybeRouter !== undefined, 0x468 /* entryPoint should have been initialized by now */);\n assert(maybeRouter?.IFluidRouter !== undefined,\n 0x469 /* Data store runtime entryPoint is not an IFluidRouter */);\n return maybeRouter?.IFluidRouter.request(request);\n },\n runtimeClass);\n\n // Create a new runtime for our data store\n // The runtime is what Fluid uses to create DDS' and route to your data store\n const runtime: FluidDataStoreRuntime = new runtimeClass(\n context,\n sharedObjectRegistry,\n existing,\n async (rt: IFluidDataStoreRuntime) => {\n assert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n // Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n // since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n // Without this I ran into issues with the load-existing flow not working correctly.\n await instance.finishInitialization(true);\n return instance;\n },\n );\n\n // Create object right away.\n // This allows object to register various callbacks with runtime before runtime\n // becomes globally available. But it's not full initialization - constructor can't\n // access DDSes or other services of runtime as objects are not fully initialized.\n // In order to use object, we need to go through full initialization by calling finishInitialization().\n const scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n const dependencyContainer = new DependencyContainer(scope.IFluidDependencySynthesizer);\n const providers = dependencyContainer.synthesize<I[\"OptionalProviders\"]>(optionalProviders, {});\n const instance = new ctor({ runtime, context, providers, initProps });\n\n // if it's a newly created object, we need to wait for it to finish initialization\n // as that results in creation of DDSes, before it gets attached, providing atomic\n // guarantee of creation.\n // WARNING: we can't do the same (yet) for already existing PureDataObject!\n // This will result in deadlock, as it tries to resolve internal handles, but any\n // handle resolution goes through root (container runtime), which can't route it back\n // to this data store, as it's still not initialized and not known to container runtime yet.\n // In the future, we should address it by using relative paths for handles and be able to resolve\n // local DDSes while data store is not fully initialized.\n if (!existing) {\n await instance.finishInitialization(existing);\n }\n\n return { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n */\nexport class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes>\n implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>, IRootDataObjectFactory {\n private readonly sharedObjectRegistry: ISharedObjectRegistry;\n private readonly registry: IFluidDataStoreRegistry | undefined;\n\n constructor(\n public readonly type: string,\n private readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n sharedObjects: readonly IChannelFactory[],\n private readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n registryEntries?: NamedFluidDataStoreRegistryEntries,\n private readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n ) {\n if (this.type === \"\") {\n throw new Error(\"undefined type member\");\n }\n if (registryEntries !== undefined) {\n this.registry = new FluidDataStoreRegistry(registryEntries);\n }\n this.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n }\n\n public get IFluidDataStoreFactory() { return this; }\n\n public get IFluidDataStoreRegistry() {\n return this.registry;\n }\n\n /**\n * Convenience helper to get the data store's/factory's data store registry entry.\n * The return type hides the factory's generics, easing grouping of registry\n * entries that differ only in this way into the same array.\n * @returns The NamedFluidDataStoreRegistryEntry\n */\n public get registryEntry(): NamedFluidDataStoreRegistryEntry {\n return [this.type, Promise.resolve(this)];\n }\n\n /**\n * This is where we do data store setup.\n *\n * @param context - data store context used to load a data store runtime\n */\n public async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {\n const { runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n existing);\n\n return runtime;\n }\n\n /**\n * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n * In other words, registry of context passed in has to contain this factory, with the name that matches\n * this factory's type.\n * It is intended to be used by data store objects that create sub-objects.\n * @param context - The context being used to create the runtime\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created data store.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createChildInstance(\n parentContext: IFluidDataStoreContext,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n parentContext.containerRuntime,\n [...parentContext.packagePath, this.type],\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n * In other words, registry of context passed in has to have this factory.\n * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n * @param context - The component context being used to create the object\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createPeerInstance(\n peerContext: IFluidDataStoreContext,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n peerContext.containerRuntime,\n peerContext.packagePath,\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createInstance(\n runtime: IContainerRuntimeBase,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n runtime,\n [this.type],\n initialState);\n }\n\n /**\n * Creates a new root instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n const context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createNonRootInstanceCore(\n containerRuntime: IContainerRuntimeBase,\n packagePath: Readonly<string[]>,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n const context = containerRuntime.createDetachedDataStore(packagePath);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createInstanceCore(\n context: IFluidDataStoreContextDetached,\n initialState?: I[\"InitialState\"],\n ): Promise<TObj> {\n const { instance, runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n false, // existing\n initialState);\n\n await context.attachRuntime(this, runtime);\n\n return instance;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,qBAAqB,EAErB,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAa3E,OAAO,EAEN,mBAAmB,GAEnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAStD;;;GAGG;AACH,KAAK,UAAU,gBAAgB,CAI9B,IAA8C,EAC9C,OAA+B,EAC/B,oBAA2C,EAC3C,iBAAoE,EACpE,eAA6C,EAC7C,QAAiB,EACjB,SAA6B;IAE7B,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,YAAY,GAAG,mBAAmB,CACjC,KAAK,EAAE,OAAiB,EAAE,UAAiC,EAAE,EAAE;;QAC9D,MAAM,WAAW,GAChB,MAAM,CAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,GAAG,EAAE,CAAA,CAAC;QACpC,MAAM,CACL,WAAW,KAAK,SAAS,EACzB,KAAK,CAAC,oDAAoD,CAC1D,CAAC;QACF,MAAM,CACL,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,MAAK,SAAS,EACvC,KAAK,CAAC,0DAA0D,CAChE,CAAC;QACF,OAAO,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,EACD,YAAY,CACZ,CAAC;IAEF,0CAA0C;IAC1C,6EAA6E;IAC7E,MAAM,OAAO,GAA0B,IAAI,YAAY,CACtD,OAAO,EACP,oBAAoB,EACpB,QAAQ,EACR,KAAK,EAAE,EAA0B,EAAE,EAAE;QACpC,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC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CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,cAAc,CAC1B,OAA8B,EAC9B,YAAgC;QAEhC,OAAO,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,kBAAkB,CAC9B,eAAuB,EACvB,OAA0B,EAC1B,YAAgC;QAEhC,MAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,yBAAyB,CACxC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgC;QAEhC,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,kBAAkB,CACjC,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidDataStoreRuntime,\n\tISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidDataStoreContext,\n\tIContainerRuntimeBase,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n\tIFluidDataStoreContextDetached,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport {\n\tFluidObjectSymbolProvider,\n\tDependencyContainer,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDataObjectProps, PureDataObject, DataObjectTypes } from \"../data-objects\";\n/*\n * Useful interface in places where it's useful to do type erasure for PureDataObject generic\n */\nexport interface IRootDataObjectFactory extends IFluidDataStoreFactory {\n\tcreateRootInstance(rootDataStoreId: string, runtime: IContainerRuntime): Promise<IFluidRouter>;\n}\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n */\nasync function createDataObject<\n\tTObj extends PureDataObject,\n\tI extends DataObjectTypes = DataObjectTypes,\n>(\n\tctor: new (props: IDataObjectProps<I>) => TObj,\n\tcontext: IFluidDataStoreContext,\n\tsharedObjectRegistry: ISharedObjectRegistry,\n\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\truntimeClassArg: typeof FluidDataStoreRuntime,\n\texisting: boolean,\n\tinitProps?: I[\"InitialState\"],\n) {\n\t// base\n\tlet runtimeClass = runtimeClassArg;\n\n\t// request mixin in\n\truntimeClass = mixinRequestHandler(\n\t\tasync (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n\t\t\tconst maybeRouter: FluidObject<IFluidRouter> | undefined =\n\t\t\t\tawait runtimeArg.entryPoint?.get();\n\t\t\tassert(\n\t\t\t\tmaybeRouter !== undefined,\n\t\t\t\t0x468 /* entryPoint should have been initialized by now */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tmaybeRouter?.IFluidRouter !== undefined,\n\t\t\t\t0x469 /* Data store runtime entryPoint is not an IFluidRouter */,\n\t\t\t);\n\t\t\treturn maybeRouter?.IFluidRouter.request(request);\n\t\t},\n\t\truntimeClass,\n\t);\n\n\t// Create a new runtime for our data store\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass(\n\t\tcontext,\n\t\tsharedObjectRegistry,\n\t\texisting,\n\t\tasync (rt: IFluidDataStoreRuntime) => {\n\t\t\tassert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n\t\t\t// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n\t\t\t// since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n\t\t\t// Without this I ran into issues with the load-existing flow not working correctly.\n\t\t\tawait instance.finishInitialization(true);\n\t\t\treturn instance;\n\t\t},\n\t);\n\n\t// Create object right away.\n\t// This allows object to register various callbacks with runtime before runtime\n\t// becomes globally available. But it's not full initialization - constructor can't\n\t// access DDSes or other services of runtime as objects are not fully initialized.\n\t// In order to use object, we need to go through full initialization by calling finishInitialization().\n\tconst scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n\tconst dependencyContainer = new DependencyContainer(scope.IFluidDependencySynthesizer);\n\tconst providers = dependencyContainer.synthesize<I[\"OptionalProviders\"]>(optionalProviders, {});\n\tconst instance = new ctor({ runtime, context, providers, initProps });\n\n\t// if it's a newly created object, we need to wait for it to finish initialization\n\t// as that results in creation of DDSes, before it gets attached, providing atomic\n\t// guarantee of creation.\n\t// WARNING: we can't do the same (yet) for already existing PureDataObject!\n\t// This will result in deadlock, as it tries to resolve internal handles, but any\n\t// handle resolution goes through root (container runtime), which can't route it back\n\t// to this data store, as it's still not initialized and not known to container runtime yet.\n\t// In the future, we should address it by using relative paths for handles and be able to resolve\n\t// local DDSes while data store is not fully initialized.\n\tif (!existing) {\n\t\tawait instance.finishInitialization(existing);\n\t}\n\n\treturn { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n */\nexport class PureDataObjectFactory<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> implements\n\t\tIFluidDataStoreFactory,\n\t\tPartial<IProvideFluidDataStoreRegistry>,\n\t\tIRootDataObjectFactory\n{\n\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry;\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\n\tconstructor(\n\t\tpublic readonly type: string,\n\t\tprivate readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[],\n\t\tprivate readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tif (this.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tif (registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t\t}\n\t\tthis.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n\t}\n\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * Convenience helper to get the data store's/factory's data store registry entry.\n\t * The return type hides the factory's generics, easing grouping of registry\n\t * entries that differ only in this way into the same array.\n\t * @returns The NamedFluidDataStoreRegistryEntry\n\t */\n\tpublic get registryEntry(): NamedFluidDataStoreRegistryEntry {\n\t\treturn [this.type, Promise.resolve(this)];\n\t}\n\n\t/**\n\t * This is where we do data store setup.\n\t *\n\t * @param context - data store context used to load a data store runtime\n\t */\n\tpublic async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {\n\t\tconst { runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\texisting,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n\t * In other words, registry of context passed in has to contain this factory, with the name that matches\n\t * this factory's type.\n\t * It is intended to be used by data store objects that create sub-objects.\n\t * @param context - The context being used to create the runtime\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created data store.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createChildInstance(\n\t\tparentContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tparentContext.containerRuntime,\n\t\t\t[...parentContext.packagePath, this.type],\n\t\t\tinitialState,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n\t * In other words, registry of context passed in has to have this factory.\n\t * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n\t * @param context - The component context being used to create the object\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createPeerInstance(\n\t\tpeerContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tpeerContext.containerRuntime,\n\t\t\tpeerContext.packagePath,\n\t\t\tinitialState,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createInstance(\n\t\truntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState);\n\t}\n\n\t/**\n\t * Creates a new root instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createRootInstance(\n\t\trootDataStoreId: string,\n\t\truntime: IContainerRuntime,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createInstanceCore(\n\t\tcontext: IFluidDataStoreContextDetached,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
|
|
@@ -59,7 +59,7 @@ export class DataObject extends PureDataObject {
|
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
// data store has a root directory so we just need to set it before calling initializingFromExisting
|
|
62
|
-
this.internalRoot = await this.runtime.getChannel(this.rootDirectoryId);
|
|
62
|
+
this.internalRoot = (await this.runtime.getChannel(this.rootDirectoryId));
|
|
63
63
|
// This will actually be an ISharedMap if the channel was previously created by the older version of
|
|
64
64
|
// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless
|
|
65
65
|
// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAoB,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;;;;GASG;AACH,MAAM,OAAgB,UAEpB,SAAQ,cAAiB;IAF3B;;QAIkB,oBAAe,GAAG,MAAM,CAAC;IAqE3C,CAAC;IAnEA;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACp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O,CAAC,MAAM,CAAC,IAAI,CAAC;oBACxB,QAAQ,EAAE,SAAS;oBACnB,SAAS,EAAE,eAAe;oBAC1B,OAAO,EACN,6EAA6E;iBAC9E,CAAC,CAAC;aACH;SACD;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACO,2BAA2B,CAAC,IAAY;QACjD,OAAO,GAAG,IAAI,6CAA6C,CAAC;IAC7D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { ISharedDirectory, MapFactory, SharedDirectory } from \"@fluidframework/map\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\nimport { PureDataObject } from \"./pureDataObject\";\nimport { DataObjectTypes } from \"./types\";\n\n/**\n * DataObject is a base data store that is primed with a root directory. It\n * ensures that it is created and ready before you can access it.\n *\n * Having a single root directory allows for easier development. Instead of creating\n * and registering channels with the runtime any new DDS that is set on the root\n * will automatically be registered.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n */\nexport abstract class DataObject<\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<I> {\n\tprivate internalRoot: ISharedDirectory | undefined;\n\tprivate readonly rootDirectoryId = \"root\";\n\n\t/**\n\t * {@inheritDoc PureDataObject.request}\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst itemId = requestParser.pathParts[0];\n\t\tif (itemId === \"bigBlobs\") {\n\t\t\tconst value = this.root.get<string>(requestParser.pathParts.join(\"/\"));\n\t\t\tif (value === undefined) {\n\t\t\t\treturn create404Response(requestParser);\n\t\t\t}\n\t\t\treturn { mimeType: \"fluid/object\", status: 200, value };\n\t\t} else {\n\t\t\treturn super.request(requestParser);\n\t\t}\n\t}\n\n\t/**\n\t * The root directory will either be ready or will return an error. If an error is thrown\n\t * the root has not been correctly created/set.\n\t */\n\tprotected get root(): ISharedDirectory {\n\t\tif (!this.internalRoot) {\n\t\t\tthrow new Error(this.getUninitializedErrorString(`root`));\n\t\t}\n\n\t\treturn this.internalRoot;\n\t}\n\n\t/**\n\t * Initializes internal objects and calls initialization overrides.\n\t * Caller is responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (!existing) {\n\t\t\t// Create a root directory and register it before calling initializingFirstTime\n\t\t\tthis.internalRoot = SharedDirectory.create(this.runtime, this.rootDirectoryId);\n\t\t\tthis.internalRoot.bindToContext();\n\t\t} else {\n\t\t\t// data store has a root directory so we just need to set it before calling initializingFromExisting\n\t\t\tthis.internalRoot = (await this.runtime.getChannel(\n\t\t\t\tthis.rootDirectoryId,\n\t\t\t)) as ISharedDirectory;\n\n\t\t\t// This will actually be an ISharedMap if the channel was previously created by the older version of\n\t\t\t// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless\n\t\t\t// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.\n\t\t\tif (this.internalRoot.attributes.type === MapFactory.Type) {\n\t\t\t\tthis.runtime.logger.send({\n\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\teventName: \"MapDataObject\",\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n\n\t/**\n\t * Generates an error string indicating an item is uninitialized.\n\t * @param item - The name of the item that was uninitialized.\n\t */\n\tprotected getUninitializedErrorString(item: string): string {\n\t\treturn `${item} must be initialized before being accessed.`;\n\t}\n}\n"]}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { assert, EventForwarder } from "@fluidframework/common-utils";
|
|
6
|
-
import { handleFromLegacyUri } from "@fluidframework/request-handler";
|
|
7
|
-
import { serviceRoutePathRoot } from "../container-services";
|
|
8
6
|
import { defaultFluidObjectRequestHandler } from "../request-handlers";
|
|
9
7
|
/**
|
|
10
8
|
* This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
|
|
@@ -29,10 +27,18 @@ export class PureDataObject extends EventForwarder {
|
|
|
29
27
|
this.dispose();
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
|
-
get disposed() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
get
|
|
30
|
+
get disposed() {
|
|
31
|
+
return this._disposed;
|
|
32
|
+
}
|
|
33
|
+
get id() {
|
|
34
|
+
return this.runtime.id;
|
|
35
|
+
}
|
|
36
|
+
get IFluidRouter() {
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
get IFluidLoadable() {
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
36
42
|
get IFluidHandle() {
|
|
37
43
|
return this.handle;
|
|
38
44
|
}
|
|
@@ -107,20 +113,15 @@ export class PureDataObject extends EventForwarder {
|
|
|
107
113
|
* define custom types/getters for object retrieval
|
|
108
114
|
*/
|
|
109
115
|
async getFluidObjectFromDirectory(key, directory, getObjectFromDirectory) {
|
|
110
|
-
const handleMaybe = getObjectFromDirectory
|
|
116
|
+
const handleMaybe = getObjectFromDirectory
|
|
117
|
+
? getObjectFromDirectory(key, directory)
|
|
118
|
+
: directory.get(key);
|
|
111
119
|
const handle = handleMaybe === null || handleMaybe === void 0 ? void 0 : handleMaybe.IFluidHandle;
|
|
112
120
|
if (handle) {
|
|
113
121
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
114
122
|
return handle.get();
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Gets the service at a given id.
|
|
119
|
-
* @param id - service id
|
|
120
|
-
*/
|
|
121
|
-
async getService(id) {
|
|
122
|
-
return handleFromLegacyUri(`/${serviceRoutePathRoot}/${id}`, this.context.containerRuntime).get();
|
|
123
|
-
}
|
|
124
125
|
/**
|
|
125
126
|
* Called every time the data store is initialized, before initializingFirstTime or
|
|
126
127
|
* initializingFromExisting is called.
|