@fluidframework/fluid-runner 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463

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 (125) hide show
  1. package/.eslintrc.cjs +16 -1
  2. package/README.md +1 -1
  3. package/api-extractor-cjs.json +8 -0
  4. package/api-extractor-lint.json +1 -1
  5. package/api-extractor.json +1 -14
  6. package/api-report/fluid-runner.api.md +26 -12
  7. package/bin/fluid-runner.mjs +8 -0
  8. package/dist/codeLoaderBundle.d.ts +2 -2
  9. package/dist/codeLoaderBundle.d.ts.map +1 -1
  10. package/dist/codeLoaderBundle.js.map +1 -1
  11. package/dist/exportFile.d.ts +10 -5
  12. package/dist/exportFile.d.ts.map +1 -1
  13. package/dist/exportFile.js +18 -18
  14. package/dist/exportFile.js.map +1 -1
  15. package/dist/fakeUrlResolver.d.ts +1 -1
  16. package/dist/fakeUrlResolver.d.ts.map +1 -1
  17. package/dist/fakeUrlResolver.js.map +1 -1
  18. package/dist/fluid-runner-alpha.d.ts +10 -4
  19. package/dist/fluid-runner-beta.d.ts +4 -11
  20. package/dist/fluid-runner-public.d.ts +4 -11
  21. package/dist/fluid-runner-untrimmed.d.ts +12 -6
  22. package/dist/fluidRunner.d.ts +2 -2
  23. package/dist/fluidRunner.d.ts.map +1 -1
  24. package/dist/fluidRunner.js +19 -43
  25. package/dist/fluidRunner.js.map +1 -1
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +15 -15
  29. package/dist/index.js.map +1 -1
  30. package/dist/logger/baseFileLogger.d.ts +1 -1
  31. package/dist/logger/baseFileLogger.d.ts.map +1 -1
  32. package/dist/logger/baseFileLogger.js.map +1 -1
  33. package/dist/logger/csvFileLogger.d.ts +1 -1
  34. package/dist/logger/csvFileLogger.d.ts.map +1 -1
  35. package/dist/logger/csvFileLogger.js +2 -2
  36. package/dist/logger/csvFileLogger.js.map +1 -1
  37. package/dist/logger/fileLogger.d.ts.map +1 -1
  38. package/dist/logger/fileLogger.js +0 -1
  39. package/dist/logger/fileLogger.js.map +1 -1
  40. package/dist/logger/jsonFileLogger.d.ts +1 -1
  41. package/dist/logger/jsonFileLogger.d.ts.map +1 -1
  42. package/dist/logger/jsonFileLogger.js +2 -2
  43. package/dist/logger/jsonFileLogger.js.map +1 -1
  44. package/dist/logger/loggerUtils.d.ts +1 -1
  45. package/dist/logger/loggerUtils.d.ts.map +1 -1
  46. package/dist/logger/loggerUtils.js +9 -9
  47. package/dist/logger/loggerUtils.js.map +1 -1
  48. package/dist/package.json +3 -0
  49. package/dist/parseBundleAndExportFile.d.ts +2 -2
  50. package/dist/parseBundleAndExportFile.d.ts.map +1 -1
  51. package/dist/parseBundleAndExportFile.js +20 -15
  52. package/dist/parseBundleAndExportFile.js.map +1 -1
  53. package/dist/utils.d.ts +1 -1
  54. package/dist/utils.d.ts.map +1 -1
  55. package/dist/utils.js.map +1 -1
  56. package/lib/codeLoaderBundle.d.ts +46 -0
  57. package/lib/codeLoaderBundle.d.ts.map +1 -0
  58. package/lib/codeLoaderBundle.js +20 -0
  59. package/lib/codeLoaderBundle.js.map +1 -0
  60. package/lib/exportFile.d.ts +38 -0
  61. package/lib/exportFile.d.ts.map +1 -0
  62. package/lib/exportFile.js +92 -0
  63. package/lib/exportFile.js.map +1 -0
  64. package/lib/fakeUrlResolver.d.ts +15 -0
  65. package/lib/fakeUrlResolver.d.ts.map +1 -0
  66. package/lib/fakeUrlResolver.js +39 -0
  67. package/lib/fakeUrlResolver.js.map +1 -0
  68. package/lib/fluid-runner-alpha.d.ts +85 -0
  69. package/lib/fluid-runner-beta.d.ts +45 -0
  70. package/lib/fluid-runner-public.d.ts +45 -0
  71. package/lib/fluid-runner-untrimmed.d.ts +181 -0
  72. package/lib/fluidRunner.d.ts +11 -0
  73. package/lib/fluidRunner.d.ts.map +1 -0
  74. package/lib/fluidRunner.js +95 -0
  75. package/lib/fluidRunner.js.map +1 -0
  76. package/lib/index.d.ts +12 -0
  77. package/lib/index.d.ts.map +1 -0
  78. package/lib/index.js +12 -0
  79. package/lib/index.js.map +1 -0
  80. package/lib/logger/baseFileLogger.d.ts +28 -0
  81. package/lib/logger/baseFileLogger.d.ts.map +1 -0
  82. package/lib/logger/baseFileLogger.js +49 -0
  83. package/lib/logger/baseFileLogger.js.map +1 -0
  84. package/lib/logger/csvFileLogger.d.ts +18 -0
  85. package/lib/logger/csvFileLogger.d.ts.map +1 -0
  86. package/lib/logger/csvFileLogger.js +37 -0
  87. package/lib/logger/csvFileLogger.js.map +1 -0
  88. package/lib/logger/fileLogger.d.ts +44 -0
  89. package/lib/logger/fileLogger.d.ts.map +1 -0
  90. package/lib/logger/fileLogger.js +14 -0
  91. package/lib/logger/fileLogger.js.map +1 -0
  92. package/lib/logger/jsonFileLogger.d.ts +14 -0
  93. package/lib/logger/jsonFileLogger.d.ts.map +1 -0
  94. package/lib/logger/jsonFileLogger.js +21 -0
  95. package/lib/logger/jsonFileLogger.js.map +1 -0
  96. package/lib/logger/loggerUtils.d.ts +44 -0
  97. package/lib/logger/loggerUtils.d.ts.map +1 -0
  98. package/lib/logger/loggerUtils.js +91 -0
  99. package/lib/logger/loggerUtils.js.map +1 -0
  100. package/lib/parseBundleAndExportFile.d.ts +13 -0
  101. package/lib/parseBundleAndExportFile.d.ts.map +1 -0
  102. package/lib/parseBundleAndExportFile.js +66 -0
  103. package/lib/parseBundleAndExportFile.js.map +1 -0
  104. package/lib/tsdoc-metadata.json +11 -0
  105. package/lib/utils.d.ts +33 -0
  106. package/lib/utils.d.ts.map +1 -0
  107. package/lib/utils.js +76 -0
  108. package/lib/utils.js.map +1 -0
  109. package/package.json +71 -42
  110. package/src/codeLoaderBundle.ts +2 -2
  111. package/src/exportFile.ts +20 -11
  112. package/src/fakeUrlResolver.ts +2 -2
  113. package/src/fluidRunner.ts +16 -16
  114. package/src/index.ts +13 -7
  115. package/src/logger/baseFileLogger.ts +3 -1
  116. package/src/logger/csvFileLogger.ts +4 -2
  117. package/src/logger/fileLogger.ts +0 -2
  118. package/src/logger/jsonFileLogger.ts +2 -1
  119. package/src/logger/loggerUtils.ts +7 -4
  120. package/src/parseBundleAndExportFile.ts +18 -9
  121. package/src/utils.ts +2 -1
  122. package/tsconfig.bin.lint.json +9 -0
  123. package/tsconfig.cjs.json +7 -0
  124. package/tsconfig.json +2 -5
  125. package/bin/fluid-runner +0 -2
package/.eslintrc.cjs CHANGED
@@ -9,12 +9,27 @@ module.exports = {
9
9
  "prettier",
10
10
  ],
11
11
  parserOptions: {
12
- project: ["./tsconfig.json", "./src/test/tsconfig.json"],
12
+ project: [
13
+ "./tsconfig.json",
14
+ "./tsconfig.bin.lint.json",
15
+ "./src/test/tsconfig.json",
16
+ "./src/test/tsconfig.cjs.lint.json",
17
+ ],
13
18
  },
14
19
  rules: {
15
20
  "@typescript-eslint/no-non-null-assertion": "off",
16
21
  "@typescript-eslint/no-use-before-define": "off",
17
22
  "@typescript-eslint/strict-boolean-expressions": "off",
18
23
  "import/no-nodejs-modules": "off",
24
+ "unicorn/filename-case": [
25
+ "error",
26
+ {
27
+ cases: {
28
+ camelCase: true,
29
+ pascalCase: true,
30
+ },
31
+ ignore: ["fluid-runner", "sample-executable"],
32
+ },
33
+ ],
19
34
  },
20
35
  };
package/README.md CHANGED
@@ -27,7 +27,7 @@ and provide a [`IFluidFileConverter`](./src/codeLoaderBundle.ts) implementation
27
27
  ```typescript
28
28
  import { fluidRunner } from "@fluidframework/fluid-runner";
29
29
 
30
- fluidRunner({
30
+ await fluidRunner({
31
31
  /* IFluidFileConverter implementation here */
32
32
  });
33
33
  ```
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
+ // CJS is actually secondary; so, no report.
5
+ "apiReport": {
6
+ "enabled": false
7
+ }
8
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.esm.primary.json"
4
4
  }
@@ -1,17 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: fix violations and remove overrides
7
- "ae-forgotten-export": {
8
- "logLevel": "warning",
9
- "addToApiReportFile": true
10
- },
11
- "ae-unresolved-link": {
12
- "logLevel": "warning",
13
- "addToApiReportFile": true
14
- }
15
- }
16
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-base.esm.primary.json"
17
4
  }
@@ -7,16 +7,14 @@
7
7
  /// <reference types="node" />
8
8
 
9
9
  import { FluidObject } from '@fluidframework/core-interfaces';
10
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
11
- import { IContainer } from '@fluidframework/container-definitions';
10
+ import { ICodeDetailsLoader } from '@fluidframework/container-definitions/internal';
11
+ import { IContainer } from '@fluidframework/container-definitions/internal';
12
12
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
13
13
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
14
14
 
15
15
  // @internal
16
16
  export function createContainerAndExecute(localOdspSnapshot: string | Uint8Array, fluidFileConverter: IFluidFileConverter, logger: ITelemetryLoggerExt, options?: string, timeout?: number, disableNetworkFetch?: boolean): Promise<string>;
17
17
 
18
- // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "@fluidframework/fluid-runner" does not have an export "IFileLogger"
19
- //
20
18
  // @internal
21
19
  export function createLogger(filePath: string, options?: ITelemetryOptions): {
22
20
  logger: ITelemetryLoggerExt;
@@ -27,7 +25,7 @@ export function createLogger(filePath: string, options?: ITelemetryOptions): {
27
25
  export function exportFile(fluidFileConverter: IFluidFileConverter, inputFile: string, outputFile: string, telemetryFile: string, options?: string, telemetryOptions?: ITelemetryOptions, timeout?: number, disableNetworkFetch?: boolean): Promise<IExportFileResponse>;
28
26
 
29
27
  // @internal (undocumented)
30
- export function fluidRunner(fluidFileConverter?: IFluidFileConverter): void;
28
+ export function fluidRunner(fluidFileConverter?: IFluidFileConverter): Promise<void>;
31
29
 
32
30
  // @internal
33
31
  export function getSnapshotFileContent(filePath: string): string | Buffer;
@@ -40,12 +38,32 @@ export interface ICodeLoaderBundle {
40
38
  fluidExport: Promise<IFluidFileConverter>;
41
39
  }
42
40
 
43
- // Warning: (ae-forgotten-export) The symbol "IExportFileResponseSuccess" needs to be exported by the entry point index.d.ts
44
- // Warning: (ae-forgotten-export) The symbol "IExportFileResponseFailure" needs to be exported by the entry point index.d.ts
45
- //
46
41
  // @alpha (undocumented)
47
42
  export type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;
48
43
 
44
+ // @alpha (undocumented)
45
+ export interface IExportFileResponseFailure {
46
+ // (undocumented)
47
+ error?: any;
48
+ // (undocumented)
49
+ errorMessage: string;
50
+ // (undocumented)
51
+ eventName: string;
52
+ // (undocumented)
53
+ success: false;
54
+ }
55
+
56
+ // @alpha (undocumented)
57
+ export interface IExportFileResponseSuccess {
58
+ // (undocumented)
59
+ success: true;
60
+ }
61
+
62
+ // @internal
63
+ export interface IFileLogger extends ITelemetryBaseLogger {
64
+ close(): Promise<void>;
65
+ }
66
+
49
67
  // @alpha
50
68
  export interface IFluidFileConverter {
51
69
  execute(container: IContainer, options?: string): Promise<string>;
@@ -80,10 +98,6 @@ export function validateAndParseTelemetryOptions(format?: string, props?: (strin
80
98
  telemetryOptions: ITelemetryOptions;
81
99
  };
82
100
 
83
- // Warnings were encountered during analysis:
84
- //
85
- // src/logger/loggerUtils.ts:29:35 - (ae-forgotten-export) The symbol "IFileLogger" needs to be exported by the entry point index.d.ts
86
-
87
101
  // (No @packageDocumentation comment for this package)
88
102
 
89
103
  ```
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+
7
+ import { fluidRunner } from "@fluidframework/fluid-runner";
8
+ await fluidRunner();
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ICodeDetailsLoader, IContainer } from "@fluidframework/container-definitions";
6
- import { ITelemetryBaseLogger, FluidObject } from "@fluidframework/core-interfaces";
5
+ import { ICodeDetailsLoader, IContainer } from "@fluidframework/container-definitions/internal";
6
+ import { FluidObject, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  /**
8
8
  * Contract that defines the necessary exports for the bundle provided at runtime
9
9
  * For an example, see "src/test/sampleCodeLoaders/sampleCodeLoader.ts"
@@ -1 +1 @@
1
- {"version":3,"file":"codeLoaderBundle.d.ts","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEpF;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzE;;;OAGG;IACH,QAAQ,CAAC,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE9D;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,iBAAiB,CAG3E;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAQzE"}
1
+ {"version":3,"file":"codeLoaderBundle.d.ts","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEpF;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzE;;;OAGG;IACH,QAAQ,CAAC,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE9D;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,iBAAiB,CAG3E;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAQzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeLoaderBundle.js","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0CH;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAW;IAC7C,+DAA+D;IAC/D,OAAO,MAAM,EAAE,WAAW,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtE,CAAC;AAHD,gDAGC;AAED,SAAgB,oBAAoB,CAAC,GAAQ;IAC5C,+DAA+D;IAC/D,OAAO,CACN,GAAG,EAAE,aAAa;QAClB,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU;QACvC,GAAG,CAAC,OAAO;QACX,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CACjC,CAAC;AACH,CAAC;AARD,oDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions\";\nimport { ITelemetryBaseLogger, FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n * @internal\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n * @alpha\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
1
+ {"version":3,"file":"codeLoaderBundle.js","sourceRoot":"","sources":["../src/codeLoaderBundle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0CH;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAW;IAC7C,+DAA+D;IAC/D,OAAO,MAAM,EAAE,WAAW,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtE,CAAC;AAHD,gDAGC;AAED,SAAgB,oBAAoB,CAAC,GAAQ;IAC5C,+DAA+D;IAC/D,OAAO,CACN,GAAG,EAAE,aAAa;QAClB,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU;QACvC,GAAG,CAAC,OAAO;QACX,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CACjC,CAAC;AACH,CAAC;AARD,oDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICodeDetailsLoader, IContainer } from \"@fluidframework/container-definitions/internal\";\nimport { FluidObject, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\n\n/**\n * Contract that defines the necessary exports for the bundle provided at runtime\n * For an example, see \"src/test/sampleCodeLoaders/sampleCodeLoader.ts\"\n * @internal\n */\nexport interface ICodeLoaderBundle {\n\t/**\n\t * Fluid export of all the required objects and functions\n\t */\n\tfluidExport: Promise<IFluidFileConverter>;\n}\n\n/**\n * Instance that holds all the details for Fluid file conversion\n * @alpha\n */\nexport interface IFluidFileConverter {\n\t/**\n\t * Get code loader details to provide at Loader creation\n\t * @param logger - created logger object to pass to code loader\n\t */\n\tgetCodeLoader(logger: ITelemetryBaseLogger): Promise<ICodeDetailsLoader>;\n\n\t/**\n\t * Get scope object to provide at Loader creation\n\t * @param logger - created logger object to pass to scope object\n\t */\n\tgetScope?(logger: ITelemetryBaseLogger): Promise<FluidObject>;\n\n\t/**\n\t * Executes code on container and returns the result\n\t * @param container - container created by this application\n\t * @param options - additional options\n\t */\n\texecute(container: IContainer, options?: string): Promise<string>;\n}\n\n/**\n * Type cast to ensure necessary methods are present in the provided bundle\n * @param bundle - bundle provided to this application\n */\nexport function isCodeLoaderBundle(bundle: any): bundle is ICodeLoaderBundle {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn bundle?.fluidExport && typeof bundle.fluidExport === \"object\";\n}\n\nexport function isFluidFileConverter(obj: any): obj is IFluidFileConverter {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn (\n\t\tobj?.getCodeLoader &&\n\t\ttypeof obj.getCodeLoader === \"function\" &&\n\t\tobj.execute &&\n\t\ttypeof obj.execute === \"function\"\n\t);\n}\n"]}
@@ -3,16 +3,22 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
- import { IFluidFileConverter } from "./codeLoaderBundle";
7
- import { ITelemetryOptions } from "./logger/fileLogger";
6
+ import { IFluidFileConverter } from "./codeLoaderBundle.js";
7
+ import { ITelemetryOptions } from "./logger/fileLogger.js";
8
8
  /**
9
9
  * @alpha
10
10
  */
11
11
  export type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;
12
- interface IExportFileResponseSuccess {
12
+ /**
13
+ * @alpha
14
+ */
15
+ export interface IExportFileResponseSuccess {
13
16
  success: true;
14
17
  }
15
- interface IExportFileResponseFailure {
18
+ /**
19
+ * @alpha
20
+ */
21
+ export interface IExportFileResponseFailure {
16
22
  success: false;
17
23
  eventName: string;
18
24
  errorMessage: string;
@@ -29,5 +35,4 @@ export declare function exportFile(fluidFileConverter: IFluidFileConverter, inpu
29
35
  * @internal
30
36
  */
31
37
  export declare function createContainerAndExecute(localOdspSnapshot: string | Uint8Array, fluidFileConverter: IFluidFileConverter, logger: ITelemetryLoggerExt, options?: string, timeout?: number, disableNetworkFetch?: boolean): Promise<string>;
32
- export {};
33
38
  //# sourceMappingURL=exportFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.d.ts","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iCAAiC,CAAC;AAIxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG,0BAA0B,CAAC;AAE1F,UAAU,0BAA0B;IACnC,OAAO,EAAE,IAAI,CAAC;CACd;AAED,UAAU,0BAA0B;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAID;;;GAGG;AACH,wBAAsB,UAAU,CAC/B,kBAAkB,EAAE,mBAAmB,EACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,iBAAiB,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC9C,iBAAiB,EAAE,MAAM,GAAG,UAAU,EACtC,kBAAkB,EAAE,mBAAmB,EACvC,MAAM,EAAE,mBAAmB,EAC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C,MAAM,CAAC,CA0CjB"}
@@ -29,34 +29,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.createContainerAndExecute = exports.exportFile = void 0;
31
31
  const fs = __importStar(require("fs"));
32
- const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
33
- const container_definitions_1 = require("@fluidframework/container-definitions");
34
- const container_loader_1 = require("@fluidframework/container-loader");
35
- const odsp_driver_1 = require("@fluidframework/odsp-driver");
36
- const fakeUrlResolver_1 = require("./fakeUrlResolver");
37
- const utils_1 = require("./utils");
38
- const loggerUtils_1 = require("./logger/loggerUtils");
32
+ const internal_1 = require("@fluidframework/container-definitions/internal");
33
+ const internal_2 = require("@fluidframework/container-loader/internal");
34
+ const internal_3 = require("@fluidframework/odsp-driver/internal");
35
+ const internal_4 = require("@fluidframework/telemetry-utils/internal");
36
+ const fakeUrlResolver_js_1 = require("./fakeUrlResolver.js");
37
+ const loggerUtils_js_1 = require("./logger/loggerUtils.js");
38
+ const utils_js_1 = require("./utils.js");
39
39
  const clientArgsValidationError = "Client_ArgsValidationError";
40
40
  /**
41
41
  * Execute code on Container based on ODSP snapshot and write result to file
42
42
  * @internal
43
43
  */
44
44
  async function exportFile(fluidFileConverter, inputFile, outputFile, telemetryFile, options, telemetryOptions, timeout, disableNetworkFetch) {
45
- const telemetryArgError = (0, loggerUtils_1.getTelemetryFileValidationError)(telemetryFile);
45
+ const telemetryArgError = (0, loggerUtils_js_1.getTelemetryFileValidationError)(telemetryFile);
46
46
  if (telemetryArgError) {
47
47
  const eventName = clientArgsValidationError;
48
48
  return { success: false, eventName, errorMessage: telemetryArgError };
49
49
  }
50
- const { fileLogger, logger } = (0, loggerUtils_1.createLogger)(telemetryFile, telemetryOptions);
50
+ const { fileLogger, logger } = (0, loggerUtils_js_1.createLogger)(telemetryFile, telemetryOptions);
51
51
  try {
52
- return await telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
53
- const argsValidationError = (0, utils_1.getArgsValidationError)(inputFile, outputFile, timeout);
52
+ return await internal_4.PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
53
+ const argsValidationError = (0, utils_js_1.getArgsValidationError)(inputFile, outputFile, timeout);
54
54
  if (argsValidationError) {
55
55
  const eventName = clientArgsValidationError;
56
56
  logger.sendErrorEvent({ eventName, message: argsValidationError });
57
57
  return { success: false, eventName, errorMessage: argsValidationError };
58
58
  }
59
- fs.writeFileSync(outputFile, await createContainerAndExecute((0, utils_1.getSnapshotFileContent)(inputFile), fluidFileConverter, logger, options, timeout, disableNetworkFetch));
59
+ fs.writeFileSync(outputFile, await createContainerAndExecute((0, utils_js_1.getSnapshotFileContent)(inputFile), fluidFileConverter, logger, options, timeout, disableNetworkFetch));
60
60
  return { success: true };
61
61
  });
62
62
  }
@@ -82,9 +82,9 @@ async function createContainerAndExecute(localOdspSnapshot, fluidFileConverter,
82
82
  throw new Error("Network fetch is not allowed");
83
83
  };
84
84
  }
85
- const loader = new container_loader_1.Loader({
86
- urlResolver: new fakeUrlResolver_1.FakeUrlResolver(),
87
- documentServiceFactory: (0, odsp_driver_1.createLocalOdspDocumentServiceFactory)(localOdspSnapshot),
85
+ const loader = new internal_2.Loader({
86
+ urlResolver: new fakeUrlResolver_js_1.FakeUrlResolver(),
87
+ documentServiceFactory: (0, internal_3.createLocalOdspDocumentServiceFactory)(localOdspSnapshot),
88
88
  codeLoader: await fluidFileConverter.getCodeLoader(logger),
89
89
  scope: await fluidFileConverter.getScope?.(logger),
90
90
  logger,
@@ -92,10 +92,10 @@ async function createContainerAndExecute(localOdspSnapshot, fluidFileConverter,
92
92
  const container = await loader.resolve({
93
93
  url: "/fakeUrl/",
94
94
  headers: {
95
- [container_definitions_1.LoaderHeader.loadMode]: { opsBeforeReturn: "cached" },
95
+ [internal_1.LoaderHeader.loadMode]: { opsBeforeReturn: "cached" },
96
96
  },
97
97
  });
98
- return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
98
+ return internal_4.PerformanceEvent.timedExecAsync(logger, { eventName: "ExportFile" }, async () => {
99
99
  try {
100
100
  return await fluidFileConverter.execute(container, options);
101
101
  }
@@ -106,7 +106,7 @@ async function createContainerAndExecute(localOdspSnapshot, fluidFileConverter,
106
106
  };
107
107
  // eslint-disable-next-line unicorn/prefer-ternary
108
108
  if (timeout !== undefined) {
109
- return (0, utils_1.timeoutPromise)((resolve, reject) => {
109
+ return (0, utils_js_1.timeoutPromise)((resolve, reject) => {
110
110
  fn()
111
111
  .then((value) => resolve(value))
112
112
  .catch((error) => reject(error));
@@ -1 +1 @@
1
- {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qEAAwF;AACxF,iFAAqE;AACrE,uEAA0D;AAC1D,6DAAoF;AAEpF,uDAAoD;AACpD,mCAAyF;AAGzF,sDAAqF;AAmBrF,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAE/D;;;GAGG;AACI,KAAK,UAAU,UAAU,CAC/B,kBAAuC,EACvC,SAAiB,EACjB,UAAkB,EAClB,aAAqB,EACrB,OAAgB,EAChB,gBAAoC,EACpC,OAAgB,EAChB,mBAA6B;IAE7B,MAAM,iBAAiB,GAAG,IAAA,6CAA+B,EAAC,aAAa,CAAC,CAAC;IACzE,IAAI,iBAAiB,EAAE;QACtB,MAAM,SAAS,GAAG,yBAAyB,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;KACtE;IACD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAA,0BAAY,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAE7E,IAAI;QACH,OAAO,MAAM,kCAAgB,CAAC,cAAc,CAC3C,MAAM,E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;AAjDD,8DAiDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver\";\nimport { getSnapshotFileContent, timeoutPromise, getArgsValidationError } from \"./utils\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils\";\n/* eslint-enable import/no-internal-modules */\n\n/**\n * @alpha\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 * @internal\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 * @internal\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
+ {"version":3,"file":"exportFile.js","sourceRoot":"","sources":["../src/exportFile.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAEzB,6EAA8E;AAC9E,wEAAmE;AACnE,mEAA6F;AAE7F,uEAA4E;AAG5E,6DAAuD;AAGvD,4DAAwF;AACxF,yCAA4F;AAyB5F,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAE/D;;;GAGG;AACI,KAAK,UAAU,UAAU,CAC/B,kBAAuC,EACvC,SAAiB,EACjB,UAAkB,EAClB,aAAqB,EACrB,OAAgB,EAChB,gBAAoC,EACpC,OAAgB,EAChB,mBAA6B;IAE7B,MAAM,iBAAiB,GAAG,IAAA,gDAA+B,EAAC,aAAa,CAAC,CAAC;IACzE,IAAI,iBAAiB,EAAE;QACtB,MAAM,SAAS,GAAG,yBAAyB,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;KACtE;IACD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GA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AC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,OAAO,CAAC,CAAC;KACZ;SAAM;QACN,OAAO,EAAE,EAAE,CAAC;KACZ;AACF,CAAC;AAjDD,8DAiDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\n\nimport { LoaderHeader } from \"@fluidframework/container-definitions/internal\";\nimport { Loader } from \"@fluidframework/container-loader/internal\";\nimport { createLocalOdspDocumentServiceFactory } from \"@fluidframework/odsp-driver/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { PerformanceEvent } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { IFluidFileConverter } from \"./codeLoaderBundle.js\";\nimport { FakeUrlResolver } from \"./fakeUrlResolver.js\";\n/* eslint-disable import/no-internal-modules */\nimport { ITelemetryOptions } from \"./logger/fileLogger.js\";\nimport { createLogger, getTelemetryFileValidationError } from \"./logger/loggerUtils.js\";\nimport { getArgsValidationError, getSnapshotFileContent, timeoutPromise } from \"./utils.js\";\n/* eslint-enable import/no-internal-modules */\n\n/**\n * @alpha\n */\nexport type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;\n\n/**\n * @alpha\n */\nexport interface IExportFileResponseSuccess {\n\tsuccess: true;\n}\n\n/**\n * @alpha\n */\nexport interface 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 * @internal\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 * @internal\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"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
- import { IContainerPackageInfo, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
6
+ import { IContainerPackageInfo, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions/internal";
7
7
  /**
8
8
  * Fake URL resolver that returns hard coded values on every request
9
9
  * @internal
@@ -1 +1 @@
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
+ {"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,6CAA6C,CAAC;AAMrD;;;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 +1 @@
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,0CAA0C,CAAC;AAE3D;;;GAGG;AACH,MAAa,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;AAjCD,0CAiCC","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 = \"https://examplehost.com/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
+ {"version":3,"file":"fakeUrlResolver.js","sourceRoot":"","sources":["../src/fakeUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACjC,MAAM,OAAO,GAAG,0CAA0C,CAAC;AAE3D;;;GAGG;AACH,MAAa,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;AAjCD,0CAiCC","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/internal\";\nimport { IOdspResolvedUrl } from \"@fluidframework/odsp-driver-definitions/internal\";\n\nconst fakeId = \"FakeUrlResolver\";\nconst fakeUrl = \"https://examplehost.com/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,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import { FluidObject } from '@fluidframework/core-interfaces';
4
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
5
- import { IContainer } from '@fluidframework/container-definitions';
4
+ import { ICodeDetailsLoader } from '@fluidframework/container-definitions/internal';
5
+ import { IContainer } from '@fluidframework/container-definitions/internal';
6
6
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
7
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
8
8
 
@@ -25,14 +25,20 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
25
25
  */
26
26
  export declare type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;
27
27
 
28
- declare interface IExportFileResponseFailure {
28
+ /**
29
+ * @alpha
30
+ */
31
+ export declare interface IExportFileResponseFailure {
29
32
  success: false;
30
33
  eventName: string;
31
34
  errorMessage: string;
32
35
  error?: any;
33
36
  }
34
37
 
35
- declare interface IExportFileResponseSuccess {
38
+ /**
39
+ * @alpha
40
+ */
41
+ export declare interface IExportFileResponseSuccess {
36
42
  success: true;
37
43
  }
38
44
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import { FluidObject } from '@fluidframework/core-interfaces';
4
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
5
- import { IContainer } from '@fluidframework/container-definitions';
4
+ import { ICodeDetailsLoader } from '@fluidframework/container-definitions/internal';
5
+ import { IContainer } from '@fluidframework/container-definitions/internal';
6
6
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
7
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
8
8
 
@@ -26,16 +26,9 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
26
26
 
27
27
  /* Excluded from this release type: IExportFileResponse */
28
28
 
29
- declare interface IExportFileResponseFailure {
30
- success: false;
31
- eventName: string;
32
- errorMessage: string;
33
- error?: any;
34
- }
29
+ /* Excluded from this release type: IExportFileResponseFailure */
35
30
 
36
- declare interface IExportFileResponseSuccess {
37
- success: true;
38
- }
31
+ /* Excluded from this release type: IExportFileResponseSuccess */
39
32
 
40
33
  /* Excluded from this release type: IFileLogger */
41
34
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import { FluidObject } from '@fluidframework/core-interfaces';
4
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
5
- import { IContainer } from '@fluidframework/container-definitions';
4
+ import { ICodeDetailsLoader } from '@fluidframework/container-definitions/internal';
5
+ import { IContainer } from '@fluidframework/container-definitions/internal';
6
6
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
7
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
8
8
 
@@ -26,16 +26,9 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
26
26
 
27
27
  /* Excluded from this release type: IExportFileResponse */
28
28
 
29
- declare interface IExportFileResponseFailure {
30
- success: false;
31
- eventName: string;
32
- errorMessage: string;
33
- error?: any;
34
- }
29
+ /* Excluded from this release type: IExportFileResponseFailure */
35
30
 
36
- declare interface IExportFileResponseSuccess {
37
- success: true;
38
- }
31
+ /* Excluded from this release type: IExportFileResponseSuccess */
39
32
 
40
33
  /* Excluded from this release type: IFileLogger */
41
34
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import { FluidObject } from '@fluidframework/core-interfaces';
4
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
5
- import { IContainer } from '@fluidframework/container-definitions';
4
+ import { ICodeDetailsLoader } from '@fluidframework/container-definitions/internal';
5
+ import { IContainer } from '@fluidframework/container-definitions/internal';
6
6
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
7
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
8
8
 
@@ -42,7 +42,7 @@ export declare function exportFile(fluidFileConverter: IFluidFileConverter, inpu
42
42
  * @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
43
43
  * @internal
44
44
  */
45
- export declare function fluidRunner(fluidFileConverter?: IFluidFileConverter): void;
45
+ export declare function fluidRunner(fluidFileConverter?: IFluidFileConverter): Promise<void>;
46
46
 
47
47
  /**
48
48
  * Get the ODSP snapshot file content
@@ -76,14 +76,20 @@ export declare interface ICodeLoaderBundle {
76
76
  */
77
77
  export declare type IExportFileResponse = IExportFileResponseSuccess | IExportFileResponseFailure;
78
78
 
79
- declare interface IExportFileResponseFailure {
79
+ /**
80
+ * @alpha
81
+ */
82
+ export declare interface IExportFileResponseFailure {
80
83
  success: false;
81
84
  eventName: string;
82
85
  errorMessage: string;
83
86
  error?: any;
84
87
  }
85
88
 
86
- declare interface IExportFileResponseSuccess {
89
+ /**
90
+ * @alpha
91
+ */
92
+ export declare interface IExportFileResponseSuccess {
87
93
  success: true;
88
94
  }
89
95
 
@@ -91,7 +97,7 @@ declare interface IExportFileResponseSuccess {
91
97
  * Contract for logger that writes telemetry to a file
92
98
  * @internal
93
99
  */
94
- declare interface IFileLogger extends ITelemetryBaseLogger {
100
+ export declare interface IFileLogger extends ITelemetryBaseLogger {
95
101
  /**
96
102
  * This method acts as a "dispose" and should be explicitly called at the end of execution
97
103
  */
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IFluidFileConverter } from "./codeLoaderBundle";
5
+ import { IFluidFileConverter } from "./codeLoaderBundle.js";
6
6
  /**
7
7
  * @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
8
8
  * @internal
9
9
  */
10
- export declare function fluidRunner(fluidFileConverter?: IFluidFileConverter): void;
10
+ export declare function fluidRunner(fluidFileConverter?: IFluidFileConverter): Promise<void>;
11
11
  //# sourceMappingURL=fluidRunner.d.ts.map
@@ -1 +1 @@
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;;;GAGG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,QAqHnE"}
1
+ {"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAO5D;;;GAGG;AACH,wBAAsB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkHzF"}