@pnp/cli-microsoft365 12.0.0-beta.d0b29c1 → 12.0.0-beta.d58fb77
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +15 -1
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.24.0-rc.0.js → doctor-1.24.0.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.24.0-rc.0.js → upgrade-1.24.0.js} +27 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
- package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
- package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
- package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
- package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
- package/dist/m365/teams/commands/message/message-get.js +19 -30
- package/dist/m365/teams/commands/message/message-list.js +26 -43
- package/dist/m365/teams/commands/message/message-remove.js +43 -58
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
- package/dist/m365/teams/commands/message/message-restore.js +40 -50
- package/dist/m365/teams/commands/message/message-send.js +19 -30
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/package.json +2 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMeetingTranscriptGetCommand_instances, _TeamsMeetingTranscriptGetCommand_initTelemetry, _TeamsMeetingTranscriptGetCommand_initOptions, _TeamsMeetingTranscriptGetCommand_initValidators, _TeamsMeetingTranscriptGetCommand_initOptionSets;
|
|
7
1
|
import auth from '../../../../Auth.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { z } from 'zod';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
10
6
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
@@ -13,6 +9,27 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import fs from 'fs';
|
|
15
11
|
import path from 'path';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
userId: z.string()
|
|
15
|
+
.refine(value => validation.isValidGuid(value), {
|
|
16
|
+
message: 'The userId value must be a valid GUID.'
|
|
17
|
+
}).optional().alias('u'),
|
|
18
|
+
userName: z.string()
|
|
19
|
+
.refine(value => validation.isValidUserPrincipalName(value), {
|
|
20
|
+
message: 'The userName value must be a valid user principal name (UPN).'
|
|
21
|
+
}).optional().alias('n'),
|
|
22
|
+
email: z.string()
|
|
23
|
+
.refine(value => validation.isValidUserPrincipalName(value), {
|
|
24
|
+
message: 'The email value must be a valid email.'
|
|
25
|
+
}).optional(),
|
|
26
|
+
meetingId: z.string().alias('m'),
|
|
27
|
+
id: z.string().alias('i'),
|
|
28
|
+
outputFile: z.string()
|
|
29
|
+
.refine(value => fs.existsSync(path.dirname(value)), {
|
|
30
|
+
message: 'Specified path where to save the file does not exist.'
|
|
31
|
+
}).optional().alias('f')
|
|
32
|
+
});
|
|
16
33
|
class TeamsMeetingTranscriptGetCommand extends GraphCommand {
|
|
17
34
|
get name() {
|
|
18
35
|
return commands.MEETING_TRANSCRIPT_GET;
|
|
@@ -20,13 +37,17 @@ class TeamsMeetingTranscriptGetCommand extends GraphCommand {
|
|
|
20
37
|
get description() {
|
|
21
38
|
return 'Downloads a transcript for a given meeting';
|
|
22
39
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
get schema() {
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
43
|
+
getRefinedSchema(schema) {
|
|
44
|
+
return schema.refine(options => [options.userId, options.userName, options.email].filter(value => value !== undefined).length <= 1, {
|
|
45
|
+
message: 'Specify either userId, userName or email, but not multiple.',
|
|
46
|
+
params: {
|
|
47
|
+
customCode: 'optionSet',
|
|
48
|
+
options: ['userId', 'userName', 'email']
|
|
49
|
+
}
|
|
50
|
+
});
|
|
30
51
|
}
|
|
31
52
|
async commandAction(logger, args) {
|
|
32
53
|
try {
|
|
@@ -103,50 +124,5 @@ class TeamsMeetingTranscriptGetCommand extends GraphCommand {
|
|
|
103
124
|
}
|
|
104
125
|
}
|
|
105
126
|
}
|
|
106
|
-
_TeamsMeetingTranscriptGetCommand_instances = new WeakSet(), _TeamsMeetingTranscriptGetCommand_initTelemetry = function _TeamsMeetingTranscriptGetCommand_initTelemetry() {
|
|
107
|
-
this.telemetry.push((args) => {
|
|
108
|
-
Object.assign(this.telemetryProperties, {
|
|
109
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
110
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
111
|
-
email: typeof args.options.email !== 'undefined',
|
|
112
|
-
outputFile: typeof args.options.outputFile !== 'undefined'
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
}, _TeamsMeetingTranscriptGetCommand_initOptions = function _TeamsMeetingTranscriptGetCommand_initOptions() {
|
|
116
|
-
this.options.unshift({
|
|
117
|
-
option: '-u, --userId [userId]'
|
|
118
|
-
}, {
|
|
119
|
-
option: '-n, --userName [userName]'
|
|
120
|
-
}, {
|
|
121
|
-
option: '--email [email]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '-m, --meetingId <meetingId>'
|
|
124
|
-
}, {
|
|
125
|
-
option: '-i, --id <id>'
|
|
126
|
-
}, {
|
|
127
|
-
option: '-f, --outputFile [outputFile]'
|
|
128
|
-
});
|
|
129
|
-
}, _TeamsMeetingTranscriptGetCommand_initValidators = function _TeamsMeetingTranscriptGetCommand_initValidators() {
|
|
130
|
-
this.validators.push(async (args) => {
|
|
131
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
132
|
-
return `${args.options.userId} is not a valid Guid`;
|
|
133
|
-
}
|
|
134
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
135
|
-
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
136
|
-
}
|
|
137
|
-
if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
|
|
138
|
-
return `${args.options.email} is not a valid email`;
|
|
139
|
-
}
|
|
140
|
-
if (args.options.outputFile && !fs.existsSync(path.dirname(args.options.outputFile))) {
|
|
141
|
-
return 'Specified path where to save the file does not exits';
|
|
142
|
-
}
|
|
143
|
-
return true;
|
|
144
|
-
});
|
|
145
|
-
}, _TeamsMeetingTranscriptGetCommand_initOptionSets = function _TeamsMeetingTranscriptGetCommand_initOptionSets() {
|
|
146
|
-
this.optionSets.push({
|
|
147
|
-
options: ['userId', 'userName', 'email'],
|
|
148
|
-
runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
127
|
export default new TeamsMeetingTranscriptGetCommand();
|
|
152
128
|
//# sourceMappingURL=meeting-transcript-get.js.map
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMeetingTranscriptListCommand_instances, _TeamsMeetingTranscriptListCommand_initTelemetry, _TeamsMeetingTranscriptListCommand_initOptions, _TeamsMeetingTranscriptListCommand_initValidators, _TeamsMeetingTranscriptListCommand_initOptionSets;
|
|
7
1
|
import auth from '../../../../Auth.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { z } from 'zod';
|
|
8
4
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
5
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
10
6
|
import { odata } from '../../../../utils/odata.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
userId: z.string()
|
|
13
|
+
.refine(value => validation.isValidGuid(value), {
|
|
14
|
+
message: 'The userId value must be a valid GUID.'
|
|
15
|
+
}).optional().alias('u'),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(value => validation.isValidUserPrincipalName(value), {
|
|
18
|
+
message: 'The userName value must be a valid user principal name (UPN).'
|
|
19
|
+
}).optional().alias('n'),
|
|
20
|
+
email: z.string()
|
|
21
|
+
.refine(value => validation.isValidUserPrincipalName(value), {
|
|
22
|
+
message: 'The email value must be a valid email.'
|
|
23
|
+
}).optional(),
|
|
24
|
+
meetingId: z.string().alias('m')
|
|
25
|
+
});
|
|
14
26
|
class TeamsMeetingTranscriptListCommand extends GraphCommand {
|
|
15
27
|
get name() {
|
|
16
28
|
return commands.MEETING_TRANSCRIPT_LIST;
|
|
@@ -21,13 +33,17 @@ class TeamsMeetingTranscriptListCommand extends GraphCommand {
|
|
|
21
33
|
defaultProperties() {
|
|
22
34
|
return ['id', 'createdDateTime'];
|
|
23
35
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
get schema() {
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
getRefinedSchema(schema) {
|
|
40
|
+
return schema.refine(options => [options.userId, options.userName, options.email].filter(value => value !== undefined).length <= 1, {
|
|
41
|
+
message: 'Specify either userId, userName or email, but not multiple.',
|
|
42
|
+
params: {
|
|
43
|
+
customCode: 'optionSet',
|
|
44
|
+
options: ['userId', 'userName', 'email']
|
|
45
|
+
}
|
|
46
|
+
});
|
|
31
47
|
}
|
|
32
48
|
async commandAction(logger, args) {
|
|
33
49
|
try {
|
|
@@ -70,42 +86,5 @@ class TeamsMeetingTranscriptListCommand extends GraphCommand {
|
|
|
70
86
|
}
|
|
71
87
|
}
|
|
72
88
|
}
|
|
73
|
-
_TeamsMeetingTranscriptListCommand_instances = new WeakSet(), _TeamsMeetingTranscriptListCommand_initTelemetry = function _TeamsMeetingTranscriptListCommand_initTelemetry() {
|
|
74
|
-
this.telemetry.push((args) => {
|
|
75
|
-
Object.assign(this.telemetryProperties, {
|
|
76
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
77
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
78
|
-
email: typeof args.options.email !== 'undefined'
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
}, _TeamsMeetingTranscriptListCommand_initOptions = function _TeamsMeetingTranscriptListCommand_initOptions() {
|
|
82
|
-
this.options.unshift({
|
|
83
|
-
option: '-u, --userId [userId]'
|
|
84
|
-
}, {
|
|
85
|
-
option: '-n, --userName [userName]'
|
|
86
|
-
}, {
|
|
87
|
-
option: '--email [email]'
|
|
88
|
-
}, {
|
|
89
|
-
option: '-m, --meetingId <meetingId>'
|
|
90
|
-
});
|
|
91
|
-
}, _TeamsMeetingTranscriptListCommand_initValidators = function _TeamsMeetingTranscriptListCommand_initValidators() {
|
|
92
|
-
this.validators.push(async (args) => {
|
|
93
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
94
|
-
return `${args.options.userId} is not a valid Guid`;
|
|
95
|
-
}
|
|
96
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
97
|
-
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
98
|
-
}
|
|
99
|
-
if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
|
|
100
|
-
return `${args.options.email} is not a valid email`;
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
});
|
|
104
|
-
}, _TeamsMeetingTranscriptListCommand_initOptionSets = function _TeamsMeetingTranscriptListCommand_initOptionSets() {
|
|
105
|
-
this.optionSets.push({
|
|
106
|
-
options: ['userId', 'userName', 'email'],
|
|
107
|
-
runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
89
|
export default new TeamsMeetingTranscriptListCommand();
|
|
111
90
|
//# sourceMappingURL=meeting-transcript-list.js.map
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMessageGetCommand_instances, _TeamsMessageGetCommand_initOptions, _TeamsMessageGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import GraphCommand from "../../../base/GraphCommand.js";
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
teamId: z.string()
|
|
10
|
+
.refine(val => validation.isValidGuid(val), {
|
|
11
|
+
message: 'The value is not a valid GUID.'
|
|
12
|
+
})
|
|
13
|
+
.alias('t'),
|
|
14
|
+
channelId: z.string()
|
|
15
|
+
.refine(val => validation.isValidTeamsChannelId(val), {
|
|
16
|
+
message: 'The value is not a valid Teams ChannelId.'
|
|
17
|
+
})
|
|
18
|
+
.alias('c'),
|
|
19
|
+
id: z.string()
|
|
20
|
+
.alias('i')
|
|
21
|
+
});
|
|
11
22
|
class TeamsMessageGetCommand extends GraphCommand {
|
|
12
23
|
get name() {
|
|
13
24
|
return commands.MESSAGE_GET;
|
|
@@ -15,11 +26,8 @@ class TeamsMessageGetCommand extends GraphCommand {
|
|
|
15
26
|
get description() {
|
|
16
27
|
return 'Retrieves a message from a channel in a Microsoft Teams team';
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_TeamsMessageGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _TeamsMessageGetCommand_instances, "m", _TeamsMessageGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _TeamsMessageGetCommand_instances, "m", _TeamsMessageGetCommand_initValidators).call(this);
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
23
31
|
}
|
|
24
32
|
async commandAction(logger, args) {
|
|
25
33
|
const requestOptions = {
|
|
@@ -38,24 +46,5 @@ class TeamsMessageGetCommand extends GraphCommand {
|
|
|
38
46
|
}
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
|
-
_TeamsMessageGetCommand_instances = new WeakSet(), _TeamsMessageGetCommand_initOptions = function _TeamsMessageGetCommand_initOptions() {
|
|
42
|
-
this.options.unshift({
|
|
43
|
-
option: '-t, --teamId <teamId>'
|
|
44
|
-
}, {
|
|
45
|
-
option: '-c, --channelId <channelId>'
|
|
46
|
-
}, {
|
|
47
|
-
option: '-i, --id <id>'
|
|
48
|
-
});
|
|
49
|
-
}, _TeamsMessageGetCommand_initValidators = function _TeamsMessageGetCommand_initValidators() {
|
|
50
|
-
this.validators.push(async (args) => {
|
|
51
|
-
if (!validation.isValidGuid(args.options.teamId)) {
|
|
52
|
-
return `${args.options.teamId} is not a valid GUID`;
|
|
53
|
-
}
|
|
54
|
-
if (!validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
55
|
-
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
56
|
-
}
|
|
57
|
-
return true;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
49
|
export default new TeamsMessageGetCommand();
|
|
61
50
|
//# sourceMappingURL=message-get.js.map
|
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMessageListCommand_instances, _TeamsMessageListCommand_initTelemetry, _TeamsMessageListCommand_initOptions, _TeamsMessageListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
teamId: z.string()
|
|
10
|
+
.refine(val => validation.isValidGuid(val), {
|
|
11
|
+
message: 'The value is not a valid GUID.'
|
|
12
|
+
})
|
|
13
|
+
.alias('i'),
|
|
14
|
+
channelId: z.string()
|
|
15
|
+
.refine(val => validation.isValidTeamsChannelId(val), {
|
|
16
|
+
message: 'The value is not a valid Teams ChannelId.'
|
|
17
|
+
})
|
|
18
|
+
.alias('c'),
|
|
19
|
+
since: z.string()
|
|
20
|
+
.refine(val => validation.isValidISODateDashOnly(val), {
|
|
21
|
+
message: 'The value is not a valid ISO Date (with dash separator).'
|
|
22
|
+
})
|
|
23
|
+
.refine(val => validation.isDateInRange(val, 8), {
|
|
24
|
+
message: 'The value is not in the last 8 months (for delta messages).'
|
|
25
|
+
})
|
|
26
|
+
.optional()
|
|
27
|
+
.alias('s')
|
|
28
|
+
});
|
|
11
29
|
class TeamsMessageListCommand extends GraphCommand {
|
|
12
30
|
get name() {
|
|
13
31
|
return commands.MESSAGE_LIST;
|
|
@@ -18,12 +36,8 @@ class TeamsMessageListCommand extends GraphCommand {
|
|
|
18
36
|
defaultProperties() {
|
|
19
37
|
return ['id', 'summary', 'body'];
|
|
20
38
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_TeamsMessageListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initTelemetry).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initValidators).call(this);
|
|
39
|
+
get schema() {
|
|
40
|
+
return options;
|
|
27
41
|
}
|
|
28
42
|
async commandAction(logger, args) {
|
|
29
43
|
const deltaExtension = args.options.since !== undefined ? `/delta?$filter=lastModifiedDateTime gt ${args.options.since}` : '';
|
|
@@ -42,36 +56,5 @@ class TeamsMessageListCommand extends GraphCommand {
|
|
|
42
56
|
}
|
|
43
57
|
}
|
|
44
58
|
}
|
|
45
|
-
_TeamsMessageListCommand_instances = new WeakSet(), _TeamsMessageListCommand_initTelemetry = function _TeamsMessageListCommand_initTelemetry() {
|
|
46
|
-
this.telemetry.push((args) => {
|
|
47
|
-
Object.assign(this.telemetryProperties, {
|
|
48
|
-
since: typeof args.options.since !== 'undefined'
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}, _TeamsMessageListCommand_initOptions = function _TeamsMessageListCommand_initOptions() {
|
|
52
|
-
this.options.unshift({
|
|
53
|
-
option: '-i, --teamId <teamId>'
|
|
54
|
-
}, {
|
|
55
|
-
option: '-c, --channelId <channelId>'
|
|
56
|
-
}, {
|
|
57
|
-
option: '-s, --since [since]'
|
|
58
|
-
});
|
|
59
|
-
}, _TeamsMessageListCommand_initValidators = function _TeamsMessageListCommand_initValidators() {
|
|
60
|
-
this.validators.push(async (args) => {
|
|
61
|
-
if (!validation.isValidGuid(args.options.teamId)) {
|
|
62
|
-
return `${args.options.teamId} is not a valid GUID`;
|
|
63
|
-
}
|
|
64
|
-
if (!validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
65
|
-
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
66
|
-
}
|
|
67
|
-
if (args.options.since && !validation.isValidISODateDashOnly(args.options.since)) {
|
|
68
|
-
return `${args.options.since} is not a valid ISO Date (with dash separator)`;
|
|
69
|
-
}
|
|
70
|
-
if (args.options.since && !validation.isDateInRange(args.options.since, 8)) {
|
|
71
|
-
return `${args.options.since} is not in the last 8 months (for delta messages)`;
|
|
72
|
-
}
|
|
73
|
-
return true;
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
59
|
export default new TeamsMessageListCommand();
|
|
77
60
|
//# sourceMappingURL=message-list.js.map
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMessageRemoveCommand_instances, _TeamsMessageRemoveCommand_initTelemetry, _TeamsMessageRemoveCommand_initOptions, _TeamsMessageRemoveCommand_initValidators, _TeamsMessageRemoveCommand_initOptionSets, _TeamsMessageRemoveCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { teams } from '../../../../utils/teams.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
teamId: z.string()
|
|
13
|
+
.refine(val => !val || validation.isValidGuid(val), {
|
|
14
|
+
message: 'The value is not a valid GUID.'
|
|
15
|
+
})
|
|
16
|
+
.optional(),
|
|
17
|
+
teamName: z.string()
|
|
18
|
+
.optional(),
|
|
19
|
+
channelId: z.string()
|
|
20
|
+
.refine(val => !val || validation.isValidTeamsChannelId(val), {
|
|
21
|
+
message: 'The value is not a valid Teams ChannelId.'
|
|
22
|
+
})
|
|
23
|
+
.optional(),
|
|
24
|
+
channelName: z.string()
|
|
25
|
+
.optional(),
|
|
26
|
+
id: z.string()
|
|
27
|
+
.alias('i'),
|
|
28
|
+
force: z.boolean()
|
|
29
|
+
.optional()
|
|
30
|
+
.alias('f')
|
|
31
|
+
});
|
|
14
32
|
class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
|
|
15
33
|
get name() {
|
|
16
34
|
return commands.MESSAGE_REMOVE;
|
|
@@ -18,14 +36,25 @@ class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
|
|
|
18
36
|
get description() {
|
|
19
37
|
return 'Removes a message from a channel in a Microsoft Teams team';
|
|
20
38
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
get schema() {
|
|
40
|
+
return options;
|
|
41
|
+
}
|
|
42
|
+
getRefinedSchema(schema) {
|
|
43
|
+
return schema
|
|
44
|
+
.refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
|
|
45
|
+
message: 'Specify either teamId or teamName, but not both.',
|
|
46
|
+
params: {
|
|
47
|
+
customCode: 'optionSet',
|
|
48
|
+
options: ['teamId', 'teamName']
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
.refine(opts => [opts.channelId, opts.channelName].filter(x => x !== undefined).length === 1, {
|
|
52
|
+
message: 'Specify either channelId or channelName, but not both.',
|
|
53
|
+
params: {
|
|
54
|
+
customCode: 'optionSet',
|
|
55
|
+
options: ['channelId', 'channelName']
|
|
56
|
+
}
|
|
57
|
+
});
|
|
29
58
|
}
|
|
30
59
|
async commandAction(logger, args) {
|
|
31
60
|
const removeTeamMessage = async () => {
|
|
@@ -64,49 +93,5 @@ class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
|
|
|
64
93
|
}
|
|
65
94
|
}
|
|
66
95
|
}
|
|
67
|
-
_TeamsMessageRemoveCommand_instances = new WeakSet(), _TeamsMessageRemoveCommand_initTelemetry = function _TeamsMessageRemoveCommand_initTelemetry() {
|
|
68
|
-
this.telemetry.push((args) => {
|
|
69
|
-
Object.assign(this.telemetryProperties, {
|
|
70
|
-
teamId: typeof args.options.teamId !== 'undefined',
|
|
71
|
-
teamName: typeof args.options.teamName !== 'undefined',
|
|
72
|
-
channelId: typeof args.options.channelId !== 'undefined',
|
|
73
|
-
channelName: typeof args.options.channelName !== 'undefined',
|
|
74
|
-
force: !!args.options.force
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}, _TeamsMessageRemoveCommand_initOptions = function _TeamsMessageRemoveCommand_initOptions() {
|
|
78
|
-
this.options.unshift({
|
|
79
|
-
option: '--teamId [teamId]'
|
|
80
|
-
}, {
|
|
81
|
-
option: '--teamName [teamName]'
|
|
82
|
-
}, {
|
|
83
|
-
option: '--channelId [channelId]'
|
|
84
|
-
}, {
|
|
85
|
-
option: '--channelName [channelName]'
|
|
86
|
-
}, {
|
|
87
|
-
option: '-i, --id <id>'
|
|
88
|
-
}, {
|
|
89
|
-
option: '-f, --force'
|
|
90
|
-
});
|
|
91
|
-
}, _TeamsMessageRemoveCommand_initValidators = function _TeamsMessageRemoveCommand_initValidators() {
|
|
92
|
-
this.validators.push(async (args) => {
|
|
93
|
-
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
94
|
-
return `'${args.options.teamId}' is not a valid GUID for 'teamId'.`;
|
|
95
|
-
}
|
|
96
|
-
if (args.options.channelId && !validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
97
|
-
return `'${args.options.channelId}' is not a valid ID for 'channelId'.`;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
});
|
|
101
|
-
}, _TeamsMessageRemoveCommand_initOptionSets = function _TeamsMessageRemoveCommand_initOptionSets() {
|
|
102
|
-
this.optionSets.push({
|
|
103
|
-
options: ['teamId', 'teamName']
|
|
104
|
-
}, {
|
|
105
|
-
options: ['channelId', 'channelName']
|
|
106
|
-
});
|
|
107
|
-
}, _TeamsMessageRemoveCommand_initTypes = function _TeamsMessageRemoveCommand_initTypes() {
|
|
108
|
-
this.types.string.push('teamId', 'teamName', 'channelId', 'channelName', 'id');
|
|
109
|
-
this.types.boolean.push('force');
|
|
110
|
-
};
|
|
111
96
|
export default new TeamsMessageRemoveCommand();
|
|
112
97
|
//# sourceMappingURL=message-remove.js.map
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _TeamsMessageReplyListCommand_instances, _TeamsMessageReplyListCommand_initOptions, _TeamsMessageReplyListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
teamId: z.string()
|
|
10
|
+
.refine(val => validation.isValidGuid(val), {
|
|
11
|
+
message: 'The value is not a valid GUID.'
|
|
12
|
+
})
|
|
13
|
+
.alias('i'),
|
|
14
|
+
channelId: z.string()
|
|
15
|
+
.refine(val => validation.isValidTeamsChannelId(val), {
|
|
16
|
+
message: 'The value is not a valid Teams ChannelId.'
|
|
17
|
+
})
|
|
18
|
+
.alias('c'),
|
|
19
|
+
messageId: z.string()
|
|
20
|
+
.alias('m')
|
|
21
|
+
});
|
|
11
22
|
class TeamsMessageReplyListCommand extends GraphCommand {
|
|
12
23
|
get name() {
|
|
13
24
|
return commands.MESSAGE_REPLY_LIST;
|
|
@@ -18,11 +29,8 @@ class TeamsMessageReplyListCommand extends GraphCommand {
|
|
|
18
29
|
defaultProperties() {
|
|
19
30
|
return ['id', 'body'];
|
|
20
31
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_TeamsMessageReplyListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _TeamsMessageReplyListCommand_instances, "m", _TeamsMessageReplyListCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _TeamsMessageReplyListCommand_instances, "m", _TeamsMessageReplyListCommand_initValidators).call(this);
|
|
32
|
+
get schema() {
|
|
33
|
+
return options;
|
|
26
34
|
}
|
|
27
35
|
async commandAction(logger, args) {
|
|
28
36
|
const endpoint = `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}/replies`;
|
|
@@ -40,24 +48,5 @@ class TeamsMessageReplyListCommand extends GraphCommand {
|
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
|
-
_TeamsMessageReplyListCommand_instances = new WeakSet(), _TeamsMessageReplyListCommand_initOptions = function _TeamsMessageReplyListCommand_initOptions() {
|
|
44
|
-
this.options.unshift({
|
|
45
|
-
option: '-i, --teamId <teamId>'
|
|
46
|
-
}, {
|
|
47
|
-
option: '-c, --channelId <channelId>'
|
|
48
|
-
}, {
|
|
49
|
-
option: '-m, --messageId <messageId>'
|
|
50
|
-
});
|
|
51
|
-
}, _TeamsMessageReplyListCommand_initValidators = function _TeamsMessageReplyListCommand_initValidators() {
|
|
52
|
-
this.validators.push(async (args) => {
|
|
53
|
-
if (!validation.isValidGuid(args.options.teamId)) {
|
|
54
|
-
return `${args.options.teamId} is not a valid GUID`;
|
|
55
|
-
}
|
|
56
|
-
if (!validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
57
|
-
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
51
|
export default new TeamsMessageReplyListCommand();
|
|
63
52
|
//# sourceMappingURL=message-reply-list.js.map
|