@pnp/cli-microsoft365 12.0.0-beta.10c5833 → 12.0.0-beta.4ac11a7
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/.devproxy/generate-openapi-spec.json +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +15 -1
- package/dist/googleAnalytics.js +96 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0-rc.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spo/commands/app/app-add.js +35 -56
- package/dist/m365/spo/commands/app/app-deploy.js +41 -59
- package/dist/m365/spo/commands/app/app-get.js +40 -56
- package/dist/m365/spo/commands/app/app-install.js +20 -41
- package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
- package/dist/m365/spo/commands/app/app-list.js +26 -44
- package/dist/m365/spo/commands/app/app-remove.js +32 -52
- package/dist/m365/spo/commands/app/app-retract.js +32 -51
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
- package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
- package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
- package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
- package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
- package/dist/m365/spo/commands/feature/feature-list.js +11 -36
- package/dist/m365/spo/commands/field/field-add.js +33 -62
- package/dist/m365/spo/commands/field/field-get.js +30 -57
- package/dist/m365/spo/commands/field/field-list.js +21 -46
- package/dist/m365/spo/commands/field/field-remove.js +32 -63
- package/dist/m365/spo/commands/field/field-set.js +34 -66
- package/dist/m365/spo/commands/file/file-get.js +4 -3
- package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
- package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
- package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
- package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
- package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
- package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
- package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
- package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spo/commands.js +3 -1
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/m365/teams/commands/channel/channel-add.js +46 -57
- package/dist/m365/teams/commands/channel/channel-get.js +41 -48
- package/dist/m365/teams/commands/channel/channel-list.js +28 -42
- package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
- package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
- package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
- package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
- package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
- package/dist/m365/teams/commands/channel/channel-set.js +47 -54
- package/dist/m365/teams/commands/chat/chat-get.js +30 -45
- package/dist/m365/teams/commands/chat/chat-list.js +22 -42
- package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
- package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
- package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
- package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
- package/dist/telemetry.js +7 -11
- package/dist/utils/spo.js +40 -3
- package/dist/utils/urlUtil.js +2 -2
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
- package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
- package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
- package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
- package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
- package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
- package/npm-shrinkwrap.json +702 -3230
- package/package.json +21 -38
- package/dist/appInsights.js +0 -43
package/dist/Auth.js
CHANGED
|
@@ -606,8 +606,22 @@ export class Auth {
|
|
|
606
606
|
const federationToken = await this.getFederationTokenFromAzureDevOps(logger, debug, serviceConnectionId);
|
|
607
607
|
return this.getAccessTokenWithFederatedToken(resource, federationToken, logger, debug);
|
|
608
608
|
}
|
|
609
|
+
else if (process.env.GITLAB_CI) {
|
|
610
|
+
if (debug) {
|
|
611
|
+
await logger.logToStderr('GITLAB_CI env variable found. The context is GitLab CI/CD...');
|
|
612
|
+
}
|
|
613
|
+
if (!process.env.GITLAB_OIDC_TOKEN) {
|
|
614
|
+
throw new CommandError('The `GITLAB_OIDC_TOKEN` environment variable is not available. Please add an id_tokens entry named GITLAB_OIDC_TOKEN with audience `api://AzureADTokenExchange` to the job.');
|
|
615
|
+
}
|
|
616
|
+
if (!this.connection.appId || this.connection.tenant === 'common') {
|
|
617
|
+
throw new CommandError('The appId and tenant parameters are required when using federated identity in GitLab CI/CD.');
|
|
618
|
+
}
|
|
619
|
+
// GitLab's id_tokens feature mints the OIDC JWT directly into the configured job variable, so no
|
|
620
|
+
// separate request to GitLab is needed to obtain the federation token before exchanging it with Entra ID.
|
|
621
|
+
return this.getAccessTokenWithFederatedToken(resource, process.env.GITLAB_OIDC_TOKEN, logger, debug);
|
|
622
|
+
}
|
|
609
623
|
else {
|
|
610
|
-
throw new CommandError('Federated identity is currently only supported in GitHub Actions
|
|
624
|
+
throw new CommandError('Federated identity is currently only supported in GitHub Actions, Azure DevOps and GitLab.');
|
|
611
625
|
}
|
|
612
626
|
}
|
|
613
627
|
async getFederationTokenFromGithub(logger, debug) {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import Axios from 'axios';
|
|
2
|
+
import Configstore from 'configstore';
|
|
3
|
+
import crypto from 'crypto';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import os from 'os';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import url from 'url';
|
|
8
|
+
import config from './config.js';
|
|
9
|
+
import { app } from './utils/app.js';
|
|
10
|
+
const measurementId = 'G-4BNT8MQCYT';
|
|
11
|
+
const apiSecret = 'mm_3WD_TRuO-9MKsuZnhDQ';
|
|
12
|
+
const endpoint = 'https://www.google-analytics.com/mp/collect';
|
|
13
|
+
const clientIdSetting = 'telemetryClientId';
|
|
14
|
+
const requestTimeout = 3000;
|
|
15
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
16
|
+
const commonProperties = {
|
|
17
|
+
version: `${app.packageJson().version}${fs.existsSync(path.join(__dirname, `..${path.sep}src`)) ? '-dev' : ''}`,
|
|
18
|
+
node: process.version,
|
|
19
|
+
os: os.platform(),
|
|
20
|
+
env: process.env.CLIMICROSOFT365_ENV ?? '',
|
|
21
|
+
ci: Boolean(process.env.CI).toString()
|
|
22
|
+
};
|
|
23
|
+
function getClientId() {
|
|
24
|
+
const store = new Configstore(config.configstoreName);
|
|
25
|
+
let clientId = store.get(clientIdSetting);
|
|
26
|
+
if (!clientId) {
|
|
27
|
+
clientId = crypto.randomUUID();
|
|
28
|
+
store.set(clientIdSetting, clientId);
|
|
29
|
+
}
|
|
30
|
+
return clientId;
|
|
31
|
+
}
|
|
32
|
+
function getSessionId(sessionId) {
|
|
33
|
+
return parseInt(crypto.createHash('sha256').update(sessionId).digest('hex').substring(0, 12), 16);
|
|
34
|
+
}
|
|
35
|
+
function toEventValue(value) {
|
|
36
|
+
if (typeof value === 'number') {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return String(value);
|
|
40
|
+
}
|
|
41
|
+
function getEvents(commandName, properties, context) {
|
|
42
|
+
const sessionId = getSessionId(context.sessionId);
|
|
43
|
+
const eventProperties = Object.entries(properties).reduce((result, [name, value]) => {
|
|
44
|
+
if (typeof value !== 'undefined') {
|
|
45
|
+
result[name] = toEventValue(value);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}, {});
|
|
49
|
+
return [{
|
|
50
|
+
name: 'command_used',
|
|
51
|
+
params: {
|
|
52
|
+
['command_name']: commandName,
|
|
53
|
+
...commonProperties,
|
|
54
|
+
shell: context.shell,
|
|
55
|
+
...eventProperties,
|
|
56
|
+
['session_id']: sessionId,
|
|
57
|
+
['engagement_time_msec']: 1
|
|
58
|
+
}
|
|
59
|
+
}];
|
|
60
|
+
}
|
|
61
|
+
async function sendEvents(events) {
|
|
62
|
+
const clientId = getClientId();
|
|
63
|
+
const response = await Axios.post(`${endpoint}?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
|
|
64
|
+
['client_id']: clientId,
|
|
65
|
+
events
|
|
66
|
+
}, {
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/json'
|
|
69
|
+
},
|
|
70
|
+
timeout: requestTimeout,
|
|
71
|
+
validateStatus: () => true
|
|
72
|
+
});
|
|
73
|
+
if (response.status < 200 || response.status >= 300) {
|
|
74
|
+
throw new Error(`Google Analytics returned ${response.status}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export const googleAnalytics = {
|
|
78
|
+
commonProperties,
|
|
79
|
+
trackEvent: async (commandName, properties, context) => {
|
|
80
|
+
await sendEvents(getEvents(commandName, properties, context));
|
|
81
|
+
},
|
|
82
|
+
trackException: async (exception, context) => {
|
|
83
|
+
const description = exception instanceof Error ? exception.message : String(exception);
|
|
84
|
+
await sendEvents([{
|
|
85
|
+
name: 'exception',
|
|
86
|
+
params: {
|
|
87
|
+
description: description.substring(0, 100),
|
|
88
|
+
...commonProperties,
|
|
89
|
+
shell: context.shell,
|
|
90
|
+
['session_id']: getSessionId(context.sessionId),
|
|
91
|
+
['engagement_time_msec']: 1
|
|
92
|
+
}
|
|
93
|
+
}]);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=googleAnalytics.js.map
|
|
@@ -653,6 +653,21 @@ export const versions = {
|
|
|
653
653
|
range: '^4 || ^5 || ^6 || ^7',
|
|
654
654
|
fix: 'npm i -g yo@7'
|
|
655
655
|
}
|
|
656
|
+
},
|
|
657
|
+
'1.24.0-rc.0': {
|
|
658
|
+
heft: {
|
|
659
|
+
range: '^1',
|
|
660
|
+
fix: 'npm i -g @rushstack/heft@1'
|
|
661
|
+
},
|
|
662
|
+
node: {
|
|
663
|
+
range: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0',
|
|
664
|
+
fix: 'Install Node.js >=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0'
|
|
665
|
+
},
|
|
666
|
+
sp: SharePointVersion.SPO,
|
|
667
|
+
yo: {
|
|
668
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
669
|
+
fix: 'npm i -g yo@7'
|
|
670
|
+
}
|
|
656
671
|
}
|
|
657
672
|
};
|
|
658
673
|
//# sourceMappingURL=SpfxCompatibilityMatrix.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
4
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
5
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
6
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
7
|
+
import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
|
|
8
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
|
+
export default [
|
|
10
|
+
new FN001008_DEP_react({ supportedRange: '18' }),
|
|
11
|
+
new FN001009_DEP_react_dom({ supportedRange: '18' }),
|
|
12
|
+
new FN001035_DEP_fluentui_react({ supportedRange: '^8.106.4' }),
|
|
13
|
+
new FN002013_DEVDEP_types_webpack_env({ supportedRange: '~1.15.2' }),
|
|
14
|
+
new FN002015_DEVDEP_types_react({ supportedRange: '18' }),
|
|
15
|
+
new FN002016_DEVDEP_types_react_dom({ supportedRange: '18' }),
|
|
16
|
+
new FN002022_DEVDEP_typescript({ supportedRange: '~5.8.0' }),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version({ includeDevDeps: true })
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=doctor-1.24.0-rc.0.js.map
|
|
@@ -78,7 +78,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
78
78
|
'1.22.1',
|
|
79
79
|
'1.22.2',
|
|
80
80
|
'1.23.0',
|
|
81
|
-
'1.23.2'
|
|
81
|
+
'1.23.2',
|
|
82
|
+
'1.24.0-rc.0'
|
|
82
83
|
];
|
|
83
84
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
84
85
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JsonRule } from '../../JsonRule.js';
|
|
2
|
+
export class FN012021_TSC_excludeDirectories extends JsonRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super();
|
|
5
|
+
this.directories = options.directories;
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN012021';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return 'tsconfig.json watchOptions.excludeDirectories property';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Update tsconfig.json watchOptions.excludeDirectories property`;
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return `{
|
|
18
|
+
"watchOptions": {
|
|
19
|
+
"excludeDirectories": ${JSON.stringify(this.directories)}
|
|
20
|
+
}
|
|
21
|
+
}`;
|
|
22
|
+
}
|
|
23
|
+
get resolutionType() {
|
|
24
|
+
return 'json';
|
|
25
|
+
}
|
|
26
|
+
get severity() {
|
|
27
|
+
return 'Required';
|
|
28
|
+
}
|
|
29
|
+
get file() {
|
|
30
|
+
return './tsconfig.json';
|
|
31
|
+
}
|
|
32
|
+
visit(project, findings) {
|
|
33
|
+
if (!project.tsConfigJson) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!project.tsConfigJson.watchOptions?.excludeDirectories ||
|
|
37
|
+
JSON.stringify(project.tsConfigJson.watchOptions.excludeDirectories) !== JSON.stringify(this.directories)) {
|
|
38
|
+
const node = this.getAstNodeFromFile(project.tsConfigJson, 'watchOptions.excludeDirectories');
|
|
39
|
+
this.addFindingWithPosition(findings, node);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=FN012021_TSC_excludeDirectories.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN027002_OVERRIDES_qs extends DependencyRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super({ packageName: 'qs', packageVersion: options.version, isOverride: true });
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN027002';
|
|
8
|
+
}
|
|
9
|
+
visit(project, findings) {
|
|
10
|
+
// If an override entry for the package already exists in package.json,
|
|
11
|
+
// emit an extra finding to remove the existing override first. This avoids
|
|
12
|
+
// having to use a separate remove-override rule (e.g. FN027002) in the upgrade scripts.
|
|
13
|
+
if (project.packageJson?.overrides?.[this.packageName] &&
|
|
14
|
+
project.packageJson.overrides[this.packageName] !== this.packageVersion) {
|
|
15
|
+
const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
|
|
16
|
+
findings.push({
|
|
17
|
+
id: `${this.id}_REMOVE`,
|
|
18
|
+
title: this.packageName,
|
|
19
|
+
description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
|
|
20
|
+
occurrences: [{
|
|
21
|
+
file: this.file,
|
|
22
|
+
resolution: `removeOverride overrides.${this.packageName}`,
|
|
23
|
+
position: this.getPositionFromNode(node)
|
|
24
|
+
}],
|
|
25
|
+
resolutionType: 'cmd',
|
|
26
|
+
severity: 'Required',
|
|
27
|
+
supersedes: []
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
super.visit(project, findings);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=FN027002_OVERRIDES_qs.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN027003_OVERRIDES_uuid extends DependencyRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super({ packageName: 'uuid', packageVersion: options.version, isOverride: true });
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN027003';
|
|
8
|
+
}
|
|
9
|
+
visit(project, findings) {
|
|
10
|
+
// If an override entry for the package already exists in package.json,
|
|
11
|
+
// emit an extra finding to remove the existing override first. This avoids
|
|
12
|
+
// having to use a separate remove-override rule (e.g. FN027003) in the upgrade scripts.
|
|
13
|
+
if (project.packageJson?.overrides?.[this.packageName] &&
|
|
14
|
+
project.packageJson.overrides[this.packageName] !== this.packageVersion) {
|
|
15
|
+
const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
|
|
16
|
+
findings.push({
|
|
17
|
+
id: `${this.id}_REMOVE`,
|
|
18
|
+
title: this.packageName,
|
|
19
|
+
description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
|
|
20
|
+
occurrences: [{
|
|
21
|
+
file: this.file,
|
|
22
|
+
resolution: `removeOverride overrides.${this.packageName}`,
|
|
23
|
+
position: this.getPositionFromNode(node)
|
|
24
|
+
}],
|
|
25
|
+
resolutionType: 'cmd',
|
|
26
|
+
severity: 'Required',
|
|
27
|
+
supersedes: []
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
super.visit(project, findings);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=FN027003_OVERRIDES_uuid.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
|
|
2
|
+
import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
|
|
3
|
+
import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
|
|
4
|
+
import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
|
|
5
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
6
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
7
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
8
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
9
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
10
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
11
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
12
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
13
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
14
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
15
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
16
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
17
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
18
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
19
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
20
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
21
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
22
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
23
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
24
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
25
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
26
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
27
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
28
|
+
import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
|
|
29
|
+
import { FN002031_DEVDEP_rushstack_heft } from './rules/FN002031_DEVDEP_rushstack_heft.js';
|
|
30
|
+
import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
|
|
31
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
32
|
+
import { FN012021_TSC_excludeDirectories } from './rules/FN012021_TSC_excludeDirectories.js';
|
|
33
|
+
import { FN020001_RES_types_react } from './rules/FN020001_RES_types_react.js';
|
|
34
|
+
import { FN021003_PKG_engines_node } from './rules/FN021003_PKG_engines_node.js';
|
|
35
|
+
import { FN027001_OVERRIDES_rushstack_heft } from './rules/FN027001_OVERRIDES_rushstack_heft.js';
|
|
36
|
+
import { FN027002_OVERRIDES_qs } from './rules/FN027002_OVERRIDES_qs.js';
|
|
37
|
+
import { FN027003_OVERRIDES_uuid } from './rules/FN027003_OVERRIDES_uuid.js';
|
|
38
|
+
export default [
|
|
39
|
+
new FN001001_DEP_microsoft_sp_core_library({ packageVersion: '1.24.0-rc.0' }),
|
|
40
|
+
new FN001002_DEP_microsoft_sp_lodash_subset({ packageVersion: '1.24.0-rc.0' }),
|
|
41
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core({ packageVersion: '1.24.0-rc.0' }),
|
|
42
|
+
new FN001004_DEP_microsoft_sp_webpart_base({ packageVersion: '1.24.0-rc.0' }),
|
|
43
|
+
new FN001008_DEP_react({ packageVersion: '18.3.1' }),
|
|
44
|
+
new FN001009_DEP_react_dom({ packageVersion: '18.3.1' }),
|
|
45
|
+
new FN001011_DEP_microsoft_sp_dialog({ packageVersion: '1.24.0-rc.0' }),
|
|
46
|
+
new FN001012_DEP_microsoft_sp_application_base({ packageVersion: '1.24.0-rc.0' }),
|
|
47
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility({ packageVersion: '1.24.0-rc.0' }),
|
|
48
|
+
new FN001021_DEP_microsoft_sp_property_pane({ packageVersion: '1.24.0-rc.0' }),
|
|
49
|
+
new FN001023_DEP_microsoft_sp_component_base({ packageVersion: '1.24.0-rc.0' }),
|
|
50
|
+
new FN001024_DEP_microsoft_sp_diagnostics({ packageVersion: '1.24.0-rc.0' }),
|
|
51
|
+
new FN001025_DEP_microsoft_sp_dynamic_data({ packageVersion: '1.24.0-rc.0' }),
|
|
52
|
+
new FN001026_DEP_microsoft_sp_extension_base({ packageVersion: '1.24.0-rc.0' }),
|
|
53
|
+
new FN001027_DEP_microsoft_sp_http({ packageVersion: '1.24.0-rc.0' }),
|
|
54
|
+
new FN001028_DEP_microsoft_sp_list_subscription({ packageVersion: '1.24.0-rc.0' }),
|
|
55
|
+
new FN001029_DEP_microsoft_sp_loader({ packageVersion: '1.24.0-rc.0' }),
|
|
56
|
+
new FN001030_DEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
|
|
57
|
+
new FN001031_DEP_microsoft_sp_odata_types({ packageVersion: '1.24.0-rc.0' }),
|
|
58
|
+
new FN001032_DEP_microsoft_sp_page_context({ packageVersion: '1.24.0-rc.0' }),
|
|
59
|
+
new FN001013_DEP_microsoft_decorators({ packageVersion: '1.24.0-rc.0' }),
|
|
60
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base({ packageVersion: '1.24.0-rc.0' }),
|
|
61
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
|
|
62
|
+
new FN002015_DEVDEP_types_react({ packageVersion: '18.2.79' }),
|
|
63
|
+
new FN002016_DEVDEP_types_react_dom({ packageVersion: '18.2.25' }),
|
|
64
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx({ packageVersion: '1.24.0-rc.0' }),
|
|
65
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx({ packageVersion: '1.24.0-rc.0' }),
|
|
66
|
+
new FN002030_DEVDEP_microsoft_spfx_web_build_rig({ packageVersion: '1.24.0-rc.0' }),
|
|
67
|
+
new FN002031_DEVDEP_rushstack_heft({ packageVersion: '1.3.2' }),
|
|
68
|
+
new FN002034_DEVDEP_microsoft_spfx_heft_plugins({ packageVersion: '1.24.0-rc.0' }),
|
|
69
|
+
new FN010001_YORC_version({ version: '1.24.0-rc.0' }),
|
|
70
|
+
new FN012021_TSC_excludeDirectories({ directories: ['**/teams', '**/temp/copilot'] }),
|
|
71
|
+
new FN020001_RES_types_react({ packageVersion: '18.2.79' }),
|
|
72
|
+
new FN021003_PKG_engines_node({ version: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0' }),
|
|
73
|
+
new FN027001_OVERRIDES_rushstack_heft({ version: '1.3.2' }),
|
|
74
|
+
new FN027002_OVERRIDES_qs({ version: '>=6.15.2' }),
|
|
75
|
+
new FN027003_OVERRIDES_uuid({ version: '>=11.1.1' })
|
|
76
|
+
];
|
|
77
|
+
//# sourceMappingURL=upgrade-1.24.0-rc.0.js.map
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
// Uncomment to support upgrading to preview releases
|
|
5
|
-
|
|
5
|
+
import { prerelease } from 'semver';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
8
8
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
@@ -87,7 +87,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
87
87
|
'1.22.1',
|
|
88
88
|
'1.22.2',
|
|
89
89
|
'1.23.0',
|
|
90
|
-
'1.23.2'
|
|
90
|
+
'1.23.2',
|
|
91
|
+
'1.24.0-rc.0'
|
|
91
92
|
];
|
|
92
93
|
}
|
|
93
94
|
async commandAction(logger, args) {
|
|
@@ -97,15 +98,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
97
98
|
}
|
|
98
99
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
99
100
|
// Uncomment to support upgrading to preview releases
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
if (!args.options.toVersion &&
|
|
102
|
+
!args.options.preview &&
|
|
103
|
+
prerelease(this.toVersion)) {
|
|
104
|
+
// no version and no preview specified while the current version to
|
|
105
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
106
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
107
|
+
// us to take second to last version
|
|
108
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
109
|
+
}
|
|
109
110
|
this.packageManager = args.options.packageManager || 'npm';
|
|
110
111
|
this.shell = args.options.shell || 'powershell';
|
|
111
112
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -1,17 +1,34 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoAppAddCommand_instances, _SpoAppAddCommand_initTelemetry, _SpoAppAddCommand_initOptions, _SpoAppAddCommand_initValidators;
|
|
7
1
|
import fs from 'fs';
|
|
8
2
|
import path from 'path';
|
|
3
|
+
import { z } from 'zod';
|
|
9
4
|
import { cli } from '../../../../cli/cli.js';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
10
6
|
import request from '../../../../request.js';
|
|
11
7
|
import { spo } from '../../../../utils/spo.js';
|
|
12
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
|
+
import { zod } from '../../../../utils/zod.js';
|
|
13
10
|
import commands from '../../commands.js';
|
|
14
11
|
import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
filePath: z.string()
|
|
15
|
+
.refine(filePath => fs.existsSync(path.resolve(filePath)), {
|
|
16
|
+
error: e => `File '${path.resolve(e.input)}' not found`,
|
|
17
|
+
abort: true
|
|
18
|
+
})
|
|
19
|
+
.refine(filePath => !fs.lstatSync(path.resolve(filePath)).isDirectory(), {
|
|
20
|
+
error: e => `Path '${path.resolve(e.input)}' points to a directory`
|
|
21
|
+
})
|
|
22
|
+
.alias('p'),
|
|
23
|
+
overwrite: z.boolean().optional(),
|
|
24
|
+
appCatalogScope: zod.coercedEnum({ tenant: 'tenant', sitecollection: 'sitecollection' }).optional().alias('s'),
|
|
25
|
+
appCatalogUrl: z.string()
|
|
26
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
27
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
28
|
+
})
|
|
29
|
+
.optional()
|
|
30
|
+
.alias('u')
|
|
31
|
+
});
|
|
15
32
|
class SpoAppAddCommand extends SpoAppBaseCommand {
|
|
16
33
|
get name() {
|
|
17
34
|
return commands.APP_ADD;
|
|
@@ -19,13 +36,18 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
|
|
|
19
36
|
get description() {
|
|
20
37
|
return 'Adds an app to the specified SharePoint Online app catalog';
|
|
21
38
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
get schema() {
|
|
40
|
+
return options;
|
|
41
|
+
}
|
|
42
|
+
getRefinedSchema(schema) {
|
|
43
|
+
return schema
|
|
44
|
+
.refine(opts => opts.appCatalogScope !== 'sitecollection' || opts.appCatalogUrl !== undefined, {
|
|
45
|
+
error: 'You must specify appCatalogUrl when appCatalogScope is sitecollection',
|
|
46
|
+
path: ['appCatalogUrl'],
|
|
47
|
+
params: {
|
|
48
|
+
customCode: 'required'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
29
51
|
}
|
|
30
52
|
async commandAction(logger, args) {
|
|
31
53
|
const scope = (args.options.appCatalogScope) ? args.options.appCatalogScope.toLowerCase() : 'tenant';
|
|
@@ -60,48 +82,5 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
|
|
|
60
82
|
}
|
|
61
83
|
}
|
|
62
84
|
}
|
|
63
|
-
_SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = function _SpoAppAddCommand_initTelemetry() {
|
|
64
|
-
this.telemetry.push((args) => {
|
|
65
|
-
Object.assign(this.telemetryProperties, {
|
|
66
|
-
overwrite: !!args.options.overwrite,
|
|
67
|
-
appCatalogScope: args.options.appCatalogScope || 'tenant',
|
|
68
|
-
appCatalogUrl: typeof args.options.appCatalogUrl !== 'undefined'
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}, _SpoAppAddCommand_initOptions = function _SpoAppAddCommand_initOptions() {
|
|
72
|
-
this.options.unshift({
|
|
73
|
-
option: '-p, --filePath <filePath>'
|
|
74
|
-
}, {
|
|
75
|
-
option: '-s, --appCatalogScope [appCatalogScope]',
|
|
76
|
-
autocomplete: this.appCatalogScopeOptions
|
|
77
|
-
}, {
|
|
78
|
-
option: '-u, --appCatalogUrl [appCatalogUrl]'
|
|
79
|
-
}, {
|
|
80
|
-
option: '--overwrite [overwrite]'
|
|
81
|
-
});
|
|
82
|
-
}, _SpoAppAddCommand_initValidators = function _SpoAppAddCommand_initValidators() {
|
|
83
|
-
this.validators.push(async (args) => {
|
|
84
|
-
if (args.options.appCatalogScope) {
|
|
85
|
-
const appCatalogScope = args.options.appCatalogScope.toLowerCase();
|
|
86
|
-
if (this.appCatalogScopeOptions.indexOf(appCatalogScope) === -1) {
|
|
87
|
-
return `${args.options.appCatalogScope} is not a valid appCatalogScope. Allowed values are: ${this.appCatalogScopeOptions.join(', ')}`;
|
|
88
|
-
}
|
|
89
|
-
if (appCatalogScope === 'sitecollection' && !args.options.appCatalogUrl) {
|
|
90
|
-
return `You must specify appCatalogUrl when appCatalogScope is sitecollection`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const fullPath = path.resolve(args.options.filePath);
|
|
94
|
-
if (!fs.existsSync(fullPath)) {
|
|
95
|
-
return `File '${fullPath}' not found`;
|
|
96
|
-
}
|
|
97
|
-
if (fs.lstatSync(fullPath).isDirectory()) {
|
|
98
|
-
return `Path '${fullPath}' points to a directory`;
|
|
99
|
-
}
|
|
100
|
-
if (args.options.appCatalogUrl) {
|
|
101
|
-
return validation.isValidSharePointUrl(args.options.appCatalogUrl);
|
|
102
|
-
}
|
|
103
|
-
return true;
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
85
|
export default new SpoAppAddCommand();
|
|
107
86
|
//# sourceMappingURL=app-add.js.map
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoAppDeployCommand_instances, _SpoAppDeployCommand_initTelemetry, _SpoAppDeployCommand_initOptions, _SpoAppDeployCommand_initValidators, _SpoAppDeployCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
11
8
|
import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
|
|
9
|
+
const appCatalogScopeOptions = { tenant: 'tenant', sitecollection: 'sitecollection' };
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string()
|
|
13
|
+
.refine(id => validation.isValidGuid(id), {
|
|
14
|
+
error: e => `${e.input} is not a valid GUID`
|
|
15
|
+
})
|
|
16
|
+
.optional()
|
|
17
|
+
.alias('i'),
|
|
18
|
+
name: z.string().optional().alias('n'),
|
|
19
|
+
appCatalogUrl: z.string()
|
|
20
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
21
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
22
|
+
})
|
|
23
|
+
.optional()
|
|
24
|
+
.alias('u'),
|
|
25
|
+
skipFeatureDeployment: z.boolean().optional(),
|
|
26
|
+
appCatalogScope: zod.coercedEnum(appCatalogScopeOptions).optional().alias('s')
|
|
27
|
+
});
|
|
12
28
|
class SpoAppDeployCommand extends SpoAppBaseCommand {
|
|
13
29
|
get name() {
|
|
14
30
|
return commands.APP_DEPLOY;
|
|
@@ -16,13 +32,25 @@ class SpoAppDeployCommand extends SpoAppBaseCommand {
|
|
|
16
32
|
get description() {
|
|
17
33
|
return 'Deploys the specified app in the specified app catalog';
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
get schema() {
|
|
36
|
+
return options;
|
|
37
|
+
}
|
|
38
|
+
getRefinedSchema(schema) {
|
|
39
|
+
return schema
|
|
40
|
+
.refine(opts => [opts.id, opts.name].filter(x => x !== undefined).length === 1, {
|
|
41
|
+
error: `Specify either 'id' or 'name', but not both.`,
|
|
42
|
+
params: {
|
|
43
|
+
customCode: 'optionSet',
|
|
44
|
+
options: ['id', 'name']
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
.refine(opts => opts.appCatalogScope !== 'sitecollection' || opts.appCatalogUrl !== undefined, {
|
|
48
|
+
error: 'You must specify appCatalogUrl when the appCatalogScope is sitecollection',
|
|
49
|
+
path: ['appCatalogUrl'],
|
|
50
|
+
params: {
|
|
51
|
+
customCode: 'required'
|
|
52
|
+
}
|
|
53
|
+
});
|
|
26
54
|
}
|
|
27
55
|
async commandAction(logger, args) {
|
|
28
56
|
const scope = (args.options.appCatalogScope) ? args.options.appCatalogScope.toLowerCase() : 'tenant';
|
|
@@ -69,51 +97,5 @@ class SpoAppDeployCommand extends SpoAppBaseCommand {
|
|
|
69
97
|
}
|
|
70
98
|
}
|
|
71
99
|
}
|
|
72
|
-
_SpoAppDeployCommand_instances = new WeakSet(), _SpoAppDeployCommand_initTelemetry = function _SpoAppDeployCommand_initTelemetry() {
|
|
73
|
-
this.telemetry.push((args) => {
|
|
74
|
-
Object.assign(this.telemetryProperties, {
|
|
75
|
-
id: (!(!args.options.id)).toString(),
|
|
76
|
-
name: (!(!args.options.name)).toString(),
|
|
77
|
-
appCatalogUrl: (!(!args.options.appCatalogUrl)).toString(),
|
|
78
|
-
skipFeatureDeployment: args.options.skipFeatureDeployment || false,
|
|
79
|
-
appCatalogScope: (!(!args.options.appCatalogScope)).toString()
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}, _SpoAppDeployCommand_initOptions = function _SpoAppDeployCommand_initOptions() {
|
|
83
|
-
this.options.unshift({
|
|
84
|
-
option: '-i, --id [id]'
|
|
85
|
-
}, {
|
|
86
|
-
option: '-n, --name [name]'
|
|
87
|
-
}, {
|
|
88
|
-
option: '-u, --appCatalogUrl [appCatalogUrl]'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--skipFeatureDeployment'
|
|
91
|
-
}, {
|
|
92
|
-
option: '-s, --appCatalogScope [appCatalogScope]',
|
|
93
|
-
autocomplete: ['tenant', 'sitecollection']
|
|
94
|
-
});
|
|
95
|
-
}, _SpoAppDeployCommand_initValidators = function _SpoAppDeployCommand_initValidators() {
|
|
96
|
-
this.validators.push(async (args) => {
|
|
97
|
-
// verify either 'tenant' or 'sitecollection' specified if scope provided
|
|
98
|
-
if (args.options.appCatalogScope) {
|
|
99
|
-
const testScope = args.options.appCatalogScope.toLowerCase();
|
|
100
|
-
if (!(testScope === 'tenant' || testScope === 'sitecollection')) {
|
|
101
|
-
return `appCatalogScope must be either 'tenant' or 'sitecollection'`;
|
|
102
|
-
}
|
|
103
|
-
if (testScope === 'sitecollection' && !args.options.appCatalogUrl) {
|
|
104
|
-
return `You must specify appCatalogUrl when the appCatalogScope is sitecollection`;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
108
|
-
return `${args.options.id} is not a valid GUID`;
|
|
109
|
-
}
|
|
110
|
-
if (args.options.appCatalogUrl) {
|
|
111
|
-
return validation.isValidSharePointUrl(args.options.appCatalogUrl);
|
|
112
|
-
}
|
|
113
|
-
return true;
|
|
114
|
-
});
|
|
115
|
-
}, _SpoAppDeployCommand_initOptionSets = function _SpoAppDeployCommand_initOptionSets() {
|
|
116
|
-
this.optionSets.push({ options: ['id', 'name'] });
|
|
117
|
-
};
|
|
118
100
|
export default new SpoAppDeployCommand();
|
|
119
101
|
//# sourceMappingURL=app-deploy.js.map
|