@fluidframework/fluid-runner 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.5.3.2.178189

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/codeLoaderBundle.d.ts +1 -2
  3. package/dist/codeLoaderBundle.d.ts.map +1 -1
  4. package/dist/codeLoaderBundle.js.map +1 -1
  5. package/dist/exportFile.d.ts.map +1 -1
  6. package/dist/exportFile.js +6 -3
  7. package/dist/exportFile.js.map +1 -1
  8. package/dist/logger/baseFileLogger.d.ts +1 -1
  9. package/dist/logger/baseFileLogger.d.ts.map +1 -1
  10. package/dist/logger/baseFileLogger.js.map +1 -1
  11. package/dist/logger/csvFileLogger.d.ts +1 -1
  12. package/dist/logger/csvFileLogger.d.ts.map +1 -1
  13. package/dist/logger/csvFileLogger.js.map +1 -1
  14. package/dist/logger/fileLogger.d.ts +1 -1
  15. package/dist/logger/fileLogger.d.ts.map +1 -1
  16. package/dist/logger/fileLogger.js.map +1 -1
  17. package/lib/codeLoaderBundle.d.ts +1 -2
  18. package/lib/codeLoaderBundle.d.ts.map +1 -1
  19. package/lib/codeLoaderBundle.js.map +1 -1
  20. package/lib/exportFile.d.ts.map +1 -1
  21. package/lib/exportFile.js +6 -3
  22. package/lib/exportFile.js.map +1 -1
  23. package/lib/logger/baseFileLogger.d.ts +1 -1
  24. package/lib/logger/baseFileLogger.d.ts.map +1 -1
  25. package/lib/logger/baseFileLogger.js.map +1 -1
  26. package/lib/logger/csvFileLogger.d.ts +1 -1
  27. package/lib/logger/csvFileLogger.d.ts.map +1 -1
  28. package/lib/logger/csvFileLogger.js.map +1 -1
  29. package/lib/logger/fileLogger.d.ts +1 -1
  30. package/lib/logger/fileLogger.d.ts.map +1 -1
  31. package/lib/logger/fileLogger.js.map +1 -1
  32. package/package.json +14 -14
  33. package/src/codeLoaderBundle.ts +1 -2
  34. package/src/exportFile.ts +5 -3
  35. package/src/logger/baseFileLogger.ts +1 -1
  36. package/src/logger/csvFileLogger.ts +1 -1
  37. package/src/logger/fileLogger.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @fluidframework/fluid-runner
2
2
 
3
+ ## 2.0.0-internal.5.3.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.0.0-internal.5.2.0
8
+
9
+ Dependency updates only.
10
+
11
+ ## 2.0.0-internal.5.1.0
12
+
13
+ Dependency updates only.
14
+
3
15
  ## 2.0.0-internal.5.0.0
4
16
 
5
17
  Dependency updates only.
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
6
5
  import { ICodeDetailsLoader, IContainer } from "@fluidframework/container-definitions";
7
- import { FluidObject } from "@fluidframework/core-interfaces";
6
+ import { ITelemetryBaseLogger, FluidObject } from "@fluidframework/core-interfaces";
8
7
  /**
9
8
  * Contract that defines the necessary exports for the bundle provided at runtime
10
9
  * For an example, see "src/test/sampleCodeLoaders/sampleCodeLoader.ts"
@@ -1 +1 @@
1
- {"version":3,"file":"codeLoaderBundle.d.ts","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,C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,EAAE,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAQzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeLoaderBundle.js","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyCH;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAW;IAC7C,+DAA+D;IAC/D,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,KAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtE,CAAC;AAHD,gDAGC;AAED,SAAgB,oBAAoB,CAAC,GAAQ;IAC5C,+DAA+D;IAC/D,OAAO,CACN,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa;QAClB,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU;QACvC,GAAG,CAAC,OAAO;QACX,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CACjC,CAAC;AACH,CAAC;AARD,oDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
1
+ {"version":3,"file":"codeLoaderBundle.js","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwCH;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAW;IAC7C,+DAA+D;IAC/D,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,KAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtE,CAAC;AAHD,gDAGC;AAED,SAAgB,oBAAoB,CAAC,GAAQ;IAC5C,+DAA+D;IAC/D,OAAO,CACN,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa;QAClB,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU;QACvC,GAAG,CAAC,OAAO;QACX,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CACjC,CAAC;AACH,CAAC;AARD,oDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions\";\nimport { ITelemetryBaseLogger, FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.d.ts","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iCAAiC,CAAC;AAIxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EAAE,iBAAi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AA0B;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAID;;GAEG;AACH,wBAAsB,UAAU,CAC/B,kBAAkB,EAAE,mBAAmB,EACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,iBAAiB,EAAE,MAAM,GAAG,UAAU,EACtC,kBAAkB,EAAE,mBAAmB,EACvC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,CAAC,CA0CjB"}
@@ -91,9 +91,12 @@ async function createContainerAndExecute(localOdspSnapshot, fluidFileConverter,
91
91
  },
92
92
  });
93
93
  return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
94
- const result = await fluidFileConverter.execute(container, options);
95
- container.close();
96
- return result;
94
+ try {
95
+ return await fluidFileConverter.execute(container, options);
96
+ }
97
+ finally {
98
+ container.dispose();
99
+ }
97
100
  });
98
101
  };
99
102
  // eslint-disable-next-line unicorn/prefer-ternary
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qEAAwF;AACxF,iFAAqE;AACrE,uEAA0D;AAC1D,6DAAoF;AAEpF,uDAAoD;AACpD,mCA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E,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,IAAI,EAAE;YACtF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACpE,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,kDAAkD;IAClD,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,OAAO,IAAA,sBAAc,EAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACjD,EAAE,EAAE;iBACF,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iBAC/B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,OAAO,CAAC,CAAC;KACZ;SAAM;QACN,OAAO,EAAE,EAAE,CAAC;KACZ;AACF,CAAC;AA/CD,8DA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver\";\nimport { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from \"./utils\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\n/* eslint-enable import/no-internal-modules */\n\nexport type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;\n\ninterface IExportFileResponseSuccess {\n\tsuccess: true;\n}\n\ninterface IExportFileResponseFailure {\n\tsuccess: false;\n\teventName: string;\n\terrorMessage: string;\n\terror?: any;\n}\n\nconst clientArgsValidationError = \"Client_ArgsValidationError\";\n\n/**\n * Execute code on Container based on ODSP snapshot and write result to file\n */\nexport async function exportFile(\n\tfluidFileConverter: IFluidFileConverter,\n\tinputFile: string,\n\toutputFile: string,\n\ttelemetryFile: string,\n\toptions?: string,\n\ttelemetryOptions?: ITelemetryOptions,\n\ttimeout?: number,\n\tdisableNetworkFetch?: boolean,\n): Promise<IExportFileResponse> {\n\tconst telemetryArgError = getTelemetryFileValidationError(telemetryFile);\n\tif (telemetryArgError) {\n\t\tconst eventName = clientArgsValidationError;\n\t\treturn { success: false, eventName, errorMessage: telemetryArgError };\n\t}\n\tconst { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);\n\n\ttry {\n\t\treturn await PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: \"ExportFile\" },\n\t\t\tasync () => {\n\t\t\t\tconst argsValidationError = getArgsValidationError(inputFile, outputFile, timeout);\n\t\t\t\tif (argsValidationError) {\n\t\t\t\t\tconst eventName = clientArgsValidationError;\n\t\t\t\t\tlogger.sendErrorEvent({ eventName, message: argsValidationError });\n\t\t\t\t\treturn { success: false, eventName, errorMessage: argsValidationError };\n\t\t\t\t}\n\n\t\t\t\tfs.writeFileSync(\n\t\t\t\t\toutputFile,\n\t\t\t\t\tawait createContainerAndExecute(\n\t\t\t\t\t\tgetSnapshotFileContent(inputFile),\n\t\t\t\t\t\tfluidFileConverter,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tdisableNetworkFetch,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn { success: true };\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tconst eventName = \"Client_UnexpectedError\";\n\t\tlogger.sendErrorEvent({ eventName }, error);\n\t\treturn { success: false, eventName, errorMessage: \"Unexpected error\", error };\n\t} finally {\n\t\tawait fileLogger.close();\n\t}\n}\n\n/**\n * Create the container based on an ODSP snapshot and execute code on it\n * @returns result of execution\n */\nexport async function createContainerAndExecute(\n\tlocalOdspSnapshot: string | Uint8Array,\n\tfluidFileConverter: IFluidFileConverter,\n\tlogger: ITelemetryLoggerExt,\n\toptions?: string,\n\ttimeout?: number,\n\tdisableNetworkFetch: boolean = false,\n): Promise<string> {\n\tconst fn = async () => {\n\t\tif (disableNetworkFetch) {\n\t\t\tglobal.fetch = async () => {\n\t\t\t\tthrow new Error(\"Network fetch is not allowed\");\n\t\t\t};\n\t\t}\n\n\t\tconst loader = new Loader({\n\t\t\turlResolver: new FakeUrlResolver(),\n\t\t\tdocumentServiceFactory: createLocalOdspDocumentServiceFactory(localOdspSnapshot),\n\t\t\tcodeLoader: await fluidFileConverter.getCodeLoader(logger),\n\t\t\tscope: await fluidFileConverter.getScope?.(logger),\n\t\t\tlogger,\n\t\t});\n\n\t\tconst container = await loader.resolve({\n\t\t\turl: \"/fakeUrl/\",\n\t\t\theaders: {\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: \"cached\" },\n\t\t\t},\n\t\t});\n\n\t\treturn PerformanceEvent.timedExecAsync(logger, { eventName: \"ExportFile\" }, async () => {\n\t\t\tconst result = await fluidFileConverter.execute(container, options);\n\t\t\tcontainer.close();\n\t\t\treturn result;\n\t\t});\n\t};\n\n\t// eslint-disable-next-line unicorn/prefer-ternary\n\tif (timeout !== undefined) {\n\t\treturn timeoutPromise<string>((resolve, reject) => {\n\t\t\tfn()\n\t\t\t\t.then((value) => resolve(value))\n\t\t\t\t.catch((error) => reject(error));\n\t\t}, timeout);\n\t} else {\n\t\treturn fn();\n\t}\n}\n"]}
1
+ {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;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,EAAE;aACtD;SACD,CAAC,CAAC;QAEH,OAAO,kCAAgB,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,IAAI,EAAE;YACtF,IAAI;gBACH,OAAO,MAAM,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;aAC5D;oBAAS;gBACT,SAAS,CAAC,OAAO,EAAE,CAAC;aACpB;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,kDAAkD;IAClD,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,OAAO,IAAA,sBAAc,EAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACjD,EAAE,EAAE;iBACF,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iBAC/B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,OAAO,CAAC,CAAC;KACZ;SAAM;QACN,OAAO,EAAE,EAAE,CAAC;KACZ;AACF,CAAC;AAjDD,8DAiDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver\";\nimport { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from \"./utils\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\n/* eslint-enable import/no-internal-modules */\n\nexport type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;\n\ninterface IExportFileResponseSuccess {\n\tsuccess: true;\n}\n\ninterface IExportFileResponseFailure {\n\tsuccess: false;\n\teventName: string;\n\terrorMessage: string;\n\terror?: any;\n}\n\nconst clientArgsValidationError = \"Client_ArgsValidationError\";\n\n/**\n * Execute code on Container based on ODSP snapshot and write result to file\n */\nexport async function exportFile(\n\tfluidFileConverter: IFluidFileConverter,\n\tinputFile: string,\n\toutputFile: string,\n\ttelemetryFile: string,\n\toptions?: string,\n\ttelemetryOptions?: ITelemetryOptions,\n\ttimeout?: number,\n\tdisableNetworkFetch?: boolean,\n): Promise<IExportFileResponse> {\n\tconst telemetryArgError = getTelemetryFileValidationError(telemetryFile);\n\tif (telemetryArgError) {\n\t\tconst eventName = clientArgsValidationError;\n\t\treturn { success: false, eventName, errorMessage: telemetryArgError };\n\t}\n\tconst { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);\n\n\ttry {\n\t\treturn await PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: \"ExportFile\" },\n\t\t\tasync () => {\n\t\t\t\tconst argsValidationError = getArgsValidationError(inputFile, outputFile, timeout);\n\t\t\t\tif (argsValidationError) {\n\t\t\t\t\tconst eventName = clientArgsValidationError;\n\t\t\t\t\tlogger.sendErrorEvent({ eventName, message: argsValidationError });\n\t\t\t\t\treturn { success: false, eventName, errorMessage: argsValidationError };\n\t\t\t\t}\n\n\t\t\t\tfs.writeFileSync(\n\t\t\t\t\toutputFile,\n\t\t\t\t\tawait createContainerAndExecute(\n\t\t\t\t\t\tgetSnapshotFileContent(inputFile),\n\t\t\t\t\t\tfluidFileConverter,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tdisableNetworkFetch,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn { success: true };\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tconst eventName = \"Client_UnexpectedError\";\n\t\tlogger.sendErrorEvent({ eventName }, error);\n\t\treturn { success: false, eventName, errorMessage: \"Unexpected error\", error };\n\t} finally {\n\t\tawait fileLogger.close();\n\t}\n}\n\n/**\n * Create the container based on an ODSP snapshot and execute code on it\n * @returns result of execution\n */\nexport async function createContainerAndExecute(\n\tlocalOdspSnapshot: string | Uint8Array,\n\tfluidFileConverter: IFluidFileConverter,\n\tlogger: ITelemetryLoggerExt,\n\toptions?: string,\n\ttimeout?: number,\n\tdisableNetworkFetch: boolean = false,\n): Promise<string> {\n\tconst fn = async () => {\n\t\tif (disableNetworkFetch) {\n\t\t\tglobal.fetch = async () => {\n\t\t\t\tthrow new Error(\"Network fetch is not allowed\");\n\t\t\t};\n\t\t}\n\n\t\tconst loader = new Loader({\n\t\t\turlResolver: new FakeUrlResolver(),\n\t\t\tdocumentServiceFactory: createLocalOdspDocumentServiceFactory(localOdspSnapshot),\n\t\t\tcodeLoader: await fluidFileConverter.getCodeLoader(logger),\n\t\t\tscope: await fluidFileConverter.getScope?.(logger),\n\t\t\tlogger,\n\t\t});\n\n\t\tconst container = await loader.resolve({\n\t\t\turl: \"/fakeUrl/\",\n\t\t\theaders: {\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: \"cached\" },\n\t\t\t},\n\t\t});\n\n\t\treturn PerformanceEvent.timedExecAsync(logger, { eventName: \"ExportFile\" }, async () => {\n\t\t\ttry {\n\t\t\t\treturn await fluidFileConverter.execute(container, options);\n\t\t\t} finally {\n\t\t\t\tcontainer.dispose();\n\t\t\t}\n\t\t});\n\t};\n\n\t// eslint-disable-next-line unicorn/prefer-ternary\n\tif (timeout !== undefined) {\n\t\treturn timeoutPromise<string>((resolve, reject) => {\n\t\t\tfn()\n\t\t\t\t.then((value) => resolve(value))\n\t\t\t\t.catch((error) => reject(error));\n\t\t}, timeout);\n\t} else {\n\t\treturn fn();\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 { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
6
  import { IFileLogger } from "./fileLogger";
7
7
  /**
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"baseFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,8BAAsB,cAAe,YAAW,WAAW;IAazD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACnC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;IACzC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;IAd1B,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvC,0CAA0C;IAC1C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,CAAM;IAC7B,SAAS,CAAC,gBAAgB,UAAS;IAEnC;;;;OAIG;gBAEiB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,MAAW,EAC3B,YAAY,CAAC,6CAAiC;IAG3D,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;cAW7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAazB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
1
+ {"version":3,"file":"baseFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,8BAAsB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,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;YAC5E,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;SACb;IACF,CAAC;IAES,KAAK,CAAC,KAAK;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7E,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;aACvD;iBAAM;gBACN,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAC7B;IACF,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD;AA7CD,wCA6CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/common-definitions\";\nimport { IFileLogger } from \"./fileLogger\";\n\n/**\n * @internal\n */\nexport abstract class BaseFileLogger implements IFileLogger {\n\tpublic supportsTags?: true | undefined;\n\n\t/** Hold events in memory until flushed */\n\tprotected events: any[] = [];\n\tprotected hasWrittenToFile = false;\n\n\t/**\n\t * @param filePath - file path to write logs to\n\t * @param eventsPerFlush - number of events per flush\n\t * @param defaultProps - default properties to add to every telemetry event\n\t */\n\tpublic constructor(\n\t\tprotected readonly filePath: string,\n\t\tprotected readonly eventsPerFlush: number = 50,\n\t\tprotected readonly defaultProps?: Record<string, string | number>,\n\t) {}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tevent = { ...event, ...this.defaultProps };\n\t\tthis.events.push(event);\n\n\t\tif (this.events.length >= this.eventsPerFlush || event.category === \"error\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tthis.flush();\n\t\t}\n\t}\n\n\tprotected async flush(): Promise<void> {\n\t\tif (this.events.length > 0) {\n\t\t\tconst contentToWrite = this.events.map((it) => JSON.stringify(it)).join(\",\");\n\t\t\tif (this.hasWrittenToFile) {\n\t\t\t\tfs.appendFileSync(this.filePath, `,${contentToWrite}`);\n\t\t\t} else {\n\t\t\t\tfs.appendFileSync(this.filePath, contentToWrite);\n\t\t\t}\n\t\t\tthis.events = [];\n\t\t\tthis.hasWrittenToFile = true;\n\t\t}\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait this.flush();\n\t}\n}\n"]}
1
+ {"version":3,"file":"baseFileLogger.js","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAIzB;;GAEG;AACH,MAAsB,cAAc;IAOnC;;;;OAIG;IACH,YACoB,QAAgB,EAChB,iBAAyB,EAAE,EAC3B,YAA8C;QAF9C,aAAQ,GAAR,QAAQ,CAAQ;QAChB,mBAAc,GAAd,cAAc,CAAa;QAC3B,iBAAY,GAAZ,YAAY,CAAkC;QAZlE,0CAA0C;QAChC,WAAM,GAAU,EAAE,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;IAWhC,CAAC;IAEG,IAAI,CAAC,KAA0B;QACrC,6CAA6C;QAC7C,KAAK,mCAAQ,KAAK,GAAK,IAAI,CAAC,YAAY,CAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAExB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;YAC5E,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;SACb;IACF,CAAC;IAES,KAAK,CAAC,KAAK;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7E,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;aACvD;iBAAM;gBACN,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAC7B;IACF,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD;AA7CD,wCA6CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport { IFileLogger } from \"./fileLogger\";\n\n/**\n * @internal\n */\nexport abstract class BaseFileLogger implements IFileLogger {\n\tpublic supportsTags?: true | undefined;\n\n\t/** Hold events in memory until flushed */\n\tprotected events: any[] = [];\n\tprotected hasWrittenToFile = false;\n\n\t/**\n\t * @param filePath - file path to write logs to\n\t * @param eventsPerFlush - number of events per flush\n\t * @param defaultProps - default properties to add to every telemetry event\n\t */\n\tpublic constructor(\n\t\tprotected readonly filePath: string,\n\t\tprotected readonly eventsPerFlush: number = 50,\n\t\tprotected readonly defaultProps?: Record<string, string | number>,\n\t) {}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tevent = { ...event, ...this.defaultProps };\n\t\tthis.events.push(event);\n\n\t\tif (this.events.length >= this.eventsPerFlush || event.category === \"error\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tthis.flush();\n\t\t}\n\t}\n\n\tprotected async flush(): Promise<void> {\n\t\tif (this.events.length > 0) {\n\t\t\tconst contentToWrite = this.events.map((it) => JSON.stringify(it)).join(\",\");\n\t\t\tif (this.hasWrittenToFile) {\n\t\t\t\tfs.appendFileSync(this.filePath, `,${contentToWrite}`);\n\t\t\t} else {\n\t\t\t\tfs.appendFileSync(this.filePath, contentToWrite);\n\t\t\t}\n\t\t\tthis.events = [];\n\t\t\tthis.hasWrittenToFile = true;\n\t\t}\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait this.flush();\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 { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
6
  import { BaseFileLogger } from "./baseFileLogger";
7
7
  /**
8
8
  * FileLogger that writes events into a defined CSV file
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAChD,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;cAErB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAQhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CASnC"}
1
+ {"version":3,"file":"csvFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAChD,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;cAErB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAQhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CASnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileLogger.js","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,uCAAiC;AAEjC,qDAAkD;AAElD;;;GAGG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAAjD;;QACC,wDAAwD;QACvC,YAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAuBtC,CAAC;IArBU,KAAK,CAAC,KAAK;QACpB,yFAAyF;IAC1F,CAAC;IAEM,IAAI,CAAC,KAA0B;QACrC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAA,gBAAK,EAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACD;AAzBD,sCAyBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { parse } from \"json2csv\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/common-definitions\";\nimport { BaseFileLogger } from \"./baseFileLogger\";\n\n/**\n * FileLogger that writes events into a defined CSV file\n * @internal\n */\nexport class CSVFileLogger extends BaseFileLogger {\n\t/** Store the column names to write as the CSV header */\n\tprivate readonly columns = new Set();\n\n\tprotected async flush(): Promise<void> {\n\t\t// No flushing is performed since we need all log entries to determine set of CSV columns\n\t}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const prop in event) {\n\t\t\tthis.columns.add(prop);\n\t\t}\n\t\tsuper.send(event);\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait super.close();\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const field in this.defaultProps) {\n\t\t\tthis.columns.add(field);\n\t\t}\n\n\t\tfs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));\n\t}\n}\n"]}
1
+ {"version":3,"file":"csvFileLogger.js","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,uCAAiC;AAEjC,qDAAkD;AAElD;;;GAGG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAAjD;;QACC,wDAAwD;QACvC,YAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAuBtC,CAAC;IArBU,KAAK,CAAC,KAAK;QACpB,yFAAyF;IAC1F,CAAC;IAEM,IAAI,CAAC,KAA0B;QACrC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAA,gBAAK,EAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACD;AAzBD,sCAyBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { parse } from \"json2csv\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport { BaseFileLogger } from \"./baseFileLogger\";\n\n/**\n * FileLogger that writes events into a defined CSV file\n * @internal\n */\nexport class CSVFileLogger extends BaseFileLogger {\n\t/** Store the column names to write as the CSV header */\n\tprivate readonly columns = new Set();\n\n\tprotected async flush(): Promise<void> {\n\t\t// No flushing is performed since we need all log entries to determine set of CSV columns\n\t}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const prop in event) {\n\t\t\tthis.columns.add(prop);\n\t\t}\n\t\tsuper.send(event);\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait super.close();\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const field in this.defaultProps) {\n\t\t\tthis.columns.add(field);\n\t\t}\n\n\t\tfs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));\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 { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * Contract for logger that writes telemetry to a file
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"fileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACxD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,YAAY;IACvB,IAAI,IAAA;IACJ,GAAG,IAAA;CACH;AAGD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAE/C,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"fileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACxD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,YAAY;IACvB,IAAI,IAAA;IACJ,GAAG,IAAA;CACH;AAGD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAE/C,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileLogger.js","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,+CAAI,CAAA;IACJ,6CAAG,CAAA;AACJ,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAmBD,gCAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\n\n/**\n * Contract for logger that writes telemetry to a file\n * @internal\n */\nexport interface IFileLogger extends ITelemetryBaseLogger {\n\t/**\n\t * This method acts as a \"dispose\" and should be explicitly called at the end of execution\n\t */\n\tclose(): Promise<void>;\n}\n\n/**\n * Desired output format for the telemetry\n */\nexport enum OutputFormat {\n\tJSON,\n\tCSV,\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Options to provide upon creation of IFileLogger\n */\nexport interface ITelemetryOptions {\n\t/** Desired output format used to create a specific IFileLogger implementation */\n\toutputFormat?: OutputFormat;\n\n\t/**\n\t * Properties that should be added to every telemetry event\n\t * Example: { \"prop1\": \"value1\", \"prop2\": 10.0 }\n\t */\n\tdefaultProps?: Record<string, string | number>;\n\n\t/** Number of telemetry events per flush to telemetry file */\n\teventsPerFlush?: number;\n}\n/* eslint-enable tsdoc/syntax */\n"]}
1
+ {"version":3,"file":"fileLogger.js","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,+CAAI,CAAA;IACJ,6CAAG,CAAA;AACJ,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAmBD,gCAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract for logger that writes telemetry to a file\n * @internal\n */\nexport interface IFileLogger extends ITelemetryBaseLogger {\n\t/**\n\t * This method acts as a \"dispose\" and should be explicitly called at the end of execution\n\t */\n\tclose(): Promise<void>;\n}\n\n/**\n * Desired output format for the telemetry\n */\nexport enum OutputFormat {\n\tJSON,\n\tCSV,\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Options to provide upon creation of IFileLogger\n */\nexport interface ITelemetryOptions {\n\t/** Desired output format used to create a specific IFileLogger implementation */\n\toutputFormat?: OutputFormat;\n\n\t/**\n\t * Properties that should be added to every telemetry event\n\t * Example: { \"prop1\": \"value1\", \"prop2\": 10.0 }\n\t */\n\tdefaultProps?: Record<string, string | number>;\n\n\t/** Number of telemetry events per flush to telemetry file */\n\teventsPerFlush?: number;\n}\n/* eslint-enable tsdoc/syntax */\n"]}
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
6
5
  import { ICodeDetailsLoader, IContainer } from "@fluidframework/container-definitions";
7
- import { FluidObject } from "@fluidframework/core-interfaces";
6
+ import { ITelemetryBaseLogger, FluidObject } from "@fluidframework/core-interfaces";
8
7
  /**
9
8
  * Contract that defines the necessary exports for the bundle provided at runtime
10
9
  * For an example, see "src/test/sampleCodeLoaders/sampleCodeLoader.ts"
@@ -1 +1 @@
1
- {"version":3,"file":"codeLoaderBundle.d.ts","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzE;;;OAGG;IACH,QAAQ,CAAC,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE9D;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,iBAAiB,CAG3E;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAQzE"}
1
+ {"version":3,"file":"codeLoaderBundle.d.ts","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAA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KAAK,UAAU,CACjC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
1
+ {"version":3,"file":"codeLoaderBundle.js","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwCH;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAW;IAC7C,+DAA+D;IAC/D,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,KAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAQ;IAC5C,+DAA+D;IAC/D,OAAO,CACN,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa;QAClB,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU;QACvC,GAAG,CAAC,OAAO;QACX,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CACjC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions\";\nimport { ITelemetryBaseLogger, FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.d.ts","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iCAAiC,CAAC;AAIxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,oBAAY,mBAAmB,GAAG,0BAA0B,GAAG,0BAA0B,CAAC;AAE1F,UAAU,0BAA0B;IACnC,OAAO,EAAE,IAAI,CAAC;CACd;AAED,UAAU,0BAA0B;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAID;;GAEG;AACH,wBAAsB,UAAU,CAC/B,kBAAkB,EAAE,mBAAmB,EACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAED;;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AChB,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,CAAC,CA0CjB"}
package/lib/exportFile.js CHANGED
@@ -68,9 +68,12 @@ export async function createContainerAndExecute(localOdspSnapshot, fluidFileConv
68
68
  },
69
69
  });
70
70
  return PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
71
- const result = await fluidFileConverter.execute(container, options);
72
- container.close();
73
- return result;
71
+ try {
72
+ return await fluidFileConverter.execute(container, options);
73
+ }
74
+ finally {
75
+ container.dispose();
76
+ }
74
77
  });
75
78
  };
76
79
  // eslint-disable-next-line unicorn/prefer-ternary
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGzF,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAgBrF,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,kBAAuC,EACvC,SAAiB,EACjB,UAAkB,EAClB,aAAqB,EACrB,OAAgB,EAChB,gBAAoC,EACpC,OAAgB,EAChB,mBAA6B;IAE7B,MAAM,iBAAiB,GAAG,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACzE,IAA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OAAO,EAAE,MAAM,EAAE,EAAE;YACjD,EAAE,EAAE;iBACF,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iBAC/B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,OAAO,CAAC,CAAC;KACZ;SAAM;QACN,OAAO,EAAE,EAAE,CAAC;KACZ;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver\";\nimport { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from \"./utils\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\n/* eslint-enable import/no-internal-modules */\n\nexport type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;\n\ninterface IExportFileResponseSuccess {\n\tsuccess: true;\n}\n\ninterface IExportFileResponseFailure {\n\tsuccess: false;\n\teventName: string;\n\terrorMessage: string;\n\terror?: any;\n}\n\nconst clientArgsValidationError = \"Client_ArgsValidationError\";\n\n/**\n * Execute code on Container based on ODSP snapshot and write result to file\n */\nexport async function exportFile(\n\tfluidFileConverter: IFluidFileConverter,\n\tinputFile: string,\n\toutputFile: string,\n\ttelemetryFile: string,\n\toptions?: string,\n\ttelemetryOptions?: ITelemetryOptions,\n\ttimeout?: number,\n\tdisableNetworkFetch?: boolean,\n): Promise<IExportFileResponse> {\n\tconst telemetryArgError = getTelemetryFileValidationError(telemetryFile);\n\tif (telemetryArgError) {\n\t\tconst eventName = clientArgsValidationError;\n\t\treturn { success: false, eventName, errorMessage: telemetryArgError };\n\t}\n\tconst { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);\n\n\ttry {\n\t\treturn await PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: \"ExportFile\" },\n\t\t\tasync () => {\n\t\t\t\tconst argsValidationError = getArgsValidationError(inputFile, outputFile, timeout);\n\t\t\t\tif (argsValidationError) {\n\t\t\t\t\tconst eventName = clientArgsValidationError;\n\t\t\t\t\tlogger.sendErrorEvent({ eventName, message: argsValidationError });\n\t\t\t\t\treturn { success: false, eventName, errorMessage: argsValidationError };\n\t\t\t\t}\n\n\t\t\t\tfs.writeFileSync(\n\t\t\t\t\toutputFile,\n\t\t\t\t\tawait createContainerAndExecute(\n\t\t\t\t\t\tgetSnapshotFileContent(inputFile),\n\t\t\t\t\t\tfluidFileConverter,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tdisableNetworkFetch,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn { success: true };\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tconst eventName = \"Client_UnexpectedError\";\n\t\tlogger.sendErrorEvent({ eventName }, error);\n\t\treturn { success: false, eventName, errorMessage: \"Unexpected error\", error };\n\t} finally {\n\t\tawait fileLogger.close();\n\t}\n}\n\n/**\n * Create the container based on an ODSP snapshot and execute code on it\n * @returns result of execution\n */\nexport async function createContainerAndExecute(\n\tlocalOdspSnapshot: string | Uint8Array,\n\tfluidFileConverter: IFluidFileConverter,\n\tlogger: ITelemetryLoggerExt,\n\toptions?: string,\n\ttimeout?: number,\n\tdisableNetworkFetch: boolean = false,\n): Promise<string> {\n\tconst fn = async () => {\n\t\tif (disableNetworkFetch) {\n\t\t\tglobal.fetch = async () => {\n\t\t\t\tthrow new Error(\"Network fetch is not allowed\");\n\t\t\t};\n\t\t}\n\n\t\tconst loader = new Loader({\n\t\t\turlResolver: new FakeUrlResolver(),\n\t\t\tdocumentServiceFactory: createLocalOdspDocumentServiceFactory(localOdspSnapshot),\n\t\t\tcodeLoader: await fluidFileConverter.getCodeLoader(logger),\n\t\t\tscope: await fluidFileConverter.getScope?.(logger),\n\t\t\tlogger,\n\t\t});\n\n\t\tconst container = await loader.resolve({\n\t\t\turl: \"/fakeUrl/\",\n\t\t\theaders: {\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: \"cached\" },\n\t\t\t},\n\t\t});\n\n\t\treturn PerformanceEvent.timedExecAsync(logger, { eventName: \"ExportFile\" }, async () => {\n\t\t\tconst result = await fluidFileConverter.execute(container, options);\n\t\t\tcontainer.close();\n\t\t\treturn result;\n\t\t});\n\t};\n\n\t// eslint-disable-next-line unicorn/prefer-ternary\n\tif (timeout !== undefined) {\n\t\treturn timeoutPromise<string>((resolve, reject) => {\n\t\t\tfn()\n\t\t\t\t.then((value) => resolve(value))\n\t\t\t\t.catch((error) => reject(error));\n\t\t}, timeout);\n\t} else {\n\t\treturn fn();\n\t}\n}\n"]}
1
+ {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AA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,MAAM,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,IAAI,EAAE;YACtF,IAAI;gBACH,OAAO,MAAM,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;aAC5D;oBAAS;gBACT,SAAS,CAAC,OAAO,EAAE,CAAC;aACpB;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,kDAAkD;IAClD,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,OAAO,cAAc,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACjD,EAAE,EAAE;iBACF,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iBAC/B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,OAAO,CAAC,CAAC;KACZ;SAAM;QACN,OAAO,EAAE,EAAE,CAAC;KACZ;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver\";\nimport { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from \"./utils\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\n/* eslint-enable import/no-internal-modules */\n\nexport type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;\n\ninterface IExportFileResponseSuccess {\n\tsuccess: true;\n}\n\ninterface IExportFileResponseFailure {\n\tsuccess: false;\n\teventName: string;\n\terrorMessage: string;\n\terror?: any;\n}\n\nconst clientArgsValidationError = \"Client_ArgsValidationError\";\n\n/**\n * Execute code on Container based on ODSP snapshot and write result to file\n */\nexport async function exportFile(\n\tfluidFileConverter: IFluidFileConverter,\n\tinputFile: string,\n\toutputFile: string,\n\ttelemetryFile: string,\n\toptions?: string,\n\ttelemetryOptions?: ITelemetryOptions,\n\ttimeout?: number,\n\tdisableNetworkFetch?: boolean,\n): Promise<IExportFileResponse> {\n\tconst telemetryArgError = getTelemetryFileValidationError(telemetryFile);\n\tif (telemetryArgError) {\n\t\tconst eventName = clientArgsValidationError;\n\t\treturn { success: false, eventName, errorMessage: telemetryArgError };\n\t}\n\tconst { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);\n\n\ttry {\n\t\treturn await PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: \"ExportFile\" },\n\t\t\tasync () => {\n\t\t\t\tconst argsValidationError = getArgsValidationError(inputFile, outputFile, timeout);\n\t\t\t\tif (argsValidationError) {\n\t\t\t\t\tconst eventName = clientArgsValidationError;\n\t\t\t\t\tlogger.sendErrorEvent({ eventName, message: argsValidationError });\n\t\t\t\t\treturn { success: false, eventName, errorMessage: argsValidationError };\n\t\t\t\t}\n\n\t\t\t\tfs.writeFileSync(\n\t\t\t\t\toutputFile,\n\t\t\t\t\tawait createContainerAndExecute(\n\t\t\t\t\t\tgetSnapshotFileContent(inputFile),\n\t\t\t\t\t\tfluidFileConverter,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tdisableNetworkFetch,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn { success: true };\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tconst eventName = \"Client_UnexpectedError\";\n\t\tlogger.sendErrorEvent({ eventName }, error);\n\t\treturn { success: false, eventName, errorMessage: \"Unexpected error\", error };\n\t} finally {\n\t\tawait fileLogger.close();\n\t}\n}\n\n/**\n * Create the container based on an ODSP snapshot and execute code on it\n * @returns result of execution\n */\nexport async function createContainerAndExecute(\n\tlocalOdspSnapshot: string | Uint8Array,\n\tfluidFileConverter: IFluidFileConverter,\n\tlogger: ITelemetryLoggerExt,\n\toptions?: string,\n\ttimeout?: number,\n\tdisableNetworkFetch: boolean = false,\n): Promise<string> {\n\tconst fn = async () => {\n\t\tif (disableNetworkFetch) {\n\t\t\tglobal.fetch = async () => {\n\t\t\t\tthrow new Error(\"Network fetch is not allowed\");\n\t\t\t};\n\t\t}\n\n\t\tconst loader = new Loader({\n\t\t\turlResolver: new FakeUrlResolver(),\n\t\t\tdocumentServiceFactory: createLocalOdspDocumentServiceFactory(localOdspSnapshot),\n\t\t\tcodeLoader: await fluidFileConverter.getCodeLoader(logger),\n\t\t\tscope: await fluidFileConverter.getScope?.(logger),\n\t\t\tlogger,\n\t\t});\n\n\t\tconst container = await loader.resolve({\n\t\t\turl: \"/fakeUrl/\",\n\t\t\theaders: {\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: \"cached\" },\n\t\t\t},\n\t\t});\n\n\t\treturn PerformanceEvent.timedExecAsync(logger, { eventName: \"ExportFile\" }, async () => {\n\t\t\ttry {\n\t\t\t\treturn await fluidFileConverter.execute(container, options);\n\t\t\t} finally {\n\t\t\t\tcontainer.dispose();\n\t\t\t}\n\t\t});\n\t};\n\n\t// eslint-disable-next-line unicorn/prefer-ternary\n\tif (timeout !== undefined) {\n\t\treturn timeoutPromise<string>((resolve, reject) => {\n\t\t\tfn()\n\t\t\t\t.then((value) => resolve(value))\n\t\t\t\t.catch((error) => reject(error));\n\t\t}, timeout);\n\t} else {\n\t\treturn fn();\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 { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
6
  import { IFileLogger } from "./fileLogger";
7
7
  /**
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"baseFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,8BAAsB,cAAe,YAAW,WAAW;IAazD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACnC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;IACzC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;IAd1B,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvC,0CAA0C;IAC1C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,CAAM;IAC7B,SAAS,CAAC,gBAAgB,UAAS;IAEnC;;;;OAIG;gBAEiB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,MAAW,EAC3B,YAAY,CAAC,6CAAiC;IAG3D,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;cAW7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAazB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
1
+ {"version":3,"file":"baseFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,8BAAsB,cAAe,YAAW,WAAW;IAazD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACnC,SAAS,CAAC,QA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E,CAAC;SACb;IACF,CAAC;IAES,KAAK,CAAC,KAAK;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7E,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;aACvD;iBAAM;gBACN,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAC7B;IACF,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/common-definitions\";\nimport { IFileLogger } from \"./fileLogger\";\n\n/**\n * @internal\n */\nexport abstract class BaseFileLogger implements IFileLogger {\n\tpublic supportsTags?: true | undefined;\n\n\t/** Hold events in memory until flushed */\n\tprotected events: any[] = [];\n\tprotected hasWrittenToFile = false;\n\n\t/**\n\t * @param filePath - file path to write logs to\n\t * @param eventsPerFlush - number of events per flush\n\t * @param defaultProps - default properties to add to every telemetry event\n\t */\n\tpublic constructor(\n\t\tprotected readonly filePath: string,\n\t\tprotected readonly eventsPerFlush: number = 50,\n\t\tprotected readonly defaultProps?: Record<string, string | number>,\n\t) {}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tevent = { ...event, ...this.defaultProps };\n\t\tthis.events.push(event);\n\n\t\tif (this.events.length >= this.eventsPerFlush || event.category === \"error\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tthis.flush();\n\t\t}\n\t}\n\n\tprotected async flush(): Promise<void> {\n\t\tif (this.events.length > 0) {\n\t\t\tconst contentToWrite = this.events.map((it) => JSON.stringify(it)).join(\",\");\n\t\t\tif (this.hasWrittenToFile) {\n\t\t\t\tfs.appendFileSync(this.filePath, `,${contentToWrite}`);\n\t\t\t} else {\n\t\t\t\tfs.appendFileSync(this.filePath, contentToWrite);\n\t\t\t}\n\t\t\tthis.events = [];\n\t\t\tthis.hasWrittenToFile = true;\n\t\t}\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait this.flush();\n\t}\n}\n"]}
1
+ {"version":3,"file":"baseFileLogger.js","sourceRoot":"","sources":["../../src/logger/baseFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;GAEG;AACH,MAAM,OAAgB,cAAc;IAOnC;;;;OAIG;IACH,YACoB,QAAgB,EAChB,iBAAyB,EAAE,EAC3B,YAA8C;QAF9C,aAAQ,GAAR,QAAQ,CAAQ;QAChB,mBAAc,GAAd,cAAc,CAAa;QAC3B,iBAAY,GAAZ,YAAY,CAAkC;QAZlE,0CAA0C;QAChC,WAAM,GAAU,EAAE,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;IAWhC,CAAC;IAEG,IAAI,CAAC,KAA0B;QACrC,6CAA6C;QAC7C,KAAK,mCAAQ,KAAK,GAAK,IAAI,CAAC,YAAY,CAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAExB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;YAC5E,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;SACb;IACF,CAAC;IAES,KAAK,CAAC,KAAK;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7E,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;aACvD;iBAAM;gBACN,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAC7B;IACF,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport { IFileLogger } from \"./fileLogger\";\n\n/**\n * @internal\n */\nexport abstract class BaseFileLogger implements IFileLogger {\n\tpublic supportsTags?: true | undefined;\n\n\t/** Hold events in memory until flushed */\n\tprotected events: any[] = [];\n\tprotected hasWrittenToFile = false;\n\n\t/**\n\t * @param filePath - file path to write logs to\n\t * @param eventsPerFlush - number of events per flush\n\t * @param defaultProps - default properties to add to every telemetry event\n\t */\n\tpublic constructor(\n\t\tprotected readonly filePath: string,\n\t\tprotected readonly eventsPerFlush: number = 50,\n\t\tprotected readonly defaultProps?: Record<string, string | number>,\n\t) {}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tevent = { ...event, ...this.defaultProps };\n\t\tthis.events.push(event);\n\n\t\tif (this.events.length >= this.eventsPerFlush || event.category === \"error\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tthis.flush();\n\t\t}\n\t}\n\n\tprotected async flush(): Promise<void> {\n\t\tif (this.events.length > 0) {\n\t\t\tconst contentToWrite = this.events.map((it) => JSON.stringify(it)).join(\",\");\n\t\t\tif (this.hasWrittenToFile) {\n\t\t\t\tfs.appendFileSync(this.filePath, `,${contentToWrite}`);\n\t\t\t} else {\n\t\t\t\tfs.appendFileSync(this.filePath, contentToWrite);\n\t\t\t}\n\t\t\tthis.events = [];\n\t\t\tthis.hasWrittenToFile = true;\n\t\t}\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait this.flush();\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 { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
6
  import { BaseFileLogger } from "./baseFileLogger";
7
7
  /**
8
8
  * FileLogger that writes events into a defined CSV file
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAChD,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;cAErB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAQhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CASnC"}
1
+ {"version":3,"file":"csvFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAChD,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;cAErB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAQhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CASnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileLogger.js","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAAjD;;QACC,wDAAwD;QACvC,YAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAuBtC,CAAC;IArBU,KAAK,CAAC,KAAK;QACpB,yFAAyF;IAC1F,CAAC;IAEM,IAAI,CAAC,KAA0B;QACrC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { parse } from \"json2csv\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/common-definitions\";\nimport { BaseFileLogger } from \"./baseFileLogger\";\n\n/**\n * FileLogger that writes events into a defined CSV file\n * @internal\n */\nexport class CSVFileLogger extends BaseFileLogger {\n\t/** Store the column names to write as the CSV header */\n\tprivate readonly columns = new Set();\n\n\tprotected async flush(): Promise<void> {\n\t\t// No flushing is performed since we need all log entries to determine set of CSV columns\n\t}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const prop in event) {\n\t\t\tthis.columns.add(prop);\n\t\t}\n\t\tsuper.send(event);\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait super.close();\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const field in this.defaultProps) {\n\t\t\tthis.columns.add(field);\n\t\t}\n\n\t\tfs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));\n\t}\n}\n"]}
1
+ {"version":3,"file":"csvFileLogger.js","sourceRoot":"","sources":["../../src/logger/csvFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAAjD;;QACC,wDAAwD;QACvC,YAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAuBtC,CAAC;IArBU,KAAK,CAAC,KAAK;QACpB,yFAAyF;IAC1F,CAAC;IAEM,IAAI,CAAC,KAA0B;QACrC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { parse } from \"json2csv\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport { BaseFileLogger } from \"./baseFileLogger\";\n\n/**\n * FileLogger that writes events into a defined CSV file\n * @internal\n */\nexport class CSVFileLogger extends BaseFileLogger {\n\t/** Store the column names to write as the CSV header */\n\tprivate readonly columns = new Set();\n\n\tprotected async flush(): Promise<void> {\n\t\t// No flushing is performed since we need all log entries to determine set of CSV columns\n\t}\n\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const prop in event) {\n\t\t\tthis.columns.add(prop);\n\t\t}\n\t\tsuper.send(event);\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait super.close();\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const field in this.defaultProps) {\n\t\t\tthis.columns.add(field);\n\t\t}\n\n\t\tfs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));\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 { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
5
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * Contract for logger that writes telemetry to a file
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"fileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACxD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,YAAY;IACvB,IAAI,IAAA;IACJ,GAAG,IAAA;CACH;AAGD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAE/C,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"fileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACxD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,YAAY;IACvB,IAAI,IAAA;IACJ,GAAG,IAAA;CACH;AAGD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAE/C,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileLogger.js","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;GAEG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,+CAAI,CAAA;IACJ,6CAAG,CAAA;AACJ,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAmBD,gCAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\n\n/**\n * Contract for logger that writes telemetry to a file\n * @internal\n */\nexport interface IFileLogger extends ITelemetryBaseLogger {\n\t/**\n\t * This method acts as a \"dispose\" and should be explicitly called at the end of execution\n\t */\n\tclose(): Promise<void>;\n}\n\n/**\n * Desired output format for the telemetry\n */\nexport enum OutputFormat {\n\tJSON,\n\tCSV,\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Options to provide upon creation of IFileLogger\n */\nexport interface ITelemetryOptions {\n\t/** Desired output format used to create a specific IFileLogger implementation */\n\toutputFormat?: OutputFormat;\n\n\t/**\n\t * Properties that should be added to every telemetry event\n\t * Example: { \"prop1\": \"value1\", \"prop2\": 10.0 }\n\t */\n\tdefaultProps?: Record<string, string | number>;\n\n\t/** Number of telemetry events per flush to telemetry file */\n\teventsPerFlush?: number;\n}\n/* eslint-enable tsdoc/syntax */\n"]}
1
+ {"version":3,"file":"fileLogger.js","sourceRoot":"","sources":["../../src/logger/fileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;GAEG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,+CAAI,CAAA;IACJ,6CAAG,CAAA;AACJ,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAmBD,gCAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract for logger that writes telemetry to a file\n * @internal\n */\nexport interface IFileLogger extends ITelemetryBaseLogger {\n\t/**\n\t * This method acts as a \"dispose\" and should be explicitly called at the end of execution\n\t */\n\tclose(): Promise<void>;\n}\n\n/**\n * Desired output format for the telemetry\n */\nexport enum OutputFormat {\n\tJSON,\n\tCSV,\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Options to provide upon creation of IFileLogger\n */\nexport interface ITelemetryOptions {\n\t/** Desired output format used to create a specific IFileLogger implementation */\n\toutputFormat?: OutputFormat;\n\n\t/**\n\t * Properties that should be added to every telemetry event\n\t * Example: { \"prop1\": \"value1\", \"prop2\": 10.0 }\n\t */\n\tdefaultProps?: Record<string, string | number>;\n\n\t/** Number of telemetry events per flush to telemetry file */\n\teventsPerFlush?: number;\n}\n/* eslint-enable tsdoc/syntax */\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/fluid-runner",
3
- "version": "2.0.0-dev.5.2.0.169897",
3
+ "version": "2.0.0-dev.5.3.2.178189",
4
4
  "description": "Utility for running various functionality inside a Fluid Framework environment",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -36,25 +36,25 @@
36
36
  "temp-directory": "nyc/.nyc_output"
37
37
  },
38
38
  "dependencies": {
39
- "@fluidframework/aqueduct": "2.0.0-dev.5.2.0.169897",
39
+ "@fluidframework/aqueduct": "2.0.0-dev.5.3.2.178189",
40
40
  "@fluidframework/common-definitions": "^0.20.1",
41
- "@fluidframework/container-definitions": "2.0.0-dev.5.2.0.169897",
42
- "@fluidframework/container-loader": "2.0.0-dev.5.2.0.169897",
43
- "@fluidframework/core-interfaces": "2.0.0-dev.5.2.0.169897",
44
- "@fluidframework/driver-definitions": "2.0.0-dev.5.2.0.169897",
45
- "@fluidframework/odsp-driver": "2.0.0-dev.5.2.0.169897",
46
- "@fluidframework/odsp-driver-definitions": "2.0.0-dev.5.2.0.169897",
47
- "@fluidframework/telemetry-utils": "2.0.0-dev.5.2.0.169897",
41
+ "@fluidframework/container-definitions": "2.0.0-dev.5.3.2.178189",
42
+ "@fluidframework/container-loader": "2.0.0-dev.5.3.2.178189",
43
+ "@fluidframework/core-interfaces": "2.0.0-dev.5.3.2.178189",
44
+ "@fluidframework/driver-definitions": "2.0.0-dev.5.3.2.178189",
45
+ "@fluidframework/odsp-driver": "2.0.0-dev.5.3.2.178189",
46
+ "@fluidframework/odsp-driver-definitions": "2.0.0-dev.5.3.2.178189",
47
+ "@fluidframework/telemetry-utils": "2.0.0-dev.5.3.2.178189",
48
48
  "json2csv": "^5.0.7",
49
49
  "yargs": "13.2.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@fluid-tools/build-cli": "^0.20.0-169245",
52
+ "@fluid-tools/build-cli": "^0.21.0",
53
53
  "@fluidframework/build-common": "^1.2.0",
54
- "@fluidframework/build-tools": "^0.20.0-169245",
54
+ "@fluidframework/build-tools": "^0.21.0",
55
55
  "@fluidframework/eslint-config-fluid": "^2.0.0",
56
- "@fluidframework/fluid-runner-previous": "npm:@fluidframework/fluid-runner@2.0.0-internal.5.0.0",
57
- "@fluidframework/mocha-test-setup": "2.0.0-dev.5.2.0.169897",
56
+ "@fluidframework/fluid-runner-previous": "npm:@fluidframework/fluid-runner@2.0.0-internal.5.2.0",
57
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.5.3.2.178189",
58
58
  "@types/mocha": "^9.1.1",
59
59
  "@types/node": "^14.18.38",
60
60
  "@types/yargs": "^13",
@@ -94,6 +94,6 @@
94
94
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
95
95
  "tsc": "tsc",
96
96
  "typetests:gen": "fluid-type-test-generator",
97
- "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
97
+ "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
98
98
  }
99
99
  }
@@ -3,9 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
7
6
  import { ICodeDetailsLoader, IContainer } from "@fluidframework/container-definitions";
8
- import { FluidObject } from "@fluidframework/core-interfaces";
7
+ import { ITelemetryBaseLogger, FluidObject } from "@fluidframework/core-interfaces";
9
8
 
10
9
  /**
11
10
  * Contract that defines the necessary exports for the bundle provided at runtime
package/src/exportFile.ts CHANGED
@@ -122,9 +122,11 @@ export async function createContainerAndExecute(
122
122
  });
123
123
 
124
124
  return PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
125
- const result = await fluidFileConverter.execute(container, options);
126
- container.close();
127
- return result;
125
+ try {
126
+ return await fluidFileConverter.execute(container, options);
127
+ } finally {
128
+ container.dispose();
129
+ }
128
130
  });
129
131
  };
130
132
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import * as fs from "fs";
7
- import { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
7
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
8
8
  import { IFileLogger } from "./fileLogger";
9
9
 
10
10
  /**
@@ -5,7 +5,7 @@
5
5
 
6
6
  import * as fs from "fs";
7
7
  import { parse } from "json2csv";
8
- import { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
8
+ import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
9
9
  import { BaseFileLogger } from "./baseFileLogger";
10
10
 
11
11
  /**
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
6
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
 
8
8
  /**
9
9
  * Contract for logger that writes telemetry to a file