@pnp/cli-microsoft365 6.0.0-beta.a9609a1 → 6.0.0-beta.b62b543
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/m365/aad/commands/app/app-add.js +4 -4
- package/dist/m365/aad/commands/app/app-list.js +38 -0
- package/dist/m365/aad/commands/user/user-get.js +1 -0
- package/dist/m365/aad/commands/user/user-guest-add.js +103 -0
- package/dist/m365/aad/commands.js +2 -0
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +4 -4
- package/dist/m365/base/SpoCommand.js +12 -11
- package/dist/m365/outlook/commands/message/message-get.js +97 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/planner/commands/bucket/bucket-get.js +4 -7
- package/dist/m365/planner/commands/plan/plan-get.js +11 -16
- package/dist/m365/pp/commands/card/card-clone.js +122 -0
- package/dist/m365/pp/commands/card/card-remove.js +130 -0
- package/dist/m365/pp/commands/solution/solution-remove.js +130 -0
- package/dist/m365/pp/commands.js +3 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.16.0-beta.1.js → doctor-1.16.0-rc.0.js} +6 -6
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.16.0-beta.2.js → upgrade-1.16.0-rc.0.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +5 -2
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -15
- package/dist/m365/spo/commands/file/file-version-list.js +96 -0
- package/dist/m365/spo/commands/folder/folder-list.js +35 -12
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +11 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +12 -1
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +150 -0
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +149 -0
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +4 -22
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +4 -15
- package/dist/m365/spo/commands/list/list-set.js +31 -8
- package/dist/m365/spo/commands/list/list-view-field-add.js +19 -5
- package/dist/m365/spo/commands/list/list-view-field-remove.js +18 -4
- package/dist/m365/spo/commands/list/list-view-field-set.js +18 -4
- package/dist/m365/spo/commands/list/list-view-list.js +14 -10
- package/dist/m365/spo/commands/list/list-view-remove.js +17 -8
- package/dist/m365/spo/commands/list/list-view-set.js +19 -7
- package/dist/m365/spo/commands/list/list-webhook-set.js +11 -12
- package/dist/m365/spo/commands/listitem/listitem-list.js +4 -7
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +4 -15
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +4 -7
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +15 -2
- package/dist/m365/spo/commands/{hubsite/hubsite-theme-sync.js → site/site-hubsite-theme-sync.js} +11 -11
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +4 -7
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +4 -15
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +4 -8
- package/dist/m365/spo/commands.js +5 -2
- package/dist/m365/teams/commands/Meeting.js +3 -0
- package/dist/m365/teams/commands/channel/channel-get.js +2 -2
- package/dist/m365/teams/commands/channel/channel-remove.js +56 -39
- package/dist/m365/teams/commands/channel/channel-set.js +57 -19
- package/dist/m365/teams/commands/meeting/meeting-list.js +153 -0
- package/dist/m365/teams/commands/team/team-archive.js +4 -7
- package/dist/m365/teams/commands/team/team-remove.js +3 -3
- package/dist/m365/teams/commands/team/team-unarchive.js +3 -3
- package/dist/m365/teams/commands.js +1 -0
- package/dist/utils/md.js +8 -1
- package/docs/docs/cmd/aad/app/app-add.md +19 -19
- package/docs/docs/cmd/aad/app/app-list.md +149 -0
- package/docs/docs/cmd/aad/user/user-guest-add.md +107 -0
- package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +12 -5
- package/docs/docs/cmd/app/app-get.md +156 -0
- package/docs/docs/cmd/app/app-open.md +20 -0
- package/docs/docs/cmd/app/permission/permission-list.md +43 -0
- package/docs/docs/cmd/booking/business/business-get.md +107 -0
- package/docs/docs/cmd/booking/business/business-list.md +34 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-add.md +4 -11
- package/docs/docs/cmd/graph/schemaextension/schemaextension-set.md +4 -10
- package/docs/docs/cmd/outlook/message/message-get.md +48 -0
- package/docs/docs/cmd/pa/app/app-get.md +184 -0
- package/docs/docs/cmd/pa/app/app-list.md +181 -0
- package/docs/docs/cmd/pa/app/app-remove.md +4 -0
- package/docs/docs/cmd/pa/connector/connector-export.md +4 -0
- package/docs/docs/cmd/pa/connector/connector-list.md +89 -0
- package/docs/docs/cmd/pa/environment/environment-get.md +113 -0
- package/docs/docs/cmd/pa/environment/environment-list.md +109 -0
- package/docs/docs/cmd/pa/pcf/pcf-init.md +4 -0
- package/docs/docs/cmd/pa/solution/solution-init.md +5 -0
- package/docs/docs/cmd/pa/solution/solution-reference-add.md +4 -0
- package/docs/docs/cmd/planner/plan/plan-get.md +2 -2
- package/docs/docs/cmd/pp/card/card-clone.md +77 -0
- package/docs/docs/cmd/pp/card/card-get.md +71 -0
- package/docs/docs/cmd/pp/card/card-list.md +71 -0
- package/docs/docs/cmd/pp/card/card-remove.md +82 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +85 -0
- package/docs/docs/cmd/pp/environment/environment-get.md +308 -0
- package/docs/docs/cmd/pp/environment/environment-list.md +312 -0
- package/docs/docs/cmd/pp/gateway/gateway-get.md +32 -0
- package/docs/docs/cmd/pp/gateway/gateway-list.md +35 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-add.md +23 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-list.md +27 -0
- package/docs/docs/cmd/pp/solution/solution-get.md +35 -0
- package/docs/docs/cmd/pp/solution/solution-list.md +37 -0
- package/docs/docs/cmd/pp/solution/solution-remove.md +82 -0
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +62 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/customaction/customaction-add.md +3 -0
- package/docs/docs/cmd/spo/customaction/customaction-set.md +3 -2
- package/docs/docs/cmd/spo/field/field-set.md +4 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.md +9 -9
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +3 -3
- package/docs/docs/cmd/spo/file/file-version-list.md +76 -0
- package/docs/docs/cmd/spo/folder/folder-list.md +45 -0
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.md +6 -0
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +6 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-connect.md +62 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +58 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-register.md +2 -2
- package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +9 -9
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +8 -8
- package/docs/docs/cmd/spo/list/list-set.md +18 -6
- package/docs/docs/cmd/spo/list/list-view-field-add.md +14 -4
- package/docs/docs/cmd/spo/list/list-view-field-remove.md +11 -2
- package/docs/docs/cmd/spo/list/list-view-field-set.md +18 -2
- package/docs/docs/cmd/spo/list/list-view-list.md +16 -7
- package/docs/docs/cmd/spo/list/list-view-remove.md +12 -3
- package/docs/docs/cmd/spo/list/list-view-set.md +20 -6
- package/docs/docs/cmd/spo/list/list-webhook-set.md +9 -2
- package/docs/docs/cmd/spo/listitem/listitem-list.md +9 -9
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +8 -8
- package/docs/docs/cmd/spo/page/page-clientsidewebpart-add.md +14 -19
- package/docs/docs/cmd/spo/page/page-control-set.md +2 -1
- package/docs/docs/cmd/spo/{hubsite/hubsite-theme-sync.md → site/site-hubsite-theme-sync.md} +5 -5
- package/docs/docs/cmd/spo/sitedesign/sitedesign-get.md +2 -2
- package/docs/docs/cmd/spo/term/term-add.md +5 -0
- package/docs/docs/cmd/spo/term/term-set-add.md +6 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-add.md +6 -6
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +4 -4
- package/docs/docs/cmd/teams/channel/channel-get.md +7 -7
- package/docs/docs/cmd/teams/channel/channel-remove.md +12 -9
- package/docs/docs/cmd/teams/channel/channel-set.md +13 -6
- package/docs/docs/cmd/teams/meeting/meeting-list.md +149 -0
- package/docs/docs/cmd/teams/message/message-get.md +80 -0
- package/docs/docs/cmd/teams/message/message-list.md +63 -0
- package/docs/docs/cmd/teams/message/message-reply-list.md +63 -0
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +31 -0
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +4 -0
- package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +35 -0
- package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +36 -0
- package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +41 -0
- package/docs/docs/cmd/teams/report/report-directroutingcalls.md +49 -0
- package/docs/docs/cmd/teams/report/report-pstncalls.md +49 -0
- package/docs/docs/cmd/teams/report/report-useractivitycounts.md +39 -0
- package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +33 -0
- package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +58 -0
- package/docs/docs/cmd/teams/tab/tab-add.md +35 -0
- package/docs/docs/cmd/teams/tab/tab-get.md +35 -0
- package/docs/docs/cmd/teams/tab/tab-list.md +43 -0
- package/docs/docs/cmd/teams/tab/tab-remove.md +4 -0
- package/docs/docs/cmd/teams/team/team-add.md +145 -0
- package/docs/docs/cmd/teams/team/team-archive.md +7 -3
- package/docs/docs/cmd/teams/team/team-clone.md +4 -0
- package/docs/docs/cmd/teams/team/team-get.md +78 -0
- package/docs/docs/cmd/teams/team/team-list.md +30 -0
- package/docs/docs/cmd/teams/team/team-remove.md +7 -3
- package/docs/docs/cmd/teams/team/team-set.md +4 -0
- package/docs/docs/cmd/teams/team/team-unarchive.md +5 -2
- package/docs/docs/cmd/teams/user/user-app-add.md +4 -0
- package/docs/docs/cmd/teams/user/user-app-list.md +40 -0
- package/docs/docs/cmd/teams/user/user-app-remove.md +4 -0
- package/docs/docs/cmd/teams/user/user-list.md +31 -0
- package/docs/docs/cmd/todo/list/list-add.md +32 -1
- package/docs/docs/cmd/todo/list/list-get.md +2 -2
- package/docs/docs/cmd/todo/list/list-list.md +31 -0
- package/docs/docs/cmd/todo/list/list-remove.md +10 -6
- package/docs/docs/cmd/todo/list/list-set.md +9 -5
- package/docs/docs/cmd/todo/task/task-add.md +58 -2
- package/docs/docs/cmd/todo/task/task-get.md +3 -3
- package/docs/docs/cmd/todo/task/task-list.md +47 -0
- package/docs/docs/cmd/todo/task/task-remove.md +9 -4
- package/docs/docs/cmd/todo/task/task-set.md +59 -5
- package/docs/docs/cmd/util/accesstoken/accesstoken-get.md +20 -0
- package/docs/docs/cmd/viva/connections/connections-app-create.md +4 -0
- package/package.json +3 -1
|
@@ -0,0 +1,130 @@
|
|
|
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 _PpCardRemoveCommand_instances, _PpCardRemoveCommand_initTelemetry, _PpCardRemoveCommand_initOptions, _PpCardRemoveCommand_initOptionSets, _PpCardRemoveCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
19
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const request_1 = require("../../../../request");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
24
|
+
const PpCardGetCommand = require("./card-get");
|
|
25
|
+
class PpCardRemoveCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_PpCardRemoveCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpCardRemoveCommand_instances, "m", _PpCardRemoveCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PpCardRemoveCommand_instances, "m", _PpCardRemoveCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PpCardRemoveCommand_instances, "m", _PpCardRemoveCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PpCardRemoveCommand_instances, "m", _PpCardRemoveCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.CARD_REMOVE;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Removes a specific Microsoft Power Platform card in the specified Power Platform environment.';
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
logger.logToStderr(`Removing card '${args.options.id || args.options.name}'...`);
|
|
44
|
+
}
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
yield this.deleteCard(args);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const result = yield Cli_1.Cli.prompt({
|
|
50
|
+
type: 'confirm',
|
|
51
|
+
name: 'continue',
|
|
52
|
+
default: false,
|
|
53
|
+
message: `Are you sure you want to remove card '${args.options.id || args.options.name}'?`
|
|
54
|
+
});
|
|
55
|
+
if (result.continue) {
|
|
56
|
+
yield this.deleteCard(args);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getCardId(args) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (args.options.id) {
|
|
64
|
+
return args.options.id;
|
|
65
|
+
}
|
|
66
|
+
const options = {
|
|
67
|
+
environment: args.options.environment,
|
|
68
|
+
name: args.options.name,
|
|
69
|
+
output: 'json',
|
|
70
|
+
debug: this.debug,
|
|
71
|
+
verbose: this.verbose
|
|
72
|
+
};
|
|
73
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(PpCardGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
74
|
+
const getCardOutput = JSON.parse(output.stdout);
|
|
75
|
+
return getCardOutput.cardid;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
deleteCard(args) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
try {
|
|
81
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
82
|
+
const cardId = yield this.getCardId(args);
|
|
83
|
+
const requestOptions = {
|
|
84
|
+
url: `${dynamicsApiUrl}/api/data/v9.1/cards(${cardId})`,
|
|
85
|
+
headers: {
|
|
86
|
+
accept: 'application/json;odata.metadata=none'
|
|
87
|
+
},
|
|
88
|
+
responseType: 'json'
|
|
89
|
+
};
|
|
90
|
+
yield request_1.default.delete(requestOptions);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
this.handleRejectedODataJsonPromise(err);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_PpCardRemoveCommand_instances = new WeakSet(), _PpCardRemoveCommand_initTelemetry = function _PpCardRemoveCommand_initTelemetry() {
|
|
99
|
+
this.telemetry.push((args) => {
|
|
100
|
+
Object.assign(this.telemetryProperties, {
|
|
101
|
+
id: typeof args.options.id !== 'undefined',
|
|
102
|
+
name: typeof args.options.name !== 'undefined',
|
|
103
|
+
asAdmin: !!args.options.asAdmin,
|
|
104
|
+
confirm: !!args.options.confirm
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, _PpCardRemoveCommand_initOptions = function _PpCardRemoveCommand_initOptions() {
|
|
108
|
+
this.options.unshift({
|
|
109
|
+
option: '-e, --environment <environment>'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --id [id]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-n, --name [name]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-a, --asAdmin'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--confirm'
|
|
118
|
+
});
|
|
119
|
+
}, _PpCardRemoveCommand_initOptionSets = function _PpCardRemoveCommand_initOptionSets() {
|
|
120
|
+
this.optionSets.push(['id', 'name']);
|
|
121
|
+
}, _PpCardRemoveCommand_initValidators = function _PpCardRemoveCommand_initValidators() {
|
|
122
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
124
|
+
return `${args.options.id} is not a valid GUID`;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
module.exports = new PpCardRemoveCommand();
|
|
130
|
+
//# sourceMappingURL=card-remove.js.map
|
|
@@ -0,0 +1,130 @@
|
|
|
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 _PpSolutionRemoveCommand_instances, _PpSolutionRemoveCommand_initTelemetry, _PpSolutionRemoveCommand_initOptions, _PpSolutionRemoveCommand_initOptionSets, _PpSolutionRemoveCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
19
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const request_1 = require("../../../../request");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
24
|
+
const PpSolutionGetCommand = require("./solution-get");
|
|
25
|
+
class PpSolutionRemoveCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_PpSolutionRemoveCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpSolutionRemoveCommand_instances, "m", _PpSolutionRemoveCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PpSolutionRemoveCommand_instances, "m", _PpSolutionRemoveCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PpSolutionRemoveCommand_instances, "m", _PpSolutionRemoveCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PpSolutionRemoveCommand_instances, "m", _PpSolutionRemoveCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.SOLUTION_REMOVE;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Removes a specific solution in the specified Power Platform environment.';
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
logger.logToStderr(`Removing solution '${args.options.id || args.options.name}'...`);
|
|
44
|
+
}
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
yield this.deleteSolution(args);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const result = yield Cli_1.Cli.prompt({
|
|
50
|
+
type: 'confirm',
|
|
51
|
+
name: 'continue',
|
|
52
|
+
default: false,
|
|
53
|
+
message: `Are you sure you want to remove solution '${args.options.id || args.options.name}'?`
|
|
54
|
+
});
|
|
55
|
+
if (result.continue) {
|
|
56
|
+
yield this.deleteSolution(args);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getSolutionId(args) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (args.options.id) {
|
|
64
|
+
return args.options.id;
|
|
65
|
+
}
|
|
66
|
+
const options = {
|
|
67
|
+
environment: args.options.environment,
|
|
68
|
+
name: args.options.name,
|
|
69
|
+
output: 'json',
|
|
70
|
+
debug: this.debug,
|
|
71
|
+
verbose: this.verbose
|
|
72
|
+
};
|
|
73
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(PpSolutionGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
74
|
+
const getSolutionOutput = JSON.parse(output.stdout);
|
|
75
|
+
return getSolutionOutput.solutionid;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
deleteSolution(args) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
try {
|
|
81
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
82
|
+
const solutionId = yield this.getSolutionId(args);
|
|
83
|
+
const requestOptions = {
|
|
84
|
+
url: `${dynamicsApiUrl}/api/data/v9.1/solutions(${solutionId})`,
|
|
85
|
+
headers: {
|
|
86
|
+
accept: 'application/json;odata.metadata=none'
|
|
87
|
+
},
|
|
88
|
+
responseType: 'json'
|
|
89
|
+
};
|
|
90
|
+
yield request_1.default.delete(requestOptions);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
this.handleRejectedODataJsonPromise(err);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_PpSolutionRemoveCommand_instances = new WeakSet(), _PpSolutionRemoveCommand_initTelemetry = function _PpSolutionRemoveCommand_initTelemetry() {
|
|
99
|
+
this.telemetry.push((args) => {
|
|
100
|
+
Object.assign(this.telemetryProperties, {
|
|
101
|
+
id: typeof args.options.id !== 'undefined',
|
|
102
|
+
name: typeof args.options.name !== 'undefined',
|
|
103
|
+
asAdmin: !!args.options.asAdmin,
|
|
104
|
+
confirm: !!args.options.confirm
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, _PpSolutionRemoveCommand_initOptions = function _PpSolutionRemoveCommand_initOptions() {
|
|
108
|
+
this.options.unshift({
|
|
109
|
+
option: '-e, --environment <environment>'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --id [id]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-n, --name [name]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-a, --asAdmin'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--confirm'
|
|
118
|
+
});
|
|
119
|
+
}, _PpSolutionRemoveCommand_initOptionSets = function _PpSolutionRemoveCommand_initOptionSets() {
|
|
120
|
+
this.optionSets.push(['id', 'name']);
|
|
121
|
+
}, _PpSolutionRemoveCommand_initValidators = function _PpSolutionRemoveCommand_initValidators() {
|
|
122
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
124
|
+
return `${args.options.id} is not a valid GUID`;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
module.exports = new PpSolutionRemoveCommand();
|
|
130
|
+
//# sourceMappingURL=solution-remove.js.map
|
package/dist/m365/pp/commands.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const prefix = 'pp';
|
|
4
4
|
exports.default = {
|
|
5
|
+
CARD_CLONE: `${prefix} card clone`,
|
|
5
6
|
CARD_GET: `${prefix} card get`,
|
|
6
7
|
CARD_LIST: `${prefix} card list`,
|
|
8
|
+
CARD_REMOVE: `${prefix} card remove`,
|
|
7
9
|
DATAVERSE_TABLE_LIST: `${prefix} dataverse table list`,
|
|
8
10
|
ENVIRONMENT_GET: `${prefix} environment get`,
|
|
9
11
|
ENVIRONMENT_LIST: `${prefix} environment list`,
|
|
@@ -13,6 +15,7 @@ exports.default = {
|
|
|
13
15
|
MANAGEMENTAPP_LIST: `${prefix} managementapp list`,
|
|
14
16
|
SOLUTION_GET: `${prefix} solution get`,
|
|
15
17
|
SOLUTION_LIST: `${prefix} solution list`,
|
|
18
|
+
SOLUTION_REMOVE: `${prefix} solution remove`,
|
|
16
19
|
TENANT_SETTINGS_LIST: `${prefix} tenant settings list`
|
|
17
20
|
};
|
|
18
21
|
//# sourceMappingURL=commands.js.map
|
|
@@ -10,14 +10,14 @@ const FN002015_DEVDEP_types_react_1 = require("./rules/FN002015_DEVDEP_types_rea
|
|
|
10
10
|
const FN002016_DEVDEP_types_react_dom_1 = require("./rules/FN002016_DEVDEP_types_react_dom");
|
|
11
11
|
const FN002019_DEVDEP_microsoft_rush_stack_compiler_1 = require("./rules/FN002019_DEVDEP_microsoft_rush_stack_compiler");
|
|
12
12
|
module.exports = [
|
|
13
|
-
new FN001008_DEP_react_1.FN001008_DEP_react('
|
|
14
|
-
new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('
|
|
15
|
-
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('7.
|
|
13
|
+
new FN001008_DEP_react_1.FN001008_DEP_react('17'),
|
|
14
|
+
new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17'),
|
|
15
|
+
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('^7.199.1'),
|
|
16
16
|
new FN002004_DEVDEP_gulp_1.FN002004_DEVDEP_gulp('4.0.2'),
|
|
17
17
|
new FN002007_DEVDEP_ajv_1.FN002007_DEVDEP_ajv('^6.12.5'),
|
|
18
18
|
new FN002013_DEVDEP_types_webpack_env_1.FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
19
|
-
new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('
|
|
20
|
-
new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('
|
|
19
|
+
new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17'),
|
|
20
|
+
new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17'),
|
|
21
21
|
new FN002019_DEVDEP_microsoft_rush_stack_compiler_1.FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.5'])
|
|
22
22
|
];
|
|
23
|
-
//# sourceMappingURL=doctor-1.16.0-
|
|
23
|
+
//# sourceMappingURL=doctor-1.16.0-rc.0.js.map
|
|
@@ -62,7 +62,7 @@ class SpfxProjectDoctorCommand extends base_project_command_1.BaseProjectCommand
|
|
|
62
62
|
'1.14.0',
|
|
63
63
|
'1.15.0',
|
|
64
64
|
'1.15.2',
|
|
65
|
-
'1.16.0-
|
|
65
|
+
'1.16.0-rc.0'
|
|
66
66
|
];
|
|
67
67
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
68
68
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -37,36 +37,36 @@ const FN021003_PKG_engines_node_1 = require("./rules/FN021003_PKG_engines_node")
|
|
|
37
37
|
const FN022001_SCSS_remove_fabric_react_1 = require("./rules/FN022001_SCSS_remove_fabric_react");
|
|
38
38
|
const FN022002_SCSS_add_fabric_react_1 = require("./rules/FN022002_SCSS_add_fabric_react");
|
|
39
39
|
module.exports = [
|
|
40
|
-
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.16.0-
|
|
41
|
-
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.16.0-
|
|
42
|
-
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.16.0-
|
|
43
|
-
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.16.0-
|
|
40
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.16.0-rc.0'),
|
|
41
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.16.0-rc.0'),
|
|
42
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.16.0-rc.0'),
|
|
43
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.16.0-rc.0'),
|
|
44
44
|
new FN001008_DEP_react_1.FN001008_DEP_react('17.0.1'),
|
|
45
45
|
new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17.0.1'),
|
|
46
|
-
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.16.0-
|
|
47
|
-
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.16.0-
|
|
48
|
-
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.16.0-
|
|
49
|
-
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.16.0-
|
|
46
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.16.0-rc.0'),
|
|
47
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.16.0-rc.0'),
|
|
48
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.16.0-rc.0'),
|
|
49
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.16.0-rc.0'),
|
|
50
50
|
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('7.199.1'),
|
|
51
|
-
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.16.0-
|
|
52
|
-
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.16.0-
|
|
53
|
-
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.16.0-
|
|
54
|
-
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.16.0-
|
|
55
|
-
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.16.0-
|
|
56
|
-
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.16.0-
|
|
57
|
-
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.16.0-
|
|
58
|
-
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.16.0-
|
|
59
|
-
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.16.0-
|
|
60
|
-
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.16.0-
|
|
61
|
-
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.16.0-
|
|
62
|
-
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.16.0-
|
|
63
|
-
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.16.0-
|
|
64
|
-
new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.16.0-
|
|
65
|
-
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.16.0-
|
|
66
|
-
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.16.0-
|
|
51
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.16.0-rc.0'),
|
|
52
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.16.0-rc.0'),
|
|
53
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.16.0-rc.0'),
|
|
54
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.16.0-rc.0'),
|
|
55
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.16.0-rc.0'),
|
|
56
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.16.0-rc.0'),
|
|
57
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.16.0-rc.0'),
|
|
58
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.16.0-rc.0'),
|
|
59
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.16.0-rc.0'),
|
|
60
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.16.0-rc.0'),
|
|
61
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.16.0-rc.0'),
|
|
62
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.16.0-rc.0'),
|
|
63
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.16.0-rc.0'),
|
|
64
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.16.0-rc.0'),
|
|
65
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.16.0-rc.0'),
|
|
66
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.16.0-rc.0'),
|
|
67
67
|
new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17.0.45'),
|
|
68
68
|
new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17.0.17'),
|
|
69
|
-
new FN010001_YORC_version_1.FN010001_YORC_version('1.16.0-
|
|
69
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.16.0-rc.0'),
|
|
70
70
|
new FN010008_YORC_nodeVersion_1.FN010008_YORC_nodeVersion(),
|
|
71
71
|
new FN010009_YORC_sdkVersions_microsoft_graph_client_1.FN010009_YORC_sdkVersions_microsoft_graph_client('3.0.2'),
|
|
72
72
|
new FN010010_YORC_sdkVersions_teams_js_1.FN010010_YORC_sdkVersions_teams_js('2.4.1'),
|
|
@@ -74,4 +74,4 @@ module.exports = [
|
|
|
74
74
|
new FN022001_SCSS_remove_fabric_react_1.FN022001_SCSS_remove_fabric_react('~office-ui-fabric-react/dist/sass/References.scss'),
|
|
75
75
|
new FN022002_SCSS_add_fabric_react_1.FN022002_SCSS_add_fabric_react('~@fluentui/react/dist/sass/References.scss')
|
|
76
76
|
];
|
|
77
|
-
//# sourceMappingURL=upgrade-1.16.0-
|
|
77
|
+
//# sourceMappingURL=upgrade-1.16.0-rc.0.js.map
|
|
@@ -66,7 +66,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
66
66
|
'1.14.0',
|
|
67
67
|
'1.15.0',
|
|
68
68
|
'1.15.2',
|
|
69
|
-
'1.16.0-
|
|
69
|
+
'1.16.0-rc.0'
|
|
70
70
|
];
|
|
71
71
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
72
72
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -78,6 +78,9 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
78
78
|
get description() {
|
|
79
79
|
return 'Upgrades SharePoint Framework project to the specified version';
|
|
80
80
|
}
|
|
81
|
+
get allowedOutputs() {
|
|
82
|
+
return ['json', 'text', 'md', 'tour'];
|
|
83
|
+
}
|
|
81
84
|
commandAction(logger, args) {
|
|
82
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
86
|
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
@@ -494,7 +497,7 @@ _SpfxProjectUpgradeCommand_instances = new WeakSet(), _SpfxProjectUpgradeCommand
|
|
|
494
497
|
});
|
|
495
498
|
this.options.forEach(o => {
|
|
496
499
|
if (o.option.indexOf('--output') > -1) {
|
|
497
|
-
o.autocomplete =
|
|
500
|
+
o.autocomplete = this.allowedOutputs;
|
|
498
501
|
}
|
|
499
502
|
});
|
|
500
503
|
}, _SpfxProjectUpgradeCommand_initValidators = function _SpfxProjectUpgradeCommand_initValidators() {
|
|
@@ -429,14 +429,14 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
429
429
|
fix: 'npm i -g yo@4'
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
|
-
'1.16.0-
|
|
432
|
+
'1.16.0-rc.0': {
|
|
433
433
|
gulpCli: {
|
|
434
434
|
range: '^1 || ^2',
|
|
435
435
|
fix: 'npm i -g gulp-cli@2'
|
|
436
436
|
},
|
|
437
437
|
node: {
|
|
438
|
-
range: '
|
|
439
|
-
fix: 'Install Node.js
|
|
438
|
+
range: '>=16.13.0 <17.0.0',
|
|
439
|
+
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
440
440
|
},
|
|
441
441
|
sp: SharePointVersion.SPO,
|
|
442
442
|
yo: {
|
|
@@ -208,24 +208,10 @@ _SpoFileRoleAssignmentAddCommand_instances = new WeakSet(), _SpoFileRoleAssignme
|
|
|
208
208
|
if (args.options.roleDefinitionId && isNaN(args.options.roleDefinitionId)) {
|
|
209
209
|
return `Specified roleDefinitionId ${args.options.roleDefinitionId} is not a number`;
|
|
210
210
|
}
|
|
211
|
-
const principalOptions = [args.options.principalId, args.options.upn, args.options.groupName];
|
|
212
|
-
if (!principalOptions.some(item => item !== undefined)) {
|
|
213
|
-
return `Specify either principalId, upn or groupName`;
|
|
214
|
-
}
|
|
215
|
-
if (principalOptions.filter(item => item !== undefined).length > 1) {
|
|
216
|
-
return `Specify either principalId, upn or groupName but not multiple`;
|
|
217
|
-
}
|
|
218
|
-
const roleDefinitionOptions = [args.options.roleDefinitionId, args.options.roleDefinitionName];
|
|
219
|
-
if (!roleDefinitionOptions.some(item => item !== undefined)) {
|
|
220
|
-
return `Specify either roleDefinitionId or roleDefinitionName`;
|
|
221
|
-
}
|
|
222
|
-
if (roleDefinitionOptions.filter(item => item !== undefined).length > 1) {
|
|
223
|
-
return `Specify either roleDefinitionId or roleDefinitionName but not multiple`;
|
|
224
|
-
}
|
|
225
211
|
return true;
|
|
226
212
|
}));
|
|
227
213
|
}, _SpoFileRoleAssignmentAddCommand_initOptionSets = function _SpoFileRoleAssignmentAddCommand_initOptionSets() {
|
|
228
|
-
this.optionSets.push(['fileId', 'fileUrl']);
|
|
214
|
+
this.optionSets.push(['fileId', 'fileUrl'], ['principalId', 'upn', 'groupName'], ['roleDefinitionId', 'roleDefinitionName']);
|
|
229
215
|
};
|
|
230
216
|
module.exports = new SpoFileRoleAssignmentAddCommand();
|
|
231
217
|
//# sourceMappingURL=file-roleassignment-add.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
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 _SpoFileVersionListCommand_instances, _SpoFileVersionListCommand_initTelemetry, _SpoFileVersionListCommand_initOptions, _SpoFileVersionListCommand_initValidators, _SpoFileVersionListCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
class SpoFileVersionListCommand extends SpoCommand_1.default {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
_SpoFileVersionListCommand_instances.add(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFileVersionListCommand_instances, "m", _SpoFileVersionListCommand_initTelemetry).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFileVersionListCommand_instances, "m", _SpoFileVersionListCommand_initOptions).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFileVersionListCommand_instances, "m", _SpoFileVersionListCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFileVersionListCommand_instances, "m", _SpoFileVersionListCommand_initOptionSets).call(this);
|
|
32
|
+
}
|
|
33
|
+
get name() {
|
|
34
|
+
return commands_1.default.FILE_VERSION_LIST;
|
|
35
|
+
}
|
|
36
|
+
get description() {
|
|
37
|
+
return 'Retrieves all versions of a file';
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (this.verbose) {
|
|
42
|
+
logger.logToStderr(`Retrieving all versions of file ${args.options.fileUrl || args.options.fileId} at site ${args.options.webUrl}...`);
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
let requestUrl = `${args.options.webUrl}/_api/web`;
|
|
46
|
+
if (args.options.fileUrl) {
|
|
47
|
+
const serverRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
48
|
+
requestUrl += `/GetFileByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(serverRelativeUrl)}')`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
requestUrl += `/GetFileById('${args.options.fileId}')`;
|
|
52
|
+
}
|
|
53
|
+
requestUrl += `/versions?$top=5000`;
|
|
54
|
+
const requestOptions = {
|
|
55
|
+
url: requestUrl,
|
|
56
|
+
headers: {
|
|
57
|
+
'accept': 'application/json;odata=nometadata'
|
|
58
|
+
},
|
|
59
|
+
responseType: 'json'
|
|
60
|
+
};
|
|
61
|
+
const response = yield request_1.default.get(requestOptions);
|
|
62
|
+
logger.log(response.value);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
this.handleRejectedODataJsonPromise(err);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_SpoFileVersionListCommand_instances = new WeakSet(), _SpoFileVersionListCommand_initTelemetry = function _SpoFileVersionListCommand_initTelemetry() {
|
|
71
|
+
this.telemetry.push((args) => {
|
|
72
|
+
Object.assign(this.telemetryProperties, {
|
|
73
|
+
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
74
|
+
fileId: typeof args.options.fileId !== 'undefined'
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}, _SpoFileVersionListCommand_initOptions = function _SpoFileVersionListCommand_initOptions() {
|
|
78
|
+
this.options.unshift({
|
|
79
|
+
option: '-w, --webUrl <webUrl>'
|
|
80
|
+
}, {
|
|
81
|
+
option: '-u, --fileUrl [fileUrl]'
|
|
82
|
+
}, {
|
|
83
|
+
option: '-i, --fileId [fileId]'
|
|
84
|
+
});
|
|
85
|
+
}, _SpoFileVersionListCommand_initValidators = function _SpoFileVersionListCommand_initValidators() {
|
|
86
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
if (args.options.fileId && !validation_1.validation.isValidGuid(args.options.fileId)) {
|
|
88
|
+
return `${args.options.fileId} is not a valid GUID`;
|
|
89
|
+
}
|
|
90
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
91
|
+
}));
|
|
92
|
+
}, _SpoFileVersionListCommand_initOptionSets = function _SpoFileVersionListCommand_initOptionSets() {
|
|
93
|
+
this.optionSets.push(['fileUrl', 'fileId']);
|
|
94
|
+
};
|
|
95
|
+
module.exports = new SpoFileVersionListCommand();
|
|
96
|
+
//# sourceMappingURL=file-version-list.js.map
|
|
@@ -13,9 +13,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpoFolderListCommand_instances, _SpoFolderListCommand_initOptions, _SpoFolderListCommand_initValidators;
|
|
16
|
+
var _SpoFolderListCommand_instances, _SpoFolderListCommand_initTelemetry, _SpoFolderListCommand_initOptions, _SpoFolderListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
19
20
|
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
20
21
|
const validation_1 = require("../../../../utils/validation");
|
|
21
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
@@ -24,6 +25,7 @@ class SpoFolderListCommand extends SpoCommand_1.default {
|
|
|
24
25
|
constructor() {
|
|
25
26
|
super();
|
|
26
27
|
_SpoFolderListCommand_instances.add(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initTelemetry).call(this);
|
|
27
29
|
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initOptions).call(this);
|
|
28
30
|
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initValidators).call(this);
|
|
29
31
|
}
|
|
@@ -39,32 +41,53 @@ class SpoFolderListCommand extends SpoCommand_1.default {
|
|
|
39
41
|
commandAction(logger, args) {
|
|
40
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
43
|
if (this.verbose) {
|
|
42
|
-
logger.logToStderr(`Retrieving folders from site ${args.options.webUrl} parent folder ${args.options.parentFolderUrl}...`);
|
|
44
|
+
logger.logToStderr(`Retrieving folders from site ${args.options.webUrl} parent folder ${args.options.parentFolderUrl} ${args.options.recursive ? '(recursive)' : ''}...`);
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
const resp = yield this.getFolderList(args.options.webUrl, args.options.parentFolderUrl, args.options.recursive);
|
|
48
|
+
logger.log(resp);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleRejectedODataJsonPromise(err);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
getFolderList(webUrl, parentFolderUrl, recursive, folders = []) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const serverRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(webUrl, parentFolderUrl);
|
|
46
58
|
const requestOptions = {
|
|
47
|
-
url:
|
|
59
|
+
url: `${webUrl}/_api/web/GetFolderByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(serverRelativeUrl)}')/folders`,
|
|
48
60
|
headers: {
|
|
49
61
|
'accept': 'application/json;odata=nometadata'
|
|
50
62
|
},
|
|
51
63
|
responseType: 'json'
|
|
52
64
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
const resp = yield request_1.default.get(requestOptions);
|
|
66
|
+
if (resp.value.length > 0) {
|
|
67
|
+
for (const folder of resp.value) {
|
|
68
|
+
folders.push(folder);
|
|
69
|
+
if (recursive) {
|
|
70
|
+
yield this.getFolderList(webUrl, folder.ServerRelativeUrl, recursive, folders);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
59
73
|
}
|
|
74
|
+
return folders;
|
|
60
75
|
});
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
|
-
_SpoFolderListCommand_instances = new WeakSet(),
|
|
78
|
+
_SpoFolderListCommand_instances = new WeakSet(), _SpoFolderListCommand_initTelemetry = function _SpoFolderListCommand_initTelemetry() {
|
|
79
|
+
this.telemetry.push((args) => {
|
|
80
|
+
Object.assign(this.telemetryProperties, {
|
|
81
|
+
recursive: !!args.options.recursive
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}, _SpoFolderListCommand_initOptions = function _SpoFolderListCommand_initOptions() {
|
|
64
85
|
this.options.unshift({
|
|
65
86
|
option: '-u, --webUrl <webUrl>'
|
|
66
87
|
}, {
|
|
67
88
|
option: '-p, --parentFolderUrl <parentFolderUrl>'
|
|
89
|
+
}, {
|
|
90
|
+
option: '--recursive [recursive]'
|
|
68
91
|
});
|
|
69
92
|
}, _SpoFolderListCommand_initValidators = function _SpoFolderListCommand_initValidators() {
|
|
70
93
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|