@microsoft/sp-module-interfaces 1.20.2 → 1.21.0-beta.2

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 (159) hide show
  1. package/dist/index-internal-beta.d.ts +59 -1
  2. package/dist/index-internal-public.d.ts +53 -1
  3. package/dist/index-internal.d.ts +760 -15
  4. package/lib-commonjs/index.js +31 -28
  5. package/lib-commonjs/manifestHelpers.js +22 -19
  6. package/lib-commonjs/manifestSchemaValidator.js +100 -63
  7. package/lib-commonjs/manifestSchemas/IAdaptiveCardExtensionManifest.js +5 -2
  8. package/lib-commonjs/manifestSchemas/IClientSideApplicationManifest.js +5 -2
  9. package/lib-commonjs/manifestSchemas/IClientSideAssemblyManifest.js +5 -2
  10. package/lib-commonjs/manifestSchemas/IClientSideComponentLoaderConfiguration.js +11 -3
  11. package/lib-commonjs/manifestSchemas/IClientSideComponentManifest.js +5 -2
  12. package/lib-commonjs/manifestSchemas/IClientSideExtensionManifest.js +5 -2
  13. package/lib-commonjs/manifestSchemas/IClientSideLibraryManifest.js +5 -2
  14. package/lib-commonjs/manifestSchemas/IClientSideManifestBase.js +10 -3
  15. package/lib-commonjs/manifestSchemas/IClientSideMultiVersionManifest.js +5 -2
  16. package/lib-commonjs/manifestSchemas/IClientSideWebPartManifest.js +62 -67
  17. package/lib-commonjs/manifestSchemas/ICommandSetExtensionManifest.js +5 -2
  18. package/lib-commonjs/manifestSchemas/IPrefabAppManifest.js +6 -0
  19. package/lib-commonjs/manifestSchemas/ManifestType.js +18 -13
  20. package/lib-commonjs/manifestSchemas/examples/application_1.manifest.js +24 -6
  21. package/lib-commonjs/manifestSchemas/examples/application_2.manifest.js +28 -7
  22. package/lib-commonjs/manifestSchemas/examples/application_3.manifest.js +22 -5
  23. package/lib-commonjs/manifestSchemas/examples/assembly_1.manifest.js +18 -4
  24. package/lib-commonjs/manifestSchemas/examples/commandSet_1.manifest.js +15 -3
  25. package/lib-commonjs/manifestSchemas/examples/extension_1.manifest.js +15 -3
  26. package/lib-commonjs/manifestSchemas/examples/extension_2.manifest.js +15 -3
  27. package/lib-commonjs/manifestSchemas/examples/extension_3.manifest.js +15 -3
  28. package/lib-commonjs/manifestSchemas/examples/extension_4.manifest.js +15 -3
  29. package/lib-commonjs/manifestSchemas/examples/library_1.manifest.js +18 -4
  30. package/lib-commonjs/manifestSchemas/examples/multi-version_1.manifest.js +24 -6
  31. package/lib-commonjs/manifestSchemas/examples/prefab_1.manifest.js +354 -0
  32. package/lib-commonjs/manifestSchemas/examples/prefab_2.manifest.js +391 -0
  33. package/lib-commonjs/manifestSchemas/examples/prefabapp.manifest.json +379 -0
  34. package/lib-commonjs/manifestSchemas/examples/webpart_1.manifest.js +24 -6
  35. package/lib-commonjs/manifestSchemas/examples/webpart_2.manifest.js +47 -12
  36. package/lib-commonjs/manifestSchemas/jsonSchemas/adaptive-card-extension-manifest.schema.json +8 -0
  37. package/lib-commonjs/manifestSchemas/jsonSchemas/client-side-component-manifest.schema.json +5 -2
  38. package/lib-commonjs/manifestSchemas/jsonSchemas/client-side-web-part-manifest.schema.json +23 -0
  39. package/lib-commonjs/manifestSchemas/jsonSchemas/prefab-app-manifest.schema.json +176 -0
  40. package/lib-commonjs/manifestSchemas/remote/draft-04.schema.json +137 -0
  41. package/lib-commonjs/manifestSchemas/remote/site-design-script-actions.schema.json +1158 -0
  42. package/{lib-commonjs → lib-dts}/index.d.ts +1 -0
  43. package/{lib-commonjs → lib-dts}/manifestSchemaValidator.d.ts +4 -1
  44. package/{lib-commonjs → lib-dts}/manifestSchemas/IAdaptiveCardExtensionManifest.d.ts +6 -0
  45. package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideComponentManifest.d.ts +1 -1
  46. package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideWebPartManifest.d.ts +33 -0
  47. package/lib-dts/manifestSchemas/IPrefabAppManifest.d.ts +255 -0
  48. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/application_1.manifest.d.ts +1 -1
  49. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/application_2.manifest.d.ts +1 -1
  50. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/application_3.manifest.d.ts +1 -1
  51. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/assembly_1.manifest.d.ts +1 -1
  52. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/commandSet_1.manifest.d.ts +1 -1
  53. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/extension_1.manifest.d.ts +1 -1
  54. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/extension_2.manifest.d.ts +1 -1
  55. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/extension_3.manifest.d.ts +1 -1
  56. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/extension_4.manifest.d.ts +1 -1
  57. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/library_1.manifest.d.ts +1 -1
  58. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/multi-version_1.manifest.d.ts +1 -1
  59. package/lib-dts/manifestSchemas/examples/prefab_1.manifest.d.ts +4 -0
  60. package/lib-dts/manifestSchemas/examples/prefab_2.manifest.d.ts +4 -0
  61. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/webpart_1.manifest.d.ts +1 -1
  62. package/{lib-commonjs → lib-dts}/manifestSchemas/examples/webpart_2.manifest.d.ts +1 -1
  63. package/{dist → lib-dts}/tsdoc-metadata.json +1 -1
  64. package/lib-esm/index.js +15 -0
  65. package/lib-esm/manifestHelpers.js +21 -0
  66. package/lib-esm/manifestSchemaValidator.js +135 -0
  67. package/lib-esm/manifestSchemas/IAdaptiveCardExtensionManifest.js +9 -0
  68. package/lib-esm/manifestSchemas/IClientSideApplicationManifest.js +5 -0
  69. package/lib-esm/manifestSchemas/IClientSideAssemblyManifest.js +7 -0
  70. package/lib-esm/manifestSchemas/IClientSideComponentLoaderConfiguration.js +17 -0
  71. package/lib-esm/manifestSchemas/IClientSideComponentManifest.js +27 -0
  72. package/lib-esm/manifestSchemas/IClientSideExtensionManifest.js +7 -0
  73. package/lib-esm/manifestSchemas/IClientSideLibraryManifest.js +7 -0
  74. package/lib-esm/manifestSchemas/IClientSideManifestBase.js +7 -0
  75. package/lib-esm/manifestSchemas/IClientSideMultiVersionManifest.js +25 -0
  76. package/lib-esm/manifestSchemas/IClientSideWebPartManifest.js +62 -0
  77. package/lib-esm/manifestSchemas/ICommandSetExtensionManifest.js +8 -0
  78. package/lib-esm/manifestSchemas/IPrefabAppManifest.js +7 -0
  79. package/lib-esm/manifestSchemas/ManifestType.js +15 -0
  80. package/lib-esm/manifestSchemas/examples/application.manifest.json +346 -0
  81. package/lib-esm/manifestSchemas/examples/application_1.manifest.js +344 -0
  82. package/lib-esm/manifestSchemas/examples/application_2.manifest.js +47 -0
  83. package/lib-esm/manifestSchemas/examples/application_3.manifest.js +42 -0
  84. package/lib-esm/manifestSchemas/examples/assembly.manifest.json +331 -0
  85. package/lib-esm/manifestSchemas/examples/assembly_1.manifest.js +336 -0
  86. package/lib-esm/manifestSchemas/examples/commandSet_1.manifest.js +42 -0
  87. package/lib-esm/manifestSchemas/examples/commandset.manifest.json +38 -0
  88. package/lib-esm/manifestSchemas/examples/extension.manifest.json +20 -0
  89. package/lib-esm/manifestSchemas/examples/extension_1.manifest.js +25 -0
  90. package/lib-esm/manifestSchemas/examples/extension_2.manifest.js +24 -0
  91. package/lib-esm/manifestSchemas/examples/extension_3.manifest.js +23 -0
  92. package/lib-esm/manifestSchemas/examples/extension_4.manifest.js +23 -0
  93. package/lib-esm/manifestSchemas/examples/library.manifest.json +330 -0
  94. package/lib-esm/manifestSchemas/examples/library_1.manifest.js +335 -0
  95. package/lib-esm/manifestSchemas/examples/multi-version_1.manifest.js +673 -0
  96. package/lib-esm/manifestSchemas/examples/multi-version_1.manifest.json +336 -0
  97. package/lib-esm/manifestSchemas/examples/prefab_1.manifest.js +344 -0
  98. package/lib-esm/manifestSchemas/examples/prefab_2.manifest.js +381 -0
  99. package/lib-esm/manifestSchemas/examples/prefabapp.manifest.json +379 -0
  100. package/lib-esm/manifestSchemas/examples/webpart.manifest.json +380 -0
  101. package/lib-esm/manifestSchemas/examples/webpart_1.manifest.js +350 -0
  102. package/lib-esm/manifestSchemas/examples/webpart_2.manifest.js +388 -0
  103. package/lib-esm/manifestSchemas/jsonSchemas/adaptive-card-extension-manifest.schema.json +230 -0
  104. package/lib-esm/manifestSchemas/jsonSchemas/any-value.schema.json +8 -0
  105. package/lib-esm/manifestSchemas/jsonSchemas/client-side-application-manifest.schema.json +138 -0
  106. package/lib-esm/manifestSchemas/jsonSchemas/client-side-assembly-manifest.schema.json +45 -0
  107. package/lib-esm/manifestSchemas/jsonSchemas/client-side-component-loader-configuration.schema.json +273 -0
  108. package/lib-esm/manifestSchemas/jsonSchemas/client-side-component-manifest.schema.json +131 -0
  109. package/lib-esm/manifestSchemas/jsonSchemas/client-side-extension-manifest.schema.json +61 -0
  110. package/lib-esm/manifestSchemas/jsonSchemas/client-side-library-manifest.schema.json +39 -0
  111. package/lib-esm/manifestSchemas/jsonSchemas/client-side-manifest-base.schema.json +25 -0
  112. package/lib-esm/manifestSchemas/jsonSchemas/client-side-multi-version-manifest.schema.json +118 -0
  113. package/lib-esm/manifestSchemas/jsonSchemas/client-side-web-part-manifest.schema.json +348 -0
  114. package/lib-esm/manifestSchemas/jsonSchemas/command-set-extension-manifest.schema.json +81 -0
  115. package/lib-esm/manifestSchemas/jsonSchemas/guid.schema.json +6 -0
  116. package/lib-esm/manifestSchemas/jsonSchemas/localized-string.schema.json +33 -0
  117. package/lib-esm/manifestSchemas/jsonSchemas/prefab-app-manifest.schema.json +176 -0
  118. package/lib-esm/manifestSchemas/jsonSchemas/semver.schema.json +8 -0
  119. package/lib-esm/manifestSchemas/remote/draft-04.schema.json +137 -0
  120. package/lib-esm/manifestSchemas/remote/site-design-script-actions.schema.json +1158 -0
  121. package/package.json +32 -11
  122. package/lib-commonjs/index.d.ts.map +0 -1
  123. package/lib-commonjs/manifestHelpers.d.ts.map +0 -1
  124. package/lib-commonjs/manifestSchemaValidator.d.ts.map +0 -1
  125. package/lib-commonjs/manifestSchemas/IAdaptiveCardExtensionManifest.d.ts.map +0 -1
  126. package/lib-commonjs/manifestSchemas/IClientSideApplicationManifest.d.ts.map +0 -1
  127. package/lib-commonjs/manifestSchemas/IClientSideAssemblyManifest.d.ts.map +0 -1
  128. package/lib-commonjs/manifestSchemas/IClientSideComponentLoaderConfiguration.d.ts.map +0 -1
  129. package/lib-commonjs/manifestSchemas/IClientSideComponentManifest.d.ts.map +0 -1
  130. package/lib-commonjs/manifestSchemas/IClientSideExtensionManifest.d.ts.map +0 -1
  131. package/lib-commonjs/manifestSchemas/IClientSideLibraryManifest.d.ts.map +0 -1
  132. package/lib-commonjs/manifestSchemas/IClientSideManifestBase.d.ts.map +0 -1
  133. package/lib-commonjs/manifestSchemas/IClientSideMultiVersionManifest.d.ts.map +0 -1
  134. package/lib-commonjs/manifestSchemas/IClientSideWebPartManifest.d.ts.map +0 -1
  135. package/lib-commonjs/manifestSchemas/ICommandSetExtensionManifest.d.ts.map +0 -1
  136. package/lib-commonjs/manifestSchemas/ManifestType.d.ts.map +0 -1
  137. package/lib-commonjs/manifestSchemas/examples/application_1.manifest.d.ts.map +0 -1
  138. package/lib-commonjs/manifestSchemas/examples/application_2.manifest.d.ts.map +0 -1
  139. package/lib-commonjs/manifestSchemas/examples/application_3.manifest.d.ts.map +0 -1
  140. package/lib-commonjs/manifestSchemas/examples/assembly_1.manifest.d.ts.map +0 -1
  141. package/lib-commonjs/manifestSchemas/examples/commandSet_1.manifest.d.ts.map +0 -1
  142. package/lib-commonjs/manifestSchemas/examples/extension_1.manifest.d.ts.map +0 -1
  143. package/lib-commonjs/manifestSchemas/examples/extension_2.manifest.d.ts.map +0 -1
  144. package/lib-commonjs/manifestSchemas/examples/extension_3.manifest.d.ts.map +0 -1
  145. package/lib-commonjs/manifestSchemas/examples/extension_4.manifest.d.ts.map +0 -1
  146. package/lib-commonjs/manifestSchemas/examples/library_1.manifest.d.ts.map +0 -1
  147. package/lib-commonjs/manifestSchemas/examples/multi-version_1.manifest.d.ts.map +0 -1
  148. package/lib-commonjs/manifestSchemas/examples/webpart_1.manifest.d.ts.map +0 -1
  149. package/lib-commonjs/manifestSchemas/examples/webpart_2.manifest.d.ts.map +0 -1
  150. /package/{lib-commonjs → lib-dts}/manifestHelpers.d.ts +0 -0
  151. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideApplicationManifest.d.ts +0 -0
  152. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideAssemblyManifest.d.ts +0 -0
  153. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideComponentLoaderConfiguration.d.ts +0 -0
  154. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideExtensionManifest.d.ts +0 -0
  155. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideLibraryManifest.d.ts +0 -0
  156. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideManifestBase.d.ts +0 -0
  157. /package/{lib-commonjs → lib-dts}/manifestSchemas/IClientSideMultiVersionManifest.d.ts +0 -0
  158. /package/{lib-commonjs → lib-dts}/manifestSchemas/ICommandSetExtensionManifest.d.ts +0 -0
  159. /package/{lib-commonjs → lib-dts}/manifestSchemas/ManifestType.d.ts +0 -0
@@ -1,29 +1,32 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./manifestSchemas/IClientSideApplicationManifest"), exports);
18
- __exportStar(require("./manifestSchemas/IClientSideAssemblyManifest"), exports);
19
- __exportStar(require("./manifestSchemas/IClientSideComponentLoaderConfiguration"), exports);
20
- __exportStar(require("./manifestSchemas/IClientSideComponentManifest"), exports);
21
- __exportStar(require("./manifestSchemas/IClientSideExtensionManifest"), exports);
22
- __exportStar(require("./manifestSchemas/IClientSideLibraryManifest"), exports);
23
- __exportStar(require("./manifestSchemas/IClientSideManifestBase"), exports);
24
- __exportStar(require("./manifestSchemas/IClientSideMultiVersionManifest"), exports);
25
- __exportStar(require("./manifestSchemas/IClientSideWebPartManifest"), exports);
26
- __exportStar(require("./manifestSchemas/ICommandSetExtensionManifest"), exports);
27
- __exportStar(require("./manifestSchemas/ManifestType"), exports);
28
- __exportStar(require("./manifestSchemas/IAdaptiveCardExtensionManifest"), exports);
29
- //# sourceMappingURL=index.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./manifestSchemas/IClientSideApplicationManifest"), exports);
6
+ _export_star(require("./manifestSchemas/IClientSideAssemblyManifest"), exports);
7
+ _export_star(require("./manifestSchemas/IClientSideComponentLoaderConfiguration"), exports);
8
+ _export_star(require("./manifestSchemas/IClientSideComponentManifest"), exports);
9
+ _export_star(require("./manifestSchemas/IClientSideExtensionManifest"), exports);
10
+ _export_star(require("./manifestSchemas/IClientSideLibraryManifest"), exports);
11
+ _export_star(require("./manifestSchemas/IClientSideManifestBase"), exports);
12
+ _export_star(require("./manifestSchemas/IClientSideMultiVersionManifest"), exports);
13
+ _export_star(require("./manifestSchemas/IClientSideWebPartManifest"), exports);
14
+ _export_star(require("./manifestSchemas/ICommandSetExtensionManifest"), exports);
15
+ _export_star(require("./manifestSchemas/ManifestType"), exports);
16
+ _export_star(require("./manifestSchemas/IAdaptiveCardExtensionManifest"), exports);
17
+ _export_star(require("./manifestSchemas/IPrefabAppManifest"), exports);
18
+ function _export_star(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
28
+ });
29
+ return from;
30
+ }
31
+
32
+ //#sourceMappingUrl=./index.js.map
@@ -1,29 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPath = exports.isLocalizedPath = exports.isMultiVersionManifest = void 0;
4
- /**
5
- * Identifies if a component manifest is a multi-version manifest.
6
- * @param manifest - The manifest for a component, which may have multiple versions
7
- * @returns If the manifest has multiple versions
8
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ isLocalizedPath: function() {
13
+ return isLocalizedPath;
14
+ },
15
+ isMultiVersionManifest: function() {
16
+ return isMultiVersionManifest;
17
+ },
18
+ isPath: function() {
19
+ return isPath;
20
+ }
21
+ });
9
22
  function isMultiVersionManifest(manifest) {
10
23
  return !!manifest.versions;
11
24
  }
12
- exports.isMultiVersionManifest = isMultiVersionManifest;
13
- /**
14
- * @param config - The module loader configuration for the module.
15
- * @returns If the module loads as a localized path.
16
- */
17
25
  function isLocalizedPath(config) {
18
26
  return config.type === 'localizedPath';
19
27
  }
20
- exports.isLocalizedPath = isLocalizedPath;
21
- /**
22
- * @param config - The module loader configuration for the module.
23
- * @returns If the module loads as a non-localized path.
24
- */
25
28
  function isPath(config) {
26
29
  return config.type === 'path';
27
30
  }
28
- exports.isPath = isPath;
29
- //# sourceMappingURL=manifestHelpers.js.map
31
+
32
+ //#sourceMappingUrl=./manifestHelpers.js.map
@@ -1,47 +1,54 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ default: function() {
13
+ return ManifestValidator;
14
+ },
15
+ zSchemaOptions: function() {
16
+ return zSchemaOptions;
7
17
  }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
18
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.zSchemaOptions = void 0;
27
- exports.ZSchema = require("z-schema");
28
- // @todo 264263 - utilize the schema validator in sp-build-common
29
- const fs = __importStar(require("fs"));
30
- const os_1 = require("os");
31
- const path = __importStar(require("path"));
19
+ const _zschema = /*#__PURE__*/ _interop_require_default(require("z-schema"));
20
+ const _nodecorelibrary = require("@rushstack/node-core-library");
21
+ const _clientsidecomponentmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-component-manifest.schema.json"));
22
+ const _clientsideapplicationmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-application-manifest.schema.json"));
23
+ const _prefabappmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/prefab-app-manifest.schema.json"));
24
+ const _clientsidewebpartmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-web-part-manifest.schema.json"));
25
+ const _commandsetextensionmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/command-set-extension-manifest.schema.json"));
26
+ const _clientsideextensionmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-extension-manifest.schema.json"));
27
+ const _clientsidelibrarymanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-library-manifest.schema.json"));
28
+ const _clientsideassemblymanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-assembly-manifest.schema.json"));
29
+ const _clientsidemultiversionmanifestschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/jsonSchemas/client-side-multi-version-manifest.schema.json"));
30
+ const _sitedesignscriptactionsschemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/remote/site-design-script-actions.schema.json"));
31
+ const _draft04schemajson = /*#__PURE__*/ _interop_require_default(require("./manifestSchemas/remote/draft-04.schema.json"));
32
+ function _interop_require_default(obj) {
33
+ return obj && obj.__esModule ? obj : {
34
+ default: obj
35
+ };
36
+ }
32
37
  // Discover the schema files
33
- const schemasDirectory = path.join(__dirname, 'manifestSchemas', 'jsonSchemas');
34
- const schemaFiles = fs.readdirSync(schemasDirectory);
35
- const schemas = schemaFiles.map((schemaFile) => require(path.join(schemasDirectory, schemaFile)));
36
- const manifestSchema = require('./manifestSchemas/jsonSchemas/client-side-component-manifest.schema.json');
37
- const applicationSchema = require('./manifestSchemas/jsonSchemas/client-side-application-manifest.schema.json');
38
- const webPartSchema = require('./manifestSchemas/jsonSchemas/client-side-web-part-manifest.schema.json');
39
- const commandSetSchema = require('./manifestSchemas/jsonSchemas/command-set-extension-manifest.schema.json');
40
- const extensionSchema = require('./manifestSchemas/jsonSchemas/client-side-extension-manifest.schema.json');
41
- const librarySchema = require('./manifestSchemas/jsonSchemas/client-side-library-manifest.schema.json');
42
- const assemblySchema = require('./manifestSchemas/jsonSchemas/client-side-assembly-manifest.schema.json');
43
- const multiVersionSchema = require('./manifestSchemas/jsonSchemas/client-side-multi-version-manifest.schema.json');
44
- exports.zSchemaOptions = {
38
+ const schemasDirectory = `${__dirname}/manifestSchemas/jsonSchemas`;
39
+ const schemaFiles = _nodecorelibrary.FileSystem.readFolderItemNames(schemasDirectory);
40
+ const schemas = schemaFiles.map((schemaFile)=>require(`${schemasDirectory}/${schemaFile}`));
41
+ const SITE_SCRIPTS_SCHEMA_URL = 'https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json';
42
+ const DRAFT_07_SCHEMA_URL = 'http://json-schema.org/draft-07/schema#';
43
+ const siteScriptsSchemaPromise = fetch(SITE_SCRIPTS_SCHEMA_URL).then((response)=>{
44
+ return response.text();
45
+ }).catch((error)=>{
46
+ // eslint-disable-next-line no-console
47
+ console.error(`Failed to fetch remote schema: ${error}`);
48
+ // fallback to local copy
49
+ return JSON.stringify(_sitedesignscriptactionsschemajson.default);
50
+ });
51
+ const zSchemaOptions = {
45
52
  breakOnFirstError: true,
46
53
  forceAdditional: true,
47
54
  forceItems: true,
@@ -51,56 +58,86 @@ exports.zSchemaOptions = {
51
58
  noTypeless: true,
52
59
  noEmptyStrings: true
53
60
  };
54
- const schemaValidator = new exports.ZSchema(exports.zSchemaOptions);
55
- schemaValidator.validateSchema(schemas);
61
+ const schemaValidator = new _zschema.default(zSchemaOptions);
62
+ const draft07ValidationOptions = {
63
+ strictMode: false,
64
+ ignoreUnresolvableReferences: true,
65
+ ignoreUnknownFormats: true
66
+ };
67
+ //
68
+ // this one is needed for the site scripts reference.
69
+ // We're faking draft-07 schema with draft-04 schema as z-schema doesn't support draft-07
70
+ //
71
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
+ schemaValidator.setRemoteReference(DRAFT_07_SCHEMA_URL, _draft04schemajson.default, draft07ValidationOptions);
73
+ siteScriptsSchemaPromise.then((remoteSchema)=>{
74
+ // ZSchema typedef doesn't contain setRemoteReference method. But it does exist in the implementation and referenced in the documentation.
75
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+ schemaValidator.setRemoteReference(SITE_SCRIPTS_SCHEMA_URL, JSON.parse(remoteSchema), {
77
+ strictMode: false,
78
+ ignoreUnresolvableReferences: true
79
+ });
80
+ schemaValidator.validateSchema(schemas);
81
+ }).catch((error)=>{
82
+ // swallowing the error here
83
+ });
56
84
  class ManifestValidator {
85
+ static registerRemoteSchemaReferences() {
86
+ return siteScriptsSchemaPromise.then(()=>{
87
+ // no-op;
88
+ }).catch(()=>{
89
+ // no-op;
90
+ });
91
+ }
57
92
  static validateApplicationManifest(manifest) {
58
- return ManifestValidator._validateManifest(manifest, applicationSchema);
93
+ return ManifestValidator._validateManifest(manifest, _clientsideapplicationmanifestschemajson.default);
94
+ }
95
+ static validatePrefabAppManifest(manifest) {
96
+ return ManifestValidator._validateManifest(manifest, _prefabappmanifestschemajson.default);
59
97
  }
60
98
  static validateCommandSetManifest(manifest) {
61
- return ManifestValidator._validateManifest(manifest, commandSetSchema);
99
+ return ManifestValidator._validateManifest(manifest, _commandsetextensionmanifestschemajson.default);
62
100
  }
63
101
  static validateExtensionManifest(manifest) {
64
- return ManifestValidator._validateManifest(manifest, extensionSchema);
102
+ return ManifestValidator._validateManifest(manifest, _clientsideextensionmanifestschemajson.default);
65
103
  }
66
- static validateWebPartManifest(
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
+ static validateWebPartManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
68
105
  manifest) {
69
- return ManifestValidator._validateManifest(manifest, webPartSchema);
106
+ return ManifestValidator._validateManifest(manifest, _clientsidewebpartmanifestschemajson.default);
70
107
  }
71
108
  static validateLibraryManifest(manifest) {
72
- return ManifestValidator._validateManifest(manifest, librarySchema);
109
+ return ManifestValidator._validateManifest(manifest, _clientsidelibrarymanifestschemajson.default);
73
110
  }
74
111
  static validateAssemblyManifest(manifest) {
75
- return ManifestValidator._validateManifest(manifest, assemblySchema);
112
+ return ManifestValidator._validateManifest(manifest, _clientsideassemblymanifestschemajson.default);
76
113
  }
77
- static validateMultiVersionManifest(
78
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
+ static validateMultiVersionManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
79
115
  manifest) {
80
- return ManifestValidator._validateManifest(manifest, multiVersionSchema);
116
+ return ManifestValidator._validateManifest(manifest, _clientsidemultiversionmanifestschemajson.default);
81
117
  }
82
118
  static validateManifest(manifest) {
83
- return ManifestValidator._validateManifest(manifest, manifestSchema);
119
+ return ManifestValidator._validateManifest(manifest, _clientsidecomponentmanifestschemajson.default);
84
120
  }
85
121
  static extractInnerErrorMessages(errors) {
86
- const printZSchemaError = (error) => {
122
+ const printZSchemaError = (error)=>{
87
123
  let innerErrors = [];
88
- (error.inner || []).forEach((innerErr) => {
124
+ (error.inner || []).forEach((innerErr)=>{
89
125
  innerErrors = innerErrors.concat(printZSchemaError(innerErr));
90
126
  });
91
- return [`(${error.path}) ${error.message}`].concat(innerErrors);
127
+ return [
128
+ `(${error.path}) ${error.message}`
129
+ ].concat(innerErrors);
92
130
  };
93
131
  let errorList = [];
94
- errors.map((error) => {
132
+ errors.map((error)=>{
95
133
  errorList = errorList.concat(printZSchemaError(error));
96
134
  });
97
135
  return errorList;
98
136
  }
99
137
  static getFormattedErrorMessage(errors) {
100
- return this.extractInnerErrorMessages(errors).join(os_1.EOL);
138
+ return this.extractInnerErrorMessages(errors).join('\n');
101
139
  }
102
- static _validateManifest(
103
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
140
+ static _validateManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
104
141
  manifest, schema) {
105
142
  if (!schema) {
106
143
  throw new Error('Unable to find the manifest schema.');
@@ -115,5 +152,5 @@ class ManifestValidator {
115
152
  };
116
153
  }
117
154
  }
118
- exports.default = ManifestValidator;
119
- //# sourceMappingURL=manifestSchemaValidator.js.map
155
+
156
+ //#sourceMappingUrl=./manifestSchemaValidator.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IAdaptiveCardExtensionManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IAdaptiveCardExtensionManifest.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideApplicationManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideApplicationManifest.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideAssemblyManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideAssemblyManifest.js.map
@@ -1,3 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideComponentLoaderConfiguration.js.map
1
+ /**
2
+ * This interface describes how a client-side component is to be loaded and initialized by a SharePoint client
3
+ * framework. It contains all data for loading an entrypoint script and its dependency scripts.
4
+ *
5
+ * @beta
6
+ */ "use strict";
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+
11
+ //#sourceMappingUrl=./IClientSideComponentLoaderConfiguration.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideComponentManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideComponentManifest.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideExtensionManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideExtensionManifest.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideLibraryManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideLibraryManifest.js.map
@@ -1,3 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideManifestBase.js.map
1
+ /**
2
+ * This interface defines members that are common between all deployable manifests.
3
+ *
4
+ * @public
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+
10
+ //#sourceMappingUrl=./IClientSideManifestBase.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IClientSideMultiVersionManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IClientSideMultiVersionManifest.js.map
@@ -1,77 +1,72 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PredefinedGroup = void 0;
4
- /**
5
- * Predefined web part group.
6
- *
7
- * @beta
8
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "PredefinedGroup", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return PredefinedGroup;
9
+ }
10
+ });
9
11
  var PredefinedGroup;
10
- (function (PredefinedGroup) {
12
+ (function(PredefinedGroup) {
11
13
  /**
12
- * Text, media and content.
13
- *
14
- * This group includes web parts that display text, multi-media, documents, information from the web, and other
15
- * rich content.
16
- *
17
- * @beta
18
- */
19
- PredefinedGroup["TextMediaAndContent"] = "cf066440-0614-43d6-98ae-0b31cf14c7c3";
14
+ * Text, media and content.
15
+ *
16
+ * This group includes web parts that display text, multi-media, documents, information from the web, and other
17
+ * rich content.
18
+ *
19
+ * @beta
20
+ */ PredefinedGroup["TextMediaAndContent"] = "cf066440-0614-43d6-98ae-0b31cf14c7c3";
20
21
  /**
21
- * Discovery.
22
- *
23
- * This group includes web parts that organize, group, and filter content to help users discover information.
24
- *
25
- * @beta
26
- */
27
- PredefinedGroup["DocumentsListsAndLibraries"] = "1edbd9a8-0bfb-4aa2-9afd-14b8c45dd489";
22
+ * Discovery.
23
+ *
24
+ * This group includes web parts that organize, group, and filter content to help users discover information.
25
+ *
26
+ * @beta
27
+ */ PredefinedGroup["DocumentsListsAndLibraries"] = "1edbd9a8-0bfb-4aa2-9afd-14b8c45dd489";
28
28
  /**
29
- * Communication and collaboration.
30
- *
31
- * This group includes web parts that facilitate information sharing, team work, and social interactions.
32
- *
33
- * @beta
34
- */
35
- PredefinedGroup["Feeds"] = "75e22ed5-fa14-4829-850a-c890608aca2d";
29
+ * Communication and collaboration.
30
+ *
31
+ * This group includes web parts that facilitate information sharing, team work, and social interactions.
32
+ *
33
+ * @beta
34
+ */ PredefinedGroup["Feeds"] = "75e22ed5-fa14-4829-850a-c890608aca2d";
36
35
  /**
37
- * Planning and process.
38
- *
39
- * This group includes web parts that empower team productivity with the use of planning and process tools.
40
- *
41
- * @beta
42
- */
43
- PredefinedGroup["NewsPeopleAndEvents"] = "1bc7927e-4a5e-4520-b540-71305c79c20a";
36
+ * Planning and process.
37
+ *
38
+ * This group includes web parts that empower team productivity with the use of planning and process tools.
39
+ *
40
+ * @beta
41
+ */ PredefinedGroup["NewsPeopleAndEvents"] = "1bc7927e-4a5e-4520-b540-71305c79c20a";
44
42
  /**
45
- * Business and intelligence.
46
- *
47
- * This group includes web parts for tracking and analyzing data, and for integrating business flow with pages.
48
- *
49
- * @beta
50
- */
51
- PredefinedGroup["DataAnalysis"] = "4aca9e90-eff5-4fa1-bac7-728f5f157b66";
43
+ * Business and intelligence.
44
+ *
45
+ * This group includes web parts for tracking and analyzing data, and for integrating business flow with pages.
46
+ *
47
+ * @beta
48
+ */ PredefinedGroup["DataAnalysis"] = "4aca9e90-eff5-4fa1-bac7-728f5f157b66";
52
49
  /**
53
- * Regional information
54
- *
55
- * This group includes web parts that display information based on current region and geographical location
56
- *
57
- * @beta
58
- */
59
- PredefinedGroup["RegionalInformation"] = "cfc8bda5-cb9b-49e3-8526-2ee6e52b256a";
50
+ * Regional information
51
+ *
52
+ * This group includes web parts that display information based on current region and geographical location
53
+ *
54
+ * @beta
55
+ */ PredefinedGroup["RegionalInformation"] = "cfc8bda5-cb9b-49e3-8526-2ee6e52b256a";
60
56
  /**
61
- * Other.
62
- *
63
- * This group includes web parts not in other groups.
64
- *
65
- * @beta
66
- */
67
- PredefinedGroup["Advanced"] = "5c03119e-3074-46fd-976b-c60198311f70";
57
+ * Other.
58
+ *
59
+ * This group includes web parts not in other groups.
60
+ *
61
+ * @beta
62
+ */ PredefinedGroup["Advanced"] = "5c03119e-3074-46fd-976b-c60198311f70";
68
63
  /**
69
- * Other.
70
- *
71
- * This group includes local web parts.
72
- *
73
- * @beta
74
- */
75
- PredefinedGroup["Local"] = "8b7bf6f1-a56a-4aa3-8657-7eb6e7e6af61";
76
- })(PredefinedGroup || (exports.PredefinedGroup = PredefinedGroup = {}));
77
- //# sourceMappingURL=IClientSideWebPartManifest.js.map
64
+ * Other.
65
+ *
66
+ * This group includes local web parts.
67
+ *
68
+ * @beta
69
+ */ PredefinedGroup["Local"] = "8b7bf6f1-a56a-4aa3-8657-7eb6e7e6af61";
70
+ })(PredefinedGroup || (PredefinedGroup = {}));
71
+
72
+ //#sourceMappingUrl=./IClientSideWebPartManifest.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ICommandSetExtensionManifest.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./ICommandSetExtensionManifest.js.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //#sourceMappingUrl=./IPrefabAppManifest.js.map
@@ -1,20 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManifestType = void 0;
4
1
  /**
5
2
  * The type of the manifest.
6
3
  *
7
4
  * @alpha
8
- */
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ Object.defineProperty(exports, "ManifestType", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return ManifestType;
13
+ }
14
+ });
9
15
  var ManifestType;
10
- (function (ManifestType) {
16
+ (function(ManifestType) {
11
17
  /**
12
- * The component manifest type.
13
- */
14
- ManifestType["component"] = "Component";
18
+ * The component manifest type.
19
+ */ ManifestType["component"] = "Component";
15
20
  /**
16
- * The container manifest type. This is used for manifests that contain other manifests, like multiversion manifests.
17
- */
18
- ManifestType["container"] = "Container";
19
- })(ManifestType || (exports.ManifestType = ManifestType = {}));
20
- //# sourceMappingURL=ManifestType.js.map
21
+ * The container manifest type. This is used for manifests that contain other manifests, like multiversion manifests.
22
+ */ ManifestType["container"] = "Container";
23
+ })(ManifestType || (ManifestType = {}));
24
+
25
+ //#sourceMappingUrl=./ManifestType.js.map