@pnp/cli-microsoft365 6.4.0-beta.6b65014 → 6.4.0-beta.99d3881
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/README.md
CHANGED
|
@@ -0,0 +1,118 @@
|
|
|
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 _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Command_1 = require("../../../../Command");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
21
|
+
const spo_1 = require("../../../../utils/spo");
|
|
22
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
23
|
+
const validation_1 = require("../../../../utils/validation");
|
|
24
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
25
|
+
const commands_1 = require("../../commands");
|
|
26
|
+
class SpoTenantApplicationCustomizerGetCommand extends SpoCommand_1.default {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands_1.default.TENANT_APPLICATIONCUSTOMIZER_GET;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return 'Get an application customizer that is installed tenant wide';
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
_SpoTenantApplicationCustomizerGetCommand_instances.add(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTelemetry).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
44
|
+
if (!appCatalogUrl) {
|
|
45
|
+
throw new Command_1.CommandError('No app catalog URL found');
|
|
46
|
+
}
|
|
47
|
+
let filter = '';
|
|
48
|
+
if (args.options.title) {
|
|
49
|
+
filter = `Title eq '${args.options.title}'`;
|
|
50
|
+
}
|
|
51
|
+
else if (args.options.id) {
|
|
52
|
+
filter = `GUID eq '${args.options.id}'`;
|
|
53
|
+
}
|
|
54
|
+
else if (args.options.clientSideComponentId) {
|
|
55
|
+
filter = `TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`;
|
|
56
|
+
}
|
|
57
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
58
|
+
const reqOptions = {
|
|
59
|
+
url: `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
|
|
60
|
+
headers: {
|
|
61
|
+
'accept': 'application/json;odata=nometadata'
|
|
62
|
+
},
|
|
63
|
+
responseType: 'json'
|
|
64
|
+
};
|
|
65
|
+
let listItemInstances;
|
|
66
|
+
try {
|
|
67
|
+
listItemInstances = yield request_1.default.get(reqOptions);
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return this.handleRejectedODataJsonPromise(err);
|
|
71
|
+
}
|
|
72
|
+
if (listItemInstances) {
|
|
73
|
+
if (listItemInstances.value.length === 0) {
|
|
74
|
+
throw new Command_1.CommandError('The specified application customizer was not found');
|
|
75
|
+
}
|
|
76
|
+
if (listItemInstances.value.length > 1) {
|
|
77
|
+
throw new Command_1.CommandError(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found. Please disambiguate (IDs): ${listItemInstances.value.map(item => item.GUID).join(', ')}`);
|
|
78
|
+
}
|
|
79
|
+
listItemInstances.value.forEach(v => delete v['ID']);
|
|
80
|
+
logger.log(listItemInstances.value[0]);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
throw new Command_1.CommandError('The specified application customizer was not found');
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
_SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantApplicationCustomizerGetCommand_initTelemetry = function _SpoTenantApplicationCustomizerGetCommand_initTelemetry() {
|
|
89
|
+
this.telemetry.push((args) => {
|
|
90
|
+
Object.assign(this.telemetryProperties, {
|
|
91
|
+
title: typeof args.options.title !== 'undefined',
|
|
92
|
+
id: typeof args.options.id !== 'undefined',
|
|
93
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
|
|
97
|
+
this.options.unshift({
|
|
98
|
+
option: '-t, --title [title]'
|
|
99
|
+
}, {
|
|
100
|
+
option: '-i, --id [id]'
|
|
101
|
+
}, {
|
|
102
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
103
|
+
});
|
|
104
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
|
|
105
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
107
|
+
return `${args.options.id} is not a valid GUID`;
|
|
108
|
+
}
|
|
109
|
+
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
110
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}));
|
|
114
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
|
|
115
|
+
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
116
|
+
};
|
|
117
|
+
module.exports = new SpoTenantApplicationCustomizerGetCommand();
|
|
118
|
+
//# sourceMappingURL=tenant-applicationcustomizer-get.js.map
|
|
@@ -279,6 +279,7 @@ exports.default = {
|
|
|
279
279
|
TENANT_APPCATALOG_ADD: `${prefix} tenant appcatalog add`,
|
|
280
280
|
TENANT_APPCATALOGURL_GET: `${prefix} tenant appcatalogurl get`,
|
|
281
281
|
TENANT_APPLICATIONCUSTOMIZER_ADD: `${prefix} tenant applicationcustomizer add`,
|
|
282
|
+
TENANT_APPLICATIONCUSTOMIZER_GET: `${prefix} tenant applicationcustomizer get`,
|
|
282
283
|
TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
|
|
283
284
|
TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
|
|
284
285
|
TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
|
package/dist/utils/spo.js
CHANGED
|
@@ -536,6 +536,20 @@ exports.spo = {
|
|
|
536
536
|
const customActionOnSite = yield getById(webUrl, id, "Site");
|
|
537
537
|
return customActionOnSite;
|
|
538
538
|
});
|
|
539
|
+
},
|
|
540
|
+
getTenantAppCatalogUrl(logger, debug) {
|
|
541
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
542
|
+
const spoUrl = yield exports.spo.getSpoUrl(logger, debug);
|
|
543
|
+
const requestOptions = {
|
|
544
|
+
url: `${spoUrl}/_api/SP_TenantSettings_Current`,
|
|
545
|
+
headers: {
|
|
546
|
+
accept: 'application/json;odata=nometadata'
|
|
547
|
+
},
|
|
548
|
+
responseType: 'json'
|
|
549
|
+
};
|
|
550
|
+
const result = yield request_1.default.get(requestOptions);
|
|
551
|
+
return result.CorporateCatalogUrl;
|
|
552
|
+
});
|
|
539
553
|
}
|
|
540
554
|
};
|
|
541
555
|
//# sourceMappingURL=spo.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# spo tenant applicationcustomizer get
|
|
2
|
+
|
|
3
|
+
Get an application customizer that is installed tenant wide
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
spo tenant applicationcustomizer get [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-t, --title [title]`
|
|
14
|
+
: The title of the application customizer. Specify either `title`, `id`, or `clientSideComponentId`.
|
|
15
|
+
|
|
16
|
+
`-i, --id [id]`
|
|
17
|
+
: The product id of the application customizer. Specify either `title`, `id`, or `clientSideComponentId`.
|
|
18
|
+
|
|
19
|
+
`-c, --clientSideComponentId [clientSideComponentId]`
|
|
20
|
+
: The Client Side Component Id (GUID) of the application customizer. Specify either `title`, `id`, or `clientSideComponentId`.
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
Retrieves an application customizer by title.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
m365 spo tenant applicationcustomizer get --title "Some customizer"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Retrieves an application customizer by id.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 spo tenant applicationcustomizer get --id 14125658-a9bc-4ddf-9c75-1b5767c9a337
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Retrieves an application customizer by clientSideComponentId.
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 spo tenant applicationcustomizer get --clientSideComponentId 7096cded-b83d-4eab-96f0-df477ed7c0bc
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Response
|
|
45
|
+
|
|
46
|
+
=== "JSON"
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"FileSystemObjectType": 0,
|
|
51
|
+
"Id": 4,
|
|
52
|
+
"ServerRedirectedEmbedUri": null,
|
|
53
|
+
"ServerRedirectedEmbedUrl": "",
|
|
54
|
+
"ContentTypeId": "0x00693E2C487575B448BD420C12CEAE7EFE",
|
|
55
|
+
"Title": "Some customizer",
|
|
56
|
+
"Modified": "2023-01-11T15:47:38Z",
|
|
57
|
+
"Created": "2023-01-11T15:47:38Z",
|
|
58
|
+
"AuthorId": 9,
|
|
59
|
+
"EditorId": 9,
|
|
60
|
+
"OData__UIVersionString": "1.0",
|
|
61
|
+
"Attachments": false,
|
|
62
|
+
"GUID": "14125658-a9bc-4ddf-9c75-1b5767c9a337",
|
|
63
|
+
"ComplianceAssetId": null,
|
|
64
|
+
"TenantWideExtensionComponentId": "7096cded-b83d-4eab-96f0-df477ed7c0bc",
|
|
65
|
+
"TenantWideExtensionComponentProperties": "{\"testMessage\":\"Test message\"}",
|
|
66
|
+
"TenantWideExtensionWebTemplate": null,
|
|
67
|
+
"TenantWideExtensionListTemplate": 0,
|
|
68
|
+
"TenantWideExtensionLocation": "ClientSideExtension.ApplicationCustomizer",
|
|
69
|
+
"TenantWideExtensionSequence": 0,
|
|
70
|
+
"TenantWideExtensionHostProperties": null,
|
|
71
|
+
"TenantWideExtensionDisabled": false
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
=== "Text"
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Attachments : false
|
|
79
|
+
AuthorId : 9
|
|
80
|
+
ComplianceAssetId : null
|
|
81
|
+
ContentTypeId : 0x00693E2C487575B448BD420C12CEAE7EFE
|
|
82
|
+
Created : 2023-01-11T15:47:38Z
|
|
83
|
+
EditorId : 9
|
|
84
|
+
FileSystemObjectType : 0
|
|
85
|
+
GUID : 14125658-a9bc-4ddf-9c75-1b5767c9a337
|
|
86
|
+
Id : 4
|
|
87
|
+
Modified : 2023-01-11T15:47:38Z
|
|
88
|
+
OData__UIVersionString : 1.0
|
|
89
|
+
ServerRedirectedEmbedUri : null
|
|
90
|
+
ServerRedirectedEmbedUrl :
|
|
91
|
+
TenantWideExtensionComponentId : 7096cded-b83d-4eab-96f0-df477ed7c0bc
|
|
92
|
+
TenantWideExtensionComponentProperties: {"testMessage":"Test message"}
|
|
93
|
+
TenantWideExtensionDisabled : false
|
|
94
|
+
TenantWideExtensionHostProperties : null
|
|
95
|
+
TenantWideExtensionListTemplate : 0
|
|
96
|
+
TenantWideExtensionLocation : ClientSideExtension.ApplicationCustomizer
|
|
97
|
+
TenantWideExtensionSequence : 0
|
|
98
|
+
TenantWideExtensionWebTemplate : null
|
|
99
|
+
Title : Some customizer
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
=== "CSV"
|
|
103
|
+
|
|
104
|
+
```csv
|
|
105
|
+
FileSystemObjectType,Id,ServerRedirectedEmbedUri,ServerRedirectedEmbedUrl,ContentTypeId,Title,Modified,Created,AuthorId,EditorId,OData__UIVersionString,Attachments,GUID,ComplianceAssetId,TenantWideExtensionComponentId,TenantWideExtensionComponentProperties,TenantWideExtensionWebTemplate,TenantWideExtensionListTemplate,TenantWideExtensionLocation,TenantWideExtensionSequence,TenantWideExtensionHostProperties,TenantWideExtensionDisabled
|
|
106
|
+
0,4,,,0x00693E2C487575B448BD420C12CEAE7EFE,Some customizer,2023-01-11T15:47:38Z,2023-01-11T15:47:38Z,9,9,1.0,,14125658-a9bc-4ddf-9c75-1b5767c9a337,,7096cded-b83d-4eab-96f0-df477ed7c0bc,"{""testMessage"":""Test message""}",,0,ClientSideExtension.ApplicationCustomizer,0,,
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
=== "Markdown"
|
|
110
|
+
|
|
111
|
+
```md
|
|
112
|
+
# spo tenant applicationcustomizer get --title "Some customizer"
|
|
113
|
+
|
|
114
|
+
Date: 1/13/2023
|
|
115
|
+
|
|
116
|
+
## Some customizer (4)
|
|
117
|
+
|
|
118
|
+
Property | Value
|
|
119
|
+
---------|-------
|
|
120
|
+
FileSystemObjectType | 0
|
|
121
|
+
Id | 4
|
|
122
|
+
ServerRedirectedEmbedUri | null
|
|
123
|
+
ServerRedirectedEmbedUrl |
|
|
124
|
+
ContentTypeId | 0x00693E2C487575B448BD420C12CEAE7EFE
|
|
125
|
+
Title | Some customizer
|
|
126
|
+
Modified | 2023-01-11T15:47:38Z
|
|
127
|
+
Created | 2023-01-11T15:47:38Z
|
|
128
|
+
AuthorId | 9
|
|
129
|
+
EditorId | 9
|
|
130
|
+
OData\_\_UIVersionString | 1.0
|
|
131
|
+
Attachments | false
|
|
132
|
+
GUID | 14125658-a9bc-4ddf-9c75-1b5767c9a337
|
|
133
|
+
ComplianceAssetId | null
|
|
134
|
+
TenantWideExtensionComponentId | 7096cded-b83d-4eab-96f0-df477ed7c0bc
|
|
135
|
+
TenantWideExtensionComponentProperties | {"testMessage":"Test message"}
|
|
136
|
+
TenantWideExtensionWebTemplate | null
|
|
137
|
+
TenantWideExtensionListTemplate | 0
|
|
138
|
+
TenantWideExtensionLocation | ClientSideExtension.ApplicationCustomizer
|
|
139
|
+
TenantWideExtensionSequence | 0
|
|
140
|
+
TenantWideExtensionHostProperties | null
|
|
141
|
+
TenantWideExtensionDisabled | false
|
|
142
|
+
```
|
package/package.json
CHANGED