@pnp/cli-microsoft365 6.11.0-beta.69fd6f4 → 6.11.0-beta.79a1133
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/dist/Auth.js +2 -1
- package/dist/Command.js +1 -1
- package/dist/m365/cli/commands/config/config-list.js +29 -0
- package/dist/m365/cli/commands.js +1 -0
- package/dist/m365/pa/commands/app/app-permission-ensure.js +177 -0
- package/dist/m365/pa/commands/app/app-permission-remove.js +170 -0
- package/dist/m365/pa/commands.js +2 -0
- package/dist/m365/planner/commands/bucket/bucket-add.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-remove.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
- package/dist/m365/planner/commands/plan/plan-get.js +1 -2
- package/dist/m365/planner/commands/plan/plan-list.js +4 -5
- package/dist/m365/planner/commands/plan/plan-set.js +2 -2
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +35 -25
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +40 -35
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +58 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +34 -23
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +171 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +3 -0
- 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.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +35 -51
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +26 -14
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/file/file-add.js +13 -13
- package/dist/m365/spo/commands/file/file-checkin.js +1 -1
- package/dist/m365/spo/commands/file/file-checkout.js +1 -1
- package/dist/m365/spo/commands/file/file-copy.js +38 -4
- package/dist/m365/spo/commands/file/file-list.js +4 -4
- package/dist/m365/spo/commands/file/file-move.js +2 -2
- package/dist/m365/spo/commands/file/file-remove.js +6 -6
- package/dist/m365/spo/commands/file/file-rename.js +2 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
- package/dist/m365/spo/commands/file/file-version-get.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +1 -1
- package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
- package/dist/m365/spo/commands/folder/folder-add.js +2 -4
- package/dist/m365/spo/commands/folder/folder-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-list.js +2 -2
- package/dist/m365/spo/commands/folder/folder-remove.js +7 -4
- package/dist/m365/spo/commands/folder/folder-rename.js +13 -17
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/group/group-list.js +0 -1
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +32 -3
- package/dist/m365/spo/commands/page/Page.js +24 -32
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +75 -54
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +41 -40
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +32 -32
- package/dist/m365/spo/commands/site/FlowsPolicy.js +10 -0
- package/dist/m365/spo/commands/site/site-add.js +113 -154
- package/dist/m365/spo/commands/site/site-apppermission-add.js +26 -27
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +37 -37
- package/dist/m365/spo/commands/site/site-apppermission-set.js +15 -16
- package/dist/m365/spo/commands/site/site-ensure.js +19 -70
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +24 -22
- package/dist/m365/spo/commands/site/site-list.js +28 -36
- package/dist/m365/spo/commands/site/site-remove.js +139 -171
- package/dist/m365/spo/commands/site/site-set.js +179 -178
- package/dist/m365/spo/commands/theme/theme-remove.js +26 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +29 -27
- package/dist/m365/spo/commands/web/web-reindex.js +17 -20
- package/dist/m365/spo/commands/web/web-remove.js +23 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +45 -52
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +58 -61
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +20 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +21 -19
- package/dist/m365/yammer/commands/message/message-like-set.js +29 -28
- package/dist/m365/yammer/commands/message/message-list.js +9 -26
- package/dist/m365/yammer/commands/message/message-remove.js +20 -18
- package/dist/m365/yammer/commands/yammer-search.js +42 -56
- package/dist/utils/aadGroup.js +20 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/planner.js +6 -3
- package/dist/utils/spo.js +601 -1
- package/docs/docs/cmd/cli/config/config-list.mdx +78 -0
- package/docs/docs/cmd/login.mdx +6 -0
- package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/file/file-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -9
- package/docs/docs/cmd/spo/file/file-checkout.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +20 -16
- package/docs/docs/cmd/spo/file/file-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-move.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-remove.mdx +8 -8
- package/docs/docs/cmd/spo/file/file-rename.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-add.mdx +76 -1
- package/docs/docs/cmd/spo/folder/folder-get.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-rename.mdx +5 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/npm-shrinkwrap.json +698 -345
- package/package.json +15 -14
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpfxProjectGithubWorkflowAddCommand_instances, _SpfxProjectGithubWorkflowAddCommand_initTelemetry, _SpfxProjectGithubWorkflowAddCommand_initOptions, _SpfxProjectGithubWorkflowAddCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
const path = require("path");
|
|
20
|
+
const yaml = require("yaml");
|
|
21
|
+
const Command_1 = require("../../../../Command");
|
|
22
|
+
const fsUtil_1 = require("../../../../utils/fsUtil");
|
|
23
|
+
const validation_1 = require("../../../../utils/validation");
|
|
24
|
+
const commands_1 = require("../../commands");
|
|
25
|
+
const DeployWorkflow_1 = require("./DeployWorkflow");
|
|
26
|
+
const base_project_command_1 = require("./base-project-command");
|
|
27
|
+
class SpfxProjectGithubWorkflowAddCommand extends base_project_command_1.BaseProjectCommand {
|
|
28
|
+
get name() {
|
|
29
|
+
return commands_1.default.PROJECT_GITHUB_WORKFLOW_ADD;
|
|
30
|
+
}
|
|
31
|
+
get description() {
|
|
32
|
+
return 'Adds a GitHub workflow for a SharePoint Framework project.';
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
_SpfxProjectGithubWorkflowAddCommand_instances.add(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpfxProjectGithubWorkflowAddCommand_instances, "m", _SpfxProjectGithubWorkflowAddCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpfxProjectGithubWorkflowAddCommand_instances, "m", _SpfxProjectGithubWorkflowAddCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpfxProjectGithubWorkflowAddCommand_instances, "m", _SpfxProjectGithubWorkflowAddCommand_initValidators).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
44
|
+
if (this.projectRootPath === null) {
|
|
45
|
+
throw new Command_1.CommandError(`Couldn't find project root folder`, SpfxProjectGithubWorkflowAddCommand.ERROR_NO_PROJECT_ROOT_FOLDER);
|
|
46
|
+
}
|
|
47
|
+
const solutionPackageJsonFile = path.join(this.projectRootPath, 'package.json');
|
|
48
|
+
const packageJson = fs.readFileSync(solutionPackageJsonFile, 'utf-8');
|
|
49
|
+
const solutionName = JSON.parse(packageJson).name;
|
|
50
|
+
if (this.debug) {
|
|
51
|
+
logger.logToStderr(`Adding GitHub workflow in the current SPFx project`);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
this.updateWorkflow(solutionName, DeployWorkflow_1.workflow, args.options);
|
|
55
|
+
this.saveWorkflow(DeployWorkflow_1.workflow);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new Command_1.CommandError(error);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
saveWorkflow(workflow) {
|
|
63
|
+
const githubPath = path.join(this.projectRootPath, '.github');
|
|
64
|
+
fsUtil_1.fsUtil.ensureDirectory(githubPath);
|
|
65
|
+
const workflowPath = path.join(githubPath, 'workflows');
|
|
66
|
+
fsUtil_1.fsUtil.ensureDirectory(workflowPath);
|
|
67
|
+
const workflowFile = path.join(workflowPath, 'deploy-spfx-solution.yml');
|
|
68
|
+
fs.writeFileSync(path.resolve(workflowFile), yaml.stringify(workflow), 'utf-8');
|
|
69
|
+
}
|
|
70
|
+
updateWorkflow(solutionName, workflow, options) {
|
|
71
|
+
var _a;
|
|
72
|
+
workflow.name = workflow.name.replace('{{ name }}', (_a = options.name) !== null && _a !== void 0 ? _a : solutionName);
|
|
73
|
+
if (options.branchName) {
|
|
74
|
+
workflow.on.push.branches[0] = options.branchName;
|
|
75
|
+
}
|
|
76
|
+
if (options.manuallyTrigger) {
|
|
77
|
+
// eslint-disable-next-line camelcase
|
|
78
|
+
workflow.on.workflow_dispatch = null;
|
|
79
|
+
}
|
|
80
|
+
if (options.skipFeatureDeployment) {
|
|
81
|
+
this.getDeployAction(workflow).with.SKIP_FEATURE_DEPLOYMENT = true;
|
|
82
|
+
}
|
|
83
|
+
if (options.overwrite) {
|
|
84
|
+
this.getDeployAction(workflow).with.OVERWRITE = true;
|
|
85
|
+
}
|
|
86
|
+
if (options.loginMethod === 'user') {
|
|
87
|
+
const loginAction = this.getLoginAction(workflow);
|
|
88
|
+
loginAction.with = {
|
|
89
|
+
ADMIN_USERNAME: '${{ secrets.ADMIN_USERNAME }}',
|
|
90
|
+
ADMIN_PASSWORD: '${{ secrets.ADMIN_PASSWORD }}'
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (options.scope === 'sitecollection') {
|
|
94
|
+
const deployAction = this.getDeployAction(workflow);
|
|
95
|
+
deployAction.with.SCOPE = 'sitecollection';
|
|
96
|
+
deployAction.with.SITE_COLLECTION_URL = options.siteUrl;
|
|
97
|
+
}
|
|
98
|
+
if (solutionName) {
|
|
99
|
+
const deployAction = this.getDeployAction(workflow);
|
|
100
|
+
deployAction.with.APP_FILE_PATH = deployAction.with.APP_FILE_PATH.replace('{{ solutionName }}', solutionName);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
getLoginAction(workflow) {
|
|
104
|
+
const steps = this.getWorkFlowSteps(workflow);
|
|
105
|
+
return steps.find(step => step.uses && step.uses.indexOf('action-cli-login') >= 0);
|
|
106
|
+
}
|
|
107
|
+
getDeployAction(workflow) {
|
|
108
|
+
const steps = this.getWorkFlowSteps(workflow);
|
|
109
|
+
return steps.find(step => step.uses && step.uses.indexOf('action-cli-deploy') >= 0);
|
|
110
|
+
}
|
|
111
|
+
getWorkFlowSteps(workflow) {
|
|
112
|
+
return workflow.jobs['build-and-deploy'].steps;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_SpfxProjectGithubWorkflowAddCommand_instances = new WeakSet(), _SpfxProjectGithubWorkflowAddCommand_initTelemetry = function _SpfxProjectGithubWorkflowAddCommand_initTelemetry() {
|
|
116
|
+
this.telemetry.push((args) => {
|
|
117
|
+
Object.assign(this.telemetryProperties, {
|
|
118
|
+
name: typeof args.options.name !== 'undefined',
|
|
119
|
+
branchName: typeof args.options.branchName !== 'undefined',
|
|
120
|
+
manuallyTrigger: !!args.options.manuallyTrigger,
|
|
121
|
+
loginMethod: typeof args.options.loginMethod !== 'undefined',
|
|
122
|
+
scope: typeof args.options.scope !== 'undefined',
|
|
123
|
+
skipFeatureDeployment: !!args.options.skipFeatureDeployment,
|
|
124
|
+
overwrite: !!args.options.overwrite
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}, _SpfxProjectGithubWorkflowAddCommand_initOptions = function _SpfxProjectGithubWorkflowAddCommand_initOptions() {
|
|
128
|
+
this.options.unshift({
|
|
129
|
+
option: '-n, --name [name]'
|
|
130
|
+
}, {
|
|
131
|
+
option: '-b, --branchName [branchName]'
|
|
132
|
+
}, {
|
|
133
|
+
option: '-m, --manuallyTrigger'
|
|
134
|
+
}, {
|
|
135
|
+
option: '-l, --loginMethod [loginMethod]',
|
|
136
|
+
autocomplete: SpfxProjectGithubWorkflowAddCommand.loginMethod
|
|
137
|
+
}, {
|
|
138
|
+
option: '-s, --scope [scope]',
|
|
139
|
+
autocomplete: SpfxProjectGithubWorkflowAddCommand.scope
|
|
140
|
+
}, {
|
|
141
|
+
option: '-u, --siteUrl [siteUrl]'
|
|
142
|
+
}, {
|
|
143
|
+
option: '--skipFeatureDeployment'
|
|
144
|
+
}, {
|
|
145
|
+
option: '--overwrite'
|
|
146
|
+
});
|
|
147
|
+
}, _SpfxProjectGithubWorkflowAddCommand_initValidators = function _SpfxProjectGithubWorkflowAddCommand_initValidators() {
|
|
148
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
if (args.options.scope && args.options.scope === 'sitecollection') {
|
|
150
|
+
if (!args.options.siteUrl) {
|
|
151
|
+
return `siteUrl option has to be defined when scope set to ${args.options.scope}`;
|
|
152
|
+
}
|
|
153
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.siteUrl);
|
|
154
|
+
if (isValidSharePointUrl !== true) {
|
|
155
|
+
return isValidSharePointUrl;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (args.options.loginMethod && SpfxProjectGithubWorkflowAddCommand.loginMethod.indexOf(args.options.loginMethod) < 0) {
|
|
159
|
+
return `${args.options.loginMethod} is not a valid login method. Allowed values are ${SpfxProjectGithubWorkflowAddCommand.loginMethod.join(', ')}`;
|
|
160
|
+
}
|
|
161
|
+
if (args.options.scope && SpfxProjectGithubWorkflowAddCommand.scope.indexOf(args.options.scope) < 0) {
|
|
162
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${SpfxProjectGithubWorkflowAddCommand.scope.join(', ')}`;
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
165
|
+
}));
|
|
166
|
+
};
|
|
167
|
+
SpfxProjectGithubWorkflowAddCommand.loginMethod = ['application', 'user'];
|
|
168
|
+
SpfxProjectGithubWorkflowAddCommand.scope = ['tenant', 'sitecollection'];
|
|
169
|
+
SpfxProjectGithubWorkflowAddCommand.ERROR_NO_PROJECT_ROOT_FOLDER = 1;
|
|
170
|
+
module.exports = new SpfxProjectGithubWorkflowAddCommand();
|
|
171
|
+
//# sourceMappingURL=project-github-workflow-add.js.map
|
|
@@ -105,7 +105,7 @@ module.exports = [
|
|
|
105
105
|
'fixWith': 'symbol'
|
|
106
106
|
},
|
|
107
107
|
'Function': {
|
|
108
|
-
'message': 'The \\'Function\\' type accepts any function-like value
|
|
108
|
+
'message': 'The \\'Function\\' type accepts any function-like value.\\nIt provides no type safety when calling the function, which can be a common source of bugs.\\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \\'new\\'.\\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -29,33 +29,33 @@ const FN002023_DEVDEP_microsoft_eslint_config_spfx_1 = require("./rules/FN002023
|
|
|
29
29
|
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
30
30
|
const FN010010_YORC_sdkVersions_teams_js_1 = require("./rules/FN010010_YORC_sdkVersions_teams_js");
|
|
31
31
|
module.exports = [
|
|
32
|
-
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.18.0-beta.
|
|
33
|
-
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.18.0-beta.
|
|
34
|
-
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.18.0-beta.
|
|
35
|
-
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.18.0-beta.
|
|
36
|
-
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.18.0-beta.
|
|
37
|
-
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.18.0-beta.
|
|
38
|
-
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.18.0-beta.
|
|
39
|
-
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.18.0-beta.
|
|
32
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.18.0-beta.5'),
|
|
33
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.18.0-beta.5'),
|
|
34
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.18.0-beta.5'),
|
|
35
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.18.0-beta.5'),
|
|
36
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.18.0-beta.5'),
|
|
37
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.18.0-beta.5'),
|
|
38
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.18.0-beta.5'),
|
|
39
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.18.0-beta.5'),
|
|
40
40
|
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('', false),
|
|
41
|
-
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.18.0-beta.
|
|
42
|
-
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.18.0-beta.
|
|
43
|
-
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.18.0-beta.
|
|
44
|
-
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.18.0-beta.
|
|
45
|
-
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.18.0-beta.
|
|
46
|
-
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.18.0-beta.
|
|
47
|
-
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.18.0-beta.
|
|
48
|
-
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.18.0-beta.
|
|
49
|
-
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.18.0-beta.
|
|
50
|
-
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.18.0-beta.
|
|
41
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.18.0-beta.5'),
|
|
42
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.18.0-beta.5'),
|
|
43
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.18.0-beta.5'),
|
|
44
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.18.0-beta.5'),
|
|
45
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.18.0-beta.5'),
|
|
46
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.18.0-beta.5'),
|
|
47
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.18.0-beta.5'),
|
|
48
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.18.0-beta.5'),
|
|
49
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.18.0-beta.5'),
|
|
50
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.18.0-beta.5'),
|
|
51
51
|
new FN001035_DEP_fluentui_react_1.FN001035_DEP_fluentui_react('8.106.4'),
|
|
52
|
-
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.18.0-beta.
|
|
53
|
-
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.0-beta.
|
|
54
|
-
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.0-beta.
|
|
55
|
-
new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.0-beta.
|
|
56
|
-
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.18.0-beta.
|
|
57
|
-
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.0-beta.
|
|
58
|
-
new FN010001_YORC_version_1.FN010001_YORC_version('1.18.0-beta.
|
|
52
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.18.0-beta.5'),
|
|
53
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.0-beta.5'),
|
|
54
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.0-beta.5'),
|
|
55
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.0-beta.5'),
|
|
56
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.18.0-beta.5'),
|
|
57
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.0-beta.5'),
|
|
58
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.18.0-beta.5'),
|
|
59
59
|
new FN010010_YORC_sdkVersions_teams_js_1.FN010010_YORC_sdkVersions_teams_js('2.12.0')
|
|
60
60
|
];
|
|
61
|
-
//# sourceMappingURL=upgrade-1.18.0-beta.
|
|
61
|
+
//# sourceMappingURL=upgrade-1.18.0-beta.5.js.map
|
|
@@ -82,7 +82,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
82
82
|
'1.17.2',
|
|
83
83
|
'1.17.3',
|
|
84
84
|
'1.17.4',
|
|
85
|
-
'1.18.0-beta.
|
|
85
|
+
'1.18.0-beta.5'
|
|
86
86
|
];
|
|
87
87
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
88
88
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -535,14 +535,14 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
535
535
|
fix: 'npm i -g yo@4'
|
|
536
536
|
}
|
|
537
537
|
},
|
|
538
|
-
'1.18.0-beta.
|
|
538
|
+
'1.18.0-beta.5': {
|
|
539
539
|
gulpCli: {
|
|
540
540
|
range: '^1 || ^2',
|
|
541
541
|
fix: 'npm i -g gulp-cli@2'
|
|
542
542
|
},
|
|
543
543
|
node: {
|
|
544
|
-
range: '>=16.
|
|
545
|
-
fix: 'Install Node.js >=16.
|
|
544
|
+
range: '>=16.14.0 <17.0.0',
|
|
545
|
+
fix: 'Install Node.js >=16.14.0 <17.0.0'
|
|
546
546
|
},
|
|
547
547
|
sp: SharePointVersion.SPO,
|
|
548
548
|
yo: {
|
|
@@ -614,28 +614,22 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger) {
|
|
617
|
-
return
|
|
617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
618
618
|
if (args.options.env) {
|
|
619
619
|
const sp = this.spVersionStringToEnum(args.options.env);
|
|
620
620
|
if ((prerequisites.sp & sp) === sp) {
|
|
621
621
|
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `Supported in ${SharePointVersion[sp]}`));
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
|
|
626
|
-
fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
|
|
627
|
-
reject(`SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`);
|
|
622
|
+
return;
|
|
628
623
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
624
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
|
|
625
|
+
fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
|
|
626
|
+
throw `SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`;
|
|
632
627
|
}
|
|
633
628
|
});
|
|
634
629
|
}
|
|
635
630
|
checkNodeVersion(prerequisites, fixes, logger) {
|
|
636
|
-
return
|
|
637
|
-
|
|
638
|
-
.then((nodeVersion) => {
|
|
631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
632
|
+
const nodeVersion = this.getNodeVersion();
|
|
639
633
|
this.checkStatus('Node', nodeVersion, prerequisites.node, OptionalOrRequired.Required, fixes, logger);
|
|
640
634
|
});
|
|
641
635
|
}
|
|
@@ -659,9 +653,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
659
653
|
});
|
|
660
654
|
}
|
|
661
655
|
checkYo(prerequisites, fixes, logger) {
|
|
662
|
-
return this
|
|
663
|
-
.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
664
|
-
.then((yoVersion) => {
|
|
656
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
657
|
+
const yoVersion = yield this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
665
658
|
if (yoVersion) {
|
|
666
659
|
this.checkStatus('yo', yoVersion, prerequisites.yo, OptionalOrRequired.Required, fixes, logger);
|
|
667
660
|
}
|
|
@@ -672,9 +665,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
672
665
|
});
|
|
673
666
|
}
|
|
674
667
|
checkGulpCli(prerequisites, fixes, logger) {
|
|
675
|
-
return this
|
|
676
|
-
.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
677
|
-
.then((gulpCliVersion) => {
|
|
668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
669
|
+
const gulpCliVersion = yield this.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
678
670
|
if (gulpCliVersion) {
|
|
679
671
|
this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli, OptionalOrRequired.Required, fixes, logger);
|
|
680
672
|
}
|
|
@@ -685,9 +677,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
685
677
|
});
|
|
686
678
|
}
|
|
687
679
|
checkGulp(fixes, logger) {
|
|
688
|
-
return this
|
|
689
|
-
.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
690
|
-
.then((gulpVersion) => {
|
|
680
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
681
|
+
const gulpVersion = yield this.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
691
682
|
if (gulpVersion) {
|
|
692
683
|
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `gulp should be removed`));
|
|
693
684
|
fixes.push('npm un -g gulp');
|
|
@@ -695,9 +686,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
695
686
|
});
|
|
696
687
|
}
|
|
697
688
|
checkTypeScript(fixes, logger) {
|
|
698
|
-
return this
|
|
699
|
-
.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger)
|
|
700
|
-
.then((typeScriptVersion) => {
|
|
689
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
690
|
+
const typeScriptVersion = yield this.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger);
|
|
701
691
|
if (typeScriptVersion) {
|
|
702
692
|
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `typescript v${typeScriptVersion} installed in the project`));
|
|
703
693
|
fixes.push('npm un typescript');
|
|
@@ -757,41 +747,35 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
757
747
|
});
|
|
758
748
|
}
|
|
759
749
|
getPackageVersion(packageName, searchMode, handlePromise, logger) {
|
|
760
|
-
return
|
|
750
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
761
751
|
const args = ['ls', packageName, '--depth=0', '--json'];
|
|
762
752
|
if (searchMode === PackageSearchMode.GlobalOnly) {
|
|
763
753
|
args.push('-g');
|
|
764
754
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
.
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
.catch(() => {
|
|
755
|
+
let version;
|
|
756
|
+
try {
|
|
757
|
+
version = yield this.getPackageVersionFromNpm(args, logger);
|
|
758
|
+
}
|
|
759
|
+
catch (_a) {
|
|
771
760
|
if (searchMode === PackageSearchMode.LocalAndGlobal) {
|
|
772
761
|
args.push('-g');
|
|
773
|
-
|
|
762
|
+
version = yield this.getPackageVersionFromNpm(args, logger);
|
|
774
763
|
}
|
|
775
764
|
else {
|
|
776
|
-
|
|
765
|
+
version = '';
|
|
777
766
|
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
767
|
+
}
|
|
768
|
+
if (version) {
|
|
769
|
+
return version;
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
if (handlePromise === HandlePromise.Continue) {
|
|
773
|
+
return '';
|
|
782
774
|
}
|
|
783
775
|
else {
|
|
784
|
-
|
|
785
|
-
resolve('');
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
reject();
|
|
789
|
-
}
|
|
776
|
+
throw new Error();
|
|
790
777
|
}
|
|
791
|
-
}
|
|
792
|
-
.catch((err) => {
|
|
793
|
-
reject(err);
|
|
794
|
-
});
|
|
778
|
+
}
|
|
795
779
|
});
|
|
796
780
|
}
|
|
797
781
|
getPackageVersionFromNpm(args, logger) {
|
|
@@ -6,6 +6,7 @@ exports.default = {
|
|
|
6
6
|
PACKAGE_GENERATE: `${prefix} package generate`,
|
|
7
7
|
PROJECT_DOCTOR: `${prefix} project doctor`,
|
|
8
8
|
PROJECT_EXTERNALIZE: `${prefix} project externalize`,
|
|
9
|
+
PROJECT_GITHUB_WORKFLOW_ADD: `${prefix} project github workflow add`,
|
|
9
10
|
PROJECT_PERMISSIONS_GRANT: `${prefix} project permissions grant`,
|
|
10
11
|
PROJECT_RENAME: `${prefix} project rename`,
|
|
11
12
|
PROJECT_UPGRADE: `${prefix} project upgrade`
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.SpoAppBaseCommand = void 0;
|
|
4
13
|
const request_1 = require("../../../../request");
|
|
5
14
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
6
15
|
class SpoAppBaseCommand extends SpoCommand_1.default {
|
|
7
16
|
getAppCatalogSiteUrl(logger, authSiteUrl, args) {
|
|
8
|
-
return
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9
18
|
if (args.options.appCatalogScope === 'sitecollection') {
|
|
10
|
-
|
|
19
|
+
// trim trailing slashes if there are any
|
|
20
|
+
const appCatalogUrl = args.options.appCatalogUrl.replace(/\/$/, '');
|
|
21
|
+
const appCatalogUrlChunks = appCatalogUrl.split('/');
|
|
22
|
+
// Trim the last part of the URL if it ends on '/appcatalog', but don't trim it if the site URL is called like that (/sites/appcatalog).
|
|
23
|
+
if (appCatalogUrl.toLowerCase().endsWith('/appcatalog') && appCatalogUrlChunks.length !== 5) {
|
|
24
|
+
return appCatalogUrl.substring(0, appCatalogUrl.lastIndexOf('/'));
|
|
25
|
+
}
|
|
11
26
|
}
|
|
12
27
|
if (args.options.appCatalogUrl) {
|
|
13
|
-
return
|
|
28
|
+
return args.options.appCatalogUrl.replace(/\/$/, '');
|
|
29
|
+
}
|
|
30
|
+
if (this.verbose) {
|
|
31
|
+
logger.logToStderr('Getting tenant app catalog url...');
|
|
14
32
|
}
|
|
15
33
|
const requestOptions = {
|
|
16
34
|
url: `${authSiteUrl}/_api/SP_TenantSettings_Current`,
|
|
@@ -19,17 +37,11 @@ class SpoAppBaseCommand extends SpoCommand_1.default {
|
|
|
19
37
|
},
|
|
20
38
|
responseType: 'json'
|
|
21
39
|
};
|
|
22
|
-
request_1.default
|
|
23
|
-
|
|
24
|
-
.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
reject('Tenant app catalog is not configured.');
|
|
29
|
-
})
|
|
30
|
-
.catch((err) => {
|
|
31
|
-
reject(err);
|
|
32
|
-
});
|
|
40
|
+
const response = yield request_1.default.get(requestOptions);
|
|
41
|
+
if (response.CorporateCatalogUrl) {
|
|
42
|
+
return response.CorporateCatalogUrl;
|
|
43
|
+
}
|
|
44
|
+
throw new Error('Tenant app catalog is not configured.');
|
|
33
45
|
});
|
|
34
46
|
}
|
|
35
47
|
}
|
|
@@ -33,6 +33,7 @@ class SpoAppAddCommand extends SpoAppBaseCommand_1.SpoAppBaseCommand {
|
|
|
33
33
|
constructor() {
|
|
34
34
|
super();
|
|
35
35
|
_SpoAppAddCommand_instances.add(this);
|
|
36
|
+
this.appCatalogScopeOptions = ['tenant', 'sitecollection'];
|
|
36
37
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initTelemetry).call(this);
|
|
37
38
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initOptions).call(this);
|
|
38
39
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initValidators).call(this);
|
|
@@ -75,9 +76,9 @@ class SpoAppAddCommand extends SpoAppBaseCommand_1.SpoAppBaseCommand {
|
|
|
75
76
|
_SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = function _SpoAppAddCommand_initTelemetry() {
|
|
76
77
|
this.telemetry.push((args) => {
|
|
77
78
|
Object.assign(this.telemetryProperties, {
|
|
78
|
-
overwrite:
|
|
79
|
+
overwrite: !!args.options.overwrite,
|
|
79
80
|
appCatalogScope: args.options.appCatalogScope || 'tenant',
|
|
80
|
-
appCatalogUrl:
|
|
81
|
+
appCatalogUrl: typeof args.options.appCatalogUrl !== 'undefined'
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
84
|
}, _SpoAppAddCommand_initOptions = function _SpoAppAddCommand_initOptions() {
|
|
@@ -85,7 +86,7 @@ _SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = f
|
|
|
85
86
|
option: '-p, --filePath <filePath>'
|
|
86
87
|
}, {
|
|
87
88
|
option: '-s, --appCatalogScope [appCatalogScope]',
|
|
88
|
-
autocomplete:
|
|
89
|
+
autocomplete: this.appCatalogScopeOptions
|
|
89
90
|
}, {
|
|
90
91
|
option: '-u, --appCatalogUrl [appCatalogUrl]'
|
|
91
92
|
}, {
|
|
@@ -93,14 +94,13 @@ _SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = f
|
|
|
93
94
|
});
|
|
94
95
|
}, _SpoAppAddCommand_initValidators = function _SpoAppAddCommand_initValidators() {
|
|
95
96
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
// verify either 'tenant' or 'sitecollection' specified if scope provided
|
|
97
97
|
if (args.options.appCatalogScope) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
98
|
+
const appCatalogScope = args.options.appCatalogScope.toLowerCase();
|
|
99
|
+
if (this.appCatalogScopeOptions.indexOf(appCatalogScope) === -1) {
|
|
100
|
+
return `${args.options.appCatalogScope} is not a valid appCatalogScope. Allowed values are: ${this.appCatalogScopeOptions.join(', ')}`;
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
103
|
-
return `You must specify appCatalogUrl when
|
|
102
|
+
if (appCatalogScope === 'sitecollection' && !args.options.appCatalogUrl) {
|
|
103
|
+
return `You must specify appCatalogUrl when appCatalogScope is sitecollection`;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
const fullPath = path.resolve(args.options.filePath);
|