@pnp/cli-microsoft365 6.1.0-beta.a927083 → 6.1.0-beta.f03db2d
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.js +2 -0
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +111 -0
- package/dist/m365/pp/commands/chatbot/chatbot-remove.js +131 -0
- package/dist/m365/pp/commands/dataverse/dataverse-table-row-list.js +95 -0
- package/dist/m365/pp/commands/solution/solution-publisher-add.js +101 -0
- package/dist/m365/pp/commands.js +4 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +38 -0
- package/dist/m365/purview/commands.js +7 -0
- package/dist/m365/spo/commands/listitem/listitem-list.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +121 -0
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/teams/commands.js +1 -0
- package/docs/docs/cmd/cli/cli-consent.md +20 -0
- package/docs/docs/cmd/cli/cli-doctor.md +50 -0
- package/docs/docs/cmd/cli/cli-issue.md +20 -0
- package/docs/docs/cmd/cli/cli-reconsent.md +20 -0
- package/docs/docs/cmd/cli/completion/completion-clink-update.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-pwsh-setup.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-pwsh-update.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-sh-setup.md +21 -1
- package/docs/docs/cmd/cli/completion/completion-sh-update.md +4 -0
- package/docs/docs/cmd/cli/config/config-get.md +22 -0
- package/docs/docs/cmd/cli/config/config-reset.md +4 -0
- package/docs/docs/cmd/cli/config/config-set.md +4 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-get.md +123 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-remove.md +52 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.md +90 -0
- package/docs/docs/cmd/pp/solution/solution-publisher-add.md +49 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +81 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +4 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +38 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-list.md +38 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +4 -0
- package/docs/docs/cmd/teams/meeting/meeting-attendancereport-list.md +69 -0
- package/docs/docs/cmd/teams/user/user-app-list.md +6 -0
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -37,6 +37,7 @@ const dictionary = [
|
|
|
37
37
|
'installed',
|
|
38
38
|
'is',
|
|
39
39
|
'issue',
|
|
40
|
+
'label',
|
|
40
41
|
'list',
|
|
41
42
|
'management',
|
|
42
43
|
'member',
|
|
@@ -52,6 +53,7 @@ const dictionary = [
|
|
|
52
53
|
'property',
|
|
53
54
|
'records',
|
|
54
55
|
'recycle',
|
|
56
|
+
'retention',
|
|
55
57
|
'role',
|
|
56
58
|
'room',
|
|
57
59
|
'schema',
|
|
@@ -0,0 +1,111 @@
|
|
|
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 _PpChatbotGetCommand_instances, _PpChatbotGetCommand_initTelemetry, _PpChatbotGetCommand_initOptions, _PpChatbotGetCommand_initOptionSets, _PpChatbotGetCommand_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 formatting_1 = require("../../../../utils/formatting");
|
|
24
|
+
class PpChatbotGetCommand extends PowerPlatformCommand_1.default {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
_PpChatbotGetCommand_instances.add(this);
|
|
28
|
+
__classPrivateFieldGet(this, _PpChatbotGetCommand_instances, "m", _PpChatbotGetCommand_initTelemetry).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpChatbotGetCommand_instances, "m", _PpChatbotGetCommand_initOptions).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PpChatbotGetCommand_instances, "m", _PpChatbotGetCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PpChatbotGetCommand_instances, "m", _PpChatbotGetCommand_initOptionSets).call(this);
|
|
32
|
+
}
|
|
33
|
+
get name() {
|
|
34
|
+
return commands_1.default.CHATBOT_GET;
|
|
35
|
+
}
|
|
36
|
+
get description() {
|
|
37
|
+
return 'Get information about the specified chatbot';
|
|
38
|
+
}
|
|
39
|
+
defaultProperties() {
|
|
40
|
+
return ['name', 'botid', 'publishedon', 'createdon', 'modifiedon'];
|
|
41
|
+
}
|
|
42
|
+
commandAction(logger, args) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
if (this.verbose) {
|
|
45
|
+
logger.logToStderr(`Retrieving chatbot '${args.options.id || args.options.name}'...`);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
49
|
+
const res = yield this.getChatbot(dynamicsApiUrl, args.options);
|
|
50
|
+
logger.log(res);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getChatbot(dynamicsApiUrl, options) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const requestOptions = {
|
|
60
|
+
headers: {
|
|
61
|
+
accept: 'application/json;odata.metadata=none'
|
|
62
|
+
},
|
|
63
|
+
responseType: 'json'
|
|
64
|
+
};
|
|
65
|
+
if (options.id) {
|
|
66
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.1/bots(${options.id})`;
|
|
67
|
+
const result = yield request_1.default.get(requestOptions);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.1/bots?$filter=name eq '${formatting_1.formatting.encodeQueryParameter(options.name)}'`;
|
|
71
|
+
const result = yield request_1.default.get(requestOptions);
|
|
72
|
+
if (result.value.length > 1) {
|
|
73
|
+
throw `Multiple chatbots with name '${options.name}' found: ${result.value.map(x => x.botid).join(',')}`;
|
|
74
|
+
}
|
|
75
|
+
if (result.value.length === 0) {
|
|
76
|
+
throw `The specified chatbot '${options.name}' does not exist.`;
|
|
77
|
+
}
|
|
78
|
+
return result.value[0];
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_PpChatbotGetCommand_instances = new WeakSet(), _PpChatbotGetCommand_initTelemetry = function _PpChatbotGetCommand_initTelemetry() {
|
|
83
|
+
this.telemetry.push((args) => {
|
|
84
|
+
Object.assign(this.telemetryProperties, {
|
|
85
|
+
id: typeof args.options.id !== 'undefined',
|
|
86
|
+
name: typeof args.options.name !== 'undefined',
|
|
87
|
+
asAdmin: !!args.options.asAdmin
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}, _PpChatbotGetCommand_initOptions = function _PpChatbotGetCommand_initOptions() {
|
|
91
|
+
this.options.unshift({
|
|
92
|
+
option: '-e, --environment <environment>'
|
|
93
|
+
}, {
|
|
94
|
+
option: '-i, --id [id]'
|
|
95
|
+
}, {
|
|
96
|
+
option: '-n, --name [name]'
|
|
97
|
+
}, {
|
|
98
|
+
option: '--asAdmin'
|
|
99
|
+
});
|
|
100
|
+
}, _PpChatbotGetCommand_initOptionSets = function _PpChatbotGetCommand_initOptionSets() {
|
|
101
|
+
this.optionSets.push({ options: ['id', 'name'] });
|
|
102
|
+
}, _PpChatbotGetCommand_initValidators = function _PpChatbotGetCommand_initValidators() {
|
|
103
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
105
|
+
return `${args.options.id} is not a valid GUID`;
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
module.exports = new PpChatbotGetCommand();
|
|
111
|
+
//# sourceMappingURL=chatbot-get.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
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 _PpChatbotRemoveCommand_instances, _PpChatbotRemoveCommand_initTelemetry, _PpChatbotRemoveCommand_initOptions, _PpChatbotRemoveCommand_initOptionSets, _PpChatbotRemoveCommand_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 PpChatbotGetCommand = require("./chatbot-get");
|
|
25
|
+
class PpChatbotRemoveCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_PpChatbotRemoveCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpChatbotRemoveCommand_instances, "m", _PpChatbotRemoveCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PpChatbotRemoveCommand_instances, "m", _PpChatbotRemoveCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PpChatbotRemoveCommand_instances, "m", _PpChatbotRemoveCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PpChatbotRemoveCommand_instances, "m", _PpChatbotRemoveCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.CHATBOT_REMOVE;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Removes the specified chatbot';
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
logger.logToStderr(`Removing chatbot '${args.options.id || args.options.name}'...`);
|
|
44
|
+
}
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
yield this.deleteChatbot(args);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const result = yield Cli_1.Cli.prompt({
|
|
50
|
+
type: 'confirm',
|
|
51
|
+
name: 'continue',
|
|
52
|
+
default: false,
|
|
53
|
+
message: `Are you sure you want to remove chatbot '${args.options.id || args.options.name}'?`
|
|
54
|
+
});
|
|
55
|
+
if (result.continue) {
|
|
56
|
+
yield this.deleteChatbot(args);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getChatbotId(args) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (args.options.id) {
|
|
64
|
+
return args.options.id;
|
|
65
|
+
}
|
|
66
|
+
const options = {
|
|
67
|
+
environment: args.options.environment,
|
|
68
|
+
name: args.options.name,
|
|
69
|
+
output: 'json',
|
|
70
|
+
debug: this.debug,
|
|
71
|
+
verbose: this.verbose
|
|
72
|
+
};
|
|
73
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(PpChatbotGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
74
|
+
const getBotOutput = JSON.parse(output.stdout);
|
|
75
|
+
return getBotOutput.botid;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
deleteChatbot(args) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
try {
|
|
81
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
82
|
+
const botId = yield this.getChatbotId(args);
|
|
83
|
+
const requestOptions = {
|
|
84
|
+
url: `${dynamicsApiUrl}/api/data/v9.1/bots(${botId})/Microsoft.Dynamics.CRM.PvaDeleteBot?tag=deprovisionbotondelete`,
|
|
85
|
+
headers: {
|
|
86
|
+
accept: 'application/json',
|
|
87
|
+
'content-type': 'application/json'
|
|
88
|
+
},
|
|
89
|
+
responseType: 'json'
|
|
90
|
+
};
|
|
91
|
+
yield request_1.default.post(requestOptions);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
this.handleRejectedODataJsonPromise(err);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_PpChatbotRemoveCommand_instances = new WeakSet(), _PpChatbotRemoveCommand_initTelemetry = function _PpChatbotRemoveCommand_initTelemetry() {
|
|
100
|
+
this.telemetry.push((args) => {
|
|
101
|
+
Object.assign(this.telemetryProperties, {
|
|
102
|
+
id: typeof args.options.id !== 'undefined',
|
|
103
|
+
name: typeof args.options.name !== 'undefined',
|
|
104
|
+
asAdmin: !!args.options.asAdmin,
|
|
105
|
+
confirm: !!args.options.confirm
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}, _PpChatbotRemoveCommand_initOptions = function _PpChatbotRemoveCommand_initOptions() {
|
|
109
|
+
this.options.unshift({
|
|
110
|
+
option: '-e, --environment <environment>'
|
|
111
|
+
}, {
|
|
112
|
+
option: '-i, --id [id]'
|
|
113
|
+
}, {
|
|
114
|
+
option: '-n, --name [name]'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--asAdmin'
|
|
117
|
+
}, {
|
|
118
|
+
option: '--confirm'
|
|
119
|
+
});
|
|
120
|
+
}, _PpChatbotRemoveCommand_initOptionSets = function _PpChatbotRemoveCommand_initOptionSets() {
|
|
121
|
+
this.optionSets.push({ options: ['id', 'name'] });
|
|
122
|
+
}, _PpChatbotRemoveCommand_initValidators = function _PpChatbotRemoveCommand_initValidators() {
|
|
123
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
125
|
+
return `${args.options.id} is not a valid GUID`;
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
}));
|
|
129
|
+
};
|
|
130
|
+
module.exports = new PpChatbotRemoveCommand();
|
|
131
|
+
//# sourceMappingURL=chatbot-remove.js.map
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _PpDataverseTableRowListCommand_instances, _PpDataverseTableRowListCommand_initTelemetry, _PpDataverseTableRowListCommand_initOptions, _PpDataverseTableRowListCommand_initOptionSets;
|
|
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 odata_1 = require("../../../../utils/odata");
|
|
23
|
+
class PpDataverseTableRowListCommand extends PowerPlatformCommand_1.default {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
_PpDataverseTableRowListCommand_instances.add(this);
|
|
27
|
+
__classPrivateFieldGet(this, _PpDataverseTableRowListCommand_instances, "m", _PpDataverseTableRowListCommand_initTelemetry).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _PpDataverseTableRowListCommand_instances, "m", _PpDataverseTableRowListCommand_initOptions).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PpDataverseTableRowListCommand_instances, "m", _PpDataverseTableRowListCommand_initOptionSets).call(this);
|
|
30
|
+
}
|
|
31
|
+
get name() {
|
|
32
|
+
return commands_1.default.DATAVERSE_TABLE_ROW_LIST;
|
|
33
|
+
}
|
|
34
|
+
get description() {
|
|
35
|
+
return 'Lists table rows for the given Dataverse table';
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
logger.logToStderr('Retrieving list of table rows');
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
44
|
+
const entitySetName = yield this.getEntitySetName(dynamicsApiUrl, args);
|
|
45
|
+
if (this.verbose) {
|
|
46
|
+
logger.logToStderr('Entity set name is: ' + entitySetName);
|
|
47
|
+
}
|
|
48
|
+
const response = yield odata_1.odata.getAllItems(`${dynamicsApiUrl}/api/data/v9.0/${entitySetName}`);
|
|
49
|
+
logger.log(response);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
this.handleRejectedODataJsonPromise(err);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
getEntitySetName(dynamicsApiUrl, args) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
if (args.options.entitySetName) {
|
|
59
|
+
return args.options.entitySetName;
|
|
60
|
+
}
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
url: `${dynamicsApiUrl}/api/data/v9.0/EntityDefinitions(LogicalName='${args.options.tableName}')?$select=EntitySetName`,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata.metadata=none'
|
|
65
|
+
},
|
|
66
|
+
responseType: 'json'
|
|
67
|
+
};
|
|
68
|
+
const response = yield request_1.default.get(requestOptions);
|
|
69
|
+
return response.EntitySetName;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_PpDataverseTableRowListCommand_instances = new WeakSet(), _PpDataverseTableRowListCommand_initTelemetry = function _PpDataverseTableRowListCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
entitySetName: typeof args.options.entitySetName !== 'undefined',
|
|
77
|
+
tableName: typeof args.options.tableName !== 'undefined',
|
|
78
|
+
asAdmin: !!args.options.asAdmin
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}, _PpDataverseTableRowListCommand_initOptions = function _PpDataverseTableRowListCommand_initOptions() {
|
|
82
|
+
this.options.unshift({
|
|
83
|
+
option: '-e, --environment <environment>'
|
|
84
|
+
}, {
|
|
85
|
+
option: '--entitySetName [entitySetName]'
|
|
86
|
+
}, {
|
|
87
|
+
option: '--tableName [tableName]'
|
|
88
|
+
}, {
|
|
89
|
+
option: '--asAdmin'
|
|
90
|
+
});
|
|
91
|
+
}, _PpDataverseTableRowListCommand_initOptionSets = function _PpDataverseTableRowListCommand_initOptionSets() {
|
|
92
|
+
this.optionSets.push({ options: ['entitySetName', 'tableName'] });
|
|
93
|
+
};
|
|
94
|
+
module.exports = new PpDataverseTableRowListCommand();
|
|
95
|
+
//# sourceMappingURL=dataverse-table-row-list.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
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 _PpSolutionPublisherAddCommand_instances, _PpSolutionPublisherAddCommand_initTelemetry, _PpSolutionPublisherAddCommand_initOptions, _PpSolutionPublisherAddCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
20
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class PpSolutionPublisherAddCommand extends PowerPlatformCommand_1.default {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
_PpSolutionPublisherAddCommand_instances.add(this);
|
|
26
|
+
__classPrivateFieldGet(this, _PpSolutionPublisherAddCommand_instances, "m", _PpSolutionPublisherAddCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _PpSolutionPublisherAddCommand_instances, "m", _PpSolutionPublisherAddCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _PpSolutionPublisherAddCommand_instances, "m", _PpSolutionPublisherAddCommand_initValidators).call(this);
|
|
29
|
+
}
|
|
30
|
+
get name() {
|
|
31
|
+
return commands_1.default.SOLUTION_PUBLISHER_ADD;
|
|
32
|
+
}
|
|
33
|
+
get description() {
|
|
34
|
+
return 'Adds a specified publisher in a given environment';
|
|
35
|
+
}
|
|
36
|
+
commandAction(logger, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (this.verbose) {
|
|
39
|
+
logger.logToStderr(`Adding new publisher '${args.options.name}'...`);
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${dynamicsApiUrl}/api/data/v9.0/publishers`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json',
|
|
49
|
+
data: {
|
|
50
|
+
uniquename: args.options.name,
|
|
51
|
+
friendlyname: args.options.displayName,
|
|
52
|
+
customizationprefix: args.options.prefix,
|
|
53
|
+
customizationoptionvalueprefix: args.options.choiceValuePrefix
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
yield request_1.default.post(requestOptions);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_PpSolutionPublisherAddCommand_instances = new WeakSet(), _PpSolutionPublisherAddCommand_initTelemetry = function _PpSolutionPublisherAddCommand_initTelemetry() {
|
|
65
|
+
this.telemetry.push((args) => {
|
|
66
|
+
Object.assign(this.telemetryProperties, {
|
|
67
|
+
asAdmin: !!args.options.asAdmin
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}, _PpSolutionPublisherAddCommand_initOptions = function _PpSolutionPublisherAddCommand_initOptions() {
|
|
71
|
+
this.options.unshift({
|
|
72
|
+
option: '-e, --environment <environment>'
|
|
73
|
+
}, {
|
|
74
|
+
option: '-n, --name <name>'
|
|
75
|
+
}, {
|
|
76
|
+
option: '--displayName <displayName>'
|
|
77
|
+
}, {
|
|
78
|
+
option: '--prefix <prefix>'
|
|
79
|
+
}, {
|
|
80
|
+
option: '--choiceValuePrefix <choiceValuePrefix>'
|
|
81
|
+
}, {
|
|
82
|
+
option: '--asAdmin'
|
|
83
|
+
});
|
|
84
|
+
}, _PpSolutionPublisherAddCommand_initValidators = function _PpSolutionPublisherAddCommand_initValidators() {
|
|
85
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
if (isNaN(args.options.choiceValuePrefix) || args.options.choiceValuePrefix < 10000 || args.options.choiceValuePrefix > 99999 || !Number.isInteger(args.options.choiceValuePrefix)) {
|
|
87
|
+
return 'Option choiceValuePrefix should be an integer between 10000 and 99999.';
|
|
88
|
+
}
|
|
89
|
+
const nameRegEx = new RegExp(/^[a-zA-Z_][A-Za-z0-9_]+$/);
|
|
90
|
+
if (!nameRegEx.test(args.options.name)) {
|
|
91
|
+
return 'Option name may only consist of alphanumeric characters and underscores. The first character cannot be a number.';
|
|
92
|
+
}
|
|
93
|
+
const prefixRegEx = new RegExp(/^(?!mscrm.*$)[a-zA-Z][A-Za-z0-9]{1,7}$/);
|
|
94
|
+
if (!prefixRegEx.test(args.options.prefix)) {
|
|
95
|
+
return `Option prefix may only consist of alphanumeric characters. The first character cannot be a number and may not start with 'mscrm'. It must be between 2 and 8 characters long.`;
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
module.exports = new PpSolutionPublisherAddCommand();
|
|
101
|
+
//# sourceMappingURL=solution-publisher-add.js.map
|
package/dist/m365/pp/commands.js
CHANGED
|
@@ -6,10 +6,13 @@ exports.default = {
|
|
|
6
6
|
CARD_GET: `${prefix} card get`,
|
|
7
7
|
CARD_LIST: `${prefix} card list`,
|
|
8
8
|
CARD_REMOVE: `${prefix} card remove`,
|
|
9
|
+
CHATBOT_GET: `${prefix} chatbot get`,
|
|
9
10
|
CHATBOT_LIST: `${prefix} chatbot list`,
|
|
11
|
+
CHATBOT_REMOVE: `${prefix} chatbot remove`,
|
|
10
12
|
DATAVERSE_TABLE_LIST: `${prefix} dataverse table list`,
|
|
11
13
|
DATAVERSE_TABLE_GET: `${prefix} dataverse table get`,
|
|
12
14
|
DATAVERSE_TABLE_REMOVE: `${prefix} dataverse table remove`,
|
|
15
|
+
DATAVERSE_TABLE_ROW_LIST: `${prefix} dataverse table row list`,
|
|
13
16
|
ENVIRONMENT_GET: `${prefix} environment get`,
|
|
14
17
|
ENVIRONMENT_LIST: `${prefix} environment list`,
|
|
15
18
|
GATEWAY_GET: `${prefix} gateway get`,
|
|
@@ -19,6 +22,7 @@ exports.default = {
|
|
|
19
22
|
SOLUTION_GET: `${prefix} solution get`,
|
|
20
23
|
SOLUTION_LIST: `${prefix} solution list`,
|
|
21
24
|
SOLUTION_REMOVE: `${prefix} solution remove`,
|
|
25
|
+
SOLUTION_PUBLISHER_ADD: `${prefix} solution publisher add`,
|
|
22
26
|
SOLUTION_PUBLISHER_GET: `${prefix} solution publisher get`,
|
|
23
27
|
SOLUTION_PUBLISHER_LIST: `${prefix} solution publisher list`,
|
|
24
28
|
SOLUTION_PUBLISHER_REMOVE: `${prefix} solution publisher remove`,
|
|
@@ -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 PurviewRetentionLabelListCommand extends GraphCommand_1.default {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands_1.default.RETENTIONLABEL_LIST;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Get a list of retention labels';
|
|
21
|
+
}
|
|
22
|
+
defaultProperties() {
|
|
23
|
+
return ['id', 'displayName', 'isInUse'];
|
|
24
|
+
}
|
|
25
|
+
commandAction(logger) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
try {
|
|
28
|
+
const items = yield odata_1.odata.getAllItems(`${this.resource}/beta/security/labels/retentionLabels`);
|
|
29
|
+
logger.log(items);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
this.handleRejectedODataJsonPromise(err);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
module.exports = new PurviewRetentionLabelListCommand();
|
|
38
|
+
//# sourceMappingURL=retentionlabel-list.js.map
|
|
@@ -68,7 +68,7 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
68
68
|
let res;
|
|
69
69
|
if (args.options.pageNumber && Number(args.options.pageNumber) > 0) {
|
|
70
70
|
const rowLimit = `$top=${Number(args.options.pageSize) * Number(args.options.pageNumber)}`;
|
|
71
|
-
const filter = args.options.filter ? `$filter=${
|
|
71
|
+
const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
|
|
72
72
|
const fieldSelect = `?$select=Id&${rowLimit}&${filter}`;
|
|
73
73
|
const requestOptions = {
|
|
74
74
|
url: `${requestUrl}/items${fieldSelect}`,
|
|
@@ -83,7 +83,7 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
83
83
|
const skipTokenId = (res && res.value && res.value.length && res.value[res.value.length - 1]) ? res.value[res.value.length - 1].Id : 0;
|
|
84
84
|
const skipToken = (args.options.pageNumber && Number(args.options.pageNumber) > 0 && skipTokenId > 0) ? `$skiptoken=Paged=TRUE%26p_ID=${res.value[res.value.length - 1].Id}` : ``;
|
|
85
85
|
const rowLimit = args.options.pageSize ? `$top=${args.options.pageSize}` : ``;
|
|
86
|
-
const filter = args.options.filter ? `$filter=${
|
|
86
|
+
const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
|
|
87
87
|
const fieldExpand = expandFieldsArray.length > 0 ? `&$expand=${expandFieldsArray.join(",")}` : ``;
|
|
88
88
|
const fieldSelect = fieldsArray.length > 0 ?
|
|
89
89
|
`?$select=${formatting_1.formatting.encodeQueryParameter(fieldsArray.join(","))}${fieldExpand}&${rowLimit}&${skipToken}&${filter}` :
|