@pnp/cli-microsoft365 11.1.0-beta.317d8bb → 11.1.0-beta.53bc672
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.
- package/.devproxy/api-specs/sharepoint.yaml +23 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -7
- package/dist/Command.js +2 -2
- package/dist/auth/msalCachePlugin.js +6 -2
- package/dist/autocomplete.js +6 -2
- package/dist/chili/chili.js +2 -1
- package/dist/cli/cli.js +4 -2
- package/dist/config.js +0 -1
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +2 -2
- package/dist/m365/app/commands/permission/permission-list.js +4 -2
- package/dist/m365/booking/commands/business/business-list.js +5 -0
- package/dist/m365/commands/setup.js +6 -3
- package/dist/m365/commands/status.js +5 -1
- package/dist/m365/connection/commands/connection-list.js +5 -1
- package/dist/m365/entra/commands/app/app-role-add.js +1 -1
- package/dist/m365/entra/commands/group/group-add.js +1 -1
- package/dist/m365/entra/commands/group/group-set.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-add.js +0 -1
- package/dist/m365/file/commands/convert/convert-pdf.js +1 -6
- package/dist/m365/flow/commands/environment/environment-list.js +5 -0
- package/dist/m365/flow/commands/flow-export.js +8 -5
- package/dist/m365/flow/commands/run/run-get.js +3 -3
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +1 -1
- package/dist/m365/onedrive/commands/onedrive-list.js +5 -0
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +5 -0
- package/dist/m365/pa/commands/app/app-export.js +1 -1
- package/dist/m365/pa/commands/app/app-get.js +1 -1
- package/dist/m365/pa/commands/environment/environment-list.js +5 -0
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/pp/commands/environment/environment-list.js +10 -23
- package/dist/m365/pp/commands/solution/solution-publisher-get.js +1 -1
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +5 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
- package/dist/m365/spfx/commands/package/package-generate.js +3 -1
- package/dist/m365/spfx/commands/project/base-project-command.js +13 -5
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +6 -4
- package/dist/m365/spfx/commands/project/project-model/ScssFile.js +3 -1
- package/dist/m365/spfx/commands/project/project-model/TsFile.js +6 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.18.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.19.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.21.0.js +2 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +5 -5
- package/dist/m365/spo/commands/file/file-add.js +4 -2
- package/dist/m365/spo/commands/file/file-rename.js +3 -4
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +9 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +12 -12
- package/dist/m365/spo/commands/page/page-add.js +4 -2
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -0
- package/dist/m365/spo/commands/page/page-set.js +4 -2
- package/dist/m365/spo/commands/page/page-text-add.js +1 -0
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +34 -54
- package/dist/m365/spo/commands/site/site-alert-list.js +107 -0
- package/dist/m365/spo/commands/theme/theme-apply.js +1 -1
- package/dist/m365/spo/commands/web/web-reindex.js +17 -27
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/tab/tab-add.js +9 -3
- package/dist/m365/viva/commands/connections/connections-app-create.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +1 -1
- package/dist/telemetry.js +3 -1
- package/dist/utils/accessToken.js +4 -0
- package/dist/utils/cache.js +3 -2
- package/dist/utils/customAppScope.js +1 -1
- package/dist/utils/directoryExtension.js +1 -1
- package/dist/utils/entraAdministrativeUnit.js +1 -1
- package/dist/utils/entraApp.js +2 -2
- package/dist/utils/entraDevice.js +1 -1
- package/dist/utils/entraServicePrincipal.js +2 -2
- package/dist/utils/formatting.js +1 -1
- package/dist/utils/md.js +2 -2
- package/dist/utils/odata.js +2 -0
- package/dist/utils/planner.js +1 -1
- package/dist/utils/powerPlatform.js +2 -2
- package/dist/utils/roleDefinition.js +2 -2
- package/dist/utils/spo.js +10 -11
- package/dist/utils/urlUtil.js +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/utils/vivaEngage.js +3 -3
- package/docs/docs/cmd/booking/business/business-get.mdx +18 -1
- package/docs/docs/cmd/booking/business/business-list.mdx +18 -1
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-remove.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-roleassignment-add.mdx +19 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +18 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +18 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +20 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +15 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +14 -0
- package/docs/docs/cmd/entra/group/group-add.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-get.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-list.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-member-add.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-member-list.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-member-remove.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-member-set.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-remove.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-set.mdx +20 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +21 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +19 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +18 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-get.mdx +18 -1
- package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +20 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +17 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +20 -0
- package/docs/docs/cmd/entra/organization/organization-list.mdx +19 -2
- package/docs/docs/cmd/entra/pim/pim-role-assignment-add.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-remove.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-add.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-get.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-list.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-remove.mdx +20 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-add.mdx +18 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-get.mdx +18 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-list.mdx +19 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx +20 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-set.mdx +23 -3
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +27 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +20 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +21 -1
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +21 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +11 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +12 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +12 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +14 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +13 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.mdx +18 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.mdx +18 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.mdx +18 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-add.mdx +12 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +19 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-list.mdx +19 -0
- package/docs/docs/cmd/spo/site/site-alert-list.mdx +187 -0
- package/eslint-rules/lib/rules/correct-command-class-name.js +18 -2
- package/eslint.config.mjs +270 -0
- package/npm-shrinkwrap.json +1279 -2304
- package/package.json +25 -23
- package/.eslintrc.cjs +0 -289
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import { odata } from '../../../../utils/odata.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class PurviewRetentionLabelListCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.RETENTIONLABEL_LIST;
|
|
@@ -8,6 +10,9 @@ class PurviewRetentionLabelListCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Get a list of retention labels';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'displayName', 'isInUse'];
|
|
13
18
|
}
|
|
@@ -128,6 +128,7 @@ class SpfxPackageGenerateCommand extends AnonymousCommand {
|
|
|
128
128
|
error = err.message;
|
|
129
129
|
}
|
|
130
130
|
finally {
|
|
131
|
+
/* eslint-disable no-unsafe-finally */
|
|
131
132
|
try {
|
|
132
133
|
if (tmpDir) {
|
|
133
134
|
if (this.verbose) {
|
|
@@ -145,10 +146,11 @@ class SpfxPackageGenerateCommand extends AnonymousCommand {
|
|
|
145
146
|
}
|
|
146
147
|
throw `An error has occurred while removing the temp folder at ${tmpDir}. Please remove it manually.`;
|
|
147
148
|
}
|
|
149
|
+
/* eslint-enable no-unsafe-finally */
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
static replaceTokens(s, tokens) {
|
|
151
|
-
return s.replace(/\$([
|
|
153
|
+
return s.replace(/\$([^$]+)\$/g, (substring, token) => {
|
|
152
154
|
if (tokens[token]) {
|
|
153
155
|
return tokens[token];
|
|
154
156
|
}
|
|
@@ -21,7 +21,9 @@ export class BaseProjectCommand extends AnonymousCommand {
|
|
|
21
21
|
source: fs.readFileSync(gitignorePath, 'utf-8')
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
catch {
|
|
24
|
+
catch {
|
|
25
|
+
// Do nothing
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
28
|
const npmignorePath = path.join(projectRootPath, '.npmignore');
|
|
27
29
|
if (fs.existsSync(npmignorePath)) {
|
|
@@ -30,7 +32,9 @@ export class BaseProjectCommand extends AnonymousCommand {
|
|
|
30
32
|
source: fs.readFileSync(npmignorePath, 'utf-8')
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
catch {
|
|
35
|
+
catch {
|
|
36
|
+
// Do nothing
|
|
37
|
+
}
|
|
34
38
|
}
|
|
35
39
|
this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'config.json'), project, 'configJson');
|
|
36
40
|
this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'copy-assets.json'), project, 'copyAssetsJson');
|
|
@@ -108,7 +112,9 @@ export class BaseProjectCommand extends AnonymousCommand {
|
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
|
-
catch {
|
|
115
|
+
catch {
|
|
116
|
+
// Do nothing
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
const packageJsonPath = path.resolve(this.projectRootPath, 'package.json');
|
|
114
120
|
try {
|
|
@@ -117,10 +123,12 @@ export class BaseProjectCommand extends AnonymousCommand {
|
|
|
117
123
|
packageJson.dependencies &&
|
|
118
124
|
packageJson.dependencies['@microsoft/sp-core-library']) {
|
|
119
125
|
const coreLibVersion = packageJson.dependencies['@microsoft/sp-core-library'];
|
|
120
|
-
return coreLibVersion.replace(/[^0-9
|
|
126
|
+
return coreLibVersion.replace(/[^0-9.]/g, '');
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
|
-
catch {
|
|
129
|
+
catch {
|
|
130
|
+
// Do nothing
|
|
131
|
+
}
|
|
124
132
|
return undefined;
|
|
125
133
|
}
|
|
126
134
|
readAndParseJsonFile(filePath, project, keyPath) {
|
|
@@ -54,7 +54,7 @@ export class FN021007_PKG_only_one_rush_stack_compiler_installed extends JsonRul
|
|
|
54
54
|
if (!tsConfigExtends) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const match = /@microsoft\/rush-stack-compiler[
|
|
57
|
+
const match = /@microsoft\/rush-stack-compiler[^/]+/.exec(tsConfigExtends);
|
|
58
58
|
if (!match) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
@@ -64,7 +64,7 @@ export class PnPJsRule extends BasicDependencyRule {
|
|
|
64
64
|
fileEdits.push(...files.map(x => ({
|
|
65
65
|
action: "add",
|
|
66
66
|
path: x,
|
|
67
|
-
targetValue: 'require(
|
|
67
|
+
targetValue: 'require("tslib");'
|
|
68
68
|
})));
|
|
69
69
|
}
|
|
70
70
|
return { entries: findings, suggestions: fileEdits };
|
|
@@ -82,9 +82,11 @@ export class PnPJsRule extends BasicDependencyRule {
|
|
|
82
82
|
...moduleConfiguration,
|
|
83
83
|
path: `https://unpkg.com/${moduleConfiguration.key}@${version}/dist/${moduleName.replace('@pnp/', '')}.es5.umd${moduleName === '@pnp/common' || moduleName === ' @pnp/pnpjs' ? '.bundle' : ''}.min.js`
|
|
84
84
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
if (moduleConfiguration.globalDependencies) {
|
|
86
|
+
moduleConfiguration.globalDependencies.forEach(dependency => {
|
|
87
|
+
result.push(...this.getModuleAndParents(project, `@${dependency.replace('/', '.')}`));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
return result;
|
|
@@ -11,7 +11,9 @@ export class TsFile {
|
|
|
11
11
|
try {
|
|
12
12
|
this._sourceFile = tsUtil.createSourceFile(path.basename(this.path), this.source, ts.ScriptTarget.Latest, true);
|
|
13
13
|
}
|
|
14
|
-
catch {
|
|
14
|
+
catch {
|
|
15
|
+
// Do nothing
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
return this._sourceFile;
|
|
17
19
|
}
|
|
@@ -29,7 +31,9 @@ export class TsFile {
|
|
|
29
31
|
try {
|
|
30
32
|
this._source = fs.readFileSync(this.path, 'utf-8');
|
|
31
33
|
}
|
|
32
|
-
catch {
|
|
34
|
+
catch {
|
|
35
|
+
// Do nothing
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
return this._source;
|
|
35
39
|
}
|
|
@@ -352,7 +352,7 @@ export default [
|
|
|
352
352
|
// STANDARDIZED BY: eslint\\conf\\eslint-recommended.js
|
|
353
353
|
'no-with': 2,
|
|
354
354
|
// RATIONALE: Makes logic easier to understand, since constants always have a known value
|
|
355
|
-
// @typescript-eslint
|
|
355
|
+
// @typescript-eslint\\eslint-plugin\\dist\\configs\\eslint-recommended.js
|
|
356
356
|
'prefer-const': 1,
|
|
357
357
|
// RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused.
|
|
358
358
|
'promise/param-names': 2,
|
|
@@ -25,6 +25,7 @@ import { FN002001_DEVDEP_microsoft_sp_build_web } from "./rules/FN002001_DEVDEP_
|
|
|
25
25
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from "./rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js";
|
|
26
26
|
import { FN002015_DEVDEP_types_react } from "./rules/FN002015_DEVDEP_types_react.js";
|
|
27
27
|
import { FN002016_DEVDEP_types_react_dom } from "./rules/FN002016_DEVDEP_types_react_dom.js";
|
|
28
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from "./rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js";
|
|
28
29
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from "./rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js";
|
|
29
30
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from "./rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js";
|
|
30
31
|
import { FN010001_YORC_version } from "./rules/FN010001_YORC_version.js";
|
|
@@ -64,6 +65,7 @@ export default [
|
|
|
64
65
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.16.0'),
|
|
65
66
|
new FN002015_DEVDEP_types_react('17.0.45'),
|
|
66
67
|
new FN002016_DEVDEP_types_react_dom('17.0.17'),
|
|
68
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.16.6'),
|
|
67
69
|
new FN010001_YORC_version('1.16.0'),
|
|
68
70
|
new FN010008_YORC_nodeVersion(),
|
|
69
71
|
new FN010009_YORC_sdkVersions_microsoft_graph_client('3.0.2'),
|
|
@@ -20,6 +20,7 @@ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_mic
|
|
|
20
20
|
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
21
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
22
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from './rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js';
|
|
23
24
|
import { FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5 } from './rules/FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5.js';
|
|
24
25
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
25
26
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
@@ -54,6 +55,7 @@ export default [
|
|
|
54
55
|
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.17.0'),
|
|
55
56
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.17.0'),
|
|
56
57
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.17.0'),
|
|
58
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.17.10'),
|
|
57
59
|
new FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5('0.4.0'),
|
|
58
60
|
new FN002024_DEVDEP_eslint('8.7.0'),
|
|
59
61
|
new FN007002_CFG_S_initialPage('https://{tenantDomain}/_layouts/workbench.aspx'),
|
|
@@ -22,6 +22,7 @@ import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/
|
|
|
22
22
|
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
23
23
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
24
24
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
25
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from './rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js';
|
|
25
26
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
26
27
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
27
28
|
import { FN002026_DEVDEP_typescript } from './rules/FN002026_DEVDEP_typescript.js';
|
|
@@ -55,6 +56,7 @@ export default [
|
|
|
55
56
|
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.0'),
|
|
56
57
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.18.0'),
|
|
57
58
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.0'),
|
|
59
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.18.14'),
|
|
58
60
|
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.0'),
|
|
59
61
|
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.0'),
|
|
60
62
|
new FN002026_DEVDEP_typescript('4.7.4'),
|
|
@@ -20,6 +20,7 @@ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_mic
|
|
|
20
20
|
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
21
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
22
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from './rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js';
|
|
23
24
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
25
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
26
|
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
@@ -46,6 +47,7 @@ export default [
|
|
|
46
47
|
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.19.0'),
|
|
47
48
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.1'),
|
|
48
49
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.1'),
|
|
50
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.19.6'),
|
|
49
51
|
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.1'),
|
|
50
52
|
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.1'),
|
|
51
53
|
new FN010001_YORC_version('1.19.0')
|
|
@@ -20,6 +20,7 @@ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_mic
|
|
|
20
20
|
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
21
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
22
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from './rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js';
|
|
23
24
|
import { FN002021_DEVDEP_rushstack_eslint_config } from './rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
24
25
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
25
26
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
@@ -49,6 +50,7 @@ export default [
|
|
|
49
50
|
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0'),
|
|
50
51
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.2'),
|
|
51
52
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.2'),
|
|
53
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.20.4'),
|
|
52
54
|
new FN002024_DEVDEP_eslint('8.57.0'),
|
|
53
55
|
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
54
56
|
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.2'),
|
|
@@ -20,6 +20,7 @@ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_mic
|
|
|
20
20
|
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
21
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
22
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002019_DEVDEP_spfx_fast_serve_helpers } from './rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js';
|
|
23
24
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
25
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
26
|
import { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
@@ -51,6 +52,7 @@ export default [
|
|
|
51
52
|
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.21.0'),
|
|
52
53
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.21.0'),
|
|
53
54
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.21.0'),
|
|
55
|
+
new FN002019_DEVDEP_spfx_fast_serve_helpers('1.21.1'),
|
|
54
56
|
new FN002024_DEVDEP_eslint('8.57.1'),
|
|
55
57
|
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.21.0'),
|
|
56
58
|
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.21.0'),
|
|
@@ -946,12 +946,12 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
getPackageVersionFromNpm(args) {
|
|
950
|
-
|
|
949
|
+
async getPackageVersionFromNpm(args) {
|
|
950
|
+
if (this.debug) {
|
|
951
|
+
await this.logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
952
|
+
}
|
|
953
|
+
return new Promise((resolve, reject) => {
|
|
951
954
|
const packageName = args[1];
|
|
952
|
-
if (this.debug) {
|
|
953
|
-
await this.logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
954
|
-
}
|
|
955
955
|
child_process.exec(`npm ${args.join(' ')}`, (err, stdout) => {
|
|
956
956
|
if (err) {
|
|
957
957
|
reject(err.message);
|
|
@@ -60,7 +60,7 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
60
60
|
};
|
|
61
61
|
await request.get(requestOptions);
|
|
62
62
|
}
|
|
63
|
-
catch
|
|
63
|
+
catch {
|
|
64
64
|
// folder does not exist so will attempt to create the folder tree
|
|
65
65
|
await spo.ensureFolder(args.options.webUrl, folderPath, logger, this.verbose);
|
|
66
66
|
}
|
|
@@ -325,7 +325,9 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
325
325
|
fs.closeSync(fd);
|
|
326
326
|
/* c8 ignore next */
|
|
327
327
|
}
|
|
328
|
-
catch {
|
|
328
|
+
catch {
|
|
329
|
+
// Do nothing
|
|
330
|
+
}
|
|
329
331
|
}
|
|
330
332
|
if (--info.RetriesLeft > 0) {
|
|
331
333
|
if (this.verbose) {
|
|
@@ -81,11 +81,10 @@ class SpoFileRenameCommand extends SpoCommand {
|
|
|
81
81
|
await cli.executeCommand(removeCommand, { options: { ...removeOptions, _: [] } });
|
|
82
82
|
}
|
|
83
83
|
catch (err) {
|
|
84
|
-
if (err
|
|
85
|
-
|
|
86
|
-
else {
|
|
87
|
-
throw err;
|
|
84
|
+
if (err?.error?.message?.includes('does not exist')) {
|
|
85
|
+
return;
|
|
88
86
|
}
|
|
87
|
+
throw err;
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
}
|
|
@@ -86,7 +86,7 @@ class SpoHubSiteListCommand extends SpoCommand {
|
|
|
86
86
|
await logger.logToStderr(res);
|
|
87
87
|
await logger.logToStderr(`Retrieved ${res.Row.length} sites in batch ${batchNumber}`);
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (res.NextHref) {
|
|
90
90
|
reqOptions.url = nonPagedUrl + res.NextHref;
|
|
91
91
|
if (this.debug) {
|
|
92
92
|
await logger.logToStderr(`Url for next batch of sites: ${reqOptions.url}`);
|
|
@@ -57,7 +57,7 @@ class SpoListItemAttachmentAddCommand extends SpoCommand {
|
|
|
57
57
|
}
|
|
58
58
|
getFileName(filePath, fileName) {
|
|
59
59
|
if (!fileName) {
|
|
60
|
-
return filePath.replace(/^.*[
|
|
60
|
+
return filePath.replace(/^.*[\\/]/, '');
|
|
61
61
|
}
|
|
62
62
|
const extension = filePath.split('.').pop();
|
|
63
63
|
if (!fileName.endsWith(`.${extension}`)) {
|
|
@@ -37,7 +37,7 @@ class SpoListItemBatchSetCommand extends SpoCommand {
|
|
|
37
37
|
const jsonContent = formatting.parseCsvToJson(csvContent);
|
|
38
38
|
const amountOfRows = jsonContent.length;
|
|
39
39
|
const idColumn = args.options.idColumn || 'ID';
|
|
40
|
-
if (!jsonContent[0]
|
|
40
|
+
if (!Object.prototype.hasOwnProperty.call(jsonContent[0], idColumn)) {
|
|
41
41
|
throw `The specified value for idColumn does not exist in the array. Specified idColumn is '${args.options.idColumn || 'ID'}'. Please specify the correct value.`;
|
|
42
42
|
}
|
|
43
43
|
const listId = args.options.listId ?
|
|
@@ -97,26 +97,30 @@ class SpoListItemBatchSetCommand extends SpoCommand {
|
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
switch (field.TypeAsString) {
|
|
100
|
-
case 'User':
|
|
100
|
+
case 'User': {
|
|
101
101
|
const userDetail = users.find(us => us.email === row[field.InternalName]);
|
|
102
102
|
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${userDetail.id}</Parameter></Parameters></Method>`;
|
|
103
103
|
break;
|
|
104
|
-
|
|
104
|
+
}
|
|
105
|
+
case 'UserMulti': {
|
|
105
106
|
const userMultiString = row[field.InternalName].toString().split(';').map((element) => {
|
|
106
107
|
const userDetail = users.find(us => us.email === element);
|
|
107
108
|
return `<Object TypeId="{c956ab54-16bd-4c18-89d2-996f57282a6f}"><Property Name="Email" Type="Null" /><Property Name="LookupId" Type="Int32">${userDetail.id}</Property><Property Name="LookupValue" Type="Null" /></Object>`;
|
|
108
109
|
});
|
|
109
110
|
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="Array">${userMultiString.join('')}</Parameter></Parameters></Method>`;
|
|
110
111
|
break;
|
|
111
|
-
|
|
112
|
+
}
|
|
113
|
+
case 'Lookup': {
|
|
112
114
|
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter TypeId="{f1d34cc0-9b50-4a78-be78-d5facfcccfb7}"><Property Name="LookupId" Type="Int32">${row[field.InternalName]}</Property><Property Name="LookupValue" Type="Null"/></Parameter></Parameters></Method>`;
|
|
113
115
|
break;
|
|
114
|
-
|
|
116
|
+
}
|
|
117
|
+
case 'LookupMulti': {
|
|
115
118
|
const lookupMultiString = row[field.InternalName].toString().split(';').map((element) => {
|
|
116
119
|
return `<Object TypeId="{f1d34cc0-9b50-4a78-be78-d5facfcccfb7}"><Property Name="LookupId" Type="Int32">${element}</Property><Property Name="LookupValue" Type="Null" /></Object>`;
|
|
117
120
|
});
|
|
118
121
|
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="Array">${lookupMultiString.join('')}</Parameter></Parameters></Method>`;
|
|
119
122
|
break;
|
|
123
|
+
}
|
|
120
124
|
default:
|
|
121
125
|
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${formatting.escapeXml(row[field.InternalName].toString())}</Parameter></Parameters></Method>`;
|
|
122
126
|
break;
|
|
@@ -238,11 +238,11 @@ export class ClientSidePage {
|
|
|
238
238
|
.replace(/:/g, ":")
|
|
239
239
|
.replace(/{/g, "{")
|
|
240
240
|
.replace(/}/g, "}")
|
|
241
|
-
.replace(/\[/g, "
|
|
242
|
-
.replace(/\]/g, "
|
|
243
|
-
.replace(/\*/g, "
|
|
244
|
-
.replace(/\$/g, "
|
|
245
|
-
.replace(/\./g, "
|
|
241
|
+
.replace(/\[/g, "[")
|
|
242
|
+
.replace(/\]/g, "]")
|
|
243
|
+
.replace(/\*/g, "*")
|
|
244
|
+
.replace(/\$/g, "$")
|
|
245
|
+
.replace(/\./g, ".");
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
248
248
|
* Converts an escaped string from a client-side control attribute to a json object
|
|
@@ -258,7 +258,7 @@ export class ClientSidePage {
|
|
|
258
258
|
[/\\/g, "\\\\"], [/"/g, "\""], [/:/g, ":"], [/{/g, "{"], [/}/g, "}"],
|
|
259
259
|
[/\\\\/g, "\\"], [/\\\?/g, "?"], [/\\\./g, "."], [/\\\[/g, "["], [/\\\]/g, "]"],
|
|
260
260
|
[/\\\(/g, "("], [/\\\)/g, ")"], [/\\\|/g, "|"], [/\\\+/g, "+"], [/\\\*/g, "*"],
|
|
261
|
-
[/\\\$/g, "$"]
|
|
261
|
+
[/\\\$/g, "$"]
|
|
262
262
|
];
|
|
263
263
|
return mapDict.reduce((r, m) => r.replace(m[0], m[1]), escaped);
|
|
264
264
|
};
|
|
@@ -298,7 +298,7 @@ export class ClientSidePage {
|
|
|
298
298
|
// get the control type
|
|
299
299
|
const ct = /controlType":(\d*?)(,|&)/i.exec(markup);
|
|
300
300
|
// if no control type is present this is a column which we give type 0 to let us process it
|
|
301
|
-
const controlType = ct
|
|
301
|
+
const controlType = ct === null || ct.length < 0 ? -1 : parseInt(ct[1], 10);
|
|
302
302
|
let control = null;
|
|
303
303
|
switch (controlType) {
|
|
304
304
|
case -1:
|
|
@@ -562,7 +562,7 @@ export class CanvasColumn extends CanvasControl {
|
|
|
562
562
|
sectionIndex: this.order,
|
|
563
563
|
zoneIndex: this.section?.order || 0,
|
|
564
564
|
zoneId: this.section?.zoneId,
|
|
565
|
-
layoutIndex: this.section?.layoutIndex
|
|
565
|
+
layoutIndex: this.section?.layoutIndex
|
|
566
566
|
},
|
|
567
567
|
zoneGroupMetadata: this.section?.zoneGroupMetadata,
|
|
568
568
|
emphasis: this.section?.emphasis
|
|
@@ -620,7 +620,7 @@ export class BackgroundSettings extends ClientSidePart {
|
|
|
620
620
|
dataVersion: this.dataVersion,
|
|
621
621
|
instanceId: this.id,
|
|
622
622
|
properties: this.propertieJson,
|
|
623
|
-
serverProcessedContent: this.serverProcessedContent
|
|
623
|
+
serverProcessedContent: this.serverProcessedContent
|
|
624
624
|
};
|
|
625
625
|
const html = [];
|
|
626
626
|
html.push(`<div data-sp-canvascontrol="" data-sp-canvasdataversion="${this.dataVersion}" data-sp-controldata="${this.jsonData}">`);
|
|
@@ -687,7 +687,7 @@ export class ClientSideText extends ClientSidePart {
|
|
|
687
687
|
layoutIndex: this.column?.section?.layoutIndex
|
|
688
688
|
},
|
|
689
689
|
zoneGroupMetadata: this.column?.section?.zoneGroupMetadata,
|
|
690
|
-
emphasis: this.column?.section?.emphasis
|
|
690
|
+
emphasis: this.column?.section?.emphasis
|
|
691
691
|
};
|
|
692
692
|
if (this.column?.section?.isLayoutReflowOnTop !== undefined) {
|
|
693
693
|
controlData.position.isLayoutReflowOnTop = this.column.section.isLayoutReflowOnTop;
|
|
@@ -806,11 +806,11 @@ export class ClientSideWebpart extends ClientSidePart {
|
|
|
806
806
|
sectionIndex: this.column ? this.column.order : 0,
|
|
807
807
|
zoneIndex: this.column && this.column.section ? this.column.section.order : 0,
|
|
808
808
|
zoneId: this.column?.section?.zoneId,
|
|
809
|
-
layoutIndex: this.column?.section?.layoutIndex
|
|
809
|
+
layoutIndex: this.column?.section?.layoutIndex
|
|
810
810
|
},
|
|
811
811
|
webPartId: this.webPartId,
|
|
812
812
|
zoneGroupMetadata: this.column?.section?.zoneGroupMetadata,
|
|
813
|
-
emphasis: this.column?.section?.emphasis
|
|
813
|
+
emphasis: this.column?.section?.emphasis
|
|
814
814
|
};
|
|
815
815
|
if (this.column?.section?.isLayoutReflowOnTop !== undefined) {
|
|
816
816
|
controlData.position.isLayoutReflowOnTop = this.column.section.isLayoutReflowOnTop;
|
|
@@ -89,7 +89,7 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
89
89
|
};
|
|
90
90
|
await request.post(requestOptions);
|
|
91
91
|
break;
|
|
92
|
-
case 'NewsPage':
|
|
92
|
+
case 'NewsPage': {
|
|
93
93
|
const listItemSetOptions = {
|
|
94
94
|
FirstPublishedDate: new Date().toISOString()
|
|
95
95
|
};
|
|
@@ -97,7 +97,8 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
97
97
|
const requestUrl = `${args.options.webUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listUrl)}')`;
|
|
98
98
|
await spo.systemUpdateListItem(requestUrl, listItemId, logger, this.verbose, listItemSetOptions);
|
|
99
99
|
break;
|
|
100
|
-
|
|
100
|
+
}
|
|
101
|
+
case 'Template': {
|
|
101
102
|
requestOptions.url = `${args.options.webUrl}/_api/SitePages/Pages(${listItemId})/SavePageAsTemplate`;
|
|
102
103
|
requestOptions.headers = {
|
|
103
104
|
'X-RequestDigest': requestDigest,
|
|
@@ -119,6 +120,7 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
119
120
|
};
|
|
120
121
|
await request.post(requestOptions);
|
|
121
122
|
break;
|
|
123
|
+
}
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
requestOptions = {
|
|
@@ -94,7 +94,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
94
94
|
};
|
|
95
95
|
await request.post(requestOptions);
|
|
96
96
|
break;
|
|
97
|
-
case 'NewsPage':
|
|
97
|
+
case 'NewsPage': {
|
|
98
98
|
const newsPageItem = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
99
99
|
const newsPageItemId = newsPageItem.Id;
|
|
100
100
|
const listItemSetOptions = {
|
|
@@ -103,7 +103,8 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
103
103
|
};
|
|
104
104
|
await spo.systemUpdateListItem(requestUrl, newsPageItemId, logger, this.verbose, listItemSetOptions);
|
|
105
105
|
break;
|
|
106
|
-
|
|
106
|
+
}
|
|
107
|
+
case 'Template': {
|
|
107
108
|
const templateItem = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
108
109
|
const templateItemId = templateItem.Id;
|
|
109
110
|
requestOptions.headers = {
|
|
@@ -132,6 +133,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
132
133
|
}
|
|
133
134
|
pageId = res.Id;
|
|
134
135
|
break;
|
|
136
|
+
}
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
if (args.options.promoteAs !== 'Template') {
|
|
@@ -49,6 +49,7 @@ class SpoPageTextAddCommand extends SpoCommand {
|
|
|
49
49
|
// Add a new section when page does not contain any sections
|
|
50
50
|
if (page.sections.length < 1) {
|
|
51
51
|
const newSection = new CanvasSection(page, 1);
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
52
53
|
newSection.defaultColumn;
|
|
53
54
|
page.sections.push(newSection);
|
|
54
55
|
}
|