@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
@@ -10,4 +10,5 @@ export * from './manifestSchemas/IClientSideWebPartManifest';
10
10
  export * from './manifestSchemas/ICommandSetExtensionManifest';
11
11
  export * from './manifestSchemas/ManifestType';
12
12
  export * from './manifestSchemas/IAdaptiveCardExtensionManifest';
13
+ export * from './manifestSchemas/IPrefabAppManifest';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- export import ZSchema = require('z-schema');
1
+ import ZSchema from 'z-schema';
2
2
  import type { IClientSideApplicationManifest } from './manifestSchemas/IClientSideApplicationManifest';
3
3
  import type { IClientSideAssemblyManifest } from './manifestSchemas/IClientSideAssemblyManifest';
4
4
  import type { IClientSideComponentManifest } from './manifestSchemas/IClientSideComponentManifest';
@@ -7,13 +7,16 @@ import type { IClientSideLibraryManifest } from './manifestSchemas/IClientSideLi
7
7
  import type { IClientSideMultiVersionManifest } from './manifestSchemas/IClientSideMultiVersionManifest';
8
8
  import type { IClientSideWebPartManifest } from './manifestSchemas/IClientSideWebPartManifest';
9
9
  import type { ICommandSetExtensionManifest } from './manifestSchemas/ICommandSetExtensionManifest';
10
+ import type { IPrefabAppManifest } from './manifestSchemas/IPrefabAppManifest';
10
11
  export declare const zSchemaOptions: ZSchema.Options;
11
12
  export interface IManifestValidatorResult {
12
13
  result: boolean;
13
14
  errors: ZSchema.SchemaErrorDetail[];
14
15
  }
15
16
  export default class ManifestValidator {
17
+ static registerRemoteSchemaReferences(): Promise<void>;
16
18
  static validateApplicationManifest(manifest: string | IClientSideApplicationManifest): IManifestValidatorResult;
19
+ static validatePrefabAppManifest(manifest: string | IPrefabAppManifest): IManifestValidatorResult;
17
20
  static validateCommandSetManifest(manifest: string | ICommandSetExtensionManifest): IManifestValidatorResult;
18
21
  static validateExtensionManifest(manifest: string | IClientSideExtensionManifest): IManifestValidatorResult;
19
22
  static validateWebPartManifest(manifest: string | IClientSideWebPartManifest<any>): IManifestValidatorResult;
@@ -70,6 +70,12 @@ export interface IAdaptiveCardExtensionManifest<TProperties> extends IClientSide
70
70
  * @internal
71
71
  */
72
72
  isolationLevel?: 'None' | 'DOMIsolation' | 'DomainIsolation';
73
+ /**
74
+ * The scope of the personalization on how an AdaptiveCardExtension can be personalized by an end user.
75
+ *
76
+ * @beta
77
+ */
78
+ personalization?: 'Disallow' | 'Allow';
73
79
  /**
74
80
  * Definition:
75
81
  * - If true, the AdaptiveCardExtension will be disposed and reloaded when the AdaptiveCardExtension data is updated by an external source.
@@ -49,7 +49,7 @@ export interface ILocalizedString {
49
49
  * Type of client-side component.
50
50
  * @public
51
51
  */
52
- export type ComponentType = 'Application' | 'WebPart' | 'Library' | 'Extension' | 'AdaptiveCardExtension';
52
+ export type ComponentType = 'Application' | 'WebPart' | 'Library' | 'Extension' | 'AdaptiveCardExtension' | 'Prefab';
53
53
  /**
54
54
  * All client-side components built on the SharePoint framework need a valid component manifest. This interface
55
55
  * represents properties that are required by all types of client-side components like Applications and Web Parts.
@@ -190,6 +190,39 @@ export interface IClientSideWebPartManifest<TProperties> extends IClientSideComp
190
190
  * and will be hosted as a Teams application (supportedHosts contains any of Teams hosts).
191
191
  */
192
192
  supportsSelfFramingInTeams?: boolean;
193
+ /**
194
+ * Definition: Defines the default sizing of webpart in flexible sections, as well as if it supports dynamic resizing.
195
+ * Example:
196
+ * ```
197
+ * flexibleLayoutSizing: {
198
+ * supportsDynamicResizing: false,
199
+ * defaultColumnWidth: 22,
200
+ * defaultRowHeight: 21
201
+ * }
202
+ * ```
203
+ * @remarks
204
+ * Ensure this remains up to date with IFlexibleControlSizingData in FlexibleControl.types.ts
205
+ */
206
+ flexibleLayoutSizing?: IFlexibleLayoutSizing;
207
+ }
208
+ /**
209
+ * Flexible layout sizing data
210
+ * @public
211
+ */
212
+ export interface IFlexibleLayoutSizing {
213
+ /**
214
+ * If true webpart can resize to any width between minimum and 70 columns
215
+ * Otherwise webpart is slot resized to 22, 34, 48, or 70 columns
216
+ */
217
+ supportsDynamicResizing?: boolean;
218
+ /**
219
+ * Default column width for the webpart, used by drop hint
220
+ */
221
+ defaultColumnWidth?: number;
222
+ /**
223
+ * Default row height for the webpart, used by drop hint
224
+ */
225
+ defaultRowHeight?: number;
193
226
  }
194
227
  /**
195
228
  * Manifest that is relevant to a Web Part instance.
@@ -0,0 +1,255 @@
1
+ import type { IClientSideComponentManifest, ILocalizedString } from './IClientSideComponentManifest';
2
+ /**
3
+ * This is the manifest for a PREFAB application.
4
+ *
5
+ * @alpha
6
+ */
7
+ export interface IPrefabAppManifest extends IClientSideComponentManifest {
8
+ /**
9
+ * Title of the application as a dictionary of locale keys to title values. This value will be
10
+ * displayed to the user in the (page creation) interface.
11
+ *
12
+ * @remarks
13
+ *
14
+ * Supported values: a dictionary of locale keys to strings. Should always have a 'default' key.
15
+ *
16
+ * Example: `"My Application"`
17
+ *
18
+ * ```
19
+ * {
20
+ * "default": "My Application"
21
+ * "en-us": "My Application",
22
+ * "fr-fr": "Ma demande",
23
+ * "zh": "我的應用程式"
24
+ * }
25
+ * ```
26
+ */
27
+ title: ILocalizedString;
28
+ /**
29
+ * Description of the application represented as a dictionary of locale keys to description values.
30
+ * This value will be displayed to the user in the (page creation) interface.
31
+ *
32
+ * @remarks
33
+ *
34
+ * Supported values: a dictionary of locale keys to strings. Should always have a 'default' key.
35
+ *
36
+ * Examples:
37
+ *
38
+ * ```
39
+ * "An application for searching for things."
40
+ * ```
41
+ * or
42
+ * ```
43
+ * {
44
+ * "default": "An application for searching for things.",
45
+ * "en-us": "An application for searching for things.",
46
+ * "fr-fr": "Une demande pour la recherche de choses.",
47
+ * "zh": "申請尋找的東西。"
48
+ * }
49
+ * ```
50
+ */
51
+ description: ILocalizedString;
52
+ /**
53
+ * Specifies if there is a FCR (Finish Run Configuration) available for the app. True if no FCE is available.
54
+ */
55
+ isConfigured: boolean;
56
+ /**
57
+ * Describes how the PREFAB app can be installed: NewSite or ExistingSite. If omitted the app supports both.
58
+ */
59
+ appInstallationTypes?: Array<'NewSite' | 'ExistingSite'>;
60
+ /**
61
+ * Site Script actions.
62
+ *
63
+ * @remarks - See https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json for a list of actions.
64
+ * - The `onInstall` actions will be run when the app is installed on a site.
65
+ * - The `onDemand` actions will not run automatically, but can be referenced by an App developer.
66
+ */
67
+ actions?: Record<string, PrefabAppSiteScript>;
68
+ /**
69
+ * Links to be rendered in the suite nav site settings menu for the PREFAB App.
70
+ */
71
+ siteSettingsLinks?: IPrefabAppSiteSettingsLink[];
72
+ /**
73
+ * Toolbox entries for the PREFAB app.
74
+ */
75
+ toolboxEntries?: IPrefabAppToolboxEntry[];
76
+ }
77
+ /**
78
+ * Available types of Site Scripts.
79
+ * - onInstall - Site Script that will be applied when the app is installed.
80
+ * - onDemand - Site Script that will be applied on demand by a PREFAB developer.
81
+ *
82
+ * @alpha
83
+ */
84
+ export type SiteScriptType = 'onInstall' | 'onDemand';
85
+ /**
86
+ * Base definition for Site Script.
87
+ *
88
+ * @alpha
89
+ */
90
+ export interface IPrefabAppSiteScriptBase {
91
+ /**
92
+ * The type of the Site Script.
93
+ */
94
+ type: SiteScriptType;
95
+ /**
96
+ * Actions to run as part of the Site Script.
97
+ * @remarks - See https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json for a list of actions.
98
+ */
99
+ actions: ISiteScriptActionBase[];
100
+ }
101
+ /**
102
+ * Site Script that will be applied when the app is installed.
103
+ *
104
+ * @alpha
105
+ */
106
+ export interface IPrefabAppOnInstallSiteScript extends IPrefabAppSiteScriptBase {
107
+ /**
108
+ * The type of the Site Script - onInstall.
109
+ */
110
+ type: 'onInstall';
111
+ }
112
+ /**
113
+ * Site Script that will be applied by a PREFAB developer.
114
+ *
115
+ * @alpha
116
+ */
117
+ export interface IPrefabAppOnDemandSiteScript extends IPrefabAppSiteScriptBase {
118
+ /**
119
+ * The type of the Site Script - onUpdate.
120
+ */
121
+ type: 'onDemand';
122
+ }
123
+ /**
124
+ * Site Script that will be applied when the app is installed or on demand by a PREFAB app developer.
125
+ *
126
+ * @alpha
127
+ */
128
+ export type PrefabAppSiteScript = IPrefabAppOnInstallSiteScript | IPrefabAppOnDemandSiteScript;
129
+ /**
130
+ * Base definition for Site Script action.
131
+ *
132
+ * @alpha
133
+ */
134
+ export interface ISiteScriptActionBase {
135
+ verb: string;
136
+ [key: string]: any;
137
+ }
138
+ /**
139
+ * Represents an item that should be rendered in the suite nav site settings menu.
140
+ *
141
+ * @alpha
142
+ */
143
+ export interface IPrefabAppSiteSettingsLink {
144
+ /**
145
+ * The unique identifier of the route to be rendered when the settings link is selected.
146
+ */
147
+ viewId: string;
148
+ /**
149
+ * Text of the link represented as a dictionary of locale keys to title values. This value will be displayed to the user in the suite nav site settings menu.
150
+ *
151
+ * @remarks
152
+ * This text should be used in the suite nav site settings menu.
153
+ *
154
+ * Supported values: a dictionary of locale keys to strings. Should always have a `'default'` key.
155
+ *
156
+ * Example: `"My App Settings"`
157
+ * ```
158
+ * {
159
+ * "default": "My App Settings",
160
+ * "en-us": "My App Settings",
161
+ * "fr-fr": "Mes paramètres d'application",
162
+ * "zh": "我的應用程式設定"
163
+ * }
164
+ * ```
165
+ *
166
+ */
167
+ text: ILocalizedString;
168
+ }
169
+ /**
170
+ * This interface specifies the set of that can be provided by a PREFAB developer if the application should be available in the modern SharePoint toolbox.
171
+ *
172
+ * @alpha
173
+ */
174
+ export interface IPrefabAppToolboxEntry {
175
+ /**
176
+ * The unique identifier of the route to be rendered if the entry is added to the page.
177
+ */
178
+ viewId: string;
179
+ /**
180
+ * Title of the PREFAB entry represented as a single a dictionary of locale keys to title values. This
181
+ * value will be displayed to the user in the toolbox.
182
+ *
183
+ * @remarks
184
+ * This title should be used in the Toolbox and other display areas.
185
+ *
186
+ * Usage: display the name of the PREFAB route in the toolbox, and the page.
187
+ *
188
+ * Supported values: a dictionary of locale keys to strings. Should always have a `'default'` key.
189
+ *
190
+ * Example: `"My PREFAB App"`
191
+ * ```
192
+ * {
193
+ * "default": "My PREFAB App"
194
+ * "en-us": "My PREFAB App",
195
+ * "fr-fr": "My PREFAB App",
196
+ * "zh": "我的 PREFAB 應用程式"
197
+ * }
198
+ * ```
199
+ */
200
+ title: ILocalizedString;
201
+ /**
202
+ * Description of the PREFAB entry represented as a dictionary of locale keys to description values. This
203
+ * value will be displayed to the user in the toolbox. This description should be used in the Toolbox tooltip and
204
+ * other display areas.
205
+ *
206
+ * @remarks
207
+ *
208
+ * Usage: display the description of the PREFAB route in the toolbox tooltip, and the page.
209
+ *
210
+ * Supported values: a dictionary of locale keys to strings. Should always have a `'default'` key.
211
+ *
212
+ * Example: `"A tool for displaying neat information."`
213
+ *
214
+ * ```
215
+ * {
216
+ * "default": "A tool for displaying neat information.",
217
+ * "en-us": "A tool for displaying neat information.",
218
+ * "fr-fr": "Un outil d'affichage des informations soignées.",
219
+ * "zh": "用於顯示整潔資訊的工具。"
220
+ * }
221
+ * ```
222
+ */
223
+ description: ILocalizedString;
224
+ /**
225
+ * The icon for the PREFAB entry, to be displayed in the toolbox, represented as a character name in the
226
+ * Office 365 icon font file.
227
+ *
228
+ * @remarks
229
+ * The icon font is specified here: {@link https://aka.ms/uifabric-icons} If this field has
230
+ * a value, the {@link IPrefabAppToolboxEntry.iconImageUrl} field will be ignored.
231
+ *
232
+ * Supported values: Any character name in the Office 365 Icon Font.
233
+ *
234
+ * Example: "graph"
235
+ */
236
+ officeFabricIconFontName?: string;
237
+ /**
238
+ * The icon for the PREFAB app, to be displayed in the toolbox, represented as image URL. The image at the
239
+ * URL must be exactly 40x28 px (SPPPLAT VSO#218660 to fix the size of the icon image).
240
+ *
241
+ * @remarks
242
+ * If the {@link IPrefabAppToolboxEntry.officeFabricIconFontName} field does not have a value,
243
+ * this field must have a value. This value can be an absolute URL (e.g. `"http://example.com/icons/my-icon.png"`) or
244
+ * a relative file path (e.g. `"./icons/my-icon.png"`). In the latter case, the path will be resolved relative to
245
+ * the folder containing the input manifest. The icon file will be copied to the deployment folder like an asset,
246
+ * and the output manifest's iconImageUrl will be replaced with a URL relative to the URL used to load all other
247
+ * assets (the loaderConfig.internalModuleBaseUrls property).
248
+ *
249
+ * Supported values: Any absolute URL.
250
+ *
251
+ * Example: `"https://contoso.akamaihd.net/files/myPREFABIcon.png"`
252
+ */
253
+ iconImageUrl?: string;
254
+ }
255
+ //# sourceMappingURL=IPrefabAppManifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideApplicationManifest } from '../IClientSideApplicationManifest';
2
2
  declare const appManifest: IClientSideApplicationManifest;
3
- export = appManifest;
3
+ export default appManifest;
4
4
  //# sourceMappingURL=application_1.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideApplicationManifest } from '../IClientSideApplicationManifest';
2
2
  declare const appManifest: IClientSideApplicationManifest;
3
- export = appManifest;
3
+ export default appManifest;
4
4
  //# sourceMappingURL=application_2.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideApplicationManifest } from '../IClientSideApplicationManifest';
2
2
  declare const appManifest: IClientSideApplicationManifest;
3
- export = appManifest;
3
+ export default appManifest;
4
4
  //# sourceMappingURL=application_3.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideAssemblyManifest } from '../IClientSideAssemblyManifest';
2
2
  declare const assemblyManifest: IClientSideAssemblyManifest;
3
- export = assemblyManifest;
3
+ export default assemblyManifest;
4
4
  //# sourceMappingURL=assembly_1.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { ICommandSetExtensionManifest } from '../ICommandSetExtensionManifest';
2
2
  declare const extensionManifest: ICommandSetExtensionManifest;
3
- export = extensionManifest;
3
+ export default extensionManifest;
4
4
  //# sourceMappingURL=commandSet_1.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideExtensionManifest } from '../IClientSideExtensionManifest';
2
2
  declare const extensionManifest: IClientSideExtensionManifest;
3
- export = extensionManifest;
3
+ export default extensionManifest;
4
4
  //# sourceMappingURL=extension_1.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideExtensionManifest } from '../IClientSideExtensionManifest';
2
2
  declare const extensionManifest: IClientSideExtensionManifest;
3
- export = extensionManifest;
3
+ export default extensionManifest;
4
4
  //# sourceMappingURL=extension_2.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideExtensionManifest } from '../IClientSideExtensionManifest';
2
2
  declare const extensionManifest: IClientSideExtensionManifest;
3
- export = extensionManifest;
3
+ export default extensionManifest;
4
4
  //# sourceMappingURL=extension_3.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideExtensionManifest } from '../IClientSideExtensionManifest';
2
2
  declare const extensionManifest: IClientSideExtensionManifest;
3
- export = extensionManifest;
3
+ export default extensionManifest;
4
4
  //# sourceMappingURL=extension_4.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideLibraryManifest } from '../IClientSideLibraryManifest';
2
2
  declare const libraryManifest: IClientSideLibraryManifest;
3
- export = libraryManifest;
3
+ export default libraryManifest;
4
4
  //# sourceMappingURL=library_1.manifest.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { IClientSideMultiVersionManifest } from '../IClientSideMultiVersionManifest';
2
2
  import type { IClientSideLibraryManifest } from '../IClientSideLibraryManifest';
3
3
  declare const multiVersionManifest: IClientSideMultiVersionManifest<IClientSideLibraryManifest>;
4
- export = multiVersionManifest;
4
+ export default multiVersionManifest;
5
5
  //# sourceMappingURL=multi-version_1.manifest.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { IPrefabAppManifest } from '../IPrefabAppManifest';
2
+ declare const prefabManifest: IPrefabAppManifest;
3
+ export default prefabManifest;
4
+ //# sourceMappingURL=prefab_1.manifest.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { IPrefabAppManifest } from '../IPrefabAppManifest';
2
+ declare const prefabManifest: IPrefabAppManifest;
3
+ export default prefabManifest;
4
+ //# sourceMappingURL=prefab_2.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideWebPartManifest } from '../IClientSideWebPartManifest';
2
2
  declare const webpartManifest: IClientSideWebPartManifest<any>;
3
- export = webpartManifest;
3
+ export default webpartManifest;
4
4
  //# sourceMappingURL=webpart_1.manifest.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { IClientSideWebPartManifest } from '../IClientSideWebPartManifest';
2
2
  declare const webpartManifest: IClientSideWebPartManifest<any>;
3
- export = webpartManifest;
3
+ export default webpartManifest;
4
4
  //# sourceMappingURL=webpart_2.manifest.d.ts.map
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.9"
8
+ "packageVersion": "7.52.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,15 @@
1
+ export * from './manifestSchemas/IClientSideApplicationManifest';
2
+ export * from './manifestSchemas/IClientSideAssemblyManifest';
3
+ export * from './manifestSchemas/IClientSideComponentLoaderConfiguration';
4
+ export * from './manifestSchemas/IClientSideComponentManifest';
5
+ export * from './manifestSchemas/IClientSideExtensionManifest';
6
+ export * from './manifestSchemas/IClientSideLibraryManifest';
7
+ export * from './manifestSchemas/IClientSideManifestBase';
8
+ export * from './manifestSchemas/IClientSideMultiVersionManifest';
9
+ export * from './manifestSchemas/IClientSideWebPartManifest';
10
+ export * from './manifestSchemas/ICommandSetExtensionManifest';
11
+ export * from './manifestSchemas/ManifestType';
12
+ export * from './manifestSchemas/IAdaptiveCardExtensionManifest';
13
+ export * from './manifestSchemas/IPrefabAppManifest';
14
+
15
+ //#sourceMappingUrl=./index.js.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Identifies if a component manifest is a multi-version manifest.
3
+ * @param manifest - The manifest for a component, which may have multiple versions
4
+ * @returns If the manifest has multiple versions
5
+ */ export function isMultiVersionManifest(manifest) {
6
+ return !!manifest.versions;
7
+ }
8
+ /**
9
+ * @param config - The module loader configuration for the module.
10
+ * @returns If the module loads as a localized path.
11
+ */ export function isLocalizedPath(config) {
12
+ return config.type === 'localizedPath';
13
+ }
14
+ /**
15
+ * @param config - The module loader configuration for the module.
16
+ * @returns If the module loads as a non-localized path.
17
+ */ export function isPath(config) {
18
+ return config.type === 'path';
19
+ }
20
+
21
+ //#sourceMappingUrl=./manifestHelpers.js.map
@@ -0,0 +1,135 @@
1
+ import ZSchema from 'z-schema';
2
+ import { FileSystem } from '@rushstack/node-core-library';
3
+ // Discover the schema files
4
+ const schemasDirectory = `${__dirname}/manifestSchemas/jsonSchemas`;
5
+ const schemaFiles = FileSystem.readFolderItemNames(schemasDirectory);
6
+ const schemas = schemaFiles.map((schemaFile)=>require(`${schemasDirectory}/${schemaFile}`));
7
+ import manifestSchema from './manifestSchemas/jsonSchemas/client-side-component-manifest.schema.json';
8
+ import applicationSchema from './manifestSchemas/jsonSchemas/client-side-application-manifest.schema.json';
9
+ import prefabAppSchema from './manifestSchemas/jsonSchemas/prefab-app-manifest.schema.json';
10
+ import webPartSchema from './manifestSchemas/jsonSchemas/client-side-web-part-manifest.schema.json';
11
+ import commandSetSchema from './manifestSchemas/jsonSchemas/command-set-extension-manifest.schema.json';
12
+ import extensionSchema from './manifestSchemas/jsonSchemas/client-side-extension-manifest.schema.json';
13
+ import librarySchema from './manifestSchemas/jsonSchemas/client-side-library-manifest.schema.json';
14
+ import assemblySchema from './manifestSchemas/jsonSchemas/client-side-assembly-manifest.schema.json';
15
+ import multiVersionSchema from './manifestSchemas/jsonSchemas/client-side-multi-version-manifest.schema.json';
16
+ // local copy of site scripts schema and draft-07 schema
17
+ import siteScriptsSchema from './manifestSchemas/remote/site-design-script-actions.schema.json';
18
+ import draft04Schema from './manifestSchemas/remote/draft-04.schema.json';
19
+ const SITE_SCRIPTS_SCHEMA_URL = 'https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json';
20
+ const DRAFT_07_SCHEMA_URL = 'http://json-schema.org/draft-07/schema#';
21
+ const siteScriptsSchemaPromise = fetch(SITE_SCRIPTS_SCHEMA_URL).then((response)=>{
22
+ return response.text();
23
+ }).catch((error)=>{
24
+ // eslint-disable-next-line no-console
25
+ console.error(`Failed to fetch remote schema: ${error}`);
26
+ // fallback to local copy
27
+ return JSON.stringify(siteScriptsSchema);
28
+ });
29
+ export const zSchemaOptions = {
30
+ breakOnFirstError: true,
31
+ forceAdditional: true,
32
+ forceItems: true,
33
+ forceMaxLength: false,
34
+ forceProperties: false,
35
+ noExtraKeywords: true,
36
+ noTypeless: true,
37
+ noEmptyStrings: true
38
+ };
39
+ const schemaValidator = new ZSchema(zSchemaOptions);
40
+ const draft07ValidationOptions = {
41
+ strictMode: false,
42
+ ignoreUnresolvableReferences: true,
43
+ ignoreUnknownFormats: true
44
+ };
45
+ //
46
+ // this one is needed for the site scripts reference.
47
+ // We're faking draft-07 schema with draft-04 schema as z-schema doesn't support draft-07
48
+ //
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ schemaValidator.setRemoteReference(DRAFT_07_SCHEMA_URL, draft04Schema, draft07ValidationOptions);
51
+ siteScriptsSchemaPromise.then((remoteSchema)=>{
52
+ // ZSchema typedef doesn't contain setRemoteReference method. But it does exist in the implementation and referenced in the documentation.
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
+ schemaValidator.setRemoteReference(SITE_SCRIPTS_SCHEMA_URL, JSON.parse(remoteSchema), {
55
+ strictMode: false,
56
+ ignoreUnresolvableReferences: true
57
+ });
58
+ schemaValidator.validateSchema(schemas);
59
+ }).catch((error)=>{
60
+ // swallowing the error here
61
+ });
62
+ class ManifestValidator {
63
+ static registerRemoteSchemaReferences() {
64
+ return siteScriptsSchemaPromise.then(()=>{
65
+ // no-op;
66
+ }).catch(()=>{
67
+ // no-op;
68
+ });
69
+ }
70
+ static validateApplicationManifest(manifest) {
71
+ return ManifestValidator._validateManifest(manifest, applicationSchema);
72
+ }
73
+ static validatePrefabAppManifest(manifest) {
74
+ return ManifestValidator._validateManifest(manifest, prefabAppSchema);
75
+ }
76
+ static validateCommandSetManifest(manifest) {
77
+ return ManifestValidator._validateManifest(manifest, commandSetSchema);
78
+ }
79
+ static validateExtensionManifest(manifest) {
80
+ return ManifestValidator._validateManifest(manifest, extensionSchema);
81
+ }
82
+ static validateWebPartManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
83
+ manifest) {
84
+ return ManifestValidator._validateManifest(manifest, webPartSchema);
85
+ }
86
+ static validateLibraryManifest(manifest) {
87
+ return ManifestValidator._validateManifest(manifest, librarySchema);
88
+ }
89
+ static validateAssemblyManifest(manifest) {
90
+ return ManifestValidator._validateManifest(manifest, assemblySchema);
91
+ }
92
+ static validateMultiVersionManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
93
+ manifest) {
94
+ return ManifestValidator._validateManifest(manifest, multiVersionSchema);
95
+ }
96
+ static validateManifest(manifest) {
97
+ return ManifestValidator._validateManifest(manifest, manifestSchema);
98
+ }
99
+ static extractInnerErrorMessages(errors) {
100
+ const printZSchemaError = (error)=>{
101
+ let innerErrors = [];
102
+ (error.inner || []).forEach((innerErr)=>{
103
+ innerErrors = innerErrors.concat(printZSchemaError(innerErr));
104
+ });
105
+ return [
106
+ `(${error.path}) ${error.message}`
107
+ ].concat(innerErrors);
108
+ };
109
+ let errorList = [];
110
+ errors.map((error)=>{
111
+ errorList = errorList.concat(printZSchemaError(error));
112
+ });
113
+ return errorList;
114
+ }
115
+ static getFormattedErrorMessage(errors) {
116
+ return this.extractInnerErrorMessages(errors).join('\n');
117
+ }
118
+ static _validateManifest(// eslint-disable-next-line @typescript-eslint/no-explicit-any
119
+ manifest, schema) {
120
+ if (!schema) {
121
+ throw new Error('Unable to find the manifest schema.');
122
+ }
123
+ if (typeof manifest === 'string') {
124
+ manifest = JSON.parse(manifest);
125
+ }
126
+ const result = schemaValidator.validate(manifest, schema);
127
+ return {
128
+ result: result,
129
+ errors: schemaValidator.getLastErrors() || []
130
+ };
131
+ }
132
+ }
133
+ export { ManifestValidator as default };
134
+
135
+ //#sourceMappingUrl=./manifestSchemaValidator.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This interface specifies the set of properties that can be pre-configured by a AdaptiveCardExtension developer. Each
3
+ * pre-configured instance of the AdaptiveCardExtension will need a copy of these properties. Organization admins and
4
+ * content authors can modify these properties on a need basis.
5
+ *
6
+ * @beta
7
+ */ export { };
8
+
9
+ //#sourceMappingUrl=./IAdaptiveCardExtensionManifest.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @alpha
3
+ */ export { };
4
+
5
+ //#sourceMappingUrl=./IClientSideApplicationManifest.js.map