@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
|
@@ -13,7 +13,7 @@ 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 _AadAppAddCommand_instances, _AadAppAddCommand_initTelemetry, _AadAppAddCommand_initOptions, _AadAppAddCommand_initValidators;
|
|
16
|
+
var _AadAppAddCommand_instances, _AadAppAddCommand_initTelemetry, _AadAppAddCommand_initOptions, _AadAppAddCommand_initValidators, _AadAppAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const fs = require("fs");
|
|
19
19
|
const uuid_1 = require("uuid");
|
|
@@ -32,6 +32,7 @@ class AadAppAddCommand extends GraphCommand_1.default {
|
|
|
32
32
|
__classPrivateFieldGet(this, _AadAppAddCommand_instances, "m", _AadAppAddCommand_initTelemetry).call(this);
|
|
33
33
|
__classPrivateFieldGet(this, _AadAppAddCommand_instances, "m", _AadAppAddCommand_initOptions).call(this);
|
|
34
34
|
__classPrivateFieldGet(this, _AadAppAddCommand_instances, "m", _AadAppAddCommand_initValidators).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _AadAppAddCommand_instances, "m", _AadAppAddCommand_initOptionSets).call(this);
|
|
35
36
|
}
|
|
36
37
|
get name() {
|
|
37
38
|
return commands_1.default.APP_ADD;
|
|
@@ -731,9 +732,6 @@ _AadAppAddCommand_instances = new WeakSet(), _AadAppAddCommand_initTelemetry = f
|
|
|
731
732
|
});
|
|
732
733
|
}, _AadAppAddCommand_initValidators = function _AadAppAddCommand_initValidators() {
|
|
733
734
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
734
|
-
if (!args.options.manifest && !args.options.name) {
|
|
735
|
-
return 'Specify either the name of the app to create or the manifest';
|
|
736
|
-
}
|
|
737
735
|
if (args.options.platform &&
|
|
738
736
|
AadAppAddCommand.aadApplicationPlatform.indexOf(args.options.platform) < 0) {
|
|
739
737
|
return `${args.options.platform} is not a valid value for platform. Allowed values are ${AadAppAddCommand.aadApplicationPlatform.join(', ')}`;
|
|
@@ -778,6 +776,8 @@ _AadAppAddCommand_instances = new WeakSet(), _AadAppAddCommand_initTelemetry = f
|
|
|
778
776
|
}
|
|
779
777
|
return true;
|
|
780
778
|
}));
|
|
779
|
+
}, _AadAppAddCommand_initOptionSets = function _AadAppAddCommand_initOptionSets() {
|
|
780
|
+
this.optionSets.push(['name', 'manifest']);
|
|
781
781
|
};
|
|
782
782
|
AadAppAddCommand.aadApplicationPlatform = ['spa', 'web', 'publicClient'];
|
|
783
783
|
AadAppAddCommand.aadAppScopeConsentBy = ['admins', 'adminsAndUsers'];
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const odata_1 = require("../../../../utils/odata");
|
|
13
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
14
|
+
const commands_1 = require("../../commands");
|
|
15
|
+
class AadAppListCommand extends GraphCommand_1.default {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands_1.default.APP_LIST;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Retrieves a list of Azure AD app registrations';
|
|
21
|
+
}
|
|
22
|
+
defaultProperties() {
|
|
23
|
+
return ['appId', 'id', 'displayName', "signInAudience"];
|
|
24
|
+
}
|
|
25
|
+
commandAction(logger) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
try {
|
|
28
|
+
const results = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/applications`);
|
|
29
|
+
logger.log(results);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
this.handleRejectedODataJsonPromise(err);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
module.exports = new AadAppListCommand();
|
|
38
|
+
//# sourceMappingURL=app-list.js.map
|
|
@@ -80,6 +80,7 @@ _AadUserGetCommand_instances = new WeakSet(), _AadUserGetCommand_initTelemetry =
|
|
|
80
80
|
Object.assign(this.telemetryProperties, {
|
|
81
81
|
id: typeof args.options.id !== 'undefined',
|
|
82
82
|
userName: typeof args.options.userName !== 'undefined',
|
|
83
|
+
email: typeof args.options.email !== 'undefined',
|
|
83
84
|
properties: args.options.properties
|
|
84
85
|
});
|
|
85
86
|
});
|
|
@@ -0,0 +1,103 @@
|
|
|
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 _AadUserGuestAddCommand_instances, _AadUserGuestAddCommand_initTelemetry, _AadUserGuestAddCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
class AadUserGuestAddCommand extends GraphCommand_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_AadUserGuestAddCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _AadUserGuestAddCommand_instances, "m", _AadUserGuestAddCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _AadUserGuestAddCommand_instances, "m", _AadUserGuestAddCommand_initOptions).call(this);
|
|
27
|
+
}
|
|
28
|
+
get name() {
|
|
29
|
+
return commands_1.default.USER_GUEST_ADD;
|
|
30
|
+
}
|
|
31
|
+
get description() {
|
|
32
|
+
return 'Invite an external user to the organization';
|
|
33
|
+
}
|
|
34
|
+
defaultProperties() {
|
|
35
|
+
return ['id', 'inviteRedeemUrl', 'invitedUserDisplayName', 'invitedUserEmailAddress', 'invitedUserType', 'resetRedemption', 'sendInvitationMessage', 'status'];
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const requestOptions = {
|
|
41
|
+
url: `${this.resource}/v1.0/invitations`,
|
|
42
|
+
headers: {
|
|
43
|
+
accept: 'application/json;odata.metadata=none'
|
|
44
|
+
},
|
|
45
|
+
responseType: 'json',
|
|
46
|
+
data: {
|
|
47
|
+
invitedUserEmailAddress: args.options.emailAddress,
|
|
48
|
+
inviteRedirectUrl: args.options.inviteRedirectUrl || 'https://myapplications.microsoft.com',
|
|
49
|
+
invitedUserDisplayName: args.options.displayName,
|
|
50
|
+
sendInvitationMessage: args.options.sendInvitationMessage,
|
|
51
|
+
invitedUserMessageInfo: {
|
|
52
|
+
customizedMessageBody: args.options.welcomeMessage,
|
|
53
|
+
messageLanguage: args.options.messageLanguage || 'en-US',
|
|
54
|
+
ccRecipients: args.options.ccRecipients ? this.mapEmailsToRecipients([args.options.ccRecipients]) : undefined
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const result = yield request_1.default.post(requestOptions);
|
|
59
|
+
logger.log(result);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
mapEmailsToRecipients(emails) {
|
|
67
|
+
return emails.map(mail => ({
|
|
68
|
+
emailAddress: {
|
|
69
|
+
address: mail.trim()
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
_AadUserGuestAddCommand_instances = new WeakSet(), _AadUserGuestAddCommand_initTelemetry = function _AadUserGuestAddCommand_initTelemetry() {
|
|
75
|
+
this.telemetry.push((args) => {
|
|
76
|
+
Object.assign(this.telemetryProperties, {
|
|
77
|
+
displayName: typeof args.options.displayName !== 'undefined',
|
|
78
|
+
inviteRedirectUrl: typeof args.options.inviteRedirectUrl !== 'undefined',
|
|
79
|
+
welcomeMessage: typeof args.options.welcomeMessage !== 'undefined',
|
|
80
|
+
messageLanguage: typeof args.options.messageLanguage !== 'undefined',
|
|
81
|
+
ccRecipients: typeof args.options.ccRecipients !== 'undefined',
|
|
82
|
+
sendInvitationMessage: !!args.options.sendInvitationMessage
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}, _AadUserGuestAddCommand_initOptions = function _AadUserGuestAddCommand_initOptions() {
|
|
86
|
+
this.options.unshift({
|
|
87
|
+
option: '--emailAddress <emailAddress>'
|
|
88
|
+
}, {
|
|
89
|
+
option: '--displayName [displayName]'
|
|
90
|
+
}, {
|
|
91
|
+
option: '--inviteRedirectUrl [inviteRedirectUrl]'
|
|
92
|
+
}, {
|
|
93
|
+
option: '--welcomeMessage [welcomeMessage]'
|
|
94
|
+
}, {
|
|
95
|
+
option: '--messageLanguage [messageLanguage]'
|
|
96
|
+
}, {
|
|
97
|
+
option: '--ccRecipients [ccRecipients]'
|
|
98
|
+
}, {
|
|
99
|
+
option: '--sendInvitationMessage'
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
module.exports = new AadUserGuestAddCommand();
|
|
103
|
+
//# sourceMappingURL=user-guest-add.js.map
|
|
@@ -4,6 +4,7 @@ const prefix = 'aad';
|
|
|
4
4
|
exports.default = {
|
|
5
5
|
APP_ADD: `${prefix} app add`,
|
|
6
6
|
APP_GET: `${prefix} app get`,
|
|
7
|
+
APP_LIST: `${prefix} app list`,
|
|
7
8
|
APP_REMOVE: `${prefix} app remove`,
|
|
8
9
|
APP_ROLE_ADD: `${prefix} app role add`,
|
|
9
10
|
APP_ROLE_LIST: `${prefix} app role list`,
|
|
@@ -54,6 +55,7 @@ exports.default = {
|
|
|
54
55
|
SP_ADD: `${prefix} sp add`,
|
|
55
56
|
SP_GET: `${prefix} sp get`,
|
|
56
57
|
USER_GET: `${prefix} user get`,
|
|
58
|
+
USER_GUEST_ADD: `${prefix} user guest add`,
|
|
57
59
|
USER_HIBP: `${prefix} user hibp`,
|
|
58
60
|
USER_LIST: `${prefix} user list`,
|
|
59
61
|
USER_PASSWORD_VALIDATE: `${prefix} user password validate`,
|
|
@@ -13,7 +13,7 @@ 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 _AdaptiveCardSendCommand_instances, _AdaptiveCardSendCommand_initTelemetry, _AdaptiveCardSendCommand_initOptions, _AdaptiveCardSendCommand_initValidators;
|
|
16
|
+
var _AdaptiveCardSendCommand_instances, _AdaptiveCardSendCommand_initTelemetry, _AdaptiveCardSendCommand_initOptions, _AdaptiveCardSendCommand_initValidators, _AdaptiveCardSendCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../request");
|
|
19
19
|
const AnonymousCommand_1 = require("../../base/AnonymousCommand");
|
|
@@ -25,6 +25,7 @@ class AdaptiveCardSendCommand extends AnonymousCommand_1.default {
|
|
|
25
25
|
__classPrivateFieldGet(this, _AdaptiveCardSendCommand_instances, "m", _AdaptiveCardSendCommand_initTelemetry).call(this);
|
|
26
26
|
__classPrivateFieldGet(this, _AdaptiveCardSendCommand_instances, "m", _AdaptiveCardSendCommand_initOptions).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _AdaptiveCardSendCommand_instances, "m", _AdaptiveCardSendCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _AdaptiveCardSendCommand_instances, "m", _AdaptiveCardSendCommand_initOptionSets).call(this);
|
|
28
29
|
}
|
|
29
30
|
get name() {
|
|
30
31
|
return commands_1.default.SEND;
|
|
@@ -206,9 +207,6 @@ _AdaptiveCardSendCommand_instances = new WeakSet(), _AdaptiveCardSendCommand_ini
|
|
|
206
207
|
});
|
|
207
208
|
}, _AdaptiveCardSendCommand_initValidators = function _AdaptiveCardSendCommand_initValidators() {
|
|
208
209
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
209
|
-
if (!args.options.card && !args.options.title) {
|
|
210
|
-
return 'Specify either the title or the card to send';
|
|
211
|
-
}
|
|
212
210
|
if (args.options.card) {
|
|
213
211
|
try {
|
|
214
212
|
JSON.parse(args.options.card);
|
|
@@ -227,6 +225,8 @@ _AdaptiveCardSendCommand_instances = new WeakSet(), _AdaptiveCardSendCommand_ini
|
|
|
227
225
|
}
|
|
228
226
|
return true;
|
|
229
227
|
}));
|
|
228
|
+
}, _AdaptiveCardSendCommand_initOptionSets = function _AdaptiveCardSendCommand_initOptionSets() {
|
|
229
|
+
this.optionSets.push(['title', 'card']);
|
|
230
230
|
};
|
|
231
231
|
module.exports = new AdaptiveCardSendCommand();
|
|
232
232
|
//# sourceMappingURL=adaptivecard-send.js.map
|
|
@@ -24,23 +24,24 @@ class SpoCommand extends Command_1.default {
|
|
|
24
24
|
getNamesOfOptionsWithUrls() {
|
|
25
25
|
const namesOfOptionsWithUrls = [
|
|
26
26
|
'appCatalogUrl',
|
|
27
|
-
'siteUrl',
|
|
28
|
-
'webUrl',
|
|
29
|
-
'origin',
|
|
30
|
-
'url',
|
|
31
|
-
'imageUrl',
|
|
32
27
|
'actionUrl',
|
|
33
|
-
'
|
|
28
|
+
'imageUrl',
|
|
34
29
|
'libraryUrl',
|
|
35
|
-
'
|
|
36
|
-
'targetUrl',
|
|
30
|
+
'logoUrl',
|
|
37
31
|
'newSiteUrl',
|
|
38
|
-
'previewImageUrl',
|
|
39
32
|
'NoAccessRedirectUrl',
|
|
40
|
-
'StartASiteFormUrl',
|
|
41
33
|
'OrgNewsSiteUrl',
|
|
34
|
+
'origin',
|
|
35
|
+
'parentUrl',
|
|
42
36
|
'parentWebUrl',
|
|
43
|
-
'
|
|
37
|
+
'previewImageUrl',
|
|
38
|
+
'siteLogoUrl',
|
|
39
|
+
'siteUrl',
|
|
40
|
+
'StartASiteFormUrl',
|
|
41
|
+
'targetUrl',
|
|
42
|
+
'thumbnailUrl',
|
|
43
|
+
'url',
|
|
44
|
+
'webUrl'
|
|
44
45
|
];
|
|
45
46
|
const excludedOptionsWithUrls = this.getExcludedOptionsWithUrls();
|
|
46
47
|
if (!excludedOptionsWithUrls) {
|
|
@@ -0,0 +1,97 @@
|
|
|
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 _OutlookMessageGetCommand_instances, _OutlookMessageGetCommand_initTelemetry, _OutlookMessageGetCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class OutlookMessageGetCommand extends GraphCommand_1.default {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
_OutlookMessageGetCommand_instances.add(this);
|
|
26
|
+
__classPrivateFieldGet(this, _OutlookMessageGetCommand_instances, "m", _OutlookMessageGetCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _OutlookMessageGetCommand_instances, "m", _OutlookMessageGetCommand_initOptions).call(this);
|
|
28
|
+
}
|
|
29
|
+
get name() {
|
|
30
|
+
return commands_1.default.MESSAGE_GET;
|
|
31
|
+
}
|
|
32
|
+
get description() {
|
|
33
|
+
return 'Retrieves specified message';
|
|
34
|
+
}
|
|
35
|
+
commandAction(logger, args) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
try {
|
|
38
|
+
const isAppOnlyAuth = Auth_1.Auth.isAppOnlyAuth(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
logger.logToStderr(`Retrieving message with id ${args.options.id} using ${isAppOnlyAuth ? 'app only permissions' : 'delegated permissions'}`);
|
|
41
|
+
}
|
|
42
|
+
let requestUrl = '';
|
|
43
|
+
if (isAppOnlyAuth) {
|
|
44
|
+
if (!args.options.userId && !args.options.userPrincipalName) {
|
|
45
|
+
throw `The option 'userId' or 'userPrincipalName' is required when retrieving an email using app only credentials`;
|
|
46
|
+
}
|
|
47
|
+
if (args.options.userId && args.options.userPrincipalName) {
|
|
48
|
+
throw `Both options 'userId' and 'userPrincipalName' cannot be set when retrieving an email using app only credentials`;
|
|
49
|
+
}
|
|
50
|
+
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.userPrincipalName}`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (args.options.userId && args.options.userPrincipalName) {
|
|
54
|
+
throw `Both options 'userId' and 'userPrincipalName' cannot be set when retrieving an email using delegated credentials`;
|
|
55
|
+
}
|
|
56
|
+
if (args.options.userId || args.options.userPrincipalName) {
|
|
57
|
+
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.userPrincipalName}`;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
requestUrl += 'me';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
requestUrl += `/messages/${args.options.id}`;
|
|
64
|
+
const requestOptions = {
|
|
65
|
+
url: `${this.resource}/v1.0/${requestUrl}`,
|
|
66
|
+
headers: {
|
|
67
|
+
accept: 'application/json;odata.metadata=none'
|
|
68
|
+
},
|
|
69
|
+
responseType: 'json'
|
|
70
|
+
};
|
|
71
|
+
const res = yield request_1.default.get(requestOptions);
|
|
72
|
+
logger.log(res);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
this.handleRejectedODataJsonPromise(err);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
_OutlookMessageGetCommand_instances = new WeakSet(), _OutlookMessageGetCommand_initTelemetry = function _OutlookMessageGetCommand_initTelemetry() {
|
|
81
|
+
this.telemetry.push((args) => {
|
|
82
|
+
Object.assign(this.telemetryProperties, {
|
|
83
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
84
|
+
userPrincipalName: typeof args.options.userPrincipalName !== 'undefined'
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}, _OutlookMessageGetCommand_initOptions = function _OutlookMessageGetCommand_initOptions() {
|
|
88
|
+
this.options.unshift({
|
|
89
|
+
option: '-i, --id <id>'
|
|
90
|
+
}, {
|
|
91
|
+
option: '--userId [userId]'
|
|
92
|
+
}, {
|
|
93
|
+
option: '--userPrincipalName [userPrincipalName]'
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
module.exports = new OutlookMessageGetCommand();
|
|
97
|
+
//# sourceMappingURL=message-get.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'outlook';
|
|
4
4
|
exports.default = {
|
|
5
5
|
MAIL_SEND: `${prefix} mail send`,
|
|
6
|
+
MESSAGE_GET: `${prefix} message get`,
|
|
6
7
|
MESSAGE_LIST: `${prefix} message list`,
|
|
7
8
|
MESSAGE_MOVE: `${prefix} message move`,
|
|
8
9
|
REPORT_MAILACTIVITYCOUNTS: `${prefix} report mailactivitycounts`,
|
|
@@ -13,7 +13,7 @@ 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 _PlannerBucketGetCommand_instances, _PlannerBucketGetCommand_initTelemetry, _PlannerBucketGetCommand_initOptions, _PlannerBucketGetCommand_initValidators;
|
|
16
|
+
var _PlannerBucketGetCommand_instances, _PlannerBucketGetCommand_initTelemetry, _PlannerBucketGetCommand_initOptions, _PlannerBucketGetCommand_initValidators, _PlannerBucketGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Auth_1 = require("../../../../Auth");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
@@ -30,6 +30,7 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
30
30
|
__classPrivateFieldGet(this, _PlannerBucketGetCommand_instances, "m", _PlannerBucketGetCommand_initTelemetry).call(this);
|
|
31
31
|
__classPrivateFieldGet(this, _PlannerBucketGetCommand_instances, "m", _PlannerBucketGetCommand_initOptions).call(this);
|
|
32
32
|
__classPrivateFieldGet(this, _PlannerBucketGetCommand_instances, "m", _PlannerBucketGetCommand_initValidators).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PlannerBucketGetCommand_instances, "m", _PlannerBucketGetCommand_initOptionSets).call(this);
|
|
33
34
|
}
|
|
34
35
|
get name() {
|
|
35
36
|
return commands_1.default.BUCKET_GET;
|
|
@@ -144,9 +145,6 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
144
145
|
if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
145
146
|
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
146
147
|
}
|
|
147
|
-
if (args.options.name) {
|
|
148
|
-
return 'Specify either id or name';
|
|
149
|
-
}
|
|
150
148
|
}
|
|
151
149
|
if (args.options.name) {
|
|
152
150
|
if (!args.options.planId && !args.options.planTitle) {
|
|
@@ -172,11 +170,10 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
172
170
|
}
|
|
173
171
|
}
|
|
174
172
|
}
|
|
175
|
-
if (!args.options.id && !args.options.name) {
|
|
176
|
-
return 'Please specify id or name';
|
|
177
|
-
}
|
|
178
173
|
return true;
|
|
179
174
|
}));
|
|
175
|
+
}, _PlannerBucketGetCommand_initOptionSets = function _PlannerBucketGetCommand_initOptionSets() {
|
|
176
|
+
this.optionSets.push(['id', 'name']);
|
|
180
177
|
};
|
|
181
178
|
module.exports = new PlannerBucketGetCommand();
|
|
182
179
|
//# sourceMappingURL=bucket-get.js.map
|
|
@@ -13,7 +13,7 @@ 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 _PlannerPlanGetCommand_instances, _PlannerPlanGetCommand_initTelemetry, _PlannerPlanGetCommand_initOptions, _PlannerPlanGetCommand_initValidators;
|
|
16
|
+
var _PlannerPlanGetCommand_instances, _PlannerPlanGetCommand_initTelemetry, _PlannerPlanGetCommand_initOptions, _PlannerPlanGetCommand_initValidators, _PlannerPlanGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Auth_1 = require("../../../../Auth");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
@@ -30,6 +30,7 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
30
30
|
__classPrivateFieldGet(this, _PlannerPlanGetCommand_instances, "m", _PlannerPlanGetCommand_initTelemetry).call(this);
|
|
31
31
|
__classPrivateFieldGet(this, _PlannerPlanGetCommand_instances, "m", _PlannerPlanGetCommand_initOptions).call(this);
|
|
32
32
|
__classPrivateFieldGet(this, _PlannerPlanGetCommand_instances, "m", _PlannerPlanGetCommand_initValidators).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PlannerPlanGetCommand_instances, "m", _PlannerPlanGetCommand_initOptionSets).call(this);
|
|
33
34
|
}
|
|
34
35
|
get name() {
|
|
35
36
|
return commands_1.default.PLAN_GET;
|
|
@@ -111,25 +112,19 @@ _PlannerPlanGetCommand_instances = new WeakSet(), _PlannerPlanGetCommand_initTel
|
|
|
111
112
|
});
|
|
112
113
|
}, _PlannerPlanGetCommand_initValidators = function _PlannerPlanGetCommand_initValidators() {
|
|
113
114
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
if (args.options.
|
|
115
|
-
return 'Specify either
|
|
115
|
+
if (args.options.title && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
116
|
+
return 'Specify either ownerGroupId or ownerGroupName';
|
|
116
117
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return 'Specify either ownerGroupId or ownerGroupName';
|
|
123
|
-
}
|
|
124
|
-
if (args.options.title && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
125
|
-
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
126
|
-
}
|
|
127
|
-
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
128
|
-
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
129
|
-
}
|
|
118
|
+
if (args.options.title && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
119
|
+
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
120
|
+
}
|
|
121
|
+
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
122
|
+
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
130
123
|
}
|
|
131
124
|
return true;
|
|
132
125
|
}));
|
|
126
|
+
}, _PlannerPlanGetCommand_initOptionSets = function _PlannerPlanGetCommand_initOptionSets() {
|
|
127
|
+
this.optionSets.push(['id', 'title']);
|
|
133
128
|
};
|
|
134
129
|
module.exports = new PlannerPlanGetCommand();
|
|
135
130
|
//# sourceMappingURL=plan-get.js.map
|
|
@@ -0,0 +1,122 @@
|
|
|
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 _PpCardCloneCommand_instances, _PpCardCloneCommand_initTelemetry, _PpCardCloneCommand_initOptions, _PpCardCloneCommand_initOptionSets, _PpCardCloneCommand_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 PpCardCloneCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_PpCardCloneCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpCardCloneCommand_instances, "m", _PpCardCloneCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PpCardCloneCommand_instances, "m", _PpCardCloneCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PpCardCloneCommand_instances, "m", _PpCardCloneCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PpCardCloneCommand_instances, "m", _PpCardCloneCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.CARD_CLONE;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Clones 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(`Cloning a card from '${args.options.id || args.options.name}'...`);
|
|
44
|
+
}
|
|
45
|
+
const res = yield this.cloneCard(args);
|
|
46
|
+
logger.log(res);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getCardId(args) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
if (args.options.id) {
|
|
52
|
+
return args.options.id;
|
|
53
|
+
}
|
|
54
|
+
const options = {
|
|
55
|
+
environment: args.options.environment,
|
|
56
|
+
name: args.options.name,
|
|
57
|
+
output: 'json',
|
|
58
|
+
debug: this.debug,
|
|
59
|
+
verbose: this.verbose
|
|
60
|
+
};
|
|
61
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(PpCardGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
62
|
+
const getCardOutput = JSON.parse(output.stdout);
|
|
63
|
+
return getCardOutput.cardid;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
cloneCard(args) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
try {
|
|
69
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
70
|
+
const cardId = yield this.getCardId(args);
|
|
71
|
+
const requestOptions = {
|
|
72
|
+
url: `${dynamicsApiUrl}/api/data/v9.1/CardCreateClone`,
|
|
73
|
+
headers: {
|
|
74
|
+
accept: 'application/json;odata.metadata=none'
|
|
75
|
+
},
|
|
76
|
+
responseType: 'json',
|
|
77
|
+
data: {
|
|
78
|
+
CardId: cardId,
|
|
79
|
+
CardName: args.options.newName
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const response = yield request_1.default.post(requestOptions);
|
|
83
|
+
return response;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.handleRejectedODataJsonPromise(err);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
_PpCardCloneCommand_instances = new WeakSet(), _PpCardCloneCommand_initTelemetry = function _PpCardCloneCommand_initTelemetry() {
|
|
92
|
+
this.telemetry.push((args) => {
|
|
93
|
+
Object.assign(this.telemetryProperties, {
|
|
94
|
+
id: typeof args.options.id !== 'undefined',
|
|
95
|
+
name: typeof args.options.name !== 'undefined',
|
|
96
|
+
asAdmin: !!args.options.asAdmin
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}, _PpCardCloneCommand_initOptions = function _PpCardCloneCommand_initOptions() {
|
|
100
|
+
this.options.unshift({
|
|
101
|
+
option: '-e, --environment <environment>'
|
|
102
|
+
}, {
|
|
103
|
+
option: '--newName <newName>'
|
|
104
|
+
}, {
|
|
105
|
+
option: '-i, --id [id]'
|
|
106
|
+
}, {
|
|
107
|
+
option: '-n, --name [name]'
|
|
108
|
+
}, {
|
|
109
|
+
option: '-a, --asAdmin'
|
|
110
|
+
});
|
|
111
|
+
}, _PpCardCloneCommand_initOptionSets = function _PpCardCloneCommand_initOptionSets() {
|
|
112
|
+
this.optionSets.push(['id', 'name']);
|
|
113
|
+
}, _PpCardCloneCommand_initValidators = function _PpCardCloneCommand_initValidators() {
|
|
114
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
116
|
+
return `${args.options.id} is not a valid GUID`;
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
module.exports = new PpCardCloneCommand();
|
|
122
|
+
//# sourceMappingURL=card-clone.js.map
|