@fluidframework/fluid-runner 2.0.0-dev.1.3.0.96595

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 (134) hide show
  1. package/.eslintrc.js +18 -0
  2. package/.mocharc.js +12 -0
  3. package/LICENSE +21 -0
  4. package/README.md +68 -0
  5. package/bin/fluid-runner +2 -0
  6. package/dist/codeLoaderBundle.d.ts +44 -0
  7. package/dist/codeLoaderBundle.d.ts.map +1 -0
  8. package/dist/codeLoaderBundle.js +23 -0
  9. package/dist/codeLoaderBundle.js.map +1 -0
  10. package/dist/exportFile.d.ts +28 -0
  11. package/dist/exportFile.d.ts.map +1 -0
  12. package/dist/exportFile.js +87 -0
  13. package/dist/exportFile.js.map +1 -0
  14. package/dist/fakeUrlResolver.d.ts +15 -0
  15. package/dist/fakeUrlResolver.d.ts.map +1 -0
  16. package/dist/fakeUrlResolver.js +43 -0
  17. package/dist/fakeUrlResolver.js.map +1 -0
  18. package/dist/fluidRunner.d.ts +10 -0
  19. package/dist/fluidRunner.d.ts.map +1 -0
  20. package/dist/fluidRunner.js +106 -0
  21. package/dist/fluidRunner.js.map +1 -0
  22. package/dist/getArgsValidationError.d.ts +6 -0
  23. package/dist/getArgsValidationError.d.ts.map +1 -0
  24. package/dist/getArgsValidationError.js +46 -0
  25. package/dist/getArgsValidationError.js.map +1 -0
  26. package/dist/index.d.ts +12 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +30 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/logger/baseFileLogger.d.ts +28 -0
  31. package/dist/logger/baseFileLogger.d.ts.map +1 -0
  32. package/dist/logger/baseFileLogger.js +72 -0
  33. package/dist/logger/baseFileLogger.js.map +1 -0
  34. package/dist/logger/csvFileLogger.d.ts +18 -0
  35. package/dist/logger/csvFileLogger.d.ts.map +1 -0
  36. package/dist/logger/csvFileLogger.js +60 -0
  37. package/dist/logger/csvFileLogger.js.map +1 -0
  38. package/dist/logger/fileLogger.d.ts +38 -0
  39. package/dist/logger/fileLogger.d.ts.map +1 -0
  40. package/dist/logger/fileLogger.js +17 -0
  41. package/dist/logger/fileLogger.js.map +1 -0
  42. package/dist/logger/jsonFileLogger.d.ts +14 -0
  43. package/dist/logger/jsonFileLogger.d.ts.map +1 -0
  44. package/dist/logger/jsonFileLogger.js +44 -0
  45. package/dist/logger/jsonFileLogger.js.map +1 -0
  46. package/dist/logger/loggerUtils.d.ts +36 -0
  47. package/dist/logger/loggerUtils.d.ts.map +1 -0
  48. package/dist/logger/loggerUtils.js +90 -0
  49. package/dist/logger/loggerUtils.js.map +1 -0
  50. package/dist/packageVersion.d.ts +9 -0
  51. package/dist/packageVersion.d.ts.map +1 -0
  52. package/dist/packageVersion.js +12 -0
  53. package/dist/packageVersion.js.map +1 -0
  54. package/dist/parseBundleAndExportFile.d.ts +12 -0
  55. package/dist/parseBundleAndExportFile.d.ts.map +1 -0
  56. package/dist/parseBundleAndExportFile.js +84 -0
  57. package/dist/parseBundleAndExportFile.js.map +1 -0
  58. package/dist/utils.d.ts +24 -0
  59. package/dist/utils.d.ts.map +1 -0
  60. package/dist/utils.js +63 -0
  61. package/dist/utils.js.map +1 -0
  62. package/lib/codeLoaderBundle.d.ts +44 -0
  63. package/lib/codeLoaderBundle.d.ts.map +1 -0
  64. package/lib/codeLoaderBundle.js +18 -0
  65. package/lib/codeLoaderBundle.js.map +1 -0
  66. package/lib/exportFile.d.ts +28 -0
  67. package/lib/exportFile.d.ts.map +1 -0
  68. package/lib/exportFile.js +63 -0
  69. package/lib/exportFile.js.map +1 -0
  70. package/lib/fakeUrlResolver.d.ts +15 -0
  71. package/lib/fakeUrlResolver.d.ts.map +1 -0
  72. package/lib/fakeUrlResolver.js +39 -0
  73. package/lib/fakeUrlResolver.js.map +1 -0
  74. package/lib/fluidRunner.d.ts +10 -0
  75. package/lib/fluidRunner.d.ts.map +1 -0
  76. package/lib/fluidRunner.js +83 -0
  77. package/lib/fluidRunner.js.map +1 -0
  78. package/lib/getArgsValidationError.d.ts +6 -0
  79. package/lib/getArgsValidationError.d.ts.map +1 -0
  80. package/lib/getArgsValidationError.js +23 -0
  81. package/lib/getArgsValidationError.js.map +1 -0
  82. package/lib/index.d.ts +12 -0
  83. package/lib/index.d.ts.map +1 -0
  84. package/lib/index.js +12 -0
  85. package/lib/index.js.map +1 -0
  86. package/lib/logger/baseFileLogger.d.ts +28 -0
  87. package/lib/logger/baseFileLogger.d.ts.map +1 -0
  88. package/lib/logger/baseFileLogger.js +49 -0
  89. package/lib/logger/baseFileLogger.js.map +1 -0
  90. package/lib/logger/csvFileLogger.d.ts +18 -0
  91. package/lib/logger/csvFileLogger.d.ts.map +1 -0
  92. package/lib/logger/csvFileLogger.js +37 -0
  93. package/lib/logger/csvFileLogger.js.map +1 -0
  94. package/lib/logger/fileLogger.d.ts +38 -0
  95. package/lib/logger/fileLogger.d.ts.map +1 -0
  96. package/lib/logger/fileLogger.js +14 -0
  97. package/lib/logger/fileLogger.js.map +1 -0
  98. package/lib/logger/jsonFileLogger.d.ts +14 -0
  99. package/lib/logger/jsonFileLogger.d.ts.map +1 -0
  100. package/lib/logger/jsonFileLogger.js +21 -0
  101. package/lib/logger/jsonFileLogger.js.map +1 -0
  102. package/lib/logger/loggerUtils.d.ts +36 -0
  103. package/lib/logger/loggerUtils.d.ts.map +1 -0
  104. package/lib/logger/loggerUtils.js +65 -0
  105. package/lib/logger/loggerUtils.js.map +1 -0
  106. package/lib/packageVersion.d.ts +9 -0
  107. package/lib/packageVersion.d.ts.map +1 -0
  108. package/lib/packageVersion.js +9 -0
  109. package/lib/packageVersion.js.map +1 -0
  110. package/lib/parseBundleAndExportFile.d.ts +12 -0
  111. package/lib/parseBundleAndExportFile.d.ts.map +1 -0
  112. package/lib/parseBundleAndExportFile.js +61 -0
  113. package/lib/parseBundleAndExportFile.js.map +1 -0
  114. package/lib/utils.d.ts +24 -0
  115. package/lib/utils.d.ts.map +1 -0
  116. package/lib/utils.js +38 -0
  117. package/lib/utils.js.map +1 -0
  118. package/package.json +87 -0
  119. package/src/codeLoaderBundle.ts +57 -0
  120. package/src/exportFile.ts +104 -0
  121. package/src/fakeUrlResolver.ts +50 -0
  122. package/src/fluidRunner.ts +106 -0
  123. package/src/getArgsValidationError.ts +27 -0
  124. package/src/index.ts +14 -0
  125. package/src/logger/baseFileLogger.ts +58 -0
  126. package/src/logger/csvFileLogger.ts +40 -0
  127. package/src/logger/fileLogger.ts +45 -0
  128. package/src/logger/jsonFileLogger.ts +27 -0
  129. package/src/logger/loggerUtils.ts +81 -0
  130. package/src/packageVersion.ts +9 -0
  131. package/src/parseBundleAndExportFile.ts +80 -0
  132. package/src/utils.ts +45 -0
  133. package/tsconfig.esnext.json +7 -0
  134. package/tsconfig.json +14 -0
@@ -0,0 +1 @@
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,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACrF,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export * from "./exportFile";
6
+ export { fluidRunner } from "./fluidRunner";
7
+ export { OutputFormat } from "./logger/fileLogger";
8
+ export { createLogger, getTelemetryFileValidationError } from "./logger/loggerUtils";
9
+ export * from "./parseBundleAndExportFile";
10
+ export { getSnapshotFileContent } from "./utils";
11
+ /* eslint-enable import/no-internal-modules */
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACrF,cAAc,4BAA4B,CAAC;AAC3C,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 * from \"./exportFile\";\nexport { fluidRunner } from \"./fluidRunner\";\nexport { OutputFormat } from \"./logger/fileLogger\";\nexport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\nexport * from \"./parseBundleAndExportFile\";\nexport { getSnapshotFileContent } from \"./utils\";\n/* eslint-enable import/no-internal-modules */\n"]}
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
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
@@ -0,0 +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;IAanD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACnC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;IACzC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;IAd7B,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvC,0CAA0C;IAC1C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,CAAM;IAC7B,SAAS,CAAC,gBAAgB,UAAS;IAEnC;;;;OAIG;gBAEoB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,MAAW,EAC3B,YAAY,CAAC,6CAAiC;IAG9D,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;cAW7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAazB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC"}
@@ -0,0 +1,49 @@
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
@@ -0,0 +1 @@
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;IAOhC;;;;OAIG;IACF,YACsB,QAAgB,EAChB,iBAAyB,EAAE,EAC3B,YAA8C;QAF9C,aAAQ,GAAR,QAAQ,CAAQ;QAChB,mBAAc,GAAd,cAAc,CAAa;QAC3B,iBAAY,GAAZ,YAAY,CAAkC;QAZrE,0CAA0C;QAChC,WAAM,GAAU,EAAE,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;IAW/B,CAAC;IAEE,IAAI,CAAC,KAA0B;QAClC,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;YACzE,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;SAChB;IACL,CAAC;IAES,KAAK,CAAC,KAAK;QACjB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,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;gBACvB,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;aAC1D;iBAAM;gBACH,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;aACpD;YACD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAChC;IACL,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACJ","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 public supportsTags?: true | undefined;\n\n /** Hold events in memory until flushed */\n protected events: any[] = [];\n protected hasWrittenToFile = false;\n\n /**\n * @param filePath - file path to write logs to\n * @param eventsPerFlush - number of events per flush\n * @param defaultProps - default properties to add to every telemetry event\n */\n public constructor(\n protected readonly filePath: string,\n protected readonly eventsPerFlush: number = 50,\n protected readonly defaultProps?: Record<string, string | number>,\n ) { }\n\n public send(event: ITelemetryBaseEvent): void {\n // eslint-disable-next-line no-param-reassign\n event = { ...event, ...this.defaultProps };\n this.events.push(event);\n\n if (this.events.length >= this.eventsPerFlush || event.category === \"error\") {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.flush();\n }\n }\n\n protected async flush(): Promise<void> {\n if (this.events.length > 0) {\n const contentToWrite = this.events.map((it) => JSON.stringify(it)).join(\",\");\n if (this.hasWrittenToFile) {\n fs.appendFileSync(this.filePath, `,${contentToWrite}`);\n } else {\n fs.appendFileSync(this.filePath, contentToWrite);\n }\n this.events = [];\n this.hasWrittenToFile = true;\n }\n }\n\n public async close(): Promise<void> {\n await this.flush();\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { ITelemetryBaseEvent } from "@fluidframework/common-definitions";
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
+ flush(): Promise<void>;
15
+ send(event: ITelemetryBaseEvent): void;
16
+ close(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=csvFileLogger.d.ts.map
@@ -0,0 +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;IAC7C,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IAExB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAQhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAStC"}
@@ -0,0 +1,37 @@
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
+ // Do nothing
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
@@ -0,0 +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;;QACI,wDAAwD;QACvC,YAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAuBzC,CAAC;IArBU,KAAK,CAAC,KAAK;QACd,aAAa;IACjB,CAAC;IAEM,IAAI,CAAC,KAA0B;QAClC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACtB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC1B;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC3B;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;IAClF,CAAC;CACJ","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 /** Store the column names to write as the CSV header */\n private readonly columns = new Set();\n\n public async flush(): Promise<void> {\n // Do nothing\n }\n\n public send(event: ITelemetryBaseEvent): void {\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (const prop in event) {\n this.columns.add(prop);\n }\n super.send(event);\n }\n\n public async close(): Promise<void> {\n await super.close();\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (const field in this.defaultProps) {\n this.columns.add(field);\n }\n\n fs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));\n }\n}\n"]}
@@ -0,0 +1,38 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
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
+ * @internal
26
+ */
27
+ export interface ITelemetryOptions {
28
+ /** Desired output format used to create a specific IFileLogger implementation */
29
+ outputFormat?: OutputFormat;
30
+ /**
31
+ * Properties that should be added to every telemetry event
32
+ * Example: { "prop1": "value1", "prop2": 10.0 }
33
+ */
34
+ defaultProps?: Record<string, string | number>;
35
+ /** Number of telemetry events per flush to telemetry file */
36
+ eventsPerFlush?: number;
37
+ }
38
+ //# sourceMappingURL=fileLogger.d.ts.map
@@ -0,0 +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;IACrD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;GAEG;AACH,oBAAY,YAAY;IACpB,IAAI,IAAA;IACJ,GAAG,IAAA;CACN;AAGD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,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;CAC3B"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +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;IACpB,+CAAI,CAAA;IACJ,6CAAG,CAAA;AACP,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAoBD,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 /**\n * This method acts as a \"dispose\" and should be explicitly called at the end of execution\n */\n close(): Promise<void>;\n}\n\n/**\n * Desired output format for the telemetry\n */\nexport enum OutputFormat {\n JSON,\n CSV,\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Options to provide upon creation of IFileLogger\n * @internal\n */\nexport interface ITelemetryOptions {\n /** Desired output format used to create a specific IFileLogger implementation */\n outputFormat?: OutputFormat;\n\n /**\n * Properties that should be added to every telemetry event\n * Example: { \"prop1\": \"value1\", \"prop2\": 10.0 }\n */\n defaultProps?: Record<string, string | number>;\n\n /** Number of telemetry events per flush to telemetry file */\n eventsPerFlush?: number;\n}\n/* eslint-enable tsdoc/syntax */\n"]}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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;gBAE1C,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,MAAW,EAC3B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAMrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAItC"}
@@ -0,0 +1,21 @@
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
@@ -0,0 +1 @@
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;IAC9C,YACI,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;IAC1C,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;CACJ","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 constructor(\n filePath: string,\n eventsPerFlush: number = 50,\n defaultProps?: Record<string, string | number>,\n ) {\n super(filePath, eventsPerFlush, defaultProps);\n fs.appendFileSync(this.filePath, \"[\");\n }\n\n public async close(): Promise<void> {\n await super.close();\n fs.appendFileSync(this.filePath, \"]\");\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { ITelemetryLogger } from "@fluidframework/common-definitions";
6
+ import { IFileLogger, ITelemetryOptions } from "./fileLogger";
7
+ /**
8
+ * Create a ITelemetryLogger wrapped around provided IFileLogger
9
+ * ! It is expected that all events be sent through the returned "logger" value
10
+ * ! The "fileLogger" value should have its "close()" method called at the end of execution
11
+ * Note: if an output format is not supplied, default is JSON
12
+ * @returns - both the IFileLogger implementation and ITelemetryLogger wrapper to be called
13
+ */
14
+ export declare function createLogger(filePath: string, options?: ITelemetryOptions): {
15
+ logger: ITelemetryLogger;
16
+ fileLogger: IFileLogger;
17
+ };
18
+ /**
19
+ * Validate the telemetryFile command line argument
20
+ * @param telemetryFile - path where telemetry will be written
21
+ */
22
+ export declare function getTelemetryFileValidationError(telemetryFile: string): string | undefined;
23
+ /**
24
+ * Validate the provided output format and default properties
25
+ * @param format - desired output format of the telemetry
26
+ * @param props - default properties to be added to every telemetry entry
27
+ * @internal
28
+ */
29
+ export declare function validateAndParseTelemetryOptions(format?: string, props?: (string | number)[]): {
30
+ success: false;
31
+ error: string;
32
+ } | {
33
+ success: true;
34
+ telemetryOptions: ITelemetryOptions;
35
+ };
36
+ //# sourceMappingURL=loggerUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loggerUtils.d.ts","sourceRoot":"","sources":["../../src/logger/loggerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAgB,MAAM,cAAc,CAAC;AAG5E;;;;;;GAMG;AACF,wBAAgB,YAAY,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,iBAAiB,GAC5B;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,WAAW,CAAC;CAAE,CASxD;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQzF;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC5C,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAC5B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,gBAAgB,EAAE,iBAAiB,CAAC;CAAE,CAwB9F"}
@@ -0,0 +1,65 @@
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 { ChildLogger } from "@fluidframework/telemetry-utils";
7
+ import { CSVFileLogger } from "./csvFileLogger";
8
+ import { OutputFormat } from "./fileLogger";
9
+ import { JSONFileLogger } from "./jsonFileLogger";
10
+ /**
11
+ * Create a ITelemetryLogger wrapped around provided IFileLogger
12
+ * ! It is expected that all events be sent through the returned "logger" value
13
+ * ! The "fileLogger" value should have its "close()" method called at the end of execution
14
+ * Note: if an output format is not supplied, default is JSON
15
+ * @returns - both the IFileLogger implementation and ITelemetryLogger wrapper to be called
16
+ */
17
+ export function createLogger(filePath, options) {
18
+ const fileLogger = (options === null || options === void 0 ? void 0 : options.outputFormat) === OutputFormat.CSV
19
+ ? new CSVFileLogger(filePath, options === null || options === void 0 ? void 0 : options.eventsPerFlush, options === null || options === void 0 ? void 0 : options.defaultProps)
20
+ : new JSONFileLogger(filePath, options === null || options === void 0 ? void 0 : options.eventsPerFlush, options === null || options === void 0 ? void 0 : options.defaultProps);
21
+ const logger = ChildLogger.create(fileLogger, "LocalSnapshotRunnerApp", { all: { Event_Time: () => Date.now() } });
22
+ return { logger, fileLogger };
23
+ }
24
+ /**
25
+ * Validate the telemetryFile command line argument
26
+ * @param telemetryFile - path where telemetry will be written
27
+ */
28
+ export function getTelemetryFileValidationError(telemetryFile) {
29
+ if (!telemetryFile) {
30
+ return "Telemetry file argument is missing.";
31
+ }
32
+ else if (fs.existsSync(telemetryFile)) {
33
+ return `Telemetry file already exists [${telemetryFile}].`;
34
+ }
35
+ return undefined;
36
+ }
37
+ /**
38
+ * Validate the provided output format and default properties
39
+ * @param format - desired output format of the telemetry
40
+ * @param props - default properties to be added to every telemetry entry
41
+ * @internal
42
+ */
43
+ export function validateAndParseTelemetryOptions(format, props) {
44
+ let outputFormat;
45
+ const defaultProps = {};
46
+ if (format) {
47
+ outputFormat = OutputFormat[format];
48
+ if (outputFormat === undefined) {
49
+ return { success: false, error: `Invalid telemetry format [${format}]` };
50
+ }
51
+ }
52
+ if (props && props.length > 0) {
53
+ if (props.length % 2 !== 0) {
54
+ return { success: false, error: `Invalid number of telemetry properties to add [${props.length}]` };
55
+ }
56
+ for (let i = 0; i < props.length; i += 2) {
57
+ if (typeof props[i] === "number") {
58
+ return { success: false, error: `Property name cannot be number at index [${i}] -> [${props[i]}]` };
59
+ }
60
+ defaultProps[props[i]] = props[i + 1];
61
+ }
62
+ }
63
+ return { success: true, telemetryOptions: { outputFormat, defaultProps } };
64
+ }
65
+ //# sourceMappingURL=loggerUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loggerUtils.js","sourceRoot":"","sources":["../../src/logger/loggerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAkC,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;GAMG;AACF,MAAM,UAAU,YAAY,CACzB,QAAgB,EAChB,OAA2B;IAE3B,MAAM,UAAU,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,MAAK,YAAY,CAAC,GAAG;QACzD,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC;QAC7E,CAAC,CAAC,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,CAAC;IAEnF,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,EAClE,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAE/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAC,aAAqB;IACjE,IAAI,CAAC,aAAa,EAAE;QAChB,OAAO,qCAAqC,CAAC;KAChD;SAAM,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;QACrC,OAAO,kCAAkC,aAAa,IAAI,CAAC;KAC9D;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC5C,MAAe,EACf,KAA2B;IAE3B,IAAI,YAAsC,CAAC;IAC3C,MAAM,YAAY,GAAoC,EAAE,CAAC;IAEzD,IAAI,MAAM,EAAE;QACR,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,YAAY,KAAK,SAAS,EAAE;YAC5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,MAAM,GAAG,EAAE,CAAC;SAC5E;KACJ;IAED,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,kDAAkD,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;SACvG;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YACtC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;gBAC9B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,4CAA4C,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;aACvG;YACD,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACzC;KACJ;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,CAAC;AAC/E,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 { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { CSVFileLogger } from \"./csvFileLogger\";\nimport { IFileLogger, ITelemetryOptions, OutputFormat } from \"./fileLogger\";\nimport { JSONFileLogger } from \"./jsonFileLogger\";\n\n/**\n * Create a ITelemetryLogger wrapped around provided IFileLogger\n * ! It is expected that all events be sent through the returned \"logger\" value\n * ! The \"fileLogger\" value should have its \"close()\" method called at the end of execution\n * Note: if an output format is not supplied, default is JSON\n * @returns - both the IFileLogger implementation and ITelemetryLogger wrapper to be called\n */\n export function createLogger(\n filePath: string,\n options?: ITelemetryOptions,\n): { logger: ITelemetryLogger; fileLogger: IFileLogger; } {\n const fileLogger = options?.outputFormat === OutputFormat.CSV\n ? new CSVFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps)\n : new JSONFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps);\n\n const logger = ChildLogger.create(fileLogger, \"LocalSnapshotRunnerApp\",\n { all: { Event_Time: () => Date.now() } });\n\n return { logger, fileLogger };\n}\n\n/**\n * Validate the telemetryFile command line argument\n * @param telemetryFile - path where telemetry will be written\n */\nexport function getTelemetryFileValidationError(telemetryFile: string): string | undefined {\n if (!telemetryFile) {\n return \"Telemetry file argument is missing.\";\n } else if (fs.existsSync(telemetryFile)) {\n return `Telemetry file already exists [${telemetryFile}].`;\n }\n\n return undefined;\n}\n\n/**\n * Validate the provided output format and default properties\n * @param format - desired output format of the telemetry\n * @param props - default properties to be added to every telemetry entry\n * @internal\n */\nexport function validateAndParseTelemetryOptions(\n format?: string,\n props?: (string | number)[],\n): { success: false; error: string; } | { success: true; telemetryOptions: ITelemetryOptions; } {\n let outputFormat: OutputFormat | undefined;\n const defaultProps: Record<string, string | number> = {};\n\n if (format) {\n outputFormat = OutputFormat[format];\n if (outputFormat === undefined) {\n return { success: false, error: `Invalid telemetry format [${format}]` };\n }\n }\n\n if (props && props.length > 0) {\n if (props.length % 2 !== 0) {\n return { success: false, error: `Invalid number of telemetry properties to add [${props.length}]` };\n }\n for (let i = 0; i < props.length; i += 2) {\n if (typeof props[i] === \"number\") {\n return { success: false, error: `Property name cannot be number at index [${i}] -> [${props[i]}]` };\n }\n defaultProps[props[i]] = props[i + 1];\n }\n }\n\n return { success: true, telemetryOptions: { outputFormat, defaultProps } };\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
+ */
7
+ export declare const pkgName = "@fluidframework/fluid-runner";
8
+ export declare const pkgVersion = "1.2.0";
9
+ //# sourceMappingURL=packageVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
+ */
7
+ export const pkgName = "@fluidframework/fluid-runner";
8
+ export const pkgVersion = "1.2.0";
9
+ //# sourceMappingURL=packageVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/fluid-runner\";\nexport const pkgVersion = \"1.2.0\";\n"]}
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { IExportFileResponse } from "./exportFile";
6
+ import { ITelemetryOptions } from "./logger/fileLogger";
7
+ /**
8
+ * Parse a provided JS bundle, execute code on Container based on ODSP snapshot, and write result to file
9
+ * @param codeLoader - path to provided JS bundle that implements ICodeLoaderBundle (see codeLoaderBundle.ts)
10
+ */
11
+ export declare function parseBundleAndExportFile(codeLoader: string, inputFile: string, outputFile: string, telemetryFile: string, options?: string, telemetryOptions?: ITelemetryOptions): Promise<IExportFileResponse>;
12
+ //# sourceMappingURL=parseBundleAndExportFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBundleAndExportFile.d.ts","sourceRoot":"","sources":["../src/parseBundleAndExportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAA6B,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC1C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,iBAAiB,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAkD9B"}
@@ -0,0 +1,61 @@
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 { isCodeLoaderBundle, isFluidFileConverter } from "./codeLoaderBundle";
8
+ import { createContainerAndExecute } from "./exportFile";
9
+ import { getArgsValidationError } from "./getArgsValidationError";
10
+ import { createLogger, getTelemetryFileValidationError } from "./logger/loggerUtils";
11
+ /* eslint-enable import/no-internal-modules */
12
+ import { getSnapshotFileContent } from "./utils";
13
+ const clientArgsValidationError = "Client_ArgsValidationError";
14
+ /**
15
+ * Parse a provided JS bundle, execute code on Container based on ODSP snapshot, and write result to file
16
+ * @param codeLoader - path to provided JS bundle that implements ICodeLoaderBundle (see codeLoaderBundle.ts)
17
+ */
18
+ export async function parseBundleAndExportFile(codeLoader, inputFile, outputFile, telemetryFile, options, telemetryOptions) {
19
+ const telemetryArgError = getTelemetryFileValidationError(telemetryFile);
20
+ if (telemetryArgError) {
21
+ const eventName = clientArgsValidationError;
22
+ return { success: false, eventName, errorMessage: telemetryArgError };
23
+ }
24
+ const { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);
25
+ try {
26
+ return await PerformanceEvent.timedExecAsync(logger, { eventName: "ParseBundleAndExportFile" }, async () => {
27
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
28
+ const codeLoaderBundle = require(codeLoader);
29
+ if (!isCodeLoaderBundle(codeLoaderBundle)) {
30
+ const eventName = clientArgsValidationError;
31
+ const errorMessage = "Code loader bundle is not of type ICodeLoaderBundle";
32
+ logger.sendErrorEvent({ eventName, message: errorMessage });
33
+ return { success: false, eventName, errorMessage };
34
+ }
35
+ const fluidExport = await codeLoaderBundle.fluidExport;
36
+ if (!isFluidFileConverter(fluidExport)) {
37
+ const eventName = clientArgsValidationError;
38
+ const errorMessage = "Fluid export from CodeLoaderBundle is not of type IFluidFileConverter";
39
+ logger.sendErrorEvent({ eventName, message: errorMessage });
40
+ return { success: false, eventName, errorMessage };
41
+ }
42
+ const argsValidationError = getArgsValidationError(inputFile, outputFile);
43
+ if (argsValidationError) {
44
+ const eventName = clientArgsValidationError;
45
+ logger.sendErrorEvent({ eventName, message: argsValidationError });
46
+ return { success: false, eventName, errorMessage: argsValidationError };
47
+ }
48
+ fs.writeFileSync(outputFile, await createContainerAndExecute(getSnapshotFileContent(inputFile), fluidExport, logger, options));
49
+ return { success: true };
50
+ });
51
+ }
52
+ catch (error) {
53
+ const eventName = "Client_UnexpectedError";
54
+ logger.sendErrorEvent({ eventName }, error);
55
+ return { success: false, eventName, errorMessage: "Unexpected error", error };
56
+ }
57
+ finally {
58
+ await fileLogger.close();
59
+ }
60
+ }
61
+ //# sourceMappingURL=parseBundleAndExportFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBundleAndExportFile.js","sourceRoot":"","sources":["../src/parseBundleAndExportFile.ts"],"names":[],"mappings":"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","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 { PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { isCodeLoaderBundle, isFluidFileConverter } from \"./codeLoaderBundle\";\nimport { createContainerAndExecute, IExportFileResponse } from \"./exportFile\";\nimport { getArgsValidationError } from \"./getArgsValidationError\";\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 */\nimport { getSnapshotFileContent } from \"./utils\";\n\nconst clientArgsValidationError = \"Client_ArgsValidationError\";\n\n/**\n * Parse a provided JS bundle, execute code on Container based on ODSP snapshot, and write result to file\n * @param codeLoader - path to provided JS bundle that implements ICodeLoaderBundle (see codeLoaderBundle.ts)\n */\nexport async function parseBundleAndExportFile(\n codeLoader: string,\n inputFile: string,\n outputFile: string,\n telemetryFile: string,\n options?: string,\n telemetryOptions?: ITelemetryOptions,\n): Promise<IExportFileResponse> {\n const telemetryArgError = getTelemetryFileValidationError(telemetryFile);\n if (telemetryArgError) {\n const eventName = clientArgsValidationError;\n return { success: false, eventName, errorMessage: telemetryArgError };\n }\n const { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);\n\n try {\n return await PerformanceEvent.timedExecAsync(logger, { eventName: \"ParseBundleAndExportFile\" }, async () => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const codeLoaderBundle = require(codeLoader);\n if (!isCodeLoaderBundle(codeLoaderBundle)) {\n const eventName = clientArgsValidationError;\n const errorMessage = \"Code loader bundle is not of type ICodeLoaderBundle\";\n logger.sendErrorEvent({ eventName, message: errorMessage });\n return { success: false, eventName, errorMessage };\n }\n\n const fluidExport = await codeLoaderBundle.fluidExport;\n if (!isFluidFileConverter(fluidExport)) {\n const eventName = clientArgsValidationError;\n const errorMessage = \"Fluid export from CodeLoaderBundle is not of type IFluidFileConverter\";\n logger.sendErrorEvent({ eventName, message: errorMessage });\n return { success: false, eventName, errorMessage };\n }\n\n const argsValidationError = getArgsValidationError(inputFile, outputFile);\n if (argsValidationError) {\n const eventName = clientArgsValidationError;\n logger.sendErrorEvent({ eventName, message: argsValidationError });\n return { success: false, eventName, errorMessage: argsValidationError };\n }\n\n fs.writeFileSync(outputFile, await createContainerAndExecute(\n getSnapshotFileContent(inputFile),\n fluidExport,\n logger,\n options,\n ));\n\n return { success: true };\n });\n } catch (error) {\n const eventName = \"Client_UnexpectedError\";\n logger.sendErrorEvent({ eventName }, error);\n return { success: false, eventName, errorMessage: \"Unexpected error\", error };\n } finally {\n await fileLogger.close();\n }\n}\n"]}
package/lib/utils.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /// <reference types="node" />
6
+ import { IFluidFileConverter } from "./codeLoaderBundle";
7
+ /**
8
+ * Is the given snapshot in JSON format
9
+ * @param content - snapshot file content
10
+ * @internal
11
+ */
12
+ export declare function isJsonSnapshot(content: Buffer): boolean;
13
+ /**
14
+ * Get the ODSP snapshot file content
15
+ * Works on both JSON and binary snapshot formats
16
+ * @param filePath - path to the ODSP snapshot file
17
+ */
18
+ export declare function getSnapshotFileContent(filePath: string): string | Buffer;
19
+ /**
20
+ * Validate provided command line arguments
21
+ * @internal
22
+ */
23
+ export declare function validateCommandLineArgs(codeLoader?: string, fluidFileConverter?: IFluidFileConverter): string | undefined;
24
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACF,wBAAgB,uBAAuB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACzC,MAAM,GAAG,SAAS,CASpB"}
package/lib/utils.js ADDED
@@ -0,0 +1,38 @@
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
+ * Is the given snapshot in JSON format
8
+ * @param content - snapshot file content
9
+ * @internal
10
+ */
11
+ export function isJsonSnapshot(content) {
12
+ return content.toString(undefined, 0, 1) === "{";
13
+ }
14
+ /**
15
+ * Get the ODSP snapshot file content
16
+ * Works on both JSON and binary snapshot formats
17
+ * @param filePath - path to the ODSP snapshot file
18
+ */
19
+ export function getSnapshotFileContent(filePath) {
20
+ // TODO: read file stream
21
+ const content = fs.readFileSync(filePath);
22
+ return isJsonSnapshot(content) ? content.toString() : content;
23
+ }
24
+ /**
25
+ * Validate provided command line arguments
26
+ * @internal
27
+ */
28
+ export function validateCommandLineArgs(codeLoader, fluidFileConverter) {
29
+ if (codeLoader && fluidFileConverter !== undefined) {
30
+ return "\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.";
31
+ }
32
+ if (!codeLoader && fluidFileConverter === undefined) {
33
+ // eslint-disable-next-line max-len
34
+ return "\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.";
35
+ }
36
+ return undefined;
37
+ }
38
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACnD,yBAAyB;IACzB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC1C,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AAClE,CAAC;AAED;;;GAGG;AACF,MAAM,UAAU,uBAAuB,CACpC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QAChD,OAAO,4FAA4F,CAAC;KACvG;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACjD,mCAAmC;QACnC,OAAO,yGAAyG,CAAC;KACpH;IACD,OAAO,SAAS,CAAC;AACrB,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 { IFluidFileConverter } from \"./codeLoaderBundle\";\n\n/**\n * Is the given snapshot in JSON format\n * @param content - snapshot file content\n * @internal\n */\nexport function isJsonSnapshot(content: Buffer): boolean {\n return content.toString(undefined, 0, 1) === \"{\";\n}\n\n/**\n * Get the ODSP snapshot file content\n * Works on both JSON and binary snapshot formats\n * @param filePath - path to the ODSP snapshot file\n */\nexport function getSnapshotFileContent(filePath: string): string | Buffer {\n // TODO: read file stream\n const content = fs.readFileSync(filePath);\n return isJsonSnapshot(content) ? content.toString() : content;\n}\n\n/**\n * Validate provided command line arguments\n * @internal\n */\n export function validateCommandLineArgs(\n codeLoader?: string,\n fluidFileConverter?: IFluidFileConverter,\n): string | undefined {\n if (codeLoader && fluidFileConverter !== undefined) {\n return \"\\\"codeLoader\\\" and \\\"fluidFileConverter\\\" cannot both be provided. See README for details.\";\n }\n if (!codeLoader && fluidFileConverter === undefined) {\n // eslint-disable-next-line max-len\n return \"\\\"codeLoader\\\" must be provided if there is no explicit \\\"fluidFileConverter\\\". See README for details.\";\n }\n return undefined;\n}\n"]}