@pnp/cli-microsoft365 7.0.0-beta.99e75a7 → 7.0.0-beta.aa2d71e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +0 -2
- package/dist/GlobalOptions.js +1 -7
- package/dist/cli/Cli.js +19 -2
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-role-add.js +5 -5
- package/dist/m365/aad/commands/app/app-set.js +5 -5
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/pa/commands.js +1 -4
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +35 -25
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +39 -34
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +9 -9
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +14 -14
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +27 -26
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +8 -8
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -11
- package/dist/m365/spo/commands/file/file-move.js +73 -97
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/folder/folder-copy.js +89 -45
- package/dist/m365/spo/commands/folder/folder-move.js +89 -47
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +34 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +1 -81
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +63 -59
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +28 -31
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/FlowsPolicy.js +7 -0
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +14 -67
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +22 -22
- package/dist/m365/spo/commands/site/site-list.js +27 -43
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +177 -198
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/theme/theme-remove.js +24 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +27 -27
- package/dist/m365/spo/commands/web/web-reindex.js +35 -42
- package/dist/m365/spo/commands/web/web-remove.js +21 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +16 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +33 -44
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +18 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +19 -19
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-like-set.js +27 -28
- package/dist/m365/yammer/commands/message/message-list.js +67 -86
- package/dist/m365/yammer/commands/message/message-remove.js +18 -18
- package/dist/m365/yammer/commands/yammer-search.js +58 -74
- package/dist/utils/aadGroup.js +18 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/spo.js +594 -53
- package/dist/utils/validation.js +0 -3
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/file/file-move.mdx +36 -18
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +39 -12
- package/docs/docs/cmd/spo/folder/folder-move.mdx +40 -13
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/npm-shrinkwrap.json +240 -1417
- package/package.json +6 -7
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsAppListCommand_instances, _TeamsAppListCommand_initTelemetry, _TeamsAppListCommand_initOptions, _TeamsAppListCommand_initValidators;
|
|
6
|
+
var _TeamsAppListCommand_instances, _a, _TeamsAppListCommand_initTelemetry, _TeamsAppListCommand_initOptions, _TeamsAppListCommand_initValidators;
|
|
7
7
|
import { odata } from '../../../../utils/odata.js';
|
|
8
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
@@ -38,7 +38,7 @@ class TeamsAppListCommand extends GraphCommand {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
_TeamsAppListCommand_instances = new WeakSet(), _TeamsAppListCommand_initTelemetry = function _TeamsAppListCommand_initTelemetry() {
|
|
41
|
+
_a = TeamsAppListCommand, _TeamsAppListCommand_instances = new WeakSet(), _TeamsAppListCommand_initTelemetry = function _TeamsAppListCommand_initTelemetry() {
|
|
42
42
|
this.telemetry.push((args) => {
|
|
43
43
|
Object.assign(this.telemetryProperties, {
|
|
44
44
|
distributionMethod: args.options.distributionMethod || false
|
|
@@ -47,13 +47,13 @@ _TeamsAppListCommand_instances = new WeakSet(), _TeamsAppListCommand_initTelemet
|
|
|
47
47
|
}, _TeamsAppListCommand_initOptions = function _TeamsAppListCommand_initOptions() {
|
|
48
48
|
this.options.unshift({
|
|
49
49
|
option: '--distributionMethod [distributionMethod]',
|
|
50
|
-
autocomplete:
|
|
50
|
+
autocomplete: _a.allowedDistributionMethods
|
|
51
51
|
});
|
|
52
52
|
}, _TeamsAppListCommand_initValidators = function _TeamsAppListCommand_initValidators() {
|
|
53
53
|
this.validators.push(async (args) => {
|
|
54
54
|
if (args.options.distributionMethod &&
|
|
55
|
-
|
|
56
|
-
return `'${args.options.distributionMethod}' is not a valid distributionMethod. Allowed distribution methods are: ${
|
|
55
|
+
_a.allowedDistributionMethods.indexOf(args.options.distributionMethod) < 0) {
|
|
56
|
+
return `'${args.options.distributionMethod}' is not a valid distributionMethod. Allowed distribution methods are: ${_a.allowedDistributionMethods.join(', ')}`;
|
|
57
57
|
}
|
|
58
58
|
return true;
|
|
59
59
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsChatMemberAddCommand_instances, _TeamsChatMemberAddCommand_initTelemetry, _TeamsChatMemberAddCommand_initOptions, _TeamsChatMemberAddCommand_initValidators, _TeamsChatMemberAddCommand_initOptionSets;
|
|
6
|
+
var _TeamsChatMemberAddCommand_instances, _a, _TeamsChatMemberAddCommand_initTelemetry, _TeamsChatMemberAddCommand_initOptions, _TeamsChatMemberAddCommand_initValidators, _TeamsChatMemberAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -49,7 +49,7 @@ class TeamsChatMemberAddCommand extends GraphCommand {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
_TeamsChatMemberAddCommand_instances = new WeakSet(), _TeamsChatMemberAddCommand_initTelemetry = function _TeamsChatMemberAddCommand_initTelemetry() {
|
|
52
|
+
_a = TeamsChatMemberAddCommand, _TeamsChatMemberAddCommand_instances = new WeakSet(), _TeamsChatMemberAddCommand_initTelemetry = function _TeamsChatMemberAddCommand_initTelemetry() {
|
|
53
53
|
this.telemetry.push((args) => {
|
|
54
54
|
Object.assign(this.telemetryProperties, {
|
|
55
55
|
userId: typeof args.options.userId !== 'undefined',
|
|
@@ -68,7 +68,7 @@ _TeamsChatMemberAddCommand_instances = new WeakSet(), _TeamsChatMemberAddCommand
|
|
|
68
68
|
option: '--userName [userName]'
|
|
69
69
|
}, {
|
|
70
70
|
option: '--role [role]',
|
|
71
|
-
autocomplete:
|
|
71
|
+
autocomplete: _a.roles
|
|
72
72
|
}, {
|
|
73
73
|
option: '--visibleHistoryStartDateTime [visibleHistoryStartDateTime]'
|
|
74
74
|
}, {
|
|
@@ -85,8 +85,8 @@ _TeamsChatMemberAddCommand_instances = new WeakSet(), _TeamsChatMemberAddCommand
|
|
|
85
85
|
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
86
86
|
return `${args.options.userName} is not a valid userName.`;
|
|
87
87
|
}
|
|
88
|
-
if (args.options.role &&
|
|
89
|
-
return `${args.options.role} is not a valid role. Allowed values are ${
|
|
88
|
+
if (args.options.role && _a.roles.indexOf(args.options.role) < 0) {
|
|
89
|
+
return `${args.options.role} is not a valid role. Allowed values are ${_a.roles.join(', ')}`;
|
|
90
90
|
}
|
|
91
91
|
if (args.options.visibleHistoryStartDateTime && !validation.isValidISODateTime(args.options.visibleHistoryStartDateTime)) {
|
|
92
92
|
return `'${args.options.visibleHistoryStartDateTime}' is not a valid visibleHistoryStartDateTime.`;
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsFunSettingsSetCommand_instances, _TeamsFunSettingsSetCommand_initTelemetry, _TeamsFunSettingsSetCommand_initOptions, _TeamsFunSettingsSetCommand_initTypes, _TeamsFunSettingsSetCommand_initValidators;
|
|
6
|
+
var _TeamsFunSettingsSetCommand_instances, _a, _TeamsFunSettingsSetCommand_initTelemetry, _TeamsFunSettingsSetCommand_initOptions, _TeamsFunSettingsSetCommand_initTypes, _TeamsFunSettingsSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -32,7 +32,7 @@ class TeamsFunSettingsSetCommand extends GraphCommand {
|
|
|
32
32
|
const data = {
|
|
33
33
|
funSettings: {}
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
_a.booleanProps.forEach(p => {
|
|
36
36
|
if (typeof args.options[p] !== 'undefined') {
|
|
37
37
|
data.funSettings[p] = args.options[p];
|
|
38
38
|
}
|
|
@@ -55,12 +55,12 @@ class TeamsFunSettingsSetCommand extends GraphCommand {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
_TeamsFunSettingsSetCommand_instances = new WeakSet(), _TeamsFunSettingsSetCommand_initTelemetry = function _TeamsFunSettingsSetCommand_initTelemetry() {
|
|
58
|
+
_a = TeamsFunSettingsSetCommand, _TeamsFunSettingsSetCommand_instances = new WeakSet(), _TeamsFunSettingsSetCommand_initTelemetry = function _TeamsFunSettingsSetCommand_initTelemetry() {
|
|
59
59
|
this.telemetry.push((args) => {
|
|
60
60
|
Object.assign(this.telemetryProperties, {
|
|
61
61
|
giphyContentRating: args.options.giphyContentRating
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
_a.booleanProps.forEach(p => {
|
|
64
64
|
this.telemetryProperties[p] = args.options[p];
|
|
65
65
|
});
|
|
66
66
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsGuestSettingsSetCommand_instances, _TeamsGuestSettingsSetCommand_initTelemetry, _TeamsGuestSettingsSetCommand_initOptions, _TeamsGuestSettingsSetCommand_initTypes, _TeamsGuestSettingsSetCommand_initValidators;
|
|
6
|
+
var _TeamsGuestSettingsSetCommand_instances, _a, _TeamsGuestSettingsSetCommand_initTelemetry, _TeamsGuestSettingsSetCommand_initOptions, _TeamsGuestSettingsSetCommand_initTypes, _TeamsGuestSettingsSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -28,7 +28,7 @@ class TeamsGuestSettingsSetCommand extends GraphCommand {
|
|
|
28
28
|
const data = {
|
|
29
29
|
guestSettings: {}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
_a.booleanProps.forEach(p => {
|
|
32
32
|
if (typeof args.options[p] !== 'undefined') {
|
|
33
33
|
data.guestSettings[p] = args.options[p];
|
|
34
34
|
}
|
|
@@ -49,9 +49,9 @@ class TeamsGuestSettingsSetCommand extends GraphCommand {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
_TeamsGuestSettingsSetCommand_instances = new WeakSet(), _TeamsGuestSettingsSetCommand_initTelemetry = function _TeamsGuestSettingsSetCommand_initTelemetry() {
|
|
52
|
+
_a = TeamsGuestSettingsSetCommand, _TeamsGuestSettingsSetCommand_instances = new WeakSet(), _TeamsGuestSettingsSetCommand_initTelemetry = function _TeamsGuestSettingsSetCommand_initTelemetry() {
|
|
53
53
|
this.telemetry.push((args) => {
|
|
54
|
-
|
|
54
|
+
_a.booleanProps.forEach(p => {
|
|
55
55
|
this.telemetryProperties[p] = args.options[p];
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsMemberSettingsSetCommand_instances, _TeamsMemberSettingsSetCommand_initTelemetry, _TeamsMemberSettingsSetCommand_initOptions, _TeamsMemberSettingsSetCommand_initTypes, _TeamsMemberSettingsSetCommand_initValidators;
|
|
6
|
+
var _TeamsMemberSettingsSetCommand_instances, _a, _TeamsMemberSettingsSetCommand_initTelemetry, _TeamsMemberSettingsSetCommand_initOptions, _TeamsMemberSettingsSetCommand_initTypes, _TeamsMemberSettingsSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -28,7 +28,7 @@ class TeamsMemberSettingsSetCommand extends GraphCommand {
|
|
|
28
28
|
const data = {
|
|
29
29
|
memberSettings: {}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
_a.booleanProps.forEach(p => {
|
|
32
32
|
if (typeof args.options[p] !== 'undefined') {
|
|
33
33
|
data.memberSettings[p] = args.options[p];
|
|
34
34
|
}
|
|
@@ -49,9 +49,9 @@ class TeamsMemberSettingsSetCommand extends GraphCommand {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
_TeamsMemberSettingsSetCommand_instances = new WeakSet(), _TeamsMemberSettingsSetCommand_initTelemetry = function _TeamsMemberSettingsSetCommand_initTelemetry() {
|
|
52
|
+
_a = TeamsMemberSettingsSetCommand, _TeamsMemberSettingsSetCommand_instances = new WeakSet(), _TeamsMemberSettingsSetCommand_initTelemetry = function _TeamsMemberSettingsSetCommand_initTelemetry() {
|
|
53
53
|
this.telemetry.push((args) => {
|
|
54
|
-
|
|
54
|
+
_a.booleanProps.forEach(p => {
|
|
55
55
|
this.telemetryProperties[p] = args.options[p];
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsMessagingSettingsSetCommand_instances, _TeamsMessagingSettingsSetCommand_initTelemetry, _TeamsMessagingSettingsSetCommand_initOptions, _TeamsMessagingSettingsSetCommand_initTypes, _TeamsMessagingSettingsSetCommand_initValidators;
|
|
6
|
+
var _TeamsMessagingSettingsSetCommand_instances, _a, _TeamsMessagingSettingsSetCommand_initTelemetry, _TeamsMessagingSettingsSetCommand_initOptions, _TeamsMessagingSettingsSetCommand_initTypes, _TeamsMessagingSettingsSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -28,7 +28,7 @@ class TeamsMessagingSettingsSetCommand extends GraphCommand {
|
|
|
28
28
|
const data = {
|
|
29
29
|
messagingSettings: {}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
_a.booleanProps.forEach((p) => {
|
|
32
32
|
if (typeof args.options[p] !== 'undefined') {
|
|
33
33
|
data.messagingSettings[p] = args.options[p];
|
|
34
34
|
}
|
|
@@ -49,9 +49,9 @@ class TeamsMessagingSettingsSetCommand extends GraphCommand {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
_TeamsMessagingSettingsSetCommand_instances = new WeakSet(), _TeamsMessagingSettingsSetCommand_initTelemetry = function _TeamsMessagingSettingsSetCommand_initTelemetry() {
|
|
52
|
+
_a = TeamsMessagingSettingsSetCommand, _TeamsMessagingSettingsSetCommand_instances = new WeakSet(), _TeamsMessagingSettingsSetCommand_initTelemetry = function _TeamsMessagingSettingsSetCommand_initTelemetry() {
|
|
53
53
|
this.telemetry.push((args) => {
|
|
54
|
-
|
|
54
|
+
_a.booleanProps.forEach((p) => {
|
|
55
55
|
this.telemetryProperties[p] = args.options[p];
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -83,7 +83,7 @@ _TeamsMessagingSettingsSetCommand_instances = new WeakSet(), _TeamsMessagingSett
|
|
|
83
83
|
}
|
|
84
84
|
let hasDuplicate = false;
|
|
85
85
|
let property = '';
|
|
86
|
-
|
|
86
|
+
_a.booleanProps.forEach((prop) => {
|
|
87
87
|
if (args.options[prop] instanceof Array) {
|
|
88
88
|
property = prop;
|
|
89
89
|
hasDuplicate = true;
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsTeamSetCommand_instances, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
6
|
+
var _TeamsTeamSetCommand_instances, _a, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -60,9 +60,9 @@ class TeamsTeamSetCommand extends GraphCommand {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
_TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
63
|
+
_a = TeamsTeamSetCommand, _TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
64
64
|
this.telemetry.push((args) => {
|
|
65
|
-
|
|
65
|
+
_a.props.forEach((p) => {
|
|
66
66
|
this.telemetryProperties[p] = typeof args.options[p] !== 'undefined';
|
|
67
67
|
});
|
|
68
68
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TodoTaskAddCommand_instances, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
6
|
+
var _TodoTaskAddCommand_instances, _a, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -27,7 +27,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
27
27
|
const endpoint = `${this.resource}/v1.0`;
|
|
28
28
|
try {
|
|
29
29
|
const listId = await this.getTodoListId(args);
|
|
30
|
-
const status = args.options.status &&
|
|
30
|
+
const status = args.options.status && _a.allowedStatuses.filter(x => x.toLowerCase() === args.options.status.toLowerCase())[0];
|
|
31
31
|
const requestOptions = {
|
|
32
32
|
url: `${endpoint}/me/todo/lists/${listId}/tasks`,
|
|
33
33
|
headers: {
|
|
@@ -85,7 +85,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
85
85
|
return taskList.id;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
_TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
88
|
+
_a = TodoTaskAddCommand, _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
89
89
|
this.telemetry.push((args) => {
|
|
90
90
|
Object.assign(this.telemetryProperties, {
|
|
91
91
|
listId: typeof args.options.listId !== 'undefined',
|
|
@@ -128,7 +128,7 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
128
128
|
option: '--startDateTime [startDateTime]'
|
|
129
129
|
}, {
|
|
130
130
|
option: '--status [status]',
|
|
131
|
-
autocomplete:
|
|
131
|
+
autocomplete: _a.allowedStatuses
|
|
132
132
|
});
|
|
133
133
|
}, _TodoTaskAddCommand_initValidators = function _TodoTaskAddCommand_initValidators() {
|
|
134
134
|
this.validators.push(async (args) => {
|
|
@@ -150,8 +150,8 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
150
150
|
if (args.options.startDateTime && !validation.isValidISODateTime(args.options.startDateTime)) {
|
|
151
151
|
return `'${args.options.startDateTime}' is not a valid datetime.`;
|
|
152
152
|
}
|
|
153
|
-
if (args.options.status &&
|
|
154
|
-
return `${args.options.status} is not a valid value for status. Valid values are ${
|
|
153
|
+
if (args.options.status && _a.allowedStatuses.map(x => x.toLowerCase()).indexOf(args.options.status.toLowerCase()) === -1) {
|
|
154
|
+
return `${args.options.status} is not a valid value for status. Valid values are ${_a.allowedStatuses.join(', ')}`;
|
|
155
155
|
}
|
|
156
156
|
if (args.options.completedDateTime && args.options.status?.toLowerCase() !== 'completed') {
|
|
157
157
|
return `The completedDateTime option can only be used when the status option is set to completed`;
|
|
@@ -24,34 +24,9 @@ class YammerMessageLikeSetCommand extends YammerCommand {
|
|
|
24
24
|
__classPrivateFieldGet(this, _YammerMessageLikeSetCommand_instances, "m", _YammerMessageLikeSetCommand_initValidators).call(this);
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
|
-
const executeLikeAction = async () => {
|
|
28
|
-
const endpoint = `${this.resource}/v1/messages/liked_by/current.json`;
|
|
29
|
-
const requestOptions = {
|
|
30
|
-
url: endpoint,
|
|
31
|
-
headers: {
|
|
32
|
-
accept: 'application/json;odata.metadata=none',
|
|
33
|
-
'content-type': 'application/json;odata=nometadata'
|
|
34
|
-
},
|
|
35
|
-
responseType: 'json',
|
|
36
|
-
data: {
|
|
37
|
-
message_id: args.options.messageId
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
try {
|
|
41
|
-
if (args.options.enable !== false) {
|
|
42
|
-
await request.post(requestOptions);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
await request.delete(requestOptions);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
this.handleRejectedODataJsonPromise(err);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
27
|
if (args.options.enable === false) {
|
|
53
28
|
if (args.options.force) {
|
|
54
|
-
await executeLikeAction();
|
|
29
|
+
await this.executeLikeAction(args.options);
|
|
55
30
|
}
|
|
56
31
|
else {
|
|
57
32
|
const messagePrompt = `Are you sure you want to unlike message ${args.options.messageId}?`;
|
|
@@ -62,12 +37,36 @@ class YammerMessageLikeSetCommand extends YammerCommand {
|
|
|
62
37
|
message: messagePrompt
|
|
63
38
|
});
|
|
64
39
|
if (result.continue) {
|
|
65
|
-
await executeLikeAction();
|
|
40
|
+
await this.executeLikeAction(args.options);
|
|
66
41
|
}
|
|
67
42
|
}
|
|
68
43
|
}
|
|
69
44
|
else {
|
|
70
|
-
await executeLikeAction();
|
|
45
|
+
await this.executeLikeAction(args.options);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async executeLikeAction(options) {
|
|
49
|
+
const requestOptions = {
|
|
50
|
+
url: `${this.resource}/v1/messages/liked_by/current.json`,
|
|
51
|
+
headers: {
|
|
52
|
+
accept: 'application/json;odata.metadata=none',
|
|
53
|
+
'content-type': 'application/json;odata=nometadata'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json',
|
|
56
|
+
data: {
|
|
57
|
+
message_id: options.messageId
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
if (options.enable !== false) {
|
|
62
|
+
await request.post(requestOptions);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
await request.delete(requestOptions);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.handleRejectedODataJsonPromise(err);
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
}
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _YammerMessageListCommand_instances, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
6
|
+
var _YammerMessageListCommand_instances, _a, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import YammerCommand from '../../../base/YammerCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
@@ -25,91 +25,72 @@ class YammerMessageListCommand extends YammerCommand {
|
|
|
25
25
|
__classPrivateFieldGet(this, _YammerMessageListCommand_instances, "m", _YammerMessageListCommand_initOptions).call(this);
|
|
26
26
|
__classPrivateFieldGet(this, _YammerMessageListCommand_instances, "m", _YammerMessageListCommand_initValidators).call(this);
|
|
27
27
|
}
|
|
28
|
-
getAllItems(logger, args, messageId) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
args.options.feedType = "All";
|
|
40
|
-
}
|
|
41
|
-
switch (args.options.feedType) {
|
|
42
|
-
case 'Top':
|
|
43
|
-
endpoint += `/messages/algo.json`;
|
|
44
|
-
break;
|
|
45
|
-
case 'My':
|
|
46
|
-
endpoint += `/messages/my_feed.json`;
|
|
47
|
-
break;
|
|
48
|
-
case 'Following':
|
|
49
|
-
endpoint += `/messages/following.json`;
|
|
50
|
-
break;
|
|
51
|
-
case 'Sent':
|
|
52
|
-
endpoint += `/messages/sent.json`;
|
|
53
|
-
break;
|
|
54
|
-
case 'Private':
|
|
55
|
-
endpoint += `/messages/private.json`;
|
|
56
|
-
break;
|
|
57
|
-
case 'Received':
|
|
58
|
-
endpoint += `/messages/received.json`;
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
endpoint += `/messages.json`;
|
|
62
|
-
}
|
|
28
|
+
async getAllItems(logger, args, messageId) {
|
|
29
|
+
let endpoint = `${this.resource}/v1`;
|
|
30
|
+
if (args.options.threadId) {
|
|
31
|
+
endpoint += `/messages/in_thread/${args.options.threadId}.json`;
|
|
32
|
+
}
|
|
33
|
+
else if (args.options.groupId) {
|
|
34
|
+
endpoint += `/messages/in_group/${args.options.groupId}.json`;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (!args.options.feedType) {
|
|
38
|
+
args.options.feedType = "All";
|
|
63
39
|
}
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
switch (args.options.feedType) {
|
|
41
|
+
case 'Top':
|
|
42
|
+
endpoint += `/messages/algo.json`;
|
|
43
|
+
break;
|
|
44
|
+
case 'My':
|
|
45
|
+
endpoint += `/messages/my_feed.json`;
|
|
46
|
+
break;
|
|
47
|
+
case 'Following':
|
|
48
|
+
endpoint += `/messages/following.json`;
|
|
49
|
+
break;
|
|
50
|
+
case 'Sent':
|
|
51
|
+
endpoint += `/messages/sent.json`;
|
|
52
|
+
break;
|
|
53
|
+
case 'Private':
|
|
54
|
+
endpoint += `/messages/private.json`;
|
|
55
|
+
break;
|
|
56
|
+
case 'Received':
|
|
57
|
+
endpoint += `/messages/received.json`;
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
endpoint += `/messages.json`;
|
|
66
61
|
}
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
}
|
|
63
|
+
if (messageId !== -1) {
|
|
64
|
+
endpoint += `?older_than=${messageId}`;
|
|
65
|
+
}
|
|
66
|
+
else if (args.options.olderThanId) {
|
|
67
|
+
endpoint += `?older_than=${args.options.olderThanId}`;
|
|
68
|
+
}
|
|
69
|
+
if (args.options.threaded) {
|
|
70
|
+
if (endpoint.indexOf("?") > -1) {
|
|
71
|
+
endpoint += "&";
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
endpoint += "&";
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
endpoint += "?";
|
|
76
|
-
}
|
|
77
|
-
endpoint += `threaded=true`;
|
|
73
|
+
else {
|
|
74
|
+
endpoint += "?";
|
|
78
75
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this
|
|
98
|
-
.getAllItems(logger, args, this.items[this.items.length - 1].id)
|
|
99
|
-
.then(() => {
|
|
100
|
-
resolve();
|
|
101
|
-
}, (err) => {
|
|
102
|
-
reject(err);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
resolve();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}, (err) => {
|
|
110
|
-
reject(err);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
76
|
+
endpoint += `threaded=true`;
|
|
77
|
+
}
|
|
78
|
+
const requestOptions = {
|
|
79
|
+
url: endpoint,
|
|
80
|
+
headers: {
|
|
81
|
+
accept: 'application/json;odata.metadata=none',
|
|
82
|
+
'content-type': 'application/json;odata=nometadata'
|
|
83
|
+
},
|
|
84
|
+
responseType: 'json'
|
|
85
|
+
};
|
|
86
|
+
const res = await request.get(requestOptions);
|
|
87
|
+
this.items = this.items.concat(res.messages);
|
|
88
|
+
if (args.options.limit && this.items.length > args.options.limit) {
|
|
89
|
+
this.items = this.items.slice(0, args.options.limit);
|
|
90
|
+
}
|
|
91
|
+
else if ((res.meta.older_available === true)) {
|
|
92
|
+
await this.getAllItems(logger, args, this.items[this.items.length - 1].id);
|
|
93
|
+
}
|
|
113
94
|
}
|
|
114
95
|
async commandAction(logger, args) {
|
|
115
96
|
this.items = []; // this will reset the items array in interactive mode
|
|
@@ -136,7 +117,7 @@ class YammerMessageListCommand extends YammerCommand {
|
|
|
136
117
|
}
|
|
137
118
|
}
|
|
138
119
|
}
|
|
139
|
-
_YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
120
|
+
_a = YammerMessageListCommand, _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
140
121
|
this.telemetry.push((args) => {
|
|
141
122
|
Object.assign(this.telemetryProperties, {
|
|
142
123
|
olderThanId: args.options.olderThanId !== undefined,
|
|
@@ -152,7 +133,7 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
152
133
|
option: '--olderThanId [olderThanId]'
|
|
153
134
|
}, {
|
|
154
135
|
option: '--feedType [feedType]',
|
|
155
|
-
autocomplete:
|
|
136
|
+
autocomplete: _a.feedTypes
|
|
156
137
|
}, {
|
|
157
138
|
option: '--groupId [groupId]'
|
|
158
139
|
}, {
|
|
@@ -170,8 +151,8 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
170
151
|
if (args.options.feedType && (args.options.groupId || args.options.threadId)) {
|
|
171
152
|
return `You cannot specify the feedType with groupId or threadId at the same time`;
|
|
172
153
|
}
|
|
173
|
-
if (args.options.feedType &&
|
|
174
|
-
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${
|
|
154
|
+
if (args.options.feedType && _a.feedTypes.indexOf(args.options.feedType) < 0) {
|
|
155
|
+
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${_a.feedTypes.join('|')}`;
|
|
175
156
|
}
|
|
176
157
|
if (args.options.olderThanId && typeof args.options.olderThanId !== 'number') {
|
|
177
158
|
return `${args.options.olderThanId} is not a number`;
|
|
@@ -23,24 +23,8 @@ class YammerMessageRemoveCommand extends YammerCommand {
|
|
|
23
23
|
__classPrivateFieldGet(this, _YammerMessageRemoveCommand_instances, "m", _YammerMessageRemoveCommand_initValidators).call(this);
|
|
24
24
|
}
|
|
25
25
|
async commandAction(logger, args) {
|
|
26
|
-
const removeMessage = async () => {
|
|
27
|
-
try {
|
|
28
|
-
const requestOptions = {
|
|
29
|
-
url: `${this.resource}/v1/messages/${args.options.id}.json`,
|
|
30
|
-
headers: {
|
|
31
|
-
accept: 'application/json;odata.metadata=none',
|
|
32
|
-
'content-type': 'application/json;odata=nometadata'
|
|
33
|
-
},
|
|
34
|
-
responseType: 'json'
|
|
35
|
-
};
|
|
36
|
-
await request.delete(requestOptions);
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
this.handleRejectedODataJsonPromise(err);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
26
|
if (args.options.force) {
|
|
43
|
-
await removeMessage();
|
|
27
|
+
await this.removeMessage(args.options);
|
|
44
28
|
}
|
|
45
29
|
else {
|
|
46
30
|
const result = await Cli.prompt({
|
|
@@ -50,10 +34,26 @@ class YammerMessageRemoveCommand extends YammerCommand {
|
|
|
50
34
|
message: `Are you sure you want to remove the Yammer message ${args.options.id}?`
|
|
51
35
|
});
|
|
52
36
|
if (result.continue) {
|
|
53
|
-
await removeMessage();
|
|
37
|
+
await this.removeMessage(args.options);
|
|
54
38
|
}
|
|
55
39
|
}
|
|
56
40
|
}
|
|
41
|
+
async removeMessage(options) {
|
|
42
|
+
try {
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${this.resource}/v1/messages/${options.id}.json`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none',
|
|
47
|
+
'content-type': 'application/json;odata=nometadata'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json'
|
|
50
|
+
};
|
|
51
|
+
await request.delete(requestOptions);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
_YammerMessageRemoveCommand_instances = new WeakSet(), _YammerMessageRemoveCommand_initTelemetry = function _YammerMessageRemoveCommand_initTelemetry() {
|
|
59
59
|
this.telemetry.push((args) => {
|