@pnp/cli-microsoft365 8.0.0 → 8.1.0-beta.3bc5759
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 +8 -8
- package/dist/Command.js +49 -2
- package/dist/cli/cli.js +60 -38
- package/dist/m365/commands/login.js +44 -96
- package/dist/m365/spe/ContainerTypeProperties.js +2 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +49 -0
- package/dist/m365/spe/commands.js +2 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +16 -21
- package/dist/m365/spo/commands/commandset/commandset-get.js +31 -17
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +19 -5
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +20 -6
- package/dist/utils/formatting.js +16 -0
- package/dist/utils/zod.js +124 -0
- package/docs/docs/cmd/spe/containertype/containertype-list.mdx +131 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +85 -36
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +18 -24
- package/docs/docs/cmd/spo/commandset/commandset-get.mdx +75 -24
- package/docs/docs/cmd/spo/commandset/commandset-list.mdx +26 -32
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.mdx +79 -30
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +20 -19
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +84 -38
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +20 -19
- package/docs/docs/cmd/teams/meeting/meeting-list.mdx +7 -3
- package/npm-shrinkwrap.json +606 -845
- package/package.json +7 -3
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets, _SpoCommandSetGetCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { spo } from '../../../../utils/spo.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -24,45 +24,53 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
24
24
|
__classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptions).call(this);
|
|
25
25
|
__classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initValidators).call(this);
|
|
26
26
|
__classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initTypes).call(this);
|
|
27
28
|
}
|
|
28
29
|
async commandAction(logger, args) {
|
|
29
30
|
try {
|
|
30
31
|
if (this.verbose) {
|
|
31
|
-
await logger.logToStderr(`Attempt to get a specific
|
|
32
|
+
await logger.logToStderr(`Attempt to get a specific Command Set by property ${args.options.title || args.options.id || args.options.clientSideComponentId}.`);
|
|
32
33
|
}
|
|
34
|
+
let commandSet;
|
|
33
35
|
if (args.options.id) {
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
+
const customAction = await spo.getCustomActionById(args.options.webUrl, args.options.id, args.options.scope);
|
|
37
|
+
if (customAction === undefined) {
|
|
36
38
|
throw `Command set with id ${args.options.id} can't be found.`;
|
|
37
39
|
}
|
|
38
|
-
else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation ===
|
|
40
|
+
else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === customAction.Location)) {
|
|
39
41
|
throw `Custom action with id ${args.options.id} is not a command set.`;
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
commandSet = customAction;
|
|
42
44
|
}
|
|
43
45
|
else if (args.options.clientSideComponentId) {
|
|
44
46
|
const filter = `${this.getBaseFilter()} ClientSideComponentId eq guid'${args.options.clientSideComponentId}'`;
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
+
const customActions = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
|
|
48
|
+
if (customActions.length === 0) {
|
|
47
49
|
throw `No command set with clientSideComponentId '${args.options.clientSideComponentId}' found.`;
|
|
48
50
|
}
|
|
49
|
-
|
|
51
|
+
commandSet = customActions[0];
|
|
50
52
|
}
|
|
51
53
|
else if (args.options.title) {
|
|
52
54
|
const filter = `${this.getBaseFilter()} Title eq '${formatting.encodeQueryParameter(args.options.title)}'`;
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
55
|
+
const customActions = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
|
|
56
|
+
if (customActions.length === 1) {
|
|
57
|
+
commandSet = customActions[0];
|
|
56
58
|
}
|
|
57
|
-
else if (
|
|
59
|
+
else if (customActions.length === 0) {
|
|
58
60
|
throw `No command set with title '${args.options.title}' found.`;
|
|
59
61
|
}
|
|
60
62
|
else {
|
|
61
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id',
|
|
62
|
-
|
|
63
|
-
await logger.log(commandSet);
|
|
63
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
|
|
64
|
+
commandSet = await cli.handleMultipleResultsFound(`Multiple command sets with title '${args.options.title}' found.`, resultAsKeyValuePair);
|
|
64
65
|
}
|
|
65
66
|
}
|
|
67
|
+
if (!args.options.clientSideComponentProperties) {
|
|
68
|
+
await logger.log(commandSet);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const properties = formatting.tryParseJson(commandSet.ClientSideComponentProperties);
|
|
72
|
+
await logger.log(properties);
|
|
73
|
+
}
|
|
66
74
|
}
|
|
67
75
|
catch (err) {
|
|
68
76
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -78,7 +86,8 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
|
|
|
78
86
|
title: typeof args.options.title !== 'undefined',
|
|
79
87
|
id: typeof args.options.id !== 'undefined',
|
|
80
88
|
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
81
|
-
scope: typeof args.options.scope !== 'undefined'
|
|
89
|
+
scope: typeof args.options.scope !== 'undefined',
|
|
90
|
+
clientSideComponentProperties: !!args.options.clientSideComponentProperties
|
|
82
91
|
});
|
|
83
92
|
});
|
|
84
93
|
}, _SpoCommandSetGetCommand_initOptions = function _SpoCommandSetGetCommand_initOptions() {
|
|
@@ -93,6 +102,8 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
|
|
|
93
102
|
}, {
|
|
94
103
|
option: '-s, --scope [scope]',
|
|
95
104
|
autocomplete: _a.scopes
|
|
105
|
+
}, {
|
|
106
|
+
option: '-p, --clientSideComponentProperties'
|
|
96
107
|
});
|
|
97
108
|
}, _SpoCommandSetGetCommand_initValidators = function _SpoCommandSetGetCommand_initValidators() {
|
|
98
109
|
this.validators.push(async (args) => {
|
|
@@ -109,6 +120,9 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
|
|
|
109
120
|
});
|
|
110
121
|
}, _SpoCommandSetGetCommand_initOptionSets = function _SpoCommandSetGetCommand_initOptionSets() {
|
|
111
122
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
123
|
+
}, _SpoCommandSetGetCommand_initTypes = function _SpoCommandSetGetCommand_initTypes() {
|
|
124
|
+
this.types.string.push('webUrl', 'title', 'id', 'clientSideComponentId', 'scope');
|
|
125
|
+
this.types.boolean.push('clientSideComponentProperties');
|
|
112
126
|
};
|
|
113
127
|
SpoCommandSetGetCommand.scopes = ['All', 'Site', 'Web'];
|
|
114
128
|
SpoCommandSetGetCommand.baseLocation = 'ClientSideExtension.ListViewCommandSet';
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets, _SpoTenantApplicationCustomizerGetCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -26,6 +26,7 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
26
26
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTypes).call(this);
|
|
29
30
|
}
|
|
30
31
|
async commandAction(logger, args) {
|
|
31
32
|
try {
|
|
@@ -50,13 +51,20 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
50
51
|
throw 'The specified application customizer was not found';
|
|
51
52
|
}
|
|
52
53
|
listItemInstances.forEach(v => delete v['ID']);
|
|
54
|
+
let listItemInstance;
|
|
53
55
|
if (listItemInstances.length > 1) {
|
|
54
56
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
55
|
-
|
|
56
|
-
await logger.log(result);
|
|
57
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
|
|
60
|
+
listItemInstance = listItemInstances[0];
|
|
61
|
+
}
|
|
62
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
63
|
+
await logger.log(listItemInstance);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
67
|
+
await logger.log(properties);
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
else {
|
|
@@ -73,7 +81,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
73
81
|
Object.assign(this.telemetryProperties, {
|
|
74
82
|
title: typeof args.options.title !== 'undefined',
|
|
75
83
|
id: typeof args.options.id !== 'undefined',
|
|
76
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
84
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
85
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
77
86
|
});
|
|
78
87
|
});
|
|
79
88
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
|
|
@@ -83,6 +92,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
83
92
|
option: '-i, --id [id]'
|
|
84
93
|
}, {
|
|
85
94
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
95
|
+
}, {
|
|
96
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
86
97
|
});
|
|
87
98
|
}, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
|
|
88
99
|
this.validators.push(async (args) => {
|
|
@@ -96,6 +107,9 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
96
107
|
});
|
|
97
108
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
|
|
98
109
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
110
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initTypes = function _SpoTenantApplicationCustomizerGetCommand_initTypes() {
|
|
111
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
112
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
99
113
|
};
|
|
100
114
|
export default new SpoTenantApplicationCustomizerGetCommand();
|
|
101
115
|
//# sourceMappingURL=tenant-applicationcustomizer-get.js.map
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets, _SpoTenantCommandSetGetCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import { CommandError } from '../../../../Command.js';
|
|
9
9
|
import request from '../../../../request.js';
|
|
@@ -27,6 +27,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
const appCatalogUrl = await spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
@@ -47,7 +48,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
47
48
|
const reqOptions = {
|
|
48
49
|
url: `${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
|
|
49
50
|
headers: {
|
|
50
|
-
|
|
51
|
+
accept: 'application/json;odata=nometadata'
|
|
51
52
|
},
|
|
52
53
|
responseType: 'json'
|
|
53
54
|
};
|
|
@@ -55,13 +56,20 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
55
56
|
const listItemInstances = await request.get(reqOptions);
|
|
56
57
|
if (listItemInstances?.value.length > 0) {
|
|
57
58
|
listItemInstances.value.forEach(v => delete v['ID']);
|
|
59
|
+
let listItemInstance;
|
|
58
60
|
if (listItemInstances.value.length > 1) {
|
|
59
61
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances.value);
|
|
60
|
-
|
|
61
|
-
await logger.log(result);
|
|
62
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
|
-
|
|
65
|
+
listItemInstance = listItemInstances.value[0];
|
|
66
|
+
}
|
|
67
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
68
|
+
await logger.log(listItemInstance);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
72
|
+
await logger.log(properties);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
else {
|
|
@@ -78,7 +86,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
78
86
|
Object.assign(this.telemetryProperties, {
|
|
79
87
|
title: typeof args.options.title !== 'undefined',
|
|
80
88
|
id: typeof args.options.id !== 'undefined',
|
|
81
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
89
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
90
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
82
91
|
});
|
|
83
92
|
});
|
|
84
93
|
}, _SpoTenantCommandSetGetCommand_initOptions = function _SpoTenantCommandSetGetCommand_initOptions() {
|
|
@@ -88,6 +97,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
88
97
|
option: '-i, --id [id]'
|
|
89
98
|
}, {
|
|
90
99
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
100
|
+
}, {
|
|
101
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
91
102
|
});
|
|
92
103
|
}, _SpoTenantCommandSetGetCommand_initValidators = function _SpoTenantCommandSetGetCommand_initValidators() {
|
|
93
104
|
this.validators.push(async (args) => {
|
|
@@ -101,6 +112,9 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
101
112
|
});
|
|
102
113
|
}, _SpoTenantCommandSetGetCommand_initOptionSets = function _SpoTenantCommandSetGetCommand_initOptionSets() {
|
|
103
114
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
115
|
+
}, _SpoTenantCommandSetGetCommand_initTypes = function _SpoTenantCommandSetGetCommand_initTypes() {
|
|
116
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
117
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
104
118
|
};
|
|
105
119
|
export default new SpoTenantCommandSetGetCommand();
|
|
106
120
|
//# sourceMappingURL=tenant-commandset-get.js.map
|
package/dist/utils/formatting.js
CHANGED
|
@@ -39,6 +39,22 @@ export const formatting = {
|
|
|
39
39
|
parseJsonWithBom(s) {
|
|
40
40
|
return JSON.parse(s.replace(/^\uFEFF/, ''));
|
|
41
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Tries to parse a string as JSON. If it fails, returns the original string.
|
|
44
|
+
* @param value JSON string to parse.
|
|
45
|
+
* @returns JSON object or the original string if parsing fails.
|
|
46
|
+
*/
|
|
47
|
+
tryParseJson(value) {
|
|
48
|
+
try {
|
|
49
|
+
if (typeof value !== 'string') {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return JSON.parse(value);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
42
58
|
filterObject(obj, propertiesToInclude) {
|
|
43
59
|
const objKeys = Object.keys(obj);
|
|
44
60
|
return propertiesToInclude
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
function parseEffect(def, _options, _currentOption) {
|
|
3
|
+
return def.schema._def;
|
|
4
|
+
}
|
|
5
|
+
function parseIntersection(def, _options, _currentOption) {
|
|
6
|
+
if (def.left._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
|
|
7
|
+
return def.left._def;
|
|
8
|
+
}
|
|
9
|
+
if (def.right._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
|
|
10
|
+
return def.right._def;
|
|
11
|
+
}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
function parseObject(def, options, _currentOption) {
|
|
15
|
+
const properties = def.shape();
|
|
16
|
+
for (const key in properties) {
|
|
17
|
+
const property = properties[key];
|
|
18
|
+
const option = {
|
|
19
|
+
name: key,
|
|
20
|
+
long: key,
|
|
21
|
+
short: property._def.alias,
|
|
22
|
+
required: true,
|
|
23
|
+
type: 'string'
|
|
24
|
+
};
|
|
25
|
+
parseDef(property._def, options, option);
|
|
26
|
+
options.push(option);
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
function parseString(_def, _options, currentOption) {
|
|
31
|
+
if (currentOption) {
|
|
32
|
+
currentOption.type = 'string';
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
function parseNumber(_def, _options, currentOption) {
|
|
37
|
+
if (currentOption) {
|
|
38
|
+
currentOption.type = 'number';
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
function parseBoolean(_def, _options, currentOption) {
|
|
43
|
+
if (currentOption) {
|
|
44
|
+
currentOption.type = 'boolean';
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
function parseOptional(def, _options, currentOption) {
|
|
49
|
+
if (currentOption) {
|
|
50
|
+
currentOption.required = false;
|
|
51
|
+
}
|
|
52
|
+
return def.innerType._def;
|
|
53
|
+
}
|
|
54
|
+
function parseDefault(def, _options, currentOption) {
|
|
55
|
+
if (currentOption) {
|
|
56
|
+
currentOption.required = false;
|
|
57
|
+
}
|
|
58
|
+
return def.innerType._def;
|
|
59
|
+
}
|
|
60
|
+
function parseEnum(def, _options, currentOption) {
|
|
61
|
+
if (currentOption) {
|
|
62
|
+
currentOption.type = 'string';
|
|
63
|
+
currentOption.autocomplete = def.values;
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
function parseNativeEnum(def, _options, currentOption) {
|
|
68
|
+
if (currentOption) {
|
|
69
|
+
currentOption.type = 'string';
|
|
70
|
+
currentOption.autocomplete = Object.getOwnPropertyNames(def.values);
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
function getParseFn(typeName) {
|
|
75
|
+
switch (typeName) {
|
|
76
|
+
case z.ZodFirstPartyTypeKind.ZodEffects:
|
|
77
|
+
return parseEffect;
|
|
78
|
+
case z.ZodFirstPartyTypeKind.ZodObject:
|
|
79
|
+
return parseObject;
|
|
80
|
+
case z.ZodFirstPartyTypeKind.ZodOptional:
|
|
81
|
+
return parseOptional;
|
|
82
|
+
case z.ZodFirstPartyTypeKind.ZodString:
|
|
83
|
+
return parseString;
|
|
84
|
+
case z.ZodFirstPartyTypeKind.ZodNumber:
|
|
85
|
+
return parseNumber;
|
|
86
|
+
case z.ZodFirstPartyTypeKind.ZodBoolean:
|
|
87
|
+
return parseBoolean;
|
|
88
|
+
case z.ZodFirstPartyTypeKind.ZodEnum:
|
|
89
|
+
return parseEnum;
|
|
90
|
+
case z.ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
91
|
+
return parseNativeEnum;
|
|
92
|
+
case z.ZodFirstPartyTypeKind.ZodDefault:
|
|
93
|
+
return parseDefault;
|
|
94
|
+
case z.ZodFirstPartyTypeKind.ZodIntersection:
|
|
95
|
+
return parseIntersection;
|
|
96
|
+
default:
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function parseDef(def, options, currentOption) {
|
|
101
|
+
let parsedDef = def;
|
|
102
|
+
do {
|
|
103
|
+
const parse = getParseFn(parsedDef.typeName);
|
|
104
|
+
if (!parse) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
parsedDef = parse(parsedDef, options, currentOption);
|
|
108
|
+
if (!parsedDef) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
} while (parsedDef);
|
|
112
|
+
}
|
|
113
|
+
export const zod = {
|
|
114
|
+
alias(alias, type) {
|
|
115
|
+
type._def.alias = alias;
|
|
116
|
+
return type;
|
|
117
|
+
},
|
|
118
|
+
schemaToOptions(schema) {
|
|
119
|
+
const options = [];
|
|
120
|
+
parseDef(schema._def, options);
|
|
121
|
+
return options;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=zod.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# Container Types list
|
|
6
|
+
|
|
7
|
+
Retrieves a list of Container Types created for a SharePoint Embedded Application
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 containertype list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
<Global />
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
Retrieves a list of Container Types created for a SharePoint Embedded Application from the tenant.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
m365 containertype list
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Response
|
|
28
|
+
|
|
29
|
+
<Tabs>
|
|
30
|
+
<TabItem value="JSON">
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
[{
|
|
34
|
+
"_ObjectType_": "Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties",
|
|
35
|
+
"ApplicationRedirectUrl": null,
|
|
36
|
+
"AzureSubscriptionId": "/Guid(00000000-0000-0000-0000-000000000000)/",
|
|
37
|
+
"ContainerTypeId": "/Guid(073269af-f1d2-042d-2ef5-5bdd6ac83115)/",
|
|
38
|
+
"CreationDate": null,
|
|
39
|
+
"DisplayName": "test1",
|
|
40
|
+
"ExpiryDate": null,
|
|
41
|
+
"IsBillingProfileRequired": true,
|
|
42
|
+
"OwningAppId": "/Guid(df4085cc-9a38-4255-badc-5c5225610475)/",
|
|
43
|
+
"OwningTenantId": "/Guid(00000000-0000-0000-0000-000000000000)/",
|
|
44
|
+
"Region": null,
|
|
45
|
+
"ResourceGroup": null,
|
|
46
|
+
"SPContainerTypeBillingClassification": 0
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"_ObjectType_": "Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties",
|
|
50
|
+
"ApplicationRedirectUrl": null,
|
|
51
|
+
"AzureSubscriptionId": "/Guid(00000000-0000-0000-0000-000000000000)/",
|
|
52
|
+
"ContainerTypeId": "/Guid(3ec7c59d-ef31-0752-1ab5-5c343a5e8557)/",
|
|
53
|
+
"CreationDate": null,
|
|
54
|
+
"DisplayName": "SharePoint Embedded Free Trial Container Type",
|
|
55
|
+
"ExpiryDate": null,
|
|
56
|
+
"IsBillingProfileRequired": true,
|
|
57
|
+
"OwningAppId": "/Guid(e6b529fe-84db-412a-8e9c-5bbb75f7b037)/",
|
|
58
|
+
"OwningTenantId": "/Guid(00000000-0000-0000-0000-000000000000)/",
|
|
59
|
+
"Region": null,
|
|
60
|
+
"ResourceGroup": null,
|
|
61
|
+
"SPContainerTypeBillingClassification": 1
|
|
62
|
+
}]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
</TabItem>
|
|
66
|
+
<TabItem value="Text">
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
ContainerTypeId DisplayName OwningAppId
|
|
70
|
+
-------------------------------------------- --------------------------------------------- --------------------------------------------
|
|
71
|
+
/Guid(073269af-f1d2-042d-2ef5-5bdd6ac83115)/ test1 /Guid(df4085cc-9a38-4255-badc-5c5225610475)/
|
|
72
|
+
/Guid(880ab3bd-5b68-01d4-3744-01a7656cf2ba)/ test1 /Guid(50785fde-3082-47ac-a36d-06282ac5c7da)/
|
|
73
|
+
/Guid(3ec7c59d-ef31-0752-1ab5-5c343a5e8557)/ SharePoint Embedded Free Trial Container Type /Guid(e6b529fe-84db-412a-8e9c-5bbb75f7b037)/
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
</TabItem>
|
|
77
|
+
<TabItem value="CSV">
|
|
78
|
+
|
|
79
|
+
```csv
|
|
80
|
+
_ObjectType_,ApplicationRedirectUrl,AzureSubscriptionId,ContainerTypeId,CreationDate,DisplayName,ExpiryDate,IsBillingProfileRequired,OwningAppId,OwningTenantId,Region,ResourceGroup,SPContainerTypeBillingClassification
|
|
81
|
+
Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties,,/Guid(00000000-0000-0000-0000-000000000000)/,/Guid(073269af-f1d2-042d-2ef5-5bdd6ac83115)/,,test1,,1,/Guid(df4085cc-9a38-4255-badc-5c5225610475)/,/Guid(00000000-0000-0000-0000-000000000000)/,,,0
|
|
82
|
+
Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties,,/Guid(00000000-0000-0000-0000-000000000000)/,/Guid(3ec7c59d-ef31-0752-1ab5-5c343a5e8557)/,,SharePoint Embedded Free Trial Container Type,,1,/Guid(e6b529fe-84db-412a-8e9c-5bbb75f7b037)/,/Guid(00000000-0000-0000-0000-000000000000)/,,,1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
</TabItem>
|
|
86
|
+
<TabItem value="Markdown">
|
|
87
|
+
|
|
88
|
+
```md
|
|
89
|
+
# spe containertype list
|
|
90
|
+
|
|
91
|
+
Date: 5/11/2024
|
|
92
|
+
|
|
93
|
+
## test1
|
|
94
|
+
|
|
95
|
+
Property | Value
|
|
96
|
+
---------|-------
|
|
97
|
+
\_ObjectType\_ | Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties
|
|
98
|
+
AzureSubscriptionId | /Guid(00000000-0000-0000-0000-000000000000)/
|
|
99
|
+
ContainerTypeId | /Guid(073269af-f1d2-042d-2ef5-5bdd6ac83115)/
|
|
100
|
+
DisplayName | test1
|
|
101
|
+
IsBillingProfileRequired | true
|
|
102
|
+
OwningAppId | /Guid(df4085cc-9a38-4255-badc-5c5225610475)/
|
|
103
|
+
OwningTenantId | /Guid(00000000-0000-0000-0000-000000000000)/
|
|
104
|
+
SPContainerTypeBillingClassification | 0
|
|
105
|
+
|
|
106
|
+
## SharePoint Embedded Free Trial Container Type
|
|
107
|
+
|
|
108
|
+
Property | Value
|
|
109
|
+
---------|-------
|
|
110
|
+
\_ObjectType\_ | Microsoft.Online.SharePoint.TenantAdministration.SPContainerTypeProperties
|
|
111
|
+
AzureSubscriptionId | /Guid(00000000-0000-0000-0000-000000000000)/
|
|
112
|
+
ContainerTypeId | /Guid(3ec7c59d-ef31-0752-1ab5-5c343a5e8557)/
|
|
113
|
+
DisplayName | SharePoint Embedded Free Trial Container Type
|
|
114
|
+
IsBillingProfileRequired | true
|
|
115
|
+
OwningAppId | /Guid(e6b529fe-84db-412a-8e9c-5bbb75f7b037)/
|
|
116
|
+
OwningTenantId | /Guid(00000000-0000-0000-0000-000000000000)/
|
|
117
|
+
SPContainerTypeBillingClassification | 1
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
</TabItem>
|
|
121
|
+
</Tabs>
|
|
122
|
+
|
|
123
|
+
## More information
|
|
124
|
+
|
|
125
|
+
In SharePoint Embedded, all files and documents are stored in Containers, and each Container is identified by a Container Type.
|
|
126
|
+
|
|
127
|
+
Container Type is a property stamped on every Container instance. Each Container Type is owned by one Application, and each Application can own only one Container Type.
|
|
128
|
+
|
|
129
|
+
The primary function of a Container Type is to manage the application workload that can access the Containers. Container Type defines the access permissions an Application has towards all Containers of that type, including create, read, write, delete containers; manage container permissions, etc.
|
|
130
|
+
|
|
131
|
+
More information about SharePoint Embedded and the limits can be found at the following location: [SharePoint Embedded](https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/app-concepts/containertypes#sharepoint-embedded-trial-container-types)
|