@pnp/cli-microsoft365 6.2.0-beta.e162995 → 6.2.0-beta.ed6bb7b
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 +6 -0
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +3 -0
- package/dist/m365/onenote/commands/page/page-list.js +137 -0
- package/dist/m365/onenote/commands.js +2 -1
- package/dist/m365/planner/commands/bucket/bucket-add.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-get.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-list.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-remove.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-set.js +0 -6
- package/dist/m365/planner/commands/plan/plan-add.js +0 -6
- package/dist/m365/planner/commands/plan/plan-get.js +0 -6
- package/dist/m365/planner/commands/plan/plan-list.js +0 -6
- package/dist/m365/planner/commands/plan/plan-remove.js +0 -6
- package/dist/m365/planner/commands/plan/plan-set.js +0 -6
- package/dist/m365/planner/commands/task/task-add.js +0 -6
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +0 -6
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +0 -6
- package/dist/m365/planner/commands/task/task-get.js +0 -6
- package/dist/m365/planner/commands/task/task-list.js +0 -6
- package/dist/m365/planner/commands/task/task-reference-list.js +0 -6
- package/dist/m365/planner/commands/task/task-set.js +0 -6
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +110 -0
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-list.js +68 -0
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-remove.js +130 -0
- package/dist/m365/pp/commands.js +3 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +143 -0
- package/dist/m365/purview/commands.js +1 -0
- package/dist/m365/spo/commands/file/GraphFileDetails.js +3 -0
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +12 -12
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +116 -0
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +133 -0
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +135 -0
- package/dist/m365/spo/commands/group/group-member-add.js +33 -6
- package/dist/m365/spo/commands/group/group-member-remove.js +78 -33
- package/dist/m365/spo/commands/list/list-add.js +3 -0
- package/dist/m365/spo/commands/list/list-retentionlabel-ensure.js +10 -2
- package/dist/m365/spo/commands/list/list-set.js +3 -0
- package/dist/m365/spo/commands/listitem/ListItemRetentionLabel.js +3 -0
- package/dist/m365/spo/commands/listitem/SiteRetentionLabel.js +3 -0
- package/dist/m365/spo/commands/listitem/listitem-list.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +161 -0
- package/dist/m365/spo/commands/term/term-list.js +99 -29
- package/dist/m365/spo/commands.js +4 -0
- package/dist/m365/teams/commands/chat/chat-list.js +29 -7
- package/dist/m365/teams/commands/message/message-send.js +81 -0
- package/dist/m365/teams/commands.js +1 -0
- package/docs/docs/cmd/onenote/page/page-list.md +140 -0
- package/docs/docs/cmd/planner/bucket/bucket-add.md +17 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.md +17 -0
- package/docs/docs/cmd/planner/bucket/bucket-list.md +17 -0
- package/docs/docs/cmd/planner/plan/plan-add.md +40 -0
- package/docs/docs/cmd/planner/plan/plan-get.md +21 -0
- package/docs/docs/cmd/planner/plan/plan-list.md +19 -0
- package/docs/docs/cmd/planner/plan/plan-set.md +20 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.md +99 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.md +95 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.md +53 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +128 -0
- package/docs/docs/cmd/spo/cdn/cdn-get.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-set.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.md +107 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-list.md +106 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.md +52 -0
- package/docs/docs/cmd/spo/group/group-member-add.md +22 -4
- package/docs/docs/cmd/spo/group/group-member-remove.md +24 -6
- package/docs/docs/cmd/spo/list/list-add.md +3 -9
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +8 -5
- package/docs/docs/cmd/spo/list/list-set.md +3 -3
- package/docs/docs/cmd/spo/listitem/listitem-get.md +11 -12
- package/docs/docs/cmd/spo/listitem/listitem-list.md +5 -5
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.md +58 -0
- package/docs/docs/cmd/spo/term/term-list.md +138 -0
- package/docs/docs/cmd/teams/chat/chat-list.md +16 -4
- package/docs/docs/cmd/teams/message/message-send.md +119 -0
- package/npm-shrinkwrap.json +182 -202
- package/package.json +12 -11
|
@@ -0,0 +1,110 @@
|
|
|
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 _PpAiBuilderModelGetCommand_instances, _PpAiBuilderModelGetCommand_initTelemetry, _PpAiBuilderModelGetCommand_initOptions, _PpAiBuilderModelGetCommand_initOptionSets, _PpAiBuilderModelGetCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class PpAiBuilderModelGetCommand extends PowerPlatformCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.AIBUILDERMODEL_GET;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Get an AI builder model in the specified Power Platform environment.';
|
|
29
|
+
}
|
|
30
|
+
defaultProperties() {
|
|
31
|
+
return ['msdyn_name', 'msdyn_aimodelid', 'createdon', 'modifiedon'];
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
_PpAiBuilderModelGetCommand_instances.add(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelGetCommand_instances, "m", _PpAiBuilderModelGetCommand_initTelemetry).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelGetCommand_instances, "m", _PpAiBuilderModelGetCommand_initOptions).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelGetCommand_instances, "m", _PpAiBuilderModelGetCommand_initOptionSets).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelGetCommand_instances, "m", _PpAiBuilderModelGetCommand_initValidators).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Retrieving an AI builder model '${args.options.id || args.options.name}'...`);
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
48
|
+
const res = yield this.getAiBuilderModel(dynamicsApiUrl, args.options);
|
|
49
|
+
logger.log(res);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
this.handleRejectedODataJsonPromise(err);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
getAiBuilderModel(dynamicsApiUrl, options) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const requestOptions = {
|
|
59
|
+
headers: {
|
|
60
|
+
accept: 'application/json;odata.metadata=none'
|
|
61
|
+
},
|
|
62
|
+
responseType: 'json'
|
|
63
|
+
};
|
|
64
|
+
if (options.id) {
|
|
65
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.1/msdyn_aimodels(${options.id})?$filter=iscustomizable/Value eq true`;
|
|
66
|
+
const result = yield request_1.default.get(requestOptions);
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.1/msdyn_aimodels?$filter=msdyn_name eq '${options.name}' and iscustomizable/Value eq true`;
|
|
70
|
+
const result = yield request_1.default.get(requestOptions);
|
|
71
|
+
if (result.value.length === 0) {
|
|
72
|
+
throw `The specified AI builder model '${options.name}' does not exist.`;
|
|
73
|
+
}
|
|
74
|
+
if (result.value.length > 1) {
|
|
75
|
+
throw `Multiple AI builder models with name '${options.name}' found: ${result.value.map(x => x.msdyn_aimodelid).join(',')}`;
|
|
76
|
+
}
|
|
77
|
+
return result.value[0];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
_PpAiBuilderModelGetCommand_instances = new WeakSet(), _PpAiBuilderModelGetCommand_initTelemetry = function _PpAiBuilderModelGetCommand_initTelemetry() {
|
|
82
|
+
this.telemetry.push((args) => {
|
|
83
|
+
Object.assign(this.telemetryProperties, {
|
|
84
|
+
id: typeof args.options.id !== 'undefined',
|
|
85
|
+
name: typeof args.options.name !== 'undefined',
|
|
86
|
+
asAdmin: !!args.options.asAdmin
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}, _PpAiBuilderModelGetCommand_initOptions = function _PpAiBuilderModelGetCommand_initOptions() {
|
|
90
|
+
this.options.unshift({
|
|
91
|
+
option: '-e, --environment <environment>'
|
|
92
|
+
}, {
|
|
93
|
+
option: '-i, --id [id]'
|
|
94
|
+
}, {
|
|
95
|
+
option: '-n, --name [name]'
|
|
96
|
+
}, {
|
|
97
|
+
option: '--asAdmin'
|
|
98
|
+
});
|
|
99
|
+
}, _PpAiBuilderModelGetCommand_initOptionSets = function _PpAiBuilderModelGetCommand_initOptionSets() {
|
|
100
|
+
this.optionSets.push({ options: ['id', 'name'] });
|
|
101
|
+
}, _PpAiBuilderModelGetCommand_initValidators = function _PpAiBuilderModelGetCommand_initValidators() {
|
|
102
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
104
|
+
return `${args.options.id} is not a valid GUID`;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}));
|
|
108
|
+
};
|
|
109
|
+
module.exports = new PpAiBuilderModelGetCommand();
|
|
110
|
+
//# sourceMappingURL=aibuildermodel-get.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
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 _PpAiBuilderModelListCommand_instances, _PpAiBuilderModelListCommand_initTelemetry, _PpAiBuilderModelListCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const odata_1 = require("../../../../utils/odata");
|
|
19
|
+
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
20
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class PpAiBuilderModelListCommand extends PowerPlatformCommand_1.default {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands_1.default.AIBUILDERMODEL_LIST;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return 'List available AI builder models in the specified Power Platform environment.';
|
|
28
|
+
}
|
|
29
|
+
defaultProperties() {
|
|
30
|
+
return ['msdyn_name', 'msdyn_aimodelid', 'createdon', 'modifiedon'];
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_PpAiBuilderModelListCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelListCommand_instances, "m", _PpAiBuilderModelListCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelListCommand_instances, "m", _PpAiBuilderModelListCommand_initOptions).call(this);
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (this.verbose) {
|
|
41
|
+
logger.logToStderr(`Retrieving available AI Builder models`);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
45
|
+
const aimodels = yield odata_1.odata.getAllItems(`${dynamicsApiUrl}/api/data/v9.0/msdyn_aimodels?$filter=iscustomizable/Value eq true`);
|
|
46
|
+
logger.log(aimodels);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
this.handleRejectedODataJsonPromise(err);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_PpAiBuilderModelListCommand_instances = new WeakSet(), _PpAiBuilderModelListCommand_initTelemetry = function _PpAiBuilderModelListCommand_initTelemetry() {
|
|
55
|
+
this.telemetry.push((args) => {
|
|
56
|
+
Object.assign(this.telemetryProperties, {
|
|
57
|
+
asAdmin: !!args.options.asAdmin
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}, _PpAiBuilderModelListCommand_initOptions = function _PpAiBuilderModelListCommand_initOptions() {
|
|
61
|
+
this.options.unshift({
|
|
62
|
+
option: '-e, --environment <environment>'
|
|
63
|
+
}, {
|
|
64
|
+
option: '--asAdmin'
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
module.exports = new PpAiBuilderModelListCommand();
|
|
68
|
+
//# sourceMappingURL=aibuildermodel-list.js.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _PpAiBuilderModelRemoveCommand_instances, _PpAiBuilderModelRemoveCommand_initTelemetry, _PpAiBuilderModelRemoveCommand_initOptions, _PpAiBuilderModelRemoveCommand_initOptionSets, _PpAiBuilderModelRemoveCommand_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 PpAiBuilderModelGetCommand = require("./aibuildermodel-get");
|
|
25
|
+
class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.AIBUILDERMODEL_REMOVE;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Removes an AI builder model in the specified Power Platform environment.';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_PpAiBuilderModelRemoveCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelRemoveCommand_instances, "m", _PpAiBuilderModelRemoveCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelRemoveCommand_instances, "m", _PpAiBuilderModelRemoveCommand_initOptions).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelRemoveCommand_instances, "m", _PpAiBuilderModelRemoveCommand_initValidators).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _PpAiBuilderModelRemoveCommand_instances, "m", _PpAiBuilderModelRemoveCommand_initOptionSets).call(this);
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
logger.logToStderr(`Removing AI builder model '${args.options.id || args.options.name}'...`);
|
|
44
|
+
}
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
yield this.deleteAiBuilderModel(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 AI builder model '${args.options.id || args.options.name}'?`
|
|
54
|
+
});
|
|
55
|
+
if (result.continue) {
|
|
56
|
+
yield this.deleteAiBuilderModel(args);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getAiBuilderModelId(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(PpAiBuilderModelGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
74
|
+
const getAiBuilderModelOutput = JSON.parse(output.stdout);
|
|
75
|
+
return getAiBuilderModelOutput.msdyn_aimodelid;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
deleteAiBuilderModel(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 aiBuilderModelId = yield this.getAiBuilderModelId(args);
|
|
83
|
+
const requestOptions = {
|
|
84
|
+
url: `${dynamicsApiUrl}/api/data/v9.1/msdyn_aimodels(${aiBuilderModelId})`,
|
|
85
|
+
headers: {
|
|
86
|
+
accept: 'application/json;odata.metadata=none'
|
|
87
|
+
},
|
|
88
|
+
responseType: 'json'
|
|
89
|
+
};
|
|
90
|
+
yield request_1.default.delete(requestOptions);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
this.handleRejectedODataJsonPromise(err);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_PpAiBuilderModelRemoveCommand_instances = new WeakSet(), _PpAiBuilderModelRemoveCommand_initTelemetry = function _PpAiBuilderModelRemoveCommand_initTelemetry() {
|
|
99
|
+
this.telemetry.push((args) => {
|
|
100
|
+
Object.assign(this.telemetryProperties, {
|
|
101
|
+
id: typeof args.options.id !== 'undefined',
|
|
102
|
+
name: typeof args.options.name !== 'undefined',
|
|
103
|
+
asAdmin: !!args.options.asAdmin,
|
|
104
|
+
confirm: !!args.options.confirm
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, _PpAiBuilderModelRemoveCommand_initOptions = function _PpAiBuilderModelRemoveCommand_initOptions() {
|
|
108
|
+
this.options.unshift({
|
|
109
|
+
option: '-e, --environment <environment>'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --id [id]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-n, --name [name]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '--asAdmin'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--confirm'
|
|
118
|
+
});
|
|
119
|
+
}, _PpAiBuilderModelRemoveCommand_initOptionSets = function _PpAiBuilderModelRemoveCommand_initOptionSets() {
|
|
120
|
+
this.optionSets.push({ options: ['id', 'name'] });
|
|
121
|
+
}, _PpAiBuilderModelRemoveCommand_initValidators = function _PpAiBuilderModelRemoveCommand_initValidators() {
|
|
122
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
124
|
+
return `${args.options.id} is not a valid GUID`;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
module.exports = new PpAiBuilderModelRemoveCommand();
|
|
130
|
+
//# sourceMappingURL=aibuildermodel-remove.js.map
|
package/dist/m365/pp/commands.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const prefix = 'pp';
|
|
4
4
|
exports.default = {
|
|
5
|
+
AIBUILDERMODEL_GET: `${prefix} aibuildermodel get`,
|
|
6
|
+
AIBUILDERMODEL_LIST: `${prefix} aibuildermodel list`,
|
|
7
|
+
AIBUILDERMODEL_REMOVE: `${prefix} aibuildermodel remove`,
|
|
5
8
|
CARD_CLONE: `${prefix} card clone`,
|
|
6
9
|
CARD_GET: `${prefix} card get`,
|
|
7
10
|
CARD_LIST: `${prefix} card list`,
|
|
@@ -0,0 +1,143 @@
|
|
|
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 _PurviewRetentionLabelAddCommand_instances, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
class PurviewRetentionLabelAddCommand extends GraphCommand_1.default {
|
|
22
|
+
get name() {
|
|
23
|
+
return commands_1.default.RETENTIONLABEL_ADD;
|
|
24
|
+
}
|
|
25
|
+
get description() {
|
|
26
|
+
return 'Create a retention label';
|
|
27
|
+
}
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
_PurviewRetentionLabelAddCommand_instances.add(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initTelemetry).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initOptions).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initValidators).call(this);
|
|
34
|
+
}
|
|
35
|
+
commandAction(logger, args) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const retentionTrigger = args.options.retentionTrigger ? args.options.retentionTrigger : 'dateLabeled';
|
|
38
|
+
const defaultRecordBehavior = args.options.defaultRecordBehavior ? args.options.defaultRecordBehavior : 'startLocked';
|
|
39
|
+
const requestBody = {
|
|
40
|
+
displayName: args.options.displayName,
|
|
41
|
+
behaviorDuringRetentionPeriod: args.options.behaviorDuringRetentionPeriod,
|
|
42
|
+
actionAfterRetentionPeriod: args.options.actionAfterRetentionPeriod,
|
|
43
|
+
retentionTrigger: retentionTrigger,
|
|
44
|
+
retentionDuration: {
|
|
45
|
+
'@odata.type': '#microsoft.graph.security.retentionDurationInDays',
|
|
46
|
+
days: args.options.retentionDuration
|
|
47
|
+
},
|
|
48
|
+
defaultRecordBehavior: defaultRecordBehavior
|
|
49
|
+
};
|
|
50
|
+
if (args.options.descriptionForAdmins) {
|
|
51
|
+
if (this.verbose) {
|
|
52
|
+
logger.logToStderr(`Using '${args.options.descriptionForAdmins}' as descriptionForAdmins`);
|
|
53
|
+
}
|
|
54
|
+
requestBody.descriptionForAdmins = args.options.descriptionForAdmins;
|
|
55
|
+
}
|
|
56
|
+
if (args.options.descriptionForUsers) {
|
|
57
|
+
if (this.verbose) {
|
|
58
|
+
logger.logToStderr(`Using '${args.options.descriptionForUsers}' as descriptionForUsers`);
|
|
59
|
+
}
|
|
60
|
+
requestBody.descriptionForUsers = args.options.descriptionForUsers;
|
|
61
|
+
}
|
|
62
|
+
if (args.options.labelToBeApplied) {
|
|
63
|
+
if (this.verbose) {
|
|
64
|
+
logger.logToStderr(`Using '${args.options.labelToBeApplied}' as labelToBeApplied...`);
|
|
65
|
+
}
|
|
66
|
+
requestBody.labelToBeApplied = args.options.labelToBeApplied;
|
|
67
|
+
}
|
|
68
|
+
const requestOptions = {
|
|
69
|
+
url: `${this.resource}/beta/security/labels/retentionLabels`,
|
|
70
|
+
headers: {
|
|
71
|
+
accept: 'application/json;odata.metadata=none'
|
|
72
|
+
},
|
|
73
|
+
data: requestBody,
|
|
74
|
+
responseType: 'json'
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
const response = yield request_1.default.post(requestOptions);
|
|
78
|
+
logger.log(response);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
this.handleRejectedODataPromise(err);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLabelAddCommand_initTelemetry = function _PurviewRetentionLabelAddCommand_initTelemetry() {
|
|
87
|
+
this.telemetry.push((args) => {
|
|
88
|
+
Object.assign(this.telemetryProperties, {
|
|
89
|
+
retentionTrigger: typeof args.options.retentionTrigger !== 'undefined',
|
|
90
|
+
defaultRecordBehavior: typeof args.options.defaultRecordBehavior !== 'undefined',
|
|
91
|
+
descriptionForUsers: typeof args.options.descriptionForUsers !== 'undefined',
|
|
92
|
+
descriptionForAdmins: typeof args.options.descriptionForAdmins !== 'undefined',
|
|
93
|
+
labelToBeApplied: typeof args.options.labelToBeApplied !== 'undefined'
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}, _PurviewRetentionLabelAddCommand_initOptions = function _PurviewRetentionLabelAddCommand_initOptions() {
|
|
97
|
+
this.options.unshift({
|
|
98
|
+
option: '-n, --displayName <displayName>'
|
|
99
|
+
}, {
|
|
100
|
+
option: '--behaviorDuringRetentionPeriod <behaviorDuringRetentionPeriod>',
|
|
101
|
+
autocomplete: ['doNotRetain', 'retain', 'retainAsRecord', 'retainAsRegulatoryRecord']
|
|
102
|
+
}, {
|
|
103
|
+
option: '--actionAfterRetentionPeriod <actionAfterRetentionPeriod>',
|
|
104
|
+
autocomplete: ['none', 'delete', 'startDispositionReview']
|
|
105
|
+
}, {
|
|
106
|
+
option: '--retentionDuration <retentionDuration>'
|
|
107
|
+
}, {
|
|
108
|
+
option: '-t, --retentionTrigger [retentionTrigger]',
|
|
109
|
+
autocomplete: ['dateLabeled', 'dateCreated', 'dateModified', 'dateOfEvent']
|
|
110
|
+
}, {
|
|
111
|
+
option: '--defaultRecordBehavior [defaultRecordBehavior]',
|
|
112
|
+
autocomplete: ['startLocked', 'startUnlocked']
|
|
113
|
+
}, {
|
|
114
|
+
option: '--descriptionForUsers [descriptionForUsers]'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--descriptionForAdmins [descriptionForAdmins]'
|
|
117
|
+
}, {
|
|
118
|
+
option: '--labelToBeApplied [labelToBeApplied]'
|
|
119
|
+
});
|
|
120
|
+
}, _PurviewRetentionLabelAddCommand_initValidators = function _PurviewRetentionLabelAddCommand_initValidators() {
|
|
121
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
if (isNaN(args.options.retentionDuration)) {
|
|
123
|
+
return `Specified retentionDuration ${args.options.retentionDuration} is not a number`;
|
|
124
|
+
}
|
|
125
|
+
if (['doNotRetain', 'retain', 'retainAsRecord', 'retainAsRegulatoryRecord'].indexOf(args.options.behaviorDuringRetentionPeriod) === -1) {
|
|
126
|
+
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are doNotRetain|retain|retainAsRecord|retainAsRegulatoryRecord`;
|
|
127
|
+
}
|
|
128
|
+
if (['none', 'delete', 'startDispositionReview'].indexOf(args.options.actionAfterRetentionPeriod) === -1) {
|
|
129
|
+
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are none|delete|startDispositionReview`;
|
|
130
|
+
}
|
|
131
|
+
if (args.options.retentionTrigger &&
|
|
132
|
+
['dateLabeled', 'dateCreated', 'dateModified', 'dateOfEvent'].indexOf(args.options.retentionTrigger) === -1) {
|
|
133
|
+
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are dateLabeled|dateCreated|dateModified|dateOfEvent`;
|
|
134
|
+
}
|
|
135
|
+
if (args.options.defaultRecordBehavior &&
|
|
136
|
+
['startLocked', 'startUnlocked'].indexOf(args.options.defaultRecordBehavior) === -1) {
|
|
137
|
+
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are startLocked|startUnlocked`;
|
|
138
|
+
}
|
|
139
|
+
return true;
|
|
140
|
+
}));
|
|
141
|
+
};
|
|
142
|
+
module.exports = new PurviewRetentionLabelAddCommand();
|
|
143
|
+
//# sourceMappingURL=retentionlabel-add.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const prefix = 'purview';
|
|
4
4
|
exports.default = {
|
|
5
|
+
RETENTIONLABEL_ADD: `${prefix} retentionlabel add`,
|
|
5
6
|
RETENTIONLABEL_GET: `${prefix} retentionlabel get`,
|
|
6
7
|
RETENTIONLABEL_LIST: `${prefix} retentionlabel list`,
|
|
7
8
|
RETENTIONLABEL_REMOVE: `${prefix} retentionlabel remove`,
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var
|
|
16
|
+
var _SpoFileSharingInfoGetCommand_instances, _SpoFileSharingInfoGetCommand_initTelemetry, _SpoFileSharingInfoGetCommand_initOptions, _SpoFileSharingInfoGetCommand_initValidators, _SpoFileSharingInfoGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -21,7 +21,7 @@ const validation_1 = require("../../../../utils/validation");
|
|
|
21
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
23
|
const FileSharingPrincipalType_1 = require("./FileSharingPrincipalType");
|
|
24
|
-
class
|
|
24
|
+
class SpoFileSharingInfoGetCommand extends SpoCommand_1.default {
|
|
25
25
|
get name() {
|
|
26
26
|
return commands_1.default.FILE_SHARINGINFO_GET;
|
|
27
27
|
}
|
|
@@ -30,11 +30,11 @@ class SpoFileSharinginfoGetCommand extends SpoCommand_1.default {
|
|
|
30
30
|
}
|
|
31
31
|
constructor() {
|
|
32
32
|
super();
|
|
33
|
-
|
|
34
|
-
__classPrivateFieldGet(this,
|
|
35
|
-
__classPrivateFieldGet(this,
|
|
36
|
-
__classPrivateFieldGet(this,
|
|
37
|
-
__classPrivateFieldGet(this,
|
|
33
|
+
_SpoFileSharingInfoGetCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _SpoFileSharingInfoGetCommand_instances, "m", _SpoFileSharingInfoGetCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoFileSharingInfoGetCommand_instances, "m", _SpoFileSharingInfoGetCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoFileSharingInfoGetCommand_instances, "m", _SpoFileSharingInfoGetCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoFileSharingInfoGetCommand_instances, "m", _SpoFileSharingInfoGetCommand_initOptionSets).call(this);
|
|
38
38
|
}
|
|
39
39
|
getExcludedOptionsWithUrls() {
|
|
40
40
|
return ['fileUrl'];
|
|
@@ -113,14 +113,14 @@ class SpoFileSharinginfoGetCommand extends SpoCommand_1.default {
|
|
|
113
113
|
}));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
_SpoFileSharingInfoGetCommand_instances = new WeakSet(), _SpoFileSharingInfoGetCommand_initTelemetry = function _SpoFileSharingInfoGetCommand_initTelemetry() {
|
|
117
117
|
this.telemetry.push((args) => {
|
|
118
118
|
Object.assign(this.telemetryProperties, {
|
|
119
119
|
fileId: (!(!args.options.fileId)).toString(),
|
|
120
120
|
fileUrl: (!(!args.options.fileUrl)).toString()
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
|
-
},
|
|
123
|
+
}, _SpoFileSharingInfoGetCommand_initOptions = function _SpoFileSharingInfoGetCommand_initOptions() {
|
|
124
124
|
this.options.unshift({
|
|
125
125
|
option: '-u, --webUrl <webUrl>'
|
|
126
126
|
}, {
|
|
@@ -128,7 +128,7 @@ _SpoFileSharinginfoGetCommand_instances = new WeakSet(), _SpoFileSharinginfoGetC
|
|
|
128
128
|
}, {
|
|
129
129
|
option: '-f, --fileUrl [fileUrl]'
|
|
130
130
|
});
|
|
131
|
-
},
|
|
131
|
+
}, _SpoFileSharingInfoGetCommand_initValidators = function _SpoFileSharingInfoGetCommand_initValidators() {
|
|
132
132
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
133
133
|
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
134
134
|
if (isValidSharePointUrl !== true) {
|
|
@@ -141,8 +141,8 @@ _SpoFileSharinginfoGetCommand_instances = new WeakSet(), _SpoFileSharinginfoGetC
|
|
|
141
141
|
}
|
|
142
142
|
return true;
|
|
143
143
|
}));
|
|
144
|
-
},
|
|
144
|
+
}, _SpoFileSharingInfoGetCommand_initOptionSets = function _SpoFileSharingInfoGetCommand_initOptionSets() {
|
|
145
145
|
this.optionSets.push({ options: ['fileId', 'fileUrl'] });
|
|
146
146
|
};
|
|
147
|
-
module.exports = new
|
|
147
|
+
module.exports = new SpoFileSharingInfoGetCommand();
|
|
148
148
|
//# sourceMappingURL=file-sharinginfo-get.js.map
|