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

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 (63) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +5 -3
  3. package/dist/codeLoaderBundle.js +2 -2
  4. package/dist/codeLoaderBundle.js.map +1 -1
  5. package/dist/exportFile.js +1 -2
  6. package/dist/exportFile.js.map +1 -1
  7. package/dist/logger/baseFileLogger.js +1 -1
  8. package/dist/logger/baseFileLogger.js.map +1 -1
  9. package/dist/logger/loggerUtils.d.ts +11 -5
  10. package/dist/logger/loggerUtils.d.ts.map +1 -1
  11. package/dist/logger/loggerUtils.js +20 -10
  12. package/dist/logger/loggerUtils.js.map +1 -1
  13. package/package.json +21 -25
  14. package/src/logger/loggerUtils.ts +18 -8
  15. package/lib/codeLoaderBundle.d.ts +0 -44
  16. package/lib/codeLoaderBundle.d.ts.map +0 -1
  17. package/lib/codeLoaderBundle.js +0 -20
  18. package/lib/codeLoaderBundle.js.map +0 -1
  19. package/lib/exportFile.d.ts +0 -28
  20. package/lib/exportFile.d.ts.map +0 -1
  21. package/lib/exportFile.js +0 -91
  22. package/lib/exportFile.js.map +0 -1
  23. package/lib/fakeUrlResolver.d.ts +0 -15
  24. package/lib/fakeUrlResolver.d.ts.map +0 -1
  25. package/lib/fakeUrlResolver.js +0 -39
  26. package/lib/fakeUrlResolver.js.map +0 -1
  27. package/lib/fluidRunner.d.ts +0 -10
  28. package/lib/fluidRunner.d.ts.map +0 -1
  29. package/lib/fluidRunner.js +0 -98
  30. package/lib/fluidRunner.js.map +0 -1
  31. package/lib/index.d.ts +0 -12
  32. package/lib/index.d.ts.map +0 -1
  33. package/lib/index.js +0 -12
  34. package/lib/index.js.map +0 -1
  35. package/lib/logger/baseFileLogger.d.ts +0 -28
  36. package/lib/logger/baseFileLogger.d.ts.map +0 -1
  37. package/lib/logger/baseFileLogger.js +0 -49
  38. package/lib/logger/baseFileLogger.js.map +0 -1
  39. package/lib/logger/csvFileLogger.d.ts +0 -18
  40. package/lib/logger/csvFileLogger.d.ts.map +0 -1
  41. package/lib/logger/csvFileLogger.js +0 -37
  42. package/lib/logger/csvFileLogger.js.map +0 -1
  43. package/lib/logger/fileLogger.d.ts +0 -37
  44. package/lib/logger/fileLogger.d.ts.map +0 -1
  45. package/lib/logger/fileLogger.js +0 -14
  46. package/lib/logger/fileLogger.js.map +0 -1
  47. package/lib/logger/jsonFileLogger.d.ts +0 -14
  48. package/lib/logger/jsonFileLogger.d.ts.map +0 -1
  49. package/lib/logger/jsonFileLogger.js +0 -21
  50. package/lib/logger/jsonFileLogger.js.map +0 -1
  51. package/lib/logger/loggerUtils.d.ts +0 -35
  52. package/lib/logger/loggerUtils.d.ts.map +0 -1
  53. package/lib/logger/loggerUtils.js +0 -78
  54. package/lib/logger/loggerUtils.js.map +0 -1
  55. package/lib/parseBundleAndExportFile.d.ts +0 -12
  56. package/lib/parseBundleAndExportFile.d.ts.map +0 -1
  57. package/lib/parseBundleAndExportFile.js +0 -60
  58. package/lib/parseBundleAndExportFile.js.map +0 -1
  59. package/lib/utils.d.ts +0 -32
  60. package/lib/utils.d.ts.map +0 -1
  61. package/lib/utils.js +0 -75
  62. package/lib/utils.js.map +0 -1
  63. package/tsconfig.esnext.json +0 -7
package/lib/exportFile.js DELETED
@@ -1,91 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import * as fs from "fs";
6
- import { PerformanceEvent } from "@fluidframework/telemetry-utils";
7
- import { LoaderHeader } from "@fluidframework/container-definitions";
8
- import { Loader } from "@fluidframework/container-loader";
9
- import { createLocalOdspDocumentServiceFactory } from "@fluidframework/odsp-driver";
10
- import { FakeUrlResolver } from "./fakeUrlResolver";
11
- import { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from "./utils";
12
- import { createLogger, getTelemetryFileValidationError } from "./logger/loggerUtils";
13
- const clientArgsValidationError = "Client_ArgsValidationError";
14
- /**
15
- * Execute code on Container based on ODSP snapshot and write result to file
16
- */
17
- export async function exportFile(fluidFileConverter, inputFile, outputFile, telemetryFile, options, telemetryOptions, timeout, disableNetworkFetch) {
18
- const telemetryArgError = getTelemetryFileValidationError(telemetryFile);
19
- if (telemetryArgError) {
20
- const eventName = clientArgsValidationError;
21
- return { success: false, eventName, errorMessage: telemetryArgError };
22
- }
23
- const { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);
24
- try {
25
- return await PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
26
- const argsValidationError = getArgsValidationError(inputFile, outputFile, timeout);
27
- if (argsValidationError) {
28
- const eventName = clientArgsValidationError;
29
- logger.sendErrorEvent({ eventName, message: argsValidationError });
30
- return { success: false, eventName, errorMessage: argsValidationError };
31
- }
32
- fs.writeFileSync(outputFile, await createContainerAndExecute(getSnapshotFileContent(inputFile), fluidFileConverter, logger, options, timeout, disableNetworkFetch));
33
- return { success: true };
34
- });
35
- }
36
- catch (error) {
37
- const eventName = "Client_UnexpectedError";
38
- logger.sendErrorEvent({ eventName }, error);
39
- return { success: false, eventName, errorMessage: "Unexpected error", error };
40
- }
41
- finally {
42
- await fileLogger.close();
43
- }
44
- }
45
- /**
46
- * Create the container based on an ODSP snapshot and execute code on it
47
- * @returns result of execution
48
- */
49
- export async function createContainerAndExecute(localOdspSnapshot, fluidFileConverter, logger, options, timeout, disableNetworkFetch = false) {
50
- const fn = async () => {
51
- var _a;
52
- if (disableNetworkFetch) {
53
- global.fetch = async () => {
54
- throw new Error("Network fetch is not allowed");
55
- };
56
- }
57
- const loader = new Loader({
58
- urlResolver: new FakeUrlResolver(),
59
- documentServiceFactory: createLocalOdspDocumentServiceFactory(localOdspSnapshot),
60
- codeLoader: await fluidFileConverter.getCodeLoader(logger),
61
- scope: await ((_a = fluidFileConverter.getScope) === null || _a === void 0 ? void 0 : _a.call(fluidFileConverter, logger)),
62
- logger,
63
- });
64
- const container = await loader.resolve({
65
- url: "/fakeUrl/",
66
- headers: {
67
- [LoaderHeader.loadMode]: { opsBeforeReturn: "cached" },
68
- },
69
- });
70
- return PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
71
- try {
72
- return await fluidFileConverter.execute(container, options);
73
- }
74
- finally {
75
- container.dispose();
76
- }
77
- });
78
- };
79
- // eslint-disable-next-line unicorn/prefer-ternary
80
- if (timeout !== undefined) {
81
- return timeoutPromise((resolve, reject) => {
82
- fn()
83
- .then((value) => resolve(value))
84
- .catch((error) => reject(error));
85
- }, timeout);
86
- }
87
- else {
88
- return fn();
89
- }
90
- }
91
- //# sourceMappingURL=exportFile.js.map
@@ -1 +0,0 @@
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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K,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"]}
@@ -1,15 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IRequest } from "@fluidframework/core-interfaces";
6
- import { IContainerPackageInfo, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
7
- /**
8
- * Fake URL resolver that returns hard coded values on every request
9
- * @internal
10
- */
11
- export declare class FakeUrlResolver implements IUrlResolver {
12
- resolve(_request: IRequest): Promise<IResolvedUrl | undefined>;
13
- getAbsoluteUrl(_resolvedUrl: IResolvedUrl, _relativeUrl: string, _packageInfoSource?: IContainerPackageInfo): Promise<string>;
14
- }
15
- //# sourceMappingURL=fakeUrlResolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fakeUrlResolver.d.ts","sourceRoot":"","sources":["../src/fakeUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACN,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAM5C;;;GAGG;AACH,qBAAa,eAAgB,YAAW,YAAY;IACtC,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAyB9D,cAAc,CAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,MAAM,EACpB,kBAAkB,CAAC,EAAE,qBAAqB,GACxC,OAAO,CAAC,MAAM,CAAC;CAGlB"}
@@ -1,39 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- const fakeId = "FakeUrlResolver";
6
- const fakeUrl = "/FakeUrlResolver/";
7
- /**
8
- * Fake URL resolver that returns hard coded values on every request
9
- * @internal
10
- */
11
- export class FakeUrlResolver {
12
- async resolve(_request) {
13
- const fakeOdspResolvedUrl = {
14
- type: "fluid",
15
- odspResolvedUrl: true,
16
- id: fakeId,
17
- siteUrl: fakeUrl,
18
- driveId: fakeId,
19
- itemId: fakeId,
20
- url: fakeUrl,
21
- hashedDocumentId: fakeId,
22
- endpoints: {
23
- snapshotStorageUrl: fakeUrl,
24
- attachmentPOSTStorageUrl: fakeUrl,
25
- attachmentGETStorageUrl: fakeUrl,
26
- deltaStorageUrl: fakeUrl,
27
- },
28
- tokens: {},
29
- fileName: fakeId,
30
- summarizer: false,
31
- fileVersion: fakeId,
32
- };
33
- return fakeOdspResolvedUrl;
34
- }
35
- async getAbsoluteUrl(_resolvedUrl, _relativeUrl, _packageInfoSource) {
36
- return "";
37
- }
38
- }
39
- //# sourceMappingURL=fakeUrlResolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fakeUrlResolver.js","sourceRoot":"","sources":["../src/fakeUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACjC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,eAAe;IACpB,KAAK,CAAC,OAAO,CAAC,QAAkB;QACtC,MAAM,mBAAmB,GAAqB;YAC7C,IAAI,EAAE,OAAO;YACb,eAAe,EAAE,IAAI;YACrB,EAAE,EAAE,MAAM;YACV,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,MAAM;YACf,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,OAAO;YACZ,gBAAgB,EAAE,MAAM;YACxB,SAAS,EAAE;gBACV,kBAAkB,EAAE,OAAO;gBAC3B,wBAAwB,EAAE,OAAO;gBACjC,uBAAuB,EAAE,OAAO;gBAChC,eAAe,EAAE,OAAO;aACxB;YACD,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,MAAM;SACnB,CAAC;QAEF,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,cAAc,CAC1B,YAA0B,EAC1B,YAAoB,EACpB,kBAA0C;QAE1C,OAAO,EAAE,CAAC;IACX,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIContainerPackageInfo,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions\";\nimport { IOdspResolvedUrl } from \"@fluidframework/odsp-driver-definitions\";\n\nconst fakeId = \"FakeUrlResolver\";\nconst fakeUrl = \"/FakeUrlResolver/\";\n\n/**\n * Fake URL resolver that returns hard coded values on every request\n * @internal\n */\nexport class FakeUrlResolver implements IUrlResolver {\n\tpublic async resolve(_request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\tconst fakeOdspResolvedUrl: IOdspResolvedUrl = {\n\t\t\ttype: \"fluid\",\n\t\t\todspResolvedUrl: true,\n\t\t\tid: fakeId,\n\t\t\tsiteUrl: fakeUrl,\n\t\t\tdriveId: fakeId,\n\t\t\titemId: fakeId,\n\t\t\turl: fakeUrl,\n\t\t\thashedDocumentId: fakeId,\n\t\t\tendpoints: {\n\t\t\t\tsnapshotStorageUrl: fakeUrl,\n\t\t\t\tattachmentPOSTStorageUrl: fakeUrl,\n\t\t\t\tattachmentGETStorageUrl: fakeUrl,\n\t\t\t\tdeltaStorageUrl: fakeUrl,\n\t\t\t},\n\t\t\ttokens: {},\n\t\t\tfileName: fakeId,\n\t\t\tsummarizer: false,\n\t\t\tfileVersion: fakeId,\n\t\t};\n\n\t\treturn fakeOdspResolvedUrl;\n\t}\n\n\tpublic async getAbsoluteUrl(\n\t\t_resolvedUrl: IResolvedUrl,\n\t\t_relativeUrl: string,\n\t\t_packageInfoSource?: IContainerPackageInfo,\n\t): Promise<string> {\n\t\treturn \"\";\n\t}\n}\n"]}
@@ -1,10 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IFluidFileConverter } from "./codeLoaderBundle";
6
- /**
7
- * @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
8
- */
9
- export declare function fluidRunner(fluidFileConverter?: IFluidFileConverter): void;
10
- //# sourceMappingURL=fluidRunner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;GAEG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,QAqHnE"}
@@ -1,98 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import * as yargs from "yargs";
6
- import { exportFile } from "./exportFile";
7
- import { parseBundleAndExportFile } from "./parseBundleAndExportFile";
8
- // eslint-disable-next-line import/no-internal-modules
9
- import { validateAndParseTelemetryOptions } from "./logger/loggerUtils";
10
- import { validateCommandLineArgs } from "./utils";
11
- /**
12
- * @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
13
- */
14
- export function fluidRunner(fluidFileConverter) {
15
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
16
- yargs
17
- .strict()
18
- .version(false)
19
- .command("exportFile", "Generate an output for a local ODSP snapshot",
20
- // eslint-disable-next-line @typescript-eslint/no-shadow
21
- (yargs) => yargs
22
- .option("codeLoader", {
23
- describe: 'Path to code loader bundle. Required if this application is being called without modification.\nSee "README.md" for more details.',
24
- type: "string",
25
- demandOption: false,
26
- })
27
- .option("inputFile", {
28
- describe: "Path to local ODSP snapshot",
29
- type: "string",
30
- demandOption: true,
31
- })
32
- .option("outputFile", {
33
- describe: "Path of output file (cannot already exist).\nExecution result will be written here",
34
- type: "string",
35
- demandOption: true,
36
- })
37
- .option("telemetryFile", {
38
- describe: "Path of telemetry file for config and session data (cannot already exist)",
39
- type: "string",
40
- demandOption: true,
41
- })
42
- .option("options", {
43
- describe: "Additional options passed to container on execution",
44
- type: "string",
45
- demandOption: false,
46
- })
47
- .option("telemetryFormat", {
48
- describe: 'Output format for telemetry. Current options are: ["JSON", "CSV"]',
49
- type: "string",
50
- demandOption: false,
51
- default: "JSON",
52
- })
53
- .option("telemetryProp", {
54
- describe: 'Property to add to every telemetry entry. Formatted like "--telemetryProp prop1 value1 --telemetryProp prop2 \\"value 2\\"".',
55
- type: "array",
56
- demandOption: false,
57
- })
58
- .option("eventsPerFlush", {
59
- describe: "Number of telemetry events per flush to telemetryFile (only applicable for JSON format)",
60
- type: "number",
61
- demandOption: false,
62
- })
63
- .option("timeout", {
64
- describe: "Allowed timeout in ms before process is automatically cancelled",
65
- type: "number",
66
- demandOption: false,
67
- })
68
- .option("disableNetworkFetch", {
69
- describe: "Should network fetch calls be explicitly disabled?",
70
- type: "boolean",
71
- demandOption: false,
72
- default: false,
73
- }),
74
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
75
- async (argv) => {
76
- const argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);
77
- if (argsError) {
78
- console.error(argsError);
79
- process.exit(1);
80
- }
81
- const telemetryOptionsResult = validateAndParseTelemetryOptions(argv.telemetryFormat, argv.telemetryProp, argv.eventsPerFlush);
82
- if (!telemetryOptionsResult.success) {
83
- console.error(telemetryOptionsResult.error);
84
- process.exit(1);
85
- }
86
- const result = await (argv.codeLoader
87
- ? parseBundleAndExportFile(argv.codeLoader, argv.inputFile, argv.outputFile, argv.telemetryFile, argv.options, telemetryOptionsResult.telemetryOptions, argv.timeout, argv.disableNetworkFetch)
88
- : exportFile(fluidFileConverter, argv.inputFile, argv.outputFile, argv.telemetryFile, argv.options, telemetryOptionsResult.telemetryOptions, argv.timeout, argv.disableNetworkFetch));
89
- if (!result.success) {
90
- console.error(`${result.eventName}: ${result.errorMessage}`);
91
- process.exit(1);
92
- }
93
- process.exit(0);
94
- })
95
- .help()
96
- .demandCommand().argv;
97
- }
98
- //# sourceMappingURL=fluidRunner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,sDAAsD;AACtD,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;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,EACvC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,mBAAmB,CACvB,CAAC,CAAC;QAEN,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CACD;SACA,IAAI,EAAE;SACN,aAAa,EAAE,CAAC,IAAI,CAAC;AACxB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as yargs from \"yargs\";\nimport { exportFile } from \"./exportFile\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { parseBundleAndExportFile } from \"./parseBundleAndExportFile\";\n// eslint-disable-next-line import/no-internal-modules\nimport { validateAndParseTelemetryOptions } from \"./logger/loggerUtils\";\nimport { validateCommandLineArgs } from \"./utils\";\n\n/**\n * @param fluidFileConverter - needs to be provided if \"codeLoaderBundle\" is not and vice versa\n */\nexport function fluidRunner(fluidFileConverter?: IFluidFileConverter) {\n\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\tyargs\n\t\t.strict()\n\t\t.version(false)\n\t\t.command(\n\t\t\t\"exportFile\",\n\t\t\t\"Generate an output for a local ODSP snapshot\",\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-shadow\n\t\t\t(yargs) =>\n\t\t\t\tyargs\n\t\t\t\t\t.option(\"codeLoader\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Path to code loader bundle. Required if this application is being called without modification.\\nSee \"README.md\" for more details.',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"inputFile\", {\n\t\t\t\t\t\tdescribe: \"Path to local ODSP snapshot\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"outputFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of output file (cannot already exist).\\nExecution result will be written here\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of telemetry file for config and session data (cannot already exist)\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"options\", {\n\t\t\t\t\t\tdescribe: \"Additional options passed to container on execution\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFormat\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Output format for telemetry. Current options are: [\"JSON\", \"CSV\"]',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: \"JSON\",\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryProp\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Property to add to every telemetry entry. Formatted like \"--telemetryProp prop1 value1 --telemetryProp prop2 \\\\\"value 2\\\\\"\".',\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"eventsPerFlush\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Number of telemetry events per flush to telemetryFile (only applicable for JSON format)\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"timeout\", {\n\t\t\t\t\t\tdescribe: \"Allowed timeout in ms before process is automatically cancelled\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"disableNetworkFetch\", {\n\t\t\t\t\t\tdescribe: \"Should network fetch calls be explicitly disabled?\",\n\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t}),\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-misused-promises\n\t\t\tasync (argv) => {\n\t\t\t\tconst argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);\n\t\t\t\tif (argsError) {\n\t\t\t\t\tconsole.error(argsError);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tconst telemetryOptionsResult = validateAndParseTelemetryOptions(\n\t\t\t\t\targv.telemetryFormat,\n\t\t\t\t\targv.telemetryProp,\n\t\t\t\t\targv.eventsPerFlush,\n\t\t\t\t);\n\t\t\t\tif (!telemetryOptionsResult.success) {\n\t\t\t\t\tconsole.error(telemetryOptionsResult.error);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\n\t\t\t\tconst result = await (argv.codeLoader\n\t\t\t\t\t? parseBundleAndExportFile(\n\t\t\t\t\t\t\targv.codeLoader,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t )\n\t\t\t\t\t: exportFile(\n\t\t\t\t\t\t\tfluidFileConverter!,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t ));\n\n\t\t\t\tif (!result.success) {\n\t\t\t\t\tconsole.error(`${result.eventName}: ${result.errorMessage}`);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tprocess.exit(0);\n\t\t\t},\n\t\t)\n\t\t.help()\n\t\t.demandCommand().argv;\n}\n"]}
package/lib/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { ICodeLoaderBundle, IFluidFileConverter } from "./codeLoaderBundle";
6
- export { createContainerAndExecute, exportFile, IExportFileResponse } from "./exportFile";
7
- export { fluidRunner } from "./fluidRunner";
8
- export { OutputFormat, ITelemetryOptions } from "./logger/fileLogger";
9
- export { createLogger, getTelemetryFileValidationError, validateAndParseTelemetryOptions, } from "./logger/loggerUtils";
10
- export { parseBundleAndExportFile } from "./parseBundleAndExportFile";
11
- export { getSnapshotFileContent } from "./utils";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,gCAAgC,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
package/lib/index.js DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { createContainerAndExecute, exportFile } from "./exportFile";
6
- export { fluidRunner } from "./fluidRunner";
7
- export { OutputFormat } from "./logger/fileLogger";
8
- export { createLogger, getTelemetryFileValidationError, validateAndParseTelemetryOptions, } from "./logger/loggerUtils";
9
- export { parseBundleAndExportFile } from "./parseBundleAndExportFile";
10
- export { getSnapshotFileContent } from "./utils";
11
- /* eslint-enable import/no-internal-modules */
12
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAuB,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,gCAAgC,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,8CAA8C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable import/no-internal-modules */\nexport { ICodeLoaderBundle, IFluidFileConverter } from \"./codeLoaderBundle\";\nexport { createContainerAndExecute, exportFile, IExportFileResponse } from \"./exportFile\";\nexport { fluidRunner } from \"./fluidRunner\";\nexport { OutputFormat, ITelemetryOptions } from \"./logger/fileLogger\";\nexport {\n\tcreateLogger,\n\tgetTelemetryFileValidationError,\n\tvalidateAndParseTelemetryOptions,\n} from \"./logger/loggerUtils\";\nexport { parseBundleAndExportFile } from \"./parseBundleAndExportFile\";\nexport { getSnapshotFileContent } from \"./utils\";\n/* eslint-enable import/no-internal-modules */\n"]}
@@ -1,28 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
- import { IFileLogger } from "./fileLogger";
7
- /**
8
- * @internal
9
- */
10
- export declare abstract class BaseFileLogger implements IFileLogger {
11
- protected readonly filePath: string;
12
- protected readonly eventsPerFlush: number;
13
- protected readonly defaultProps?: Record<string, string | number> | undefined;
14
- supportsTags?: true | undefined;
15
- /** Hold events in memory until flushed */
16
- protected events: any[];
17
- protected hasWrittenToFile: boolean;
18
- /**
19
- * @param filePath - file path to write logs to
20
- * @param eventsPerFlush - number of events per flush
21
- * @param defaultProps - default properties to add to every telemetry event
22
- */
23
- constructor(filePath: string, eventsPerFlush?: number, defaultProps?: Record<string, string | number> | undefined);
24
- send(event: ITelemetryBaseEvent): void;
25
- protected flush(): Promise<void>;
26
- close(): Promise<void>;
27
- }
28
- //# sourceMappingURL=baseFileLogger.d.ts.map
@@ -1 +0,0 @@
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,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,49 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import * as fs from "fs";
6
- /**
7
- * @internal
8
- */
9
- export class BaseFileLogger {
10
- /**
11
- * @param filePath - file path to write logs to
12
- * @param eventsPerFlush - number of events per flush
13
- * @param defaultProps - default properties to add to every telemetry event
14
- */
15
- constructor(filePath, eventsPerFlush = 50, defaultProps) {
16
- this.filePath = filePath;
17
- this.eventsPerFlush = eventsPerFlush;
18
- this.defaultProps = defaultProps;
19
- /** Hold events in memory until flushed */
20
- this.events = [];
21
- this.hasWrittenToFile = false;
22
- }
23
- send(event) {
24
- // eslint-disable-next-line no-param-reassign
25
- event = Object.assign(Object.assign({}, event), this.defaultProps);
26
- this.events.push(event);
27
- if (this.events.length >= this.eventsPerFlush || event.category === "error") {
28
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
29
- this.flush();
30
- }
31
- }
32
- async flush() {
33
- if (this.events.length > 0) {
34
- const contentToWrite = this.events.map((it) => JSON.stringify(it)).join(",");
35
- if (this.hasWrittenToFile) {
36
- fs.appendFileSync(this.filePath, `,${contentToWrite}`);
37
- }
38
- else {
39
- fs.appendFileSync(this.filePath, contentToWrite);
40
- }
41
- this.events = [];
42
- this.hasWrittenToFile = true;
43
- }
44
- }
45
- async close() {
46
- await this.flush();
47
- }
48
- }
49
- //# sourceMappingURL=baseFileLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"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jD;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"]}
@@ -1,18 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
6
- import { BaseFileLogger } from "./baseFileLogger";
7
- /**
8
- * FileLogger that writes events into a defined CSV file
9
- * @internal
10
- */
11
- export declare class CSVFileLogger extends BaseFileLogger {
12
- /** Store the column names to write as the CSV header */
13
- private readonly columns;
14
- protected flush(): Promise<void>;
15
- send(event: ITelemetryBaseEvent): void;
16
- close(): Promise<void>;
17
- }
18
- //# sourceMappingURL=csvFileLogger.d.ts.map
@@ -1 +0,0 @@
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,37 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import * as fs from "fs";
6
- import { parse } from "json2csv";
7
- import { BaseFileLogger } from "./baseFileLogger";
8
- /**
9
- * FileLogger that writes events into a defined CSV file
10
- * @internal
11
- */
12
- export class CSVFileLogger extends BaseFileLogger {
13
- constructor() {
14
- super(...arguments);
15
- /** Store the column names to write as the CSV header */
16
- this.columns = new Set();
17
- }
18
- async flush() {
19
- // No flushing is performed since we need all log entries to determine set of CSV columns
20
- }
21
- send(event) {
22
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
23
- for (const prop in event) {
24
- this.columns.add(prop);
25
- }
26
- super.send(event);
27
- }
28
- async close() {
29
- await super.close();
30
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
31
- for (const field in this.defaultProps) {
32
- this.columns.add(field);
33
- }
34
- fs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));
35
- }
36
- }
37
- //# sourceMappingURL=csvFileLogger.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,37 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
- /**
7
- * Contract for logger that writes telemetry to a file
8
- * @internal
9
- */
10
- export interface IFileLogger extends ITelemetryBaseLogger {
11
- /**
12
- * This method acts as a "dispose" and should be explicitly called at the end of execution
13
- */
14
- close(): Promise<void>;
15
- }
16
- /**
17
- * Desired output format for the telemetry
18
- */
19
- export declare enum OutputFormat {
20
- JSON = 0,
21
- CSV = 1
22
- }
23
- /**
24
- * Options to provide upon creation of IFileLogger
25
- */
26
- export interface ITelemetryOptions {
27
- /** Desired output format used to create a specific IFileLogger implementation */
28
- outputFormat?: OutputFormat;
29
- /**
30
- * Properties that should be added to every telemetry event
31
- * Example: { "prop1": "value1", "prop2": 10.0 }
32
- */
33
- defaultProps?: Record<string, string | number>;
34
- /** Number of telemetry events per flush to telemetry file */
35
- eventsPerFlush?: number;
36
- }
37
- //# sourceMappingURL=fileLogger.d.ts.map
@@ -1 +0,0 @@
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,14 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- /**
6
- * Desired output format for the telemetry
7
- */
8
- export var OutputFormat;
9
- (function (OutputFormat) {
10
- OutputFormat[OutputFormat["JSON"] = 0] = "JSON";
11
- OutputFormat[OutputFormat["CSV"] = 1] = "CSV";
12
- })(OutputFormat || (OutputFormat = {}));
13
- /* eslint-enable tsdoc/syntax */
14
- //# sourceMappingURL=fileLogger.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,14 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { BaseFileLogger } from "./baseFileLogger";
6
- /**
7
- * FileLogger that writes events into a defined CSV file
8
- * @internal
9
- */
10
- export declare class JSONFileLogger extends BaseFileLogger {
11
- constructor(filePath: string, eventsPerFlush?: number, defaultProps?: Record<string, string | number>);
12
- close(): Promise<void>;
13
- }
14
- //# sourceMappingURL=jsonFileLogger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonFileLogger.d.ts","sourceRoot":"","sources":["../../src/logger/jsonFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,cAAe,SAAQ,cAAc;gBAEhD,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,MAAW,EAC3B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAMlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAInC"}
@@ -1,21 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import * as fs from "fs";
6
- import { BaseFileLogger } from "./baseFileLogger";
7
- /**
8
- * FileLogger that writes events into a defined CSV file
9
- * @internal
10
- */
11
- export class JSONFileLogger extends BaseFileLogger {
12
- constructor(filePath, eventsPerFlush = 50, defaultProps) {
13
- super(filePath, eventsPerFlush, defaultProps);
14
- fs.appendFileSync(this.filePath, "[");
15
- }
16
- async close() {
17
- await super.close();
18
- fs.appendFileSync(this.filePath, "]");
19
- }
20
- }
21
- //# sourceMappingURL=jsonFileLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonFileLogger.js","sourceRoot":"","sources":["../../src/logger/jsonFileLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,cAAc;IACjD,YACC,QAAgB,EAChB,iBAAyB,EAAE,EAC3B,YAA8C;QAE9C,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QAC9C,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACvC,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 { BaseFileLogger } from \"./baseFileLogger\";\n\n/**\n * FileLogger that writes events into a defined CSV file\n * @internal\n */\nexport class JSONFileLogger extends BaseFileLogger {\n\tconstructor(\n\t\tfilePath: string,\n\t\teventsPerFlush: number = 50,\n\t\tdefaultProps?: Record<string, string | number>,\n\t) {\n\t\tsuper(filePath, eventsPerFlush, defaultProps);\n\t\tfs.appendFileSync(this.filePath, \"[\");\n\t}\n\n\tpublic async close(): Promise<void> {\n\t\tawait super.close();\n\t\tfs.appendFileSync(this.filePath, \"]\");\n\t}\n}\n"]}