@pnp/cli-microsoft365 10.10.0 → 10.11.0-beta.b1eeb91
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/.eslintrc.cjs +2 -0
- package/Dockerfile +2 -2
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/base/GraphApplicationCommand.js +17 -0
- package/dist/m365/base/{DelegatedGraphCommand.js → GraphDelegatedCommand.js} +4 -4
- package/dist/m365/base/PowerAppsCommand.js +1 -1
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/base/PowerBICommand.js +1 -1
- package/dist/m365/base/PowerPlatformCommand.js +1 -1
- package/dist/m365/base/VivaEngageCommand.js +1 -1
- package/dist/m365/cli/commands/app/app-add.js +95 -0
- package/dist/m365/cli/commands.js +1 -0
- package/dist/m365/entra/commands/app/app-get.js +11 -52
- package/dist/m365/entra/commands/app/app-permission-add.js +19 -30
- package/dist/m365/entra/commands/app/app-permission-list.js +2 -19
- package/dist/m365/entra/commands/app/app-permission-remove.js +22 -31
- package/dist/m365/entra/commands/app/app-remove.js +2 -18
- package/dist/m365/entra/commands/app/app-role-add.js +10 -43
- package/dist/m365/entra/commands/app/app-role-list.js +2 -20
- package/dist/m365/entra/commands/app/app-role-remove.js +9 -40
- package/dist/m365/entra/commands/app/app-set.js +2 -19
- package/dist/m365/outlook/commands/message/message-move.js +1 -1
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +7 -21
- package/dist/m365/spe/commands/container/container-recyclebinitem-restore.js +96 -0
- package/dist/m365/spe/commands.js +1 -0
- package/dist/m365/spfx/commands/project/base-project-command.js +1 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.22.0-beta.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-model/SassJson.js +2 -0
- package/dist/m365/spfx/commands/project/project-model/index.js +1 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002031_DEVDEP_rushstack_heft.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002032_DEVDEP_typescript_eslint_parser.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002033_DEVDEP_jest_junit.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010011_YORC_useGulp.js +40 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015010_FILE_gulpfile_js.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015011_FILE_tsconfig_json.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015012_FILE_config_heft_json.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015013_FILE_config_jest_config_json.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015014_FILE_config_rig_json.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015015_FILE_config_typescript_json.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021004_PKG_scripts_build.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021005_PKG_scripts_test.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021006_PKG_scripts_clean.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021007_PKG_scripts_deploy.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021008_PKG_scripts_start.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021009_PKG_scripts_build_watch.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021010_PKG_scripts_package_solution.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021011_PKG_scripts_deploy_azure_storage.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021012_PKG_scripts_eject_webpack.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021013_PKG_overrides_rushstack_heft.js +45 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023003_GITIGNORE_libdts.js +36 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023004_GITIGNORE_libcommonjs.js +36 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023005_GITIGNORE_libesm.js +36 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023006_GITIGNORE_jestoutput.js +36 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN026001_CFG_SASS_schema.js +40 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN026002_CFG_SASS_extends.js +40 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FileAddRemoveRule.js +7 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.0-beta.1.js +241 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/page/Page.js +10 -3
- package/dist/m365/spo/commands/page/page-section-list.js +5 -1
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +13 -7
- package/dist/m365/spo/commands/site/site-appcatalog-list.js +38 -2
- package/dist/m365/spo/commands/tenant/tenant-site-unarchive.js +1 -1
- package/dist/m365/teams/commands/callrecord/callrecord-list.js +100 -0
- package/dist/m365/teams/commands/chat/chat-message-send.js +2 -2
- package/dist/m365/teams/commands/message/message-remove.js +2 -2
- package/dist/m365/teams/commands/message/message-restore.js +2 -2
- package/dist/m365/teams/commands.js +1 -0
- package/dist/m365/todo/commands/list/list-add.js +2 -2
- package/dist/m365/todo/commands/list/list-get.js +2 -2
- package/dist/m365/todo/commands/list/list-list.js +2 -2
- package/dist/m365/todo/commands/list/list-remove.js +2 -2
- package/dist/m365/todo/commands/list/list-set.js +2 -2
- package/dist/m365/todo/commands/task/task-add.js +2 -2
- package/dist/m365/todo/commands/task/task-get.js +2 -2
- package/dist/m365/todo/commands/task/task-list.js +2 -2
- package/dist/m365/todo/commands/task/task-remove.js +2 -2
- package/dist/m365/todo/commands/task/task-set.js +2 -2
- package/dist/utils/accessToken.js +9 -5
- package/dist/utils/entraApp.js +15 -0
- package/docs/docs/cmd/cli/app/app-add.mdx +50 -0
- package/docs/docs/cmd/spe/container/container-recyclebinitem-restore.mdx +53 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-list.mdx +11 -0
- package/docs/docs/cmd/spo/tenant/tenant-site-unarchive.mdx +1 -1
- package/docs/docs/cmd/teams/callrecord/callrecord-list.mdx +173 -0
- package/npm-shrinkwrap.json +293 -765
- package/package.json +18 -18
|
@@ -4,12 +4,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _EntraAppRoleListCommand_instances, _EntraAppRoleListCommand_initTelemetry, _EntraAppRoleListCommand_initOptions, _EntraAppRoleListCommand_initOptionSets;
|
|
7
|
-
import request from '../../../../request.js';
|
|
8
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
9
7
|
import { odata } from '../../../../utils/odata.js';
|
|
10
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
9
|
import commands from '../../commands.js';
|
|
12
|
-
import { cli } from '../../../../cli/cli.js';
|
|
13
10
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
14
11
|
class EntraAppRoleListCommand extends GraphCommand {
|
|
15
12
|
get name() {
|
|
@@ -51,23 +48,8 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
51
48
|
return app.id;
|
|
52
49
|
}
|
|
53
50
|
else {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
headers: {
|
|
57
|
-
accept: 'application/json;odata.metadata=none'
|
|
58
|
-
},
|
|
59
|
-
responseType: 'json'
|
|
60
|
-
};
|
|
61
|
-
const res = await request.get(requestOptions);
|
|
62
|
-
if (res.value.length === 1) {
|
|
63
|
-
return res.value[0].id;
|
|
64
|
-
}
|
|
65
|
-
if (res.value.length === 0) {
|
|
66
|
-
throw `No Microsoft Entra application registration with name ${appName} found`;
|
|
67
|
-
}
|
|
68
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
69
|
-
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${appName}' found.`, resultAsKeyValuePair);
|
|
70
|
-
return result.id;
|
|
51
|
+
const app = await entraApp.getAppRegistrationByAppName(appName, ["id"]);
|
|
52
|
+
return app.id;
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
}
|
|
@@ -46,8 +46,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
async processAppRoleDelete(logger, args) {
|
|
49
|
-
const
|
|
50
|
-
const app = await this.getEntraApp(appObjectId, logger);
|
|
49
|
+
const app = await this.getEntraApp(args, logger);
|
|
51
50
|
const appRoleDeleteIdentifierNameValue = args.options.name ? `name '${args.options.name}'` : (args.options.claim ? `claim '${args.options.claim}'` : `id '${args.options.id}'`);
|
|
52
51
|
if (this.verbose) {
|
|
53
52
|
await logger.logToStderr(`Deleting role with ${appRoleDeleteIdentifierNameValue} from Microsoft Entra app ${app.id}...`);
|
|
@@ -109,49 +108,19 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
109
108
|
};
|
|
110
109
|
return request.patch(requestOptions);
|
|
111
110
|
}
|
|
112
|
-
async getEntraApp(
|
|
111
|
+
async getEntraApp(args, logger) {
|
|
112
|
+
const { appObjectId, appId, appName } = args.options;
|
|
113
113
|
if (this.verbose) {
|
|
114
|
-
await logger.logToStderr(`Retrieving
|
|
114
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appObjectId ? appObjectId : (appId ? appId : appName)}...`);
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
headers: {
|
|
119
|
-
accept: 'application/json;odata.metadata=none'
|
|
120
|
-
},
|
|
121
|
-
responseType: 'json'
|
|
122
|
-
};
|
|
123
|
-
return request.get(requestOptions);
|
|
124
|
-
}
|
|
125
|
-
async getAppObjectId(args, logger) {
|
|
126
|
-
if (args.options.appObjectId) {
|
|
127
|
-
return args.options.appObjectId;
|
|
128
|
-
}
|
|
129
|
-
const { appId, appName } = args.options;
|
|
130
|
-
if (this.verbose) {
|
|
131
|
-
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : appName}...`);
|
|
116
|
+
if (appObjectId) {
|
|
117
|
+
return await entraApp.getAppRegistrationByObjectId(appObjectId, ['id', 'appRoles']);
|
|
132
118
|
}
|
|
133
|
-
if (appId) {
|
|
134
|
-
|
|
135
|
-
return app.id;
|
|
119
|
+
else if (appId) {
|
|
120
|
+
return await entraApp.getAppRegistrationByAppId(appId, ['id', 'appRoles']);
|
|
136
121
|
}
|
|
137
122
|
else {
|
|
138
|
-
|
|
139
|
-
url: `${this.resource}/v1.0/myorganization/applications?$filter=displayName eq '${formatting.encodeQueryParameter(appName)}'&$select=id`,
|
|
140
|
-
headers: {
|
|
141
|
-
accept: 'application/json;odata.metadata=none'
|
|
142
|
-
},
|
|
143
|
-
responseType: 'json'
|
|
144
|
-
};
|
|
145
|
-
const res = await request.get(requestOptions);
|
|
146
|
-
if (res.value.length === 1) {
|
|
147
|
-
return res.value[0].id;
|
|
148
|
-
}
|
|
149
|
-
if (res.value.length === 0) {
|
|
150
|
-
throw `No Microsoft Entra application registration with name ${appName} found`;
|
|
151
|
-
}
|
|
152
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
153
|
-
const result = (await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${appName}' found.`, resultAsKeyValuePair));
|
|
154
|
-
return result.id;
|
|
123
|
+
return await entraApp.getAppRegistrationByAppName(appName, ['id', 'appRoles']);
|
|
155
124
|
}
|
|
156
125
|
}
|
|
157
126
|
}
|
|
@@ -6,10 +6,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _EntraAppSetCommand_instances, _a, _EntraAppSetCommand_initTelemetry, _EntraAppSetCommand_initOptions, _EntraAppSetCommand_initValidators, _EntraAppSetCommand_initOptionSets, _EntraAppSetCommand_initTypes;
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
|
-
import { cli } from '../../../../cli/cli.js';
|
|
13
11
|
import { optionsUtils } from '../../../../utils/optionsUtils.js';
|
|
14
12
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
15
13
|
class EntraAppSetCommand extends GraphCommand {
|
|
@@ -57,23 +55,8 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
57
55
|
return app.id;
|
|
58
56
|
}
|
|
59
57
|
else {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
headers: {
|
|
63
|
-
accept: 'application/json;odata.metadata=none'
|
|
64
|
-
},
|
|
65
|
-
responseType: 'json'
|
|
66
|
-
};
|
|
67
|
-
const res = await request.get(requestOptions);
|
|
68
|
-
if (res.value.length === 1) {
|
|
69
|
-
return res.value[0].id;
|
|
70
|
-
}
|
|
71
|
-
if (res.value.length === 0) {
|
|
72
|
-
throw `No Microsoft Entra application registration with name ${name} found`;
|
|
73
|
-
}
|
|
74
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
75
|
-
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registration with name '${name}' found.`, resultAsKeyValuePair);
|
|
76
|
-
return result.id;
|
|
58
|
+
const app = await entraApp.getAppRegistrationByAppName(name, ["id"]);
|
|
59
|
+
return app.id;
|
|
77
60
|
}
|
|
78
61
|
}
|
|
79
62
|
async updateUnknownOptions(args, objectId) {
|
|
@@ -9,7 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import commands from '../../commands.js';
|
|
10
10
|
import { Outlook } from '../../Outlook.js';
|
|
11
11
|
import { cli } from '../../../../cli/cli.js';
|
|
12
|
-
import DelegatedGraphCommand from '../../../base/
|
|
12
|
+
import DelegatedGraphCommand from '../../../base/GraphDelegatedCommand.js';
|
|
13
13
|
class OutlookMessageMoveCommand extends DelegatedGraphCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.MESSAGE_MOVE;
|
|
@@ -5,11 +5,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _PpManagementAppAddCommand_instances, _PpManagementAppAddCommand_initTelemetry, _PpManagementAppAddCommand_initOptions, _PpManagementAppAddCommand_initValidators, _PpManagementAppAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
9
8
|
import { validation } from '../../../../utils/validation.js';
|
|
10
9
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
|
-
import {
|
|
11
|
+
import { entraApp } from '../../../../utils/entraApp.js';
|
|
13
12
|
class PpManagementAppAddCommand extends PowerPlatformCommand {
|
|
14
13
|
get name() {
|
|
15
14
|
return commands.MANAGEMENTAPP_ADD;
|
|
@@ -48,27 +47,14 @@ class PpManagementAppAddCommand extends PowerPlatformCommand {
|
|
|
48
47
|
return args.options.appId;
|
|
49
48
|
}
|
|
50
49
|
const { objectId, name } = args.options;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const requestOptions = {
|
|
55
|
-
url: `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=${filter}&$select=appId`,
|
|
56
|
-
headers: {
|
|
57
|
-
accept: 'application/json;odata.metadata=none'
|
|
58
|
-
},
|
|
59
|
-
responseType: 'json'
|
|
60
|
-
};
|
|
61
|
-
const entraApps = await request.get((requestOptions));
|
|
62
|
-
if (entraApps.value.length === 0) {
|
|
63
|
-
const applicationIdentifier = objectId ? `ID ${objectId}` : `name ${name}`;
|
|
64
|
-
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
50
|
+
if (objectId) {
|
|
51
|
+
const app = await entraApp.getAppRegistrationByObjectId(objectId, ['appId']);
|
|
52
|
+
return app.appId;
|
|
65
53
|
}
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
else {
|
|
55
|
+
const app = await entraApp.getAppRegistrationByAppName(name, ['appId']);
|
|
56
|
+
return app.appId;
|
|
68
57
|
}
|
|
69
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('appId', entraApps.value);
|
|
70
|
-
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${name}' found.`, resultAsKeyValuePair);
|
|
71
|
-
return result.appId;
|
|
72
58
|
}
|
|
73
59
|
}
|
|
74
60
|
_PpManagementAppAddCommand_instances = new WeakSet(), _PpManagementAppAddCommand_initTelemetry = function _PpManagementAppAddCommand_initTelemetry() {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import { spo } from '../../../../utils/spo.js';
|
|
6
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
|
+
import { spe } from '../../../../utils/spe.js';
|
|
8
|
+
import { odata } from '../../../../utils/odata.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { cli } from '../../../../cli/cli.js';
|
|
11
|
+
import request from '../../../../request.js';
|
|
12
|
+
const options = globalOptionsZod
|
|
13
|
+
.extend({
|
|
14
|
+
containerTypeId: z.string()
|
|
15
|
+
.refine(id => validation.isValidGuid(id), id => ({
|
|
16
|
+
message: `'${id}' is not a valid GUID.`
|
|
17
|
+
})).optional(),
|
|
18
|
+
containerTypeName: z.string().optional(),
|
|
19
|
+
id: z.string().optional(),
|
|
20
|
+
name: z.string().optional()
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
class SpeContainerRecycleBinItemRestoreCommand extends GraphCommand {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands.CONTAINER_RECYCLEBINITEM_RESTORE;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Restores a deleted container';
|
|
29
|
+
}
|
|
30
|
+
get schema() {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
getRefinedSchema(schema) {
|
|
34
|
+
return schema
|
|
35
|
+
.refine((options) => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
36
|
+
message: 'Use one of the following options: id or name.'
|
|
37
|
+
})
|
|
38
|
+
.refine((options) => !options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
39
|
+
message: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.'
|
|
40
|
+
})
|
|
41
|
+
.refine((options) => options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 0, {
|
|
42
|
+
message: 'Options containerTypeId and containerTypeName are only required when restoring a container by name.'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async commandAction(logger, args) {
|
|
46
|
+
try {
|
|
47
|
+
const containerId = await this.getContainerId(args.options, logger);
|
|
48
|
+
if (this.verbose) {
|
|
49
|
+
await logger.logToStderr(`Restoring deleted container with ID '${containerId}'...`);
|
|
50
|
+
}
|
|
51
|
+
const requestOptions = {
|
|
52
|
+
url: `${this.resource}/v1.0/storage/fileStorage/deletedContainers/${containerId}/restore`,
|
|
53
|
+
headers: {
|
|
54
|
+
accept: 'application/json;odata.metadata=none'
|
|
55
|
+
},
|
|
56
|
+
responseType: 'json'
|
|
57
|
+
};
|
|
58
|
+
await request.post(requestOptions);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.handleRejectedODataJsonPromise(err);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async getContainerId(options, logger) {
|
|
65
|
+
if (options.id) {
|
|
66
|
+
return options.id;
|
|
67
|
+
}
|
|
68
|
+
if (this.verbose) {
|
|
69
|
+
await logger.logToStderr(`Retrieving container with name '${options.name}'...`);
|
|
70
|
+
}
|
|
71
|
+
const containerTypeId = await this.getContainerTypeId(options, logger);
|
|
72
|
+
const containers = await odata.getAllItems(`${this.resource}/v1.0/storage/fileStorage/deletedContainers?$filter=containerTypeId eq ${containerTypeId}&$select=id,displayName`);
|
|
73
|
+
const matchingContainers = containers.filter(c => c.displayName.toLowerCase() === options.name.toLowerCase());
|
|
74
|
+
if (matchingContainers.length === 0) {
|
|
75
|
+
throw new Error(`The specified container '${options.name}' does not exist.`);
|
|
76
|
+
}
|
|
77
|
+
if (matchingContainers.length > 1) {
|
|
78
|
+
const containerKeyValuePair = formatting.convertArrayToHashTable('id', matchingContainers);
|
|
79
|
+
const container = await cli.handleMultipleResultsFound(`Multiple containers with name '${options.name}' found.`, containerKeyValuePair);
|
|
80
|
+
return container.id;
|
|
81
|
+
}
|
|
82
|
+
return matchingContainers[0].id;
|
|
83
|
+
}
|
|
84
|
+
async getContainerTypeId(options, logger) {
|
|
85
|
+
if (options.containerTypeId) {
|
|
86
|
+
return options.containerTypeId;
|
|
87
|
+
}
|
|
88
|
+
if (this.verbose) {
|
|
89
|
+
await logger.logToStderr(`Getting container type with name '${options.containerTypeName}'...`);
|
|
90
|
+
}
|
|
91
|
+
const adminUrl = await spo.getSpoAdminUrl(logger, this.verbose);
|
|
92
|
+
return spe.getContainerTypeIdByName(adminUrl, options.containerTypeName);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export default new SpeContainerRecycleBinItemRestoreCommand();
|
|
96
|
+
//# sourceMappingURL=container-recyclebinitem-restore.js.map
|
|
@@ -7,6 +7,7 @@ export default {
|
|
|
7
7
|
CONTAINER_REMOVE: `${prefix} container remove`,
|
|
8
8
|
CONTAINER_PERMISSION_LIST: `${prefix} container permission list`,
|
|
9
9
|
CONTAINER_RECYCLEBINITEM_LIST: `${prefix} container recyclebinitem list`,
|
|
10
|
+
CONTAINER_RECYCLEBINITEM_RESTORE: `${prefix} container recyclebinitem restore`,
|
|
10
11
|
CONTAINERTYPE_ADD: `${prefix} containertype add`,
|
|
11
12
|
CONTAINERTYPE_GET: `${prefix} containertype get`,
|
|
12
13
|
CONTAINERTYPE_LIST: `${prefix} containertype list`,
|
|
@@ -43,6 +43,7 @@ export class BaseProjectCommand extends AnonymousCommand {
|
|
|
43
43
|
this.readAndParseJsonFile(path.join(projectRootPath, 'tslint.json'), project, 'tsLintJsonRoot');
|
|
44
44
|
this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'write-manifests.json'), project, 'writeManifestsJson');
|
|
45
45
|
this.readAndParseJsonFile(path.join(projectRootPath, '.yo-rc.json'), project, 'yoRcJson');
|
|
46
|
+
this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'sass.json'), project, 'sassJson');
|
|
46
47
|
const gulpfileJsPath = path.join(projectRootPath, 'gulpfile.js');
|
|
47
48
|
if (fs.existsSync(gulpfileJsPath)) {
|
|
48
49
|
project.gulpfileJs = {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FN002021_DEVDEP_rushstack_eslint_config } from '../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
2
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
3
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
4
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
5
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
6
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
7
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
8
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
|
+
export default [
|
|
10
|
+
new FN001008_DEP_react('17'),
|
|
11
|
+
new FN001009_DEP_react_dom('17'),
|
|
12
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
13
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
14
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
15
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
16
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.3.0'),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(true)
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=doctor-1.22.0-beta.1.js.map
|
|
@@ -73,7 +73,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
73
73
|
'1.19.0',
|
|
74
74
|
'1.20.0',
|
|
75
75
|
'1.21.0',
|
|
76
|
-
'1.21.1'
|
|
76
|
+
'1.21.1',
|
|
77
|
+
'1.22.0-beta.1'
|
|
77
78
|
];
|
|
78
79
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
79
80
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -11,6 +11,7 @@ export * from './PackageJson.js';
|
|
|
11
11
|
export * from './PackageSolutionJson.js';
|
|
12
12
|
export * from './Project.js';
|
|
13
13
|
export * from './ScssFile.js';
|
|
14
|
+
export * from './SassJson.js';
|
|
14
15
|
export * from './ServeJson.js';
|
|
15
16
|
export * from './TsConfigJson.js';
|
|
16
17
|
export * from './TsFile.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002001_DEVDEP_microsoft_sp_build_web extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('@microsoft/sp-build-web', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('@microsoft/sp-build-web', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002001';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002004_DEVDEP_gulp extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('gulp', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('gulp', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002004';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002007_DEVDEP_ajv extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('ajv', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('ajv', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002007';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3 extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('@microsoft/rush-stack-compiler-5.3', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('@microsoft/rush-stack-compiler-5.3', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002029';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002030_DEVDEP_microsoft_spfx_web_build_rig extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@microsoft/spfx-web-build-rig', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002030';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002030_DEVDEP_microsoft_spfx_web_build_rig.js.map
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002031_DEVDEP_rushstack_heft.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002031_DEVDEP_rushstack_heft extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@rushstack/heft', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002031';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002031_DEVDEP_rushstack_heft.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002032_DEVDEP_typescript_eslint_parser extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@typescript-eslint/parser', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002032';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002032_DEVDEP_typescript_eslint_parser.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002033_DEVDEP_jest_junit extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('jest-junit', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002033';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002033_DEVDEP_jest_junit.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { JsonRule } from '../../JsonRule.js';
|
|
2
|
+
export class FN010011_YORC_useGulp extends JsonRule {
|
|
3
|
+
constructor(useGulp) {
|
|
4
|
+
super();
|
|
5
|
+
this.useGulp = useGulp;
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN010011';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return '.yo-rc.json useGulp';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Update useGulp property in .yo-rc.json`;
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return `{
|
|
18
|
+
"useGulp": ${this.useGulp.toString()}
|
|
19
|
+
}`;
|
|
20
|
+
}
|
|
21
|
+
get resolutionType() {
|
|
22
|
+
return 'json';
|
|
23
|
+
}
|
|
24
|
+
get severity() {
|
|
25
|
+
return 'Recommended';
|
|
26
|
+
}
|
|
27
|
+
get file() {
|
|
28
|
+
return './.yo-rc.json';
|
|
29
|
+
}
|
|
30
|
+
visit(project, findings) {
|
|
31
|
+
if (!project.yoRcJson) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (project.yoRcJson["@microsoft/generator-sharepoint"]?.useGulp !== this.useGulp) {
|
|
35
|
+
const node = this.getAstNodeFromFile(project.yoRcJson, '@microsoft/generator-sharepoint.useGulp');
|
|
36
|
+
this.addFindingWithPosition(findings, node);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=FN010011_YORC_useGulp.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015010_FILE_gulpfile_js extends FileAddRemoveRule {
|
|
3
|
+
constructor(add) {
|
|
4
|
+
super('./gulpfile.js', add);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015010';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015010_FILE_gulpfile_js.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015011_FILE_tsconfig_json extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./tsconfig.json', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015011';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015011_FILE_tsconfig_json.js.map
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015012_FILE_config_heft_json.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015012_FILE_config_heft_json extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./config/heft.json', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015012';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015012_FILE_config_heft_json.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015013_FILE_config_jest_config_json extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./config/jest.config.json', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015013';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015013_FILE_config_jest_config_json.js.map
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015014_FILE_config_rig_json.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015014_FILE_config_rig_json extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./config/rig.json', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015014';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015014_FILE_config_rig_json.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015015_FILE_config_typescript_json extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./config/typescript.json', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015015';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015015_FILE_config_typescript_json.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JsonRule } from "../../JsonRule.js";
|
|
2
|
+
export class FN021004_PKG_scripts_build extends JsonRule {
|
|
3
|
+
constructor(script) {
|
|
4
|
+
super();
|
|
5
|
+
this.script = script;
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN021004';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return 'package.json scripts.build';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return 'Update package.json scripts.build property';
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return `{
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "${this.script}"
|
|
20
|
+
}
|
|
21
|
+
}`;
|
|
22
|
+
}
|
|
23
|
+
get resolutionType() {
|
|
24
|
+
return 'json';
|
|
25
|
+
}
|
|
26
|
+
get severity() {
|
|
27
|
+
return 'Required';
|
|
28
|
+
}
|
|
29
|
+
get file() {
|
|
30
|
+
return './package.json';
|
|
31
|
+
}
|
|
32
|
+
visit(project, findings) {
|
|
33
|
+
if (!project.packageJson) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!project.packageJson.scripts ||
|
|
37
|
+
typeof project.packageJson.scripts !== 'object' ||
|
|
38
|
+
!project.packageJson.scripts.build ||
|
|
39
|
+
project.packageJson.scripts.build !== this.script) {
|
|
40
|
+
const node = this.getAstNodeFromFile(project.packageJson, 'scripts.build');
|
|
41
|
+
this.addFindingWithPosition(findings, node);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=FN021004_PKG_scripts_build.js.map
|